0

I have this bottom action bar style

enter image description here

I want to design like this (left , center, right) with background color blue or red

enter image description here

this is the menu

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
    <item android:id="@+id/action_settings" android:title="@string/action_settings"
        android:orderInCategory="100" app:showAsAction="never" />

    <item android:id="@+id/menu_save"
        android:icon="@drawable/ic_action_picture"
        android:title="Save"
        app:showAsAction="always"/>

    <item android:id="@+id/menu_search"
        android:icon="@drawable/ic_action_picture"

        android:title="Search"
        app:showAsAction="always"/>

    <item android:id="@+id/menu_share"
        android:icon="@drawable/ic_action_picture"
        android:title="Share"
        app:showAsAction="always"
        />

</menu>

If you need anything else ask me

Moudiz
  • 7,211
  • 22
  • 78
  • 156

2 Answers2

1

Here you can download the needed icons: https://www.google.com/design/icons/index.html

The distance between the icons can you make with a custom android:actionButtonStyle like:

<item name="android:actionButtonStyle">@style/ActionButtonStyle</item>

<style name="ActionButtonStyle" parent="@android:style/Widget.Holo.Light.ActionButton">
    <item name="android:minWidth">70dip</item>
    <item name="android:paddingLeft">70dip</item>
    <item name="android:paddingRight">70dip</item>                  
</style>

And the background color:

ActionBar bar = getActionBar();
bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#FF0000")));
Patricia
  • 2,885
  • 2
  • 26
  • 32
1

If you have not solved your issue, you can refer to the following:

activity_main.xml:

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".MainActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_main" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar_bottom"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:layout_alignParentBottom="true"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay">

            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">

                <ImageButton
                    android:id="@+id/button1"
                    android:layout_width="10dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.175"
                    android:background="@android:color/transparent"
                    android:src="@drawable/ic_action_back" />

                <View
                    android:id="@+id/view1"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="0.1" />

                <ImageButton
                    android:id="@+id/button2"
                    android:layout_width="10dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.175"
                    android:background="@android:color/transparent"
                    android:src="@drawable/ic_action_cloud" />

                <View
                    android:id="@+id/view2"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="0.1"
                    android:background="@android:color/transparent" />

                <ImageButton
                    android:id="@+id/button3"
                    android:layout_width="10dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.175"
                    android:background="@android:color/transparent"
                    android:src="@drawable/ic_action_copy" />

                <View
                    android:id="@+id/view3"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="0.1"
                    android:background="@android:color/transparent" />

                <ImageButton
                    android:id="@+id/button4"
                    android:layout_width="10dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.175"
                    android:background="@android:color/transparent"
                    android:src="@drawable/ic_action_help" />

            </LinearLayout>

        </android.support.v7.widget.Toolbar>

    </RelativeLayout>

</android.support.design.widget.CoordinatorLayout>

BNK's screenshot

BNK
  • 23,994
  • 8
  • 77
  • 87