kanytu / android-material-drawer-template

An Android template with navigation drawer for material design
Apache License 2.0
674 stars 217 forks source link

RTL support #22

Closed khalid-hussain closed 9 years ago

khalid-hussain commented 9 years ago

Hi there,

I'm a beginner at Android development. I can't seem to find an easy way to insert RTL support for the navigation drawer. I've inserted the option android:supportsRtl="true" in the manifest and tried this but the function no longer accepts integer. I'm not sure how to overcome this.

Will this feature be easy to implement?

kanytu commented 9 years ago

I just added android:supportsRtl="true" to the manifest and added

getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);

On the activity onCreate and I got this result:

ezgif com-optimize 4

khalid-hussain commented 9 years ago

In this case, the minSdkVersion has to be 17 right? Or is it possible to keep it at its original value?

kanytu commented 9 years ago

Yes you're correct. RTL was only added in Android 4.2.

http://developer.android.com/about/versions/jelly-bean.html#42-native-rtl

khalid-hussain commented 9 years ago

Thank you very much.