3

I am not quite sure what kind of layout Gmail is using in Android. I suppose they use a floating ViewGroup.

But for the menu on the top and bottom I really need somebody point me how to make that.

Macarse
  • 91,829
  • 44
  • 175
  • 230
Huppo
  • 971
  • 2
  • 10
  • 11
  • 1
    This is called a "split action bar", see the section in the [actionbar design guide](http://developer.android.com/design/patterns/actionbar.html) and the [ActionBar documentation](http://developer.android.com/guide/topics/ui/actionbar.html#SplitBar). –  Jun 01 '12 at 18:13

4 Answers4

4

I suggest you to use the Sherlock ActionBar:

http://actionbarsherlock.com/

This allows you to easily develop an application with an action bar for every version of Android from 2.x and up.

In the sample app you can find the code to achieve what you are looking for under "Split Action Items". The idea is that you add actions from the menu as usual, but writting the following line in your manifest activity:

android:uiOptions="splitActionBarWhenNarrow"

Demo App with code for the Split ActionBar

MRD
  • 7,146
  • 1
  • 21
  • 21
  • for some applications this is ok . But for e.g. an office application it is not. Using it landscape disapears. – GorillaApe Aug 29 '13 at 14:14
3

You can create a menu which will sit on the bottom of a listview using the <RelativeLayout> tag like so

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content" >
    <ListView
      android:layout_height="wrap_content"
      android:layout_width="fill_parent" android:id="@android:id/list"
      android:listSelector="@android:color/transparent"
      android:layout_above="@+id/footer" />

    <include android:id="@+id/footer" android:layout_height="wrap_content"
      layout="@layout/mymenu" android:layout_width="fill_parent"
      android:layout_centerHorizontal="true"
      android:layout_alignParentBottom="true" >
    </include>
</RelativeLayout>

mymenu will contain a linearlayout with something like a tablelayout with a few rows (which can be textviews, imageviews, etc.) The table will sit at the bottom of your screen and the listview will be in a frame which starts at the top of the screen and ends at the top of the menu (no overlap)

You could also do the same for the top of the screen by simply having the listview say layout_below="@+id/header" instead of layout_above"@+id/footer" (or do both!)

matt5784
  • 3,065
  • 2
  • 24
  • 42
0

This is covered on android. You have to implement a "split action bar". Note that it works in potrait view and disappears when you switch to landscape. Android Action Bar

HagTheDon
  • 141
  • 1
  • 6
-1

It looks like a custom ActionBar implementation. If you put icons in a normal ActionBar and there is not enough space to display them, android creates a bottom bar on its own and display the icons there.

I had a similar application and I chose to put my own custom bar there instead of implementing ActionBar

kishu27
  • 3,140
  • 2
  • 26
  • 41