button bar similar to twitter app for android

守給你的承諾、 提交于 2019-12-07 05:00:32

Like in the Google IO App?

If so, the Source Code is freely available here.


Okay, a little tour on how Google does it:

  1. The activity_home.xml-layout includes (Line 21) the actionbar.xml-layout (This is done in every Layout so the Actionbar must not always be duplicated).
  2. The actionbar.xml-Layout creates a LinearLayout for the UI-Elements.
  3. Then, for example the HomeActivity-Activity sets the content view to the activity_home.xml-layout, receives an ActivityHelper-class and calls its setupActionBar()-method.
  4. The mantioned ActivityHelper-class is in the hg/ android/ src/ com/ google/ android/ apps/ iosched/ util/-package and has the setupActionBar()-method which creates the Action bar.

This might be easier then it looks. Read your way through the Source Code and try it yourself.

I think these controls are Radio Button/ Radio Group with customization.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!