Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Right to Left layout support is causing warning lints in xml editor

Recently I updated to the new ADT plugin. Since then whenever I'm creating an xml layout using any tag like

android:layout_toRightOf="  " 
android:layout_alignParentLeft="true"

and basically anything with the word left and right a lint warning shows telling me to add start and end tags for every left and right tag I use in order to support right to left layouts.

for example it suggests I change the previous xml to

android:layout_toRightOf="  " 
android:layout_alignParentLeft="true"
android:layout_toEndOf="  " 
android:layout_alignParentStart="true"

Is anyone having the same issue ? Is there a way to either have the eclipse xml editor add these tags automatically as I move a view inside a layout or just to disable these lints or feature completely ? I tried declaring in my manifest

android:supportsRtl="false"

in order to disable the feature but that line needs api 17+ and my app supports api 9+.

Does anyone have a solution ?

like image 281
mremremre1 Avatar asked Sep 04 '14 11:09

mremremre1


1 Answers

If you declared android:targetSdkVersion in your AndroidManifest.xml file with a value of 17 or higher, then you'll also need to declare android:layout_toEndOf and android:layout_toStartOf to support right-to-left display.

But, if your android:targetSdkVersion is 16 or lower, you can ignore the Lint warning as it does not affect the development or deployment of your application.

like image 147
ChuongPham Avatar answered Nov 15 '22 03:11

ChuongPham