class AMQView
Attributes
activity[RW]
extra[RW]
layout_params[RW]
options[RW]
style_name[RW]
stylesheet[RW]
view[RW]
Public Class Methods
new(view, activity, stylesheet, style_name, layout_params, options = {})
click to toggle source
# File lib/android_motion_query/views.rb, line 4 def initialize(view, activity, stylesheet, style_name, layout_params, options = {}) self.view = view self.activity = activity self.stylesheet = stylesheet self.style_name = style_name self.layout_params = layout_params self.options = { parent: nil, }.merge(options) end
Public Instance Methods
adapter(list, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 98 def adapter(list, &block) # this method has to be called from a grid_view or similar views (which accept adapters) self.get.adapter = AMQAdapter.new(self.activity, list, &block) self end
add(view_sym, style, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 41 def add(view_sym, style, &block) self.send(view_sym, style, &block) end
bottom()
click to toggle source
# File lib/android_motion_query/views.rb, line 21 def bottom; get.getBottom end
create_android_query_view(view, style_method, layout_params, options = {}, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 33 def create_android_query_view(view, style_method, layout_params, options = {}, &block) aqv = AMQView.new(view, self.activity, self.stylesheet, style_method, layout_params, options) self.stylesheet.apply_style_for(aqv, style_method, layout_params) self.get.addView(aqv.get) block.call(aqv) if block_given? aqv end
data(t)
click to toggle source
# File lib/android_motion_query/views.rb, line 27 def data(t); get.text = t; self end
edit_text(style_method, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 73 def edit_text(style_method, &block) view = Android::Widget::EditText.new(self.activity) new_view(view, style_method, &block) end
frame_layout(style_method, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 57 def frame_layout(style_method, &block) view = Android::Widget::FrameLayout.new(self.activity) lp = Android::Widget::FrameLayout::LayoutParams create_android_query_view(view, style_method, lp, {}, &block) end
get()
click to toggle source
# File lib/android_motion_query/views.rb, line 18 def get; self.view end
grid_view(style_method, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 93 def grid_view(style_method, &block) view = Android::Widget::GridView.new(self.activity) new_view(view, style_method, &block) end
height()
click to toggle source
# File lib/android_motion_query/views.rb, line 24 def height; get.getHeight end
id()
click to toggle source
convenience methods
# File lib/android_motion_query/views.rb, line 16 def id; get.id end
id=(vid)
click to toggle source
# File lib/android_motion_query/views.rb, line 17 def id=(vid); get.id = vid; self end
image_view(style_method, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 83 def image_view(style_method, &block) view = Android::Widget::ImageView.new(self.activity) new_view(view, style_method, &block) end
left()
click to toggle source
# File lib/android_motion_query/views.rb, line 19 def left; get.getLeft end
linear_layout(style_method, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 45 def linear_layout(style_method, &block) view = Android::Widget::LinearLayout.new(self.activity) lp = Android::Widget::LinearLayout::LayoutParams create_android_query_view(view, style_method, lp, {}, &block) end
new_view(view, style_method, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 104 def new_view(view, style_method, &block) create_android_query_view(view, style_method, self.layout_params, {}, &block) end
plain_view(style_method, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 63 def plain_view(style_method, &block) view = Android::View::View.new(self.activity) new_view(view, style_method, &block) end
relative_layout(style_method, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 51 def relative_layout(style_method, &block) view = Android::Widget::RelativeLayout.new(self.activity) lp = Android::Widget::RelativeLayout::LayoutParams create_android_query_view(view, style_method, lp, {}, &block) end
right()
click to toggle source
# File lib/android_motion_query/views.rb, line 20 def right; get.getRight end
tap(&block)
click to toggle source
# File lib/android_motion_query/views.rb, line 28 def tap(&block) self.get.onClickListener = AMQTapListener.new(self.activity, self, &block) self end
text()
click to toggle source
# File lib/android_motion_query/views.rb, line 25 def text; get.text end
text=(t)
click to toggle source
# File lib/android_motion_query/views.rb, line 26 def text=(t); get.text = t end
text_view(style_method, &block)
click to toggle source
# File lib/android_motion_query/views.rb, line 68 def text_view(style_method, &block) view = Android::Widget::TextView.new(self.activity) new_view(view, style_method, &block) end
top()
click to toggle source
# File lib/android_motion_query/views.rb, line 22 def top; get.getTop end
width()
click to toggle source
# File lib/android_motion_query/views.rb, line 23 def width; get.getWidth end