android - setDisplayHomeAsUpEnabled using a style attribute -


is possible when usingappcompatactivityto specify getsupportactionbar().setdisplayhomeasupenabled(true)using styles, rather doing programmatically?

i can specify drawable itself, how enable using styles?

<style name="myactivitytheme" parent="theme.appcompat.light.darkactionbar">     <item name="actionbartheme">@style/myactionbar</item> </style>  <style name="myactionbar" parent="themeoverlay.appcompat.dark.actionbar">     <item name="homeasupindicator">@drawable/ic_clear</item>     <!-- enable above using style attribute --> </style> 

in styles:

<style name="myactionbarstyle" parent="widget.appcompat.light.actionbar.solid">     <item name="displayoptions">showtitle|homeasup</item> </style>  <style name="apptheme" parent="theme.appcompat.light.darkactionbar">     ...     <item name="actionbarstyle">@style/myactionbarstyle</item> </style> 

will launch activity arrow:

enter image description here


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -