I want to display the bottom tab bar as MAC system dock menu
How to achieve this dock menu in android
TabHost
not provide to much facility to customize there layout. So what i did, I create a layout as I wanted with combination of ImageView and transfer it's click to relative TabWidget
. I created layout like below.
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal">
<include
android:id="@+id/customtab"
layout="@layout/customtablayout"/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0" />
</FrameLayout>
</LinearLayout>
Here customtablayout
is my layout with images as tab(you can add anithing). and when I click to a image, I called tabHost.setCurrentTab(index);
.
You can check (tab whith image) : How to change the Tabs Images in the TabHost
You applay mirror effect to your image
Set Animation for resizing the view Resizing layouts programmatically (as animation)