From d7b0f0de4f0b55c137443aab782a8051a34fe70f Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Tue, 25 Jan 2011 13:38:52 -0800 Subject: LayoutLib API update: build properties and multi ViewInfo results. The build properties are needed to populate android.os.Build The multi ViewInfo results are needed to access all the top level children of a merge layout. Change-Id: I49638ae76aaf9e83dc4a0a73c3e7966d7b0a14a3 --- .../src/com/android/ide/common/rendering/LayoutLibrary.java | 7 +++++-- .../src/com/android/ide/common/rendering/StaticRenderSession.java | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'ide_common/src') diff --git a/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java b/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java index 815ee19..bd72632 100644 --- a/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java +++ b/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java @@ -225,6 +225,7 @@ public class LayoutLibrary { * Initializes the Layout Library object. This must be called before any other action is taken * on the instance. * + * @param platformProperties The build properties for the platform. * @param fontLocation the location of the fonts in the SDK target. * @param enumValueMap map attrName => { map enumFlagName => Integer value }. This is typically * read from attrs.xml in the SDK target. @@ -233,10 +234,12 @@ public class LayoutLibrary { * * @see Bridge#init(String, Map) */ - public boolean init(File fontLocation, Map> enumValueMap, + public boolean init(Map platformProperties, + File fontLocation, Map> enumValueMap, LayoutLog log) { if (mBridge != null) { - return mBridge.init(fontLocation, enumValueMap, log); + return mBridge.init(platformProperties, fontLocation, enumValueMap, log); } else if (mLegacyBridge != null) { return mLegacyBridge.init(fontLocation.getAbsolutePath(), enumValueMap); } diff --git a/ide_common/src/com/android/ide/common/rendering/StaticRenderSession.java b/ide_common/src/com/android/ide/common/rendering/StaticRenderSession.java index a33a497..c122c1c 100644 --- a/ide_common/src/com/android/ide/common/rendering/StaticRenderSession.java +++ b/ide_common/src/com/android/ide/common/rendering/StaticRenderSession.java @@ -21,6 +21,8 @@ import com.android.ide.common.rendering.api.Result; import com.android.ide.common.rendering.api.ViewInfo; import java.awt.image.BufferedImage; +import java.util.Collections; +import java.util.List; /** * Static {@link RenderSession} returning a given {@link Result}, {@link ViewInfo} and @@ -35,12 +37,12 @@ import java.awt.image.BufferedImage; public class StaticRenderSession extends RenderSession { private final Result mResult; - private final ViewInfo mRootViewInfo; + private final List mRootViewInfo; private final BufferedImage mImage; public StaticRenderSession(Result result, ViewInfo rootViewInfo, BufferedImage image) { mResult = result; - mRootViewInfo = rootViewInfo; + mRootViewInfo = Collections.singletonList(rootViewInfo); mImage = image; } @@ -50,7 +52,7 @@ public class StaticRenderSession extends RenderSession { } @Override - public ViewInfo getRootView() { + public List getRootViews() { return mRootViewInfo; } -- cgit v1.1