I am creating an application that contains a header with a button on the right that should slide a list view to left when I click on it(similar to the chat list in Facebook)
–> 
When I was including this header without putting the list view in it, it was working properly. But now I am inserting this list view inside the .xml file of the header (because the header is always shown for the user and he can click on this list view button in any layout that is shown for him).
The problem that I want to include this header to all the other layouts without changing the way they looks and show this list each time he click on the button.
I searched and found a lot of answers but every solution was about making the same as I did in the previous screen shots in each page which is not an optimistic solution for multiple pages.
*I am working on API level 10 and want to find the solution without using Actionbar.
Tell me please if more information would be helpful, any help will be really appreciated.
Thanks in advance.
UPDATE my xml file :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/GeneralRelativeLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<RelativeLayout android:id="@+id/rel_layout"
android:layout_width="200dp"
android:layout_height="fill_parent"
android:background="@android:color/white" android:layout_alignParentRight="true">
<LinearLayout android:id="@+id/fake_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"></LinearLayout>
<ListView android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="@android:color/background_dark"
></ListView>
</RelativeLayout>
<RelativeLayout android:id="@+id/rel_layout_second"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<LinearLayout android:id="@+id/lin_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/background_light"
android:orientation="vertical"
android:layout_centerHorizontal="true" android:layout_alignParentTop="true">
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="slide"
android:layout_gravity="right|center"></Button>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
Try to create a
RelativeLayoutfor theListViewwith aandroid:visibility="gone"and all the other components in the same User Interface inside anotherRelativeLayout.Then change its visibility upon the state of the menu if it’s opened or closed.