OSDN Git Service

Add new rules to layoutopt: UseCompoundDrawables and UselessLayout.
[android-x86/development.git] / tools / layoutopt / libs / uix / src / resources / rules / TooManyViews.rule
1 // Rule: TooManyViews
2 //
3 // Description: Checks whether the layout has too many views.
4 //
5 // Conditions:
6 // - The document contains more than 80 views
7
8 if (xml.isRoot && (size = xml.'**'.size()) > 80) {
9     analysis << "This layout has too many views: ${size} views, it should have <= 80!"
10 }