I am using right to left support for my app. I have a custom arrow set to toolbar as the navigation icon. When I switch to arabic language, everything aligns to right including the toolbar custom navigation arrow. But the problem is the custom navigation icon is not flipping, that is it should be pointing to the right instead of left(default). This works fine with the default indicator if I dont specify any navigation icon. Have anyone encountered this?
Any solution?
Here is my code for the toolbar
<android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/white" app:contentInsetLeft="0dp" app:contentInsetStart="0dp" app:contentInsetStartWithNavigation="0dp" app:elevation="0dp" app:navigationIcon="@drawable/ic_back" app:popupTheme="@style/AppTheme.PopupOverlay" app:logo="@drawable/ic_logo" android:gravity="center_vertical|start" >
in Activity
Toolbar toolbar = (Toolbar) findViewById(R.id.tb_venue_filter); setSupportActionBar(toolbar); setDisplayHomeAsUpEnabled(true);
Answer
This is a feature of the Drawable
, not so much the Toolbar.
Try with:
toolbar.getNavigationIcon().setAutoMirrored(true);