I'm going on with my menu slider bar action and for that I had Googled and finished my slide bar action with help of the below link
http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/
Now what i need is to add a profile image and user name with his location (eg:image,john,Chennai) in top of the list. I tried that by creating seperate relative layout for the above three and another separate layout for the rest of list items but i am getting some alignment issues.
here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:id="@+id/userimage_top"
android:layout_width="match_parent"
android:layout_height="90dp">
<ImageView
android:id="@+id/usermenu_image"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
androidaddingLeft="5dp"
androidrc="@drawable/profile_circle" />
<TextView
android:id="@+id/user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/usermenu_image"
android:layout_below="@+id/usermenu_image"
android:text="name"
android:textColor="@color/lightred"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
android:id="@+id/user_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/usermenu_image"
android:layout_below="@+id/user_name"
android:text="loication"
android:textColor="@color/lightred"
android:textSize="15dp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/userimage_menu"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/list_selector"
android:layout_alignParentLeft="true"
android:layout_below="@+id/userimage_top" >
<ImageView
android:id="@+id/icon"
android:layout_width="25dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:contentDescription="@string/desc_list_item_icon"
androidrc="@drawable/home_icon"
android:layout_centerVertical="true" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@id/icon"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:textColor="@color/list_item_title"
android:gravity="center_vertical"
androidaddingRight="40dp"/>
<TextView android:id="@+id/counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/counter_bg"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:textColor="@color/counter_text_color"/>
</RelativeLayout>
</RelativeLayout>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Framelayout to display Fragments -->
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- Listview to display slider menu -->
<ListView
android:id="@+id/list_slidermenu"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
androidivider="@color/list_divider"
androidividerHeight="1dp"
android:listSelector="@drawable/list_selector"
android:background="@drawable/side_menu_panel"/>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
so can any one please help me to solve this problem.