infinitered / bluepotion

Like RedPotion, but for Android
MIT License
74 stars 18 forks source link

Added actions for action bar buttons #12

Closed jamonholmgren closed 9 years ago

jamonholmgren commented 9 years ago

You can now do:

  def on_create_menu(menu)
    add_action_bar_button title: "Test 1", show: :if_room, action: :some_method
    add_action_bar_button title: "Test 2", show: :if_room, action: :some_other_method
  end

... and it'll work like ProMotion iOS.

Also added icon:

  def on_create_menu(menu)
    add_action_bar_button icon: :my_icon, show: :if_room, action: :some_method
  end
jamonholmgren commented 9 years ago

Returning false from your action method (like some_method) will prevent the super call (for example, if you're overriding the back button ... not recommended, though!)

darinwilson commented 9 years ago

👍