0

i'm using actionbarsherlock for my actionbar. I have a sliding menu and searchview. when the application get launches, it will automatically pick the up navigation icon from style.xml file.

When the search menu gets expanded, the up navigation icon will not get changed, it will be still looking like 3 line slider menu. How to change the up navigation icon when searchview is expanded?. I have represented the flow in below image.

enter image description here

Naruto
  • 9,476
  • 37
  • 118
  • 201

2 Answers2

0

<style name="MyThemeForSearch" parent="@style/MyCustomTheme"> <item name="android:homeAsUpIndicator">@drawable/my_back_indicator_for_search</item> </style>

Community
  • 1
  • 1
VenomVendor
  • 15,064
  • 13
  • 65
  • 96
  • Ya, that works well when i launch the app, there i have placed 3 strips bar image. Now, when my search expanded, how to update there to arrow? – Naruto Jul 30 '14 at 05:09
  • Could you please provide me snip of code, setTheme is supported in API 8? – Naruto Jul 30 '14 at 05:10
  • setTheme is available from API-1 – VenomVendor Jul 30 '14 at 05:16
  • i tried like this, `@Override public boolean onMenuItemActionExpand(MenuItem item) { mAddnewtaskmenu.setVisible(false); setTheme(R.style.arrowtheme);`} it didnt work – Naruto Jul 30 '14 at 15:08
0

check your layout drawable's whether you have set an image like 3 liner slide menu when you create navigation drawer it automatically sets default image which will be loaded representing 3 liner slide like you mentioned change your ic_drawer.png image and replace image with what icon you wish. also you might go check changing your theme

> <style name="Theme.MyFancyTheme" parent="android:Theme.Holo">
>     <item name="android:homeAsUpIndicator">@drawable/my_fancy_up_indicator</item>
> </style>