In my application I started to set the UI to meet Material Design use the Toolbar.
I want to add the back arrow on the action bar. It looks ok but somehow, when I change my phone locality to Hebrew which is a rtl language, the arrow change it's direction and instead of pointing "out", it is now pointing "in". Please refer to image to see how arrow looks in Hebrew and English. Is there a way to control the arrow direction (I want it will point "out" always of course)?
I tried to add the android:layoutDirection="ltr" and android:textDirection="ltr" but it didn't helped.
Thanks for who can answer on this.
Here is the code of the Toolbar layout:
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="@color/primaryColor"
app:theme="@style/MyCustomToolBarTheme"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark"
android:textDirection="ltr"
android:layoutDirection="ltr">
Finally I succeeded to change the arrow direction.
Well, actually I followed this post: First, I have found some action bar icons and placed a drawable back icons in the project. Then I used this code to set the arrow programmatically:
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_action_back);
The "back" icon is provided by a drawable specified in the homeAsUpIndicator attribute of the theme. You can try to override it and put your own marker (arrow out) it would be something like this:
<style name="Theme.MyTheme" parent="android:Theme.Holo">
<item name="android:homeAsUpIndicator">@drawable/out_arrow</item>
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With