summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-01-20 17:02:37 -0800
committerDeepanshu Gupta <deepanshu@google.com>2014-01-20 17:02:37 -0800
commit35d56c0d67537e56fafebd8edf790026644fe8de (patch)
tree1f5513a491be890aec3dd8db9683b955857c919a /tools
parentc174288d345d4a80b326b12ff4c10a6c99570997 (diff)
downloadframeworks_base-35d56c0d67537e56fafebd8edf790026644fe8de.zip
frameworks_base-35d56c0d67537e56fafebd8edf790026644fe8de.tar.gz
frameworks_base-35d56c0d67537e56fafebd8edf790026644fe8de.tar.bz2
Optimize layout rendering in layoutlib
The height of a layout should be zero if it is assigned a layout_weight. This way, the layout is measured only once and prevents spurious errors. Bug: https://code.google.com/p/android/issues/detail?id=58398 Change-Id: If49a7480e5eb82cb86780e00f2f5b65ee053fc2a
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
index 57771e3..377d996 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
@@ -334,7 +334,7 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
backgroundView = backgroundLayout;
backgroundLayout.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
- LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
+ LayoutParams.MATCH_PARENT, 0);
layoutParams.weight = 1;
backgroundLayout.setLayoutParams(layoutParams);
topLayout.addView(backgroundLayout);
@@ -369,7 +369,7 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
// content frame
mContentRoot = new FrameLayout(context);
layoutParams = new LinearLayout.LayoutParams(
- LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
+ LayoutParams.MATCH_PARENT, 0);
layoutParams.weight = 1;
mContentRoot.setLayoutParams(layoutParams);
backgroundLayout.addView(mContentRoot);