Make @OnTextChanged more useful when using multiple Views
See original GitHub issue@OnTextChanged
can be applied to methods with different signatures that mirror TextWatcher
’s before
/after
/onTextChanged()
methods. But none of those possible signatures include the View
that was annotated. When specifying multiple View
s, it doesn’t seem to be possible to associate that callback to the View
whose text changed. For example:
@OnTextChanged({R.id.edittext_foo, R.id.edittext_bar})
protected void handleTextChange(Editable editable) {
// I have the Editable that changed but which View's Editable is it???
}
For comparison, the signatures accepted for @OnCheckChanged
and @OnClick
include the View
. Are there technical reasons why it would be impractical to include the Editable
’s View
as a parameter?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:12
- Comments:6 (2 by maintainers)
Top Results From Across the Web
onTextChanged Event for many Textboxes c# - Stack Overflow
Yes, you can create a single event - and then subscribe all the text boxes to the same event handler in your class,...
Read more >TextBox.OnTextChanged(EventArgs) Method (System.Web.UI ...
Creates a multi selection check box group that can be dynamically created by binding the control to a data source. GridView.RowCommand Event (System.Web.UI....
Read more >How to Handle Multiple Inputs with a Single onChange ...
Besides handling just one input, a single onChange handler can be set up to handle many different inputs in the form.
Read more >Handle changes to a text field - Flutter documentation
Handle changes to a text field · 1. Supply an onChanged() callback to a TextField or a TextFormField · 2. Use a TextEditingController....
Read more >Backbone.js
Models and Views. Model-View Separation. The single most important thing that Backbone can help you with is keeping your business logic separate from...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
below code can be used to get the current view,
//Inside a activity View view = getCurrentFocus();
with this view object you can get the id view.getId(); and use the same for comparison.
Hope this helped.
My biggest objection is that this would require specialization of a mechanism which is currently general. The reason those other listeners allow receiving the view is because their associated callback does as well.
On Tue, Jul 12, 2016 at 6:31 PM Brandon Rich notifications@github.com wrote: