5

I have designed an app, that replicates the way Android embeds tabs in the actionbar, when there is room for it. In the two images below, you can see how the bottom part is in two panes in portrait mode, and becomes one single pane in landscape mode.

Non-embedded

Embedded

What I want to do: Change to single pane layout whenever the actionbar changes to embedded mode, and to the two pane layout when the actionbar is not in embedded mode.

What I have done so far: Put the two pane mode in the "layout"-folder and the single pane mode in the "layout-land"-folder. However, I am not quite sure, that this will replicate the actionbar behaviour. I would imagine, that big screen devices would show the embedded mode even when in portrait mode.

So, does anyone know exactly which parameters change the actionbar from non-embedded to embedded, and whether this could be fixed simply by adding some other qualifiers to the layout-folders name?

Mads Frandsen
  • 523
  • 4
  • 12
  • http://developer.android.com/guide/topics/ui/actionbar.html#Tabs is that a solution? – Vasily Sochinsky Jun 08 '13 at 19:55
  • I'm not quite sure, that I understand? I am already using the actionbar tabs at the top, but I want to replicate the behaviour at the bottom as well. – Mads Frandsen Jun 10 '13 at 22:01
  • My bad for inattentive reading, excuse me. – Vasily Sochinsky Jun 11 '13 at 09:55
  • You wrote: 'I want to replicate the behaviour at the bottom as well'. Just to clarify, are you asking how to display tabs at the bottom of the screen at the same time as displaying tabs inside the ActionBar (at top of screen)? – Gunnar Karlsson Jun 13 '13 at 00:35
  • I think this might be related, no? http://stackoverflow.com/questions/13828659/how-to-stop-actionbar-tab-navigation-to-display-as-a-spinner-when-it-gets-too-lo – Raanan Jun 14 '13 at 11:13
  • @GunnarKarlsson Not exactly. I don't want to have tabs, at the bottom, but if you look in my updated question, then I am positioning the blue box to the right of the red box instead of below the red box. This is the same, that the actionbar does with the tabs, when there is room for it. What I am trying to find out, is what the criteria is for this to happen with the actionbar, so I can replicate it in my red and blue box at the bottom of the screen. I hope this helps to clear it up a bit. – Mads Frandsen Jun 16 '13 at 20:22
  • @Raanan I'm afraid, I cannot see how that question relates to my question. – Mads Frandsen Jun 16 '13 at 20:26

1 Answers1

1

ActionBarSherlock which, I believe, replicates native ActionBar's behavior checks R.bool.abs__action_bar_embed_tabs resource. And this resource is true only for values-w480 configuration.

kriomant
  • 2,216
  • 1
  • 16
  • 21
  • That is exactly what, I was looking for. Maybe I can check this boolean resource to make sure it works even if they change this later on. For now, I'll go with w480 - thank you! – Mads Frandsen Aug 23 '13 at 10:30