Class: CompoundButtonWrapper

Inherits:
ViewWrapper show all
Defined in:
lib/droiuby/wrappers/compound_button_wrapper.rb

Instance Method Summary collapse

Methods inherited from ViewWrapper

#animate, #background=, #background_color=, #blink, #builder, #click, #data, #enabled=, #enabled?, #find, #gone=, #gone?, #height=, #hidden?, #hide!, #initialize, #invalidate, #native, #p_tree, #parent, #show!, #tag, #to_front!, #to_native, #visible=, #visible?, #width=

Methods included from Droiuby::ViewHelper

included

Methods included from JavaMethodHelper

included

Constructor Details

This class inherits a constructor from ViewWrapper

Instance Method Details

#checked=(value) ⇒ Object



18
19
20
# File 'lib/droiuby/wrappers/compound_button_wrapper.rb', line 18

def checked=(value)
  self.native.setChecked(value)
end

#checked?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/droiuby/wrappers/compound_button_wrapper.rb', line 14

def checked?
  self.native.isChecked
end

#on(event, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/droiuby/wrappers/compound_button_wrapper.rb', line 4

def on(event,&block)
  listener_ref = event.to_s.camelize
  case event.to_sym
    when :checked_change
      self.native.send(:"setOn#{listener_ref}Listener",_listener("On#{listener_ref}Listener", 'android.widget.CompoundButton', &block))
    else
      super(event, &block)
  end
end