2

I need supporting RTL languages on my application , problem is with back arrow on some devices specially samsung galaxy note 4. there is no problem on other devices so far but on note 4. how can I change the direction on this device also? this is how I do:

on manifest :

android:supportsRtl="true"

library : I am using appcompatV7(latest one)

drawable folder: I added all folders from support library version 4 like drawable-ldrtl-xxxhdpi

drawable: I am using android provided abc_ic_ab_back_mtrl_am_alpha.png in every single drawable folder

code :

    if(Build.VERSION.SDK_INT>17)
    mToolBar.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);

also I added this : getSupportActionBar().setHomeAsUpIndicator(R.drawable.abc_ic_ab_back_mtrl_am_alpha);

also in my style.xml there is :

    <item name="homeAsUpIndicator">@drawable/abc_ic_ab_back_mtrl_am_alpha</item>

With all of this, back arrow direction is ok on all devices so far except samsung galaxy note 4! Attached image is output on samsung note 4 which is wrong and back arrow should point to right instead of left can somebody please help on this

wrong direction! should point to right not left regards

pRaNaY
  • 24,642
  • 24
  • 96
  • 146
Mahdi Giveie
  • 630
  • 1
  • 8
  • 25
  • Related: https://stackoverflow.com/questions/31963619/android-navigation-button-show-wrong-side-when-layout-direction-is-rtl – Mr-IDE Dec 24 '17 at 18:20

2 Answers2

2

finally fixed this by using this line of code :

getSupportActionBar().setHomeAsUpIndicator(R.drawable.back_arrow)
Mahdi Giveie
  • 630
  • 1
  • 8
  • 25
0

Just right click drawable>New>Image Asset> Icon Type: Action Bar & Tab Icons... color your want. and add this to your style

 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
     <!--... Your Style...-->
     <item name="android:homeAsUpIndicator">@drawable/ic_action_back</item>
 </style>

Just right click drawable>New>Image Asset> Icon Type: Action Bar & Tab Icons...