1

I want to build a single-line action bar exactly like in fb, with tabs embedded inside the actionbar in form of icons at center so that when user swipes page the next icon is highlighted.

I'm using HoloEverywhere lib which uses actionbarsherlock internally. I'm aware of actionbar customviews but couldnt figure out how to embed tabs inside the customview. Please help . If possible please share code sample

Thanks in advance

enter image description here

Timmy Simons
  • 599
  • 8
  • 21
  • It's highly likely that Facebook is not using the system ActionBar. – Karakuri Apr 07 '14 at 14:44
  • This bar is not an ActionBar. Hide the ActionBar and implement your own Bar View. – Brais Gabin Apr 07 '14 at 15:32
  • @BraisGabin but then how do they syncronize page swipe with the icons, i mean if fragment is swiped , the respective icon is highligted – Timmy Simons Apr 07 '14 at 15:49
  • I don't know. They do all custom. All Facebook app is custom. Facebook is not a good example of Android Design. It's only a great example of Facebook Design. – Brais Gabin Apr 07 '14 at 15:54

1 Answers1

0

Just create an xml layout that looks like the Facebook action bar, then do something like this:

ActionBar action = getSupportActionBar();
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.your_header_xml, null);
action.setCustomView(view);

You just have to make the xml, then it should display fine.

Lunchbox
  • 1,538
  • 2
  • 16
  • 42