diff options
author | Xavier Ducrohet <xav@android.com> | 2011-02-04 17:28:43 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-02-04 17:34:40 -0800 |
commit | e25af9f721bcc89d73c8e56adc9d02a6bcfac1c6 (patch) | |
tree | 5aff7ab5aa59bf8482327a95b09a13652dce9f38 /layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java | |
parent | 1d2909b8ff75a392af9231fe848674378b234bb9 (diff) | |
download | sdk-e25af9f721bcc89d73c8e56adc9d02a6bcfac1c6.zip sdk-e25af9f721bcc89d73c8e56adc9d02a6bcfac1c6.tar.gz sdk-e25af9f721bcc89d73c8e56adc9d02a6bcfac1c6.tar.bz2 |
Add to layoutlib the ability to simply render a Drawable.
RenderParams is now a base class. SessionParams extends it
(and contains the layout and the rendering mode which are not
part of the base class).
DrawableParams is used for the new action and adds a reference
to a ResourceValue.
Change-Id: Ieacf4da91fda95df1d25a32ae0953bd9d8028113
Diffstat (limited to 'layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java')
-rw-r--r-- | layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java | 15 |
1 files changed, 14 insertions, 1 deletions
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 755c736..48309cf 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 @@ -17,6 +17,9 @@ package com.android.ide.common.rendering.api; +import com.android.ide.common.rendering.api.Result.Status; + +import java.awt.image.BufferedImage; import java.io.File; import java.util.EnumSet; import java.util.Map; @@ -78,11 +81,21 @@ public abstract class Bridge { * @return a new {@link RenderSession} object that contains the result of the scene creation and * first rendering. */ - public RenderSession createSession(RenderParams params) { + public RenderSession createSession(SessionParams params) { return null; } /** + * Renders a Drawable. If the rendering is successful, the result image is accessible through + * {@link Result#getData()}. It is of type {@link BufferedImage} + * @param params the rendering parameters. + * @return the result of the action. + */ + public Result renderDrawable(DrawableParams params) { + return Status.NOT_IMPLEMENTED.createResult(); + } + + /** * Clears the resource cache for a specific project. * <p/>This cache contains bitmaps and nine patches that are loaded from the disk and reused * until this method is called. |