summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2011-02-02 18:37:59 -0800
committerXavier Ducrohet <xav@android.com>2011-02-02 18:37:59 -0800
commit33758ef8c98efb669c65eb9404b99ee5df09c6b5 (patch)
tree624741f3a013a08100e5b6c0b3e7b9c6e5fc838c /tools
parenta4747d536e905c3c34ab0d3c1c9c7485d6fac689 (diff)
downloadframeworks_base-33758ef8c98efb669c65eb9404b99ee5df09c6b5.zip
frameworks_base-33758ef8c98efb669c65eb9404b99ee5df09c6b5.tar.gz
frameworks_base-33758ef8c98efb669c65eb9404b99ee5df09c6b5.tar.bz2
LayoutLib: Fix some rendering issues
Change-Id: I662a39a783de5bc7f3063f46cedaab11c7e6496e
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java3
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java11
2 files changed, 9 insertions, 5 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index 4220ddd..bb4c56c 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -413,6 +413,9 @@ public final class BridgeContext extends Activity {
ResourceValue item = mRenderResources.findResValue(customStyle,
false /*forceFrameworkOnly*/);
+ // resolve it in case it links to something else
+ item = mRenderResources.resolveResValue(item);
+
if (item instanceof StyleResourceValue) {
defStyleValues = (StyleResourceValue)item;
}
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 fa04697..c8ad1d6 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
@@ -361,9 +361,6 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider {
View view = mInflater.inflate(mBlockParser, mViewRoot);
- // post-inflate process. For now this supports TabHost/TabWidget
- postInflateProcess(view, mParams.getProjectCallback());
-
Fragment_Delegate.setProjectCallback(null);
// set the AttachInfo on the root view.
@@ -375,6 +372,9 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider {
info.mHardwareAccelerated = false;
mViewRoot.dispatchAttachedToWindow(info, 0);
+ // post-inflate process. For now this supports TabHost/TabWidget
+ postInflateProcess(view, mParams.getProjectCallback());
+
// get the background drawable
if (mWindowBackground != null) {
Drawable d = ResourceHelper.getDrawable(mWindowBackground,
@@ -461,13 +461,14 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider {
// remeasure with the size we need
// This must always be done before the call to layout
w_spec = MeasureSpec.makeMeasureSpec(mMeasuredScreenWidth, MeasureSpec.EXACTLY);
- h_spec = MeasureSpec.makeMeasureSpec(mMeasuredScreenHeight,
- MeasureSpec.EXACTLY);
+ h_spec = MeasureSpec.makeMeasureSpec(mMeasuredScreenHeight, MeasureSpec.EXACTLY);
mViewRoot.measure(w_spec, h_spec);
// now do the layout.
mViewRoot.layout(0, 0, mMeasuredScreenWidth, mMeasuredScreenHeight);
+ mViewRoot.mAttachInfo.mTreeObserver.dispatchOnPreDraw();
+
// draw the views
// create the BufferedImage into which the layout will be rendered.
boolean newImage = false;