0

I am trying to use layoutDirection="rtl to set navigation button on right side.But Navigation button animated into a forward button instead of a back button.

Shows a forward button.Need a forward button here

I have already tried

getSupportActionBar().setDisplayShowHomeEnabled(true);

    getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_arrow_back_black_24dp);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_back_black_24dp);

and

toggle.setDrawerIndicatorEnabled(true);

EDIT I am afraid I didn't explain my question well, i am just trying to change the icon in the left direction. https://i.stack.imgur.com/6ojIb.jpg

I would greatly appreciate any feedback on this.

J B
  • 11
  • 4
  • have you checked this https://stackoverflow.com/questions/18547277/how-to-set-navigation-drawer-to-be-opened-from-right-to-left – Im Batman Oct 08 '17 at 20:42
  • Yes i did , I am not trying to move the whole drawer . Just the direction of arrow after navigation button clicked – J B Oct 08 '17 at 21:10
  • If you do actually want the whole `Toolbar` flipped right-to-left like you have it, have a look at [this post](https://stackoverflow.com/a/37774380). If you're just trying to move the toggle to the other side, then [this answer](https://stackoverflow.com/a/39136512) can help. You'd just need to change all of that `DrawerLayout`'s `GravityCompat.END` uses to `GravityCompat.START`. – Mike M. Oct 09 '17 at 02:58
  • @MikeM. thank you, i really appreciate your comment. but I am afraid I didn't explain my question well, i am just trying to change the icon in the left direction.If you have time please have look this [image link](https://imgur.com/a/fl3Y0) – J B Oct 09 '17 at 19:09
  • @ImBatman thanks for the comment but that didn't help.i am change toogle icon like this [image](https://imgur.com/a/fl3Y0) – J B Oct 09 '17 at 19:19
  • Yeah, that's what my answer in [the first link I commented above](https://stackoverflow.com/a/37774380) will do. I just gave the second one in case you didn't really want the `Toolbar`'s layout direction flipped, and we're only doing that as a last resort. – Mike M. Oct 09 '17 at 19:56
  • I just realized that I didn't explicitly state that you'd have to change the `DrawerArrowDrawable.ARROW_DIRECTION_RIGHT` in that answer, but I'd imagine you noticed that already. – Mike M. Oct 10 '17 at 00:24
  • 1
    Thank you so much @MikeM. for the link. as you said DrawerArrowDrawable.ARROW_DIRECTION_RIGHT to _LEFT and it is working perfectly fine now. Truly appreciate the time you spent reviewing my question. – J B Oct 10 '17 at 04:37

0 Answers0