diff options
author | Tor Norbye <tnorbye@google.com> | 2012-10-16 12:38:47 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-10-16 12:38:47 -0700 |
commit | 38ae2882d93208001c46108fd56b18ef740a6ad5 (patch) | |
tree | dd458d962f0121e30847dc3f2362c299e1980a9f /lint | |
parent | 77908982268f51c9bb6ea4535daf2058999cdc10 (diff) | |
download | sdk-38ae2882d93208001c46108fd56b18ef740a6ad5.zip sdk-38ae2882d93208001c46108fd56b18ef740a6ad5.tar.gz sdk-38ae2882d93208001c46108fd56b18ef740a6ad5.tar.bz2 |
Fix required attribute check for GridLayout children
Change-Id: I58e67eb1acb6b8e5a503f1aa7822c97b545eac10
Diffstat (limited to 'lint')
-rw-r--r-- | lint/libs/lint_checks/src/com/android/tools/lint/checks/RequiredAttributeDetector.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/RequiredAttributeDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/RequiredAttributeDetector.java index 81b0626..a71f4b4 100644 --- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/RequiredAttributeDetector.java +++ b/lint/libs/lint_checks/src/com/android/tools/lint/checks/RequiredAttributeDetector.java @@ -319,7 +319,15 @@ public class RequiredAttributeDetector extends LayoutDetector implements Detecto String parentTag = element.getParentNode() != null ? element.getParentNode().getNodeName() : ""; - if (TABLE_LAYOUT.equals(parentTag) || TABLE_ROW.equals(parentTag)) { + if (TABLE_LAYOUT.equals(parentTag) + || TABLE_ROW.equals(parentTag) + || GRID_LAYOUT.equals(parentTag) + || FQCN_GRID_LAYOUT_V7.equals(parentTag)) { + return; + } + + String tag = element.getTagName(); + if (tag.equals(VIEW_INCLUDE)) { return; } @@ -368,11 +376,6 @@ public class RequiredAttributeDetector extends LayoutDetector implements Detecto } } - String tag = element.getTagName(); - if (tag.equals(VIEW_INCLUDE) || tag.equals(GRID_LAYOUT) - || tag.equals(FQCN_GRID_LAYOUT_V7)) { - return; - } String message; if (!(hasWidth || hasHeight)) { if (certain) { |