am ece784c5: Fix error in InefficientWeight rule. It would wrongly assume 0dip != 0dip.

Merge commit 'ece784c583edbbeb56e8a74d4ddf039121d0df71' into eclair-mr2

* commit 'ece784c583edbbeb56e8a74d4ddf039121d0df71':
  Fix error in InefficientWeight rule. It would wrongly assume 0dip != 0dip.
This commit is contained in:
Romain Guy
2009-10-06 16:33:57 -07:00
committed by Android Git Automerger
2 changed files with 16 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ if (parent.is("LinearLayout") && node.'@android:layout_weight' &&
parent.'*'.findAll{ it.'@android:layout_weight' }.size() == 1) {
def dimension = parent.'@android:orientation' == "vertical" ?
"android:layout_height" : "android:layout_width"
if (node."@${dimension}"[0] != 0) {
if (node."@${dimension}"[0] != '0') {
analysis << "Use an ${dimension} of 0dip instead of ${node."@${dimension}"} " +
"for better performance"
}

View File

@@ -25,5 +25,20 @@
android:layout_weight="1.0" />
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<Button
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1.0" />
</LinearLayout>
</LinearLayout>