Sha256: 927a5cc023283ceb6c33fbaf6c833396eaa664f2dee0eb6e57ea9b29e7f9b014

Contents?: true

Size: 1006 Bytes

Versions: 15

Compression:

Stored size: 1006 Bytes

Contents

require 'ruboto/widget'

ruboto_import_widgets :LinearLayout, :TextView

class DialogFragmentActivity
  def onCreate(bundle)
    super
    set_title 'Dialog Fragment Test'

    self.content_view =
        linear_layout :orientation => :vertical, :gravity => :center do
          text_view :id => 42, :text => title, :text_size => 48.0,
                    :gravity => :center
        end
    ft = getFragmentManager.beginTransaction
    ft.addToBackStack(nil)
    ExampleDialogFragment.new.show(ft, 'example_dialog')
  end
end

class ExampleDialogFragment < android.app.DialogFragment
  def onCreate(bundle)
    super
    @some_var = 'Ruboto does fragments!'
  end

  def onCreateView(inflater, container, bundle)
    dialog.title = @some_var

    linear_layout :orientation => :vertical do
      linear_layout :gravity => :center, :layout => {:width => :fill_parent} do
        text_view :text => @some_var, :id => 43, :text_size => 40.0,
                  :gravity => :center
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ruboto-1.6.1 test/activity/dialog_fragment_activity.rb
ruboto-1.6.0 test/activity/dialog_fragment_activity.rb
ruboto-1.5.0 test/activity/dialog_fragment_activity.rb
ruboto-1.4.1 test/activity/dialog_fragment_activity.rb
ruboto-1.4.0 test/activity/dialog_fragment_activity.rb
ruboto-1.3.1 test/activity/dialog_fragment_activity.rb
ruboto-1.3.0 test/activity/dialog_fragment_activity.rb
ruboto-1.2.0 test/activity/dialog_fragment_activity.rb
ruboto-1.1.2 test/activity/dialog_fragment_activity.rb
ruboto-1.1.1 test/activity/dialog_fragment_activity.rb
ruboto-1.1.0 test/activity/dialog_fragment_activity.rb
ruboto-1.0.3 test/activity/dialog_fragment_activity.rb
ruboto-1.0.2 test/activity/dialog_fragment_activity.rb
ruboto-1.0.1 test/activity/dialog_fragment_activity.rb
ruboto-1.0.0 test/activity/dialog_fragment_activity.rb