Sha256: 14557ebbd664ecc1affba1526e4e9a4e783b6a4160c01933d0038c5ea83ddac4

Contents?: true

Size: 845 Bytes

Versions: 24

Compression:

Stored size: 845 Bytes

Contents

module SugarCube
  class << Repl

    def build_default_tree
      build_tree(@default)
    end

    def adjust_init(item)
      if item.is_a?(Android::View::View)
        @restore = {}
      end
    end

    def register_default_tree_selectors
      register_tree_selector(Android::ViewGroup) do |view|
        views = []
        # item.getChildCount.times do |index|
        #   views << item.getChildAt(index)
        # end
        views
      end
      register_tree_selector(Android::View::View) { |view| [view] }
    end

    def draw_tree_item(item)
      # item.to_s
      'todo'
    end

    def get_tree_item(item)
      if item.nil?
        @default
      else
        item
      end
    end

    def format_frame(frame)
      "[[#{frame.origin.x}, #{frame.origin.y}], [#{frame.size.width}, #{frame.size.height}]]"
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
sugarcube-3.0.4 lib/android/sugarcube-repl/repl.rb
sugarcube-3.0.3 lib/android/sugarcube-repl/repl.rb
sugarcube-3.0.2 lib/android/sugarcube-repl/repl.rb
sugarcube-3.0.1 lib/android/sugarcube-repl/repl.rb