Class: RMQTextChange
- Inherits:
-
Android::Telephony::PhoneNumberFormattingTextWatcher
- Object
- Android::Telephony::PhoneNumberFormattingTextWatcher
- RMQTextChange
- Defined in:
- lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb
Overview
developer.android.com/reference/android/text/TextWatcher.html there seems to be a bug with this particular interface - subclassing this class works around it community.rubymotion.com/t/how-to-use-textwatcher-to-listen-to-changes-of-an-edittext/522
Instance Attribute Summary collapse
-
#change_block ⇒ Object
Returns the value of attribute change_block.
Instance Method Summary collapse
- #afterTextChanged(s) ⇒ Object
- #beforeTextChanged(s, start, count, after) ⇒ Object
-
#initialize(action = :after, &block) ⇒ RMQTextChange
constructor
A new instance of RMQTextChange.
- #onTextChanged(s, start, before, count) ⇒ Object
Constructor Details
permalink #initialize(action = :after, &block) ⇒ RMQTextChange
Returns a new instance of RMQTextChange.
7 8 9 10 |
# File 'lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb', line 7 def initialize(action=:after, &block) @action = action @change_block = block end |
Instance Attribute Details
Instance Method Details
permalink #afterTextChanged(s) ⇒ Object
[View source]
20 21 22 |
# File 'lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb', line 20 def afterTextChanged(s) @change_block.call(s) if @action == :after end |
permalink #beforeTextChanged(s, start, count, after) ⇒ Object
[View source]
16 17 18 |
# File 'lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb', line 16 def beforeTextChanged(s, start, count, after) @change_block.call(s, start, count, after) if @action == :before end |
permalink #onTextChanged(s, start, before, count) ⇒ Object
[View source]
12 13 14 |
# File 'lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb', line 12 def onTextChanged(s, start, before, count) @change_block.call(s, start, before, count) if @action == :on end |