You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The scope of this ticket is a refactor of the current ChipsEditText auto suggestions code in order to achieve higher configurability and modularity.
See the Notes app for the reference and files Edit.java & EditView.java for a working example.
Whenever user wants to add a bubble using Add Bubble button the AutocompletePopover.show gets called. A change in ChipsEditText.onTextChanged can trigger suggestion search using provided AutocompleteResolver which is maintained by AutocompleteManager. Once search is complete, the result is populated back to AutocompletePopover.
Limitations:
AutocompleteResolver interface currently only allows to resolve String types (see ArrayList<String> getSuggestions(String query)), other types are not supported. This is not really helpful, e.g. one can imagine a list of suggested users to type with their avatars on side which is not achievable at the moment.
AutocompleteManager is executing millions of threads right now as you type... or some number close to that - this is obviously not good. Two immediate optimisations that come into my mind: first one is using a single thread executor, second one is smart deferring/cancelling search queries as user is typing (optional). That said we could also have a background thread Handler instance running & collecting messages and prioritising them appropriately. Moreover rxJava has been made a dependency of this library so now we can use that as well. Pretty much anything will be an improvement here.
AutocompletePopover what's good about this class is that it sticks to the cursor as you type. What's not so great is that the layout R.layout.autocomplete_popover is pretty much frozen in the library and highly uncustomizable. We should have an option to generate any layout that suits our needs, e.g. if someone sets a different BubbleStyle on ChipsEditText then the popover should be able to reflect this. It would be also probably better if we could create this popover in getWindow().getDecorView() rather as it is now because we force users of this library to always use RelativeLayout whenever they want to have AutocompletePopover.
The task here is to propose something that overcomes above limitations, makes us more generic along with an updated working piece of code in the Notes app.
The text was updated successfully, but these errors were encountered:
The scope of this ticket is a refactor of the current
ChipsEditText
auto suggestions code in order to achieve higher configurability and modularity.See the Notes app for the reference and files
Edit.java
&EditView.java
for a working example.Whenever user wants to add a bubble using
Add Bubble
button theAutocompletePopover.show
gets called. A change inChipsEditText.onTextChanged
can trigger suggestion search using providedAutocompleteResolver
which is maintained byAutocompleteManager
. Once search is complete, the result is populated back toAutocompletePopover
.Limitations:
AutocompleteResolver
interface currently only allows to resolveString
types (seeArrayList<String> getSuggestions(String query)
), other types are not supported. This is not really helpful, e.g. one can imagine a list of suggested users to type with their avatars on side which is not achievable at the moment.AutocompleteManager
is executing millions of threads right now as you type... or some number close to that - this is obviously not good. Two immediate optimisations that come into my mind: first one is using a single thread executor, second one is smart deferring/cancelling search queries as user is typing (optional). That said we could also have a background threadHandler
instance running & collecting messages and prioritising them appropriately. Moreover rxJava has been made a dependency of this library so now we can use that as well. Pretty much anything will be an improvement here.AutocompletePopover
what's good about this class is that it sticks to the cursor as you type. What's not so great is that the layoutR.layout.autocomplete_popover
is pretty much frozen in the library and highly uncustomizable. We should have an option to generate any layout that suits our needs, e.g. if someone sets a differentBubbleStyle
onChipsEditText
then the popover should be able to reflect this. It would be also probably better if we could create this popover ingetWindow().getDecorView()
rather as it is now because we force users of this library to always useRelativeLayout
whenever they want to haveAutocompletePopover
.The task here is to propose something that overcomes above limitations, makes us more generic along with an updated working piece of code in the Notes app.
The text was updated successfully, but these errors were encountered: