3

Hello friends i wnat to make custom slidng drawer like you-tube in my application

enter image description here

When user click on any item it should be show me like above image which i highlight so any idea how can i achieve this ?

Harshal Kalavadiya
  • 2,412
  • 4
  • 38
  • 71
  • 2
    its called the navigation drawer. – Raghunandan Apr 11 '14 at 04:12
  • go through following link for navigation Drawer's UI principals: https://developer.android.com/design/patterns/navigation-drawer.html and then go through thi link to create actual navigation drawer http://developer.android.com/training/implementing-navigation/nav-drawer.html – Jigar Apr 11 '14 at 04:17
  • check this http://sunil-android.blogspot.in/2013/09/slide-menu-navigation-drawer-in-android.html @Harshal Kalavadiya – TheFlash Apr 11 '14 at 04:22
  • @ Jigar Jariwala , @ Indiandroid : i already seen that exapmles in but this examples highlight selector in whole listbackground but i also want red color indicator at starting which is mention – Harshal Kalavadiya Apr 11 '14 at 04:28

1 Answers1

3

Yesterday I faced same problem

but this examples highlight selector in whole listbackground but i also want red color indicator at starting which is mention

You need to create two selector. 1. For whole item 2. for that red part

For that Place a view in listitem on left side and create a selector for it.

then use following code. Here android:duplicateParentState="true" works for you. When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself.

<TextView
    android:layout_width="3dp"
    android:layout_height="match_parent"
    android:duplicateParentState="true"
    android:background="@drawable/selector_for_red" />
Ketan Ahir
  • 6,678
  • 1
  • 23
  • 45