Sha256: 6d392c652927753610ad13bd396ea52035e519a87cb4ca04d60d0fb03448c74b

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

STACK_DEPTH_SCRIPT = java.lang.Thread.current_thread.stack_trace.length.to_s

require 'ruboto/activity'

ruboto_import_widgets :Button, :LinearLayout, :TextView

class StackActivity
  STACK_DEPTH_CLASS = java.lang.Thread.current_thread.stack_trace.length.to_s
  include Ruboto::Activity

  def on_create(bundle)
    stack_depth_on_create = java.lang.Thread.current_thread.stack_trace.length.to_s
    setTitle File.basename(__FILE__).chomp('_activity.rb').split('_').map { |s| "#{s[0..0].upcase}#{s[1..-1]}" }.join(' ')

    self.content_view =
        linear_layout :orientation => :vertical, :gravity => android.view.Gravity::CENTER do
          stack_depth_linear_layout = java.lang.Thread.current_thread.stack_trace.length.to_s
          text_view :id => 42, :text => STACK_DEPTH_SCRIPT, :text_size => 48.0, :gravity => android.view.Gravity::CENTER
          text_view :id => 43, :text => STACK_DEPTH_CLASS, :text_size => 48.0, :gravity => android.view.Gravity::CENTER
          text_view :id => 44, :text => stack_depth_on_create, :text_size => 48.0, :gravity => android.view.Gravity::CENTER
          text_view :id => 45, :text => stack_depth_linear_layout, :text_size => 48.0, :gravity => android.view.Gravity::CENTER
        end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruboto-0.7.0 test/activity/stack_activity.rb