-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
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:
AutocompleteResolverinterface currently only allows to resolveStringtypes (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.AutocompleteManageris 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 threadHandlerinstance 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.AutocompletePopoverwhat'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_popoveris 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 differentBubbleStyleonChipsEditTextthen 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 useRelativeLayoutwhenever 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels