Class: ViewGroupWrapper

Inherits:
ViewWrapper show all
Defined in:
lib/droiuby/wrappers/view_group_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_native, #visible=, #visible?, #width=

Methods included from Droiuby::Wrappers::Listeners

#on

Methods included from Droiuby::ViewHelper

included

Methods included from JavaMethodHelper

included

Constructor Details

This class inherits a constructor from ViewWrapper

Instance Method Details

#<<(markup_or_view) ⇒ Object



23
24
25
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 23

def <<(markup_or_view)
  append(markup_or_view)
end

#append(markup_or_view) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 12

def append(markup_or_view)
  if markup_or_view.kind_of? String
    _activity_builder.parsePartialAppendChildren(@view, markup_or_view, _execution_bundle)
  elsif markup_or_view.kind_of? ViewWrapper
    _activity_builder.appendChild(@view,  markup_or_view.native)
  elsif markup_or_view.kind_of? Java::android.view.View.new
    _activity_builder.appendChild(@view,  markup_or_view)
  end
  after_partial_setup(self)
end

#child(index) ⇒ Object



50
51
52
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 50

def child(index)
  @view.getChildAt(index)
end

#childrenObject



43
44
45
46
47
48
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 43

def children
  wrapped_views = (0...self.count).collect { |i|
    wrap_native_view(self.child(i))
  }
  ViewArray.new(wrapped_views)
end

#countObject



35
36
37
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 35

def count
  @view.getChildCount
end

#form_fieldsObject



54
55
56
57
58
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 54

def form_fields
  fields = {}
  collect_fields(self, fields)
  fields
end

#innerObject

TODO: support reverse markup generation



8
9
10
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 8

def inner
  puts "TODO"
end

#inner=(markup) ⇒ Object



2
3
4
5
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 2

def inner=(markup)
  _activity_builder.parsePartialReplaceChildren(@view, markup, _execution_bundle)
  after_partial_setup(self)
end

#remove_all_viewsObject



39
40
41
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 39

def remove_all_views
  @view.removeAllViews
end

#to_front!(child = nil) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/droiuby/wrappers/view_group_wrapper.rb', line 27

def to_front!(child = nil)
  if child.nil?
    super
  else
    @view.bringChildToFront(self.to_native(child))
  end
end