0

I am writting my application in rtl language. I have set my navigation drawer to come from right to left when the phone language is English. But when I change the phone's language to farsi (rtl language) it brings me the error that says: "No drawer view found with gravity RIGHT". So how can I set my navigation drawer to come from right in both languages?

Paebbels
  • 15,573
  • 13
  • 70
  • 139
moji
  • 63
  • 10

1 Answers1

0

Use Gravity.START and Gravity.END instead of left/right. If you specify your drawer as Gravity.START, it will show on the left for English and on the right for Farsi.

Francesc
  • 25,014
  • 10
  • 66
  • 84
  • yesit become that way that you said but i want that in both languages it become from right to left @Francesc – moji Apr 29 '16 at 22:43
  • If you want your drawer always on the right side regardless of language, then use Gravity.RIGHT. – Francesc Apr 29 '16 at 23:26
  • thank Francesc. it worked for me. ofcourse i write some code to complete your idea. thats it: if (mDrawerLayout.isDrawerOpen(Gravity.RIGHT)) { mDrawerLayout.closeDrawer(Gravity.RIGHT); } else {mDrawerLayout.openDrawer(Gravity.RIGHT);} – moji Apr 30 '16 at 05:08