I have a font file whose icons I am using in layout files via a Custom TextView.
I created a Custom Class : class CustomFontTextView extends TextView
say, icon is there in Font file Sample.ttf as string resource :
<string name="icon"></string>
In layouts, I can use it as :
<com.sec.mywash.views.CustomFontTextView
custom:custom_typeface="sample_font"
android:text="@string/icon"/>.
However , my requirement is to change the Home up button in action bar that we set in style.xml as item:
<item "android:homeAsUpIndicator">@drawable/....</item>
How to use the icon image from font file in style.xml which takes drawable.
You can create your own drawable class for doing this, something like this
I think in your case its not possible to change Home up button icon via xml...you are using an iconFont, so your icon is actually a text and to display those icons you need your CustomTextView or any View, which extends the TextView. android:homeAsUpIndicator requires drawable. Possible solution could be: to have this special icon in drawable folder.