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/api/Bridge.java | 5 ++++- .../com/android/ide/common/rendering/api/RenderSession.java | 13 +++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'layoutlib_api') diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java b/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java index 79741ea..d014b6c 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java @@ -50,13 +50,16 @@ public abstract class Bridge { /** * Initializes the Bridge object. * + * @param platformProperties The build properties for the platform. * @param fontLocation the location of the fonts. * @param enumValueMap map attrName => { map enumFlagName => Integer value }. This is typically * read from attrs.xml in the SDK target. * @param log a {@link LayoutLog} object. Can be null. * @return true if success. */ - public boolean init(File fontLocation, Map> enumValueMap, + public boolean init(Map platformProperties, + File fontLocation, + Map> enumValueMap, LayoutLog log) { return false; } diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java b/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java index 4db766d..0adf6f5 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java @@ -21,6 +21,7 @@ import static com.android.ide.common.rendering.api.Result.Status.NOT_IMPLEMENTED import com.android.ide.common.rendering.api.Result.Status; import java.awt.image.BufferedImage; +import java.util.List; import java.util.Map; /** @@ -42,16 +43,20 @@ public class RenderSession { } /** - * Returns the {@link ViewInfo} object for the top level view. - *

- * + * Returns the {@link ViewInfo} objects for the top level views. + *

+ * In most case the list will only contain one item. If the top level node is {@code merge} + * though then it will contain all the items under the {@code merge} tag. + *

* This is reset to a new instance every time {@link #render()} is called and can be * null if the call failed (and the method returned a {@link Result} with * {@link Status#ERROR_UNKNOWN} or {@link Status#NOT_IMPLEMENTED}. *

* This can be safely modified by the caller. + * + * @return the list of {@link ViewInfo} or null if there aren't any. */ - public ViewInfo getRootView() { + public List getRootViews() { return null; } -- cgit v1.1