4

I am developing the tablet version of an app and have a 2 pane layout (master-detail) with 2 fragments, where the left fragment contains one menu item and the right fragment contains several menu items. As a default, all menu items of both fragments are displayed on the right end of the toolbar.

How can i position the menu-item of the left fragment directly above the right upper corner of this fragment (See the gmail app on tablets in landscape mode as an example -> gmail tablet)?

Lukas Lechner
  • 7,881
  • 7
  • 40
  • 53

2 Answers2

0

It depends on relative values of orderInCategory under each menu item, even for items in different menu files upon rendered in two pane mode.

This will show lower

<item android:id="@+id/action_sort_popular"
    android:title="@string/sort_popularity"
    android:orderInCategory="101"
    app:showAsAction="never" />

And this will show higher up

<item android:id="@+id/action_sort_rating"
    android:title="@string/sort_rating"
    android:orderInCategory="100"
    app:showAsAction="never" />
anandbibek
  • 1,659
  • 16
  • 20
0

Couldn't really find anything on this, apart from this tutorial (Scroll down half way to section Split Toolbar for Tablets).

It gets the job done, however i'm not sure if its the correct way of doing it.

Anthony Cannon
  • 1,245
  • 9
  • 20