More lint checks: translation, i18n, proguard, gridlayout, "px"
This changeset adds more lint checks:
(1) Translation. It looks at all the string values in the application,
and if there are discrepancies (where a translatable string is not
defined in all provided languages and regions) then these are
listed.
(2) Internationalization. It looks for text: and contentDescription:
attributes and ensures that these refer to @string resources, not
hardcoded string values. This lint warning also has an associated
quickfix when shown in Eclipse which invokes the Extract String
refactoring wizard on the right selection context.
(3) Proguard. It looks for the old (broken) patterns we had in older
proguard.cfg files (-keepclasseswithmembernames instead of
-keepclasseswithmembers which implies shrinking.)
(4) GridLayout. It looks at the layout constraints provided on views
in a GridLayout and ensures that they fall within the overall
dimensions of the grid.
(5) "px" usage. It looks for dimensions using "px" as a unit and
recommends switching to dp instead. This lint warning also has a
quickfix in Eclipse which pops up a dialog asking for the screen
density and then converts the px value to the right dp value and
changes the unit.
(6) TextFields. It looks at EditTexts and makes sure they either set
inputType, hint or inputMethod. There's a quickfix in Eclipse for
setting the inputType, which adds the property and automatically
invokes content assist for showing the possible values.
This changeset also adds some quick fixes for a few existing lint
warnings:
(7) Accessibility: Insert a content description attribute, front the
editor and select the placeholder value.
(8) Useless leaf layout: Remove the leaf layout
(9) Useless middle layout: Invoke the Remove Container visual
refactoring
10) Inefficient Linear Layout Weights: Change the attribute to 0dp
Plus unit tests.
Change-Id: Iebd7b23224a898bd1851abd578460019aee44df5
45 files changed