Android Studio enum left right bug? How to disable RTL warnings for the entire project?

Android Studio should be known to those who, in most cases, simply exacerbate the Lint warnings "Use left / right, not start / end attributes." I use Android Studio 0.8.9, but the following problem was also present in earlier versions: if you add this ultra-minimal piece of code anywhere in your code

public enum BiteMeLint { LEFT } 

Android Studio shows a warning

Use "Gravity.START" instead of "Gravity.LEFT" to ensure correct behavior in locales from right to left.

This also happens for the RIGHT constant, although in this case it is suggested to use Gravity.END. Now I am a developer who loves to have his code completely cleared of any warnings, either by observing, or, if this is not possible, by suppressing and installing "todo" or "fixme" where necessary. Here, since I use "LEFT" and "RIGHT" as constants for the actual directions, the warning is obviously a mistake. Sorry, adding

 @SuppressLint("RtlHardcoded") 

does not remove the warning. So how do I remove this warning joke? And now, when I ask, can I somehow completely turn off RTL warnings for the project, I'm sure that it will never start in the locale from right to left?

+6
source share
1 answer

According to this tracker , this is a bug that was recently fixed in Android Studio 0.8.10.

The option to disable this check can be found in the Project Settings | Inspections | Android Lint | Unsing left/right instead of start/end attributes Project Settings | Inspections | Android Lint | Unsing left/right instead of start/end attributes Project Settings | Inspections | Android Lint | Unsing left/right instead of start/end attributes . Therefore, you can simply disable it for the entire project by unchecking the box.

+4
source

Source: https://habr.com/ru/post/975998/


All Articles