Skip to content

Replace TextWatchers with InputFilters #556

Open
@mzorz

Description

@mzorz

InputFilters are better suited for making/limiting changes on Editables
https://developer.android.com/reference/android/text/InputFilter.html

With TextWatchers, we're needing to control flow in difficult ways, as having to bypass the execution of some watchers with isTextChangedListenerDisabled for instance, or marking specific spans within the text so we're able to flag what's about to change and what not.

We’d reach a higher level of predictability by replacing TextWatchers with InputFilter-based listeners, and making sure each processor (currently a TextWatcher) is executed in the same order each time. This ensures a state A -> process P -> state B dynamic is known and repeatable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions