New rules for layoutopt: IncorrectHeight/WidthIn[Horizontal]ScrollView, UselessView.

This change also refactors the uix library to remove an unnecessary class (LayoutNode.)
The refactoring helps writing cleaner script by accessing only the node object instead
of xml and node. This change also augment the capabilities of the node in Groovy scripts.

Change-Id: Id7515f9a79826909834d82496a6d9dfbc19988ad
This commit is contained in:
Romain Guy
2009-10-06 11:37:46 -07:00
parent d9050e6102
commit 1e2cbdfa84
18 changed files with 220 additions and 238 deletions

View File

@@ -9,9 +9,8 @@
// - The node is fill_parent in both orientation *or* it has no layout_gravity
// - The node does not have a background nor a foreground
if (xml.isRoot() && xml.is("FrameLayout") && !xml.'@android:background' &&
!xml.'@android:foreground' && ((node.isWidthFillParent() &&
node.isHeightFillParent()) || !xml.'@android:layout_gravity')) {
analysis << [node: node, description: "The root-level <FrameLayout/> can be " +
"replaced with <merge/>"]
if (node.isRoot() && node.is("FrameLayout") && !node.'@android:background' &&
!node.'@android:foreground' && ((node.isWidthFillParent() &&
node.isHeightFillParent()) || !node.'@android:layout_gravity')) {
analysis << "The root-level <FrameLayout/> can be replaced with <merge/>"
}