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 /eclipse | |
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 'eclipse')
4 files changed, 11 insertions, 10 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java index f09ef99..bfbbf31 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java @@ -26,11 +26,11 @@ import com.android.ide.common.rendering.StaticRenderSession; import com.android.ide.common.rendering.api.Capability; import com.android.ide.common.rendering.api.ILayoutPullParser; import com.android.ide.common.rendering.api.LayoutLog; -import com.android.ide.common.rendering.api.RenderParams; import com.android.ide.common.rendering.api.RenderSession; import com.android.ide.common.rendering.api.ResourceValue; import com.android.ide.common.rendering.api.Result; -import com.android.ide.common.rendering.api.RenderParams.RenderingMode; +import com.android.ide.common.rendering.api.SessionParams; +import com.android.ide.common.rendering.api.SessionParams.RenderingMode; import com.android.ide.common.resources.ResourceResolver; import com.android.ide.common.sdk.LoadStatus; import com.android.ide.eclipse.adt.AdtPlugin; @@ -1660,11 +1660,11 @@ public class GraphicalEditorPart extends EditorPart configuredProjectRes, frameworkResources, theme, isProjectTheme); - RenderParams params = new RenderParams( + SessionParams params = new SessionParams( topParser, + renderingMode, iProject /* projectKey */, width, height, - renderingMode, density, xdpi, ydpi, resolver, mProjectCallback, diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java index 08aef31..b73bff8 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java @@ -24,12 +24,13 @@ import static com.android.ide.common.layout.LayoutConstants.VALUE_WRAP_CONTENT; import com.android.ide.common.api.InsertType; import com.android.ide.common.api.Rect; +import com.android.ide.common.api.MenuAction.Toggle; import com.android.ide.common.rendering.LayoutLibrary; import com.android.ide.common.rendering.api.Capability; import com.android.ide.common.rendering.api.LayoutLog; -import com.android.ide.common.rendering.api.RenderParams.RenderingMode; import com.android.ide.common.rendering.api.RenderSession; import com.android.ide.common.rendering.api.ViewInfo; +import com.android.ide.common.rendering.api.SessionParams.RenderingMode; import com.android.ide.eclipse.adt.internal.editors.IconFactory; import com.android.ide.eclipse.adt.internal.editors.descriptors.DocumentDescriptor; import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PreviewIconFactory.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PreviewIconFactory.java index 1d92f3a..d6057fc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PreviewIconFactory.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PreviewIconFactory.java @@ -25,7 +25,7 @@ import com.android.ide.common.rendering.api.RenderSession; import com.android.ide.common.rendering.api.ResourceValue; import com.android.ide.common.rendering.api.StyleResourceValue; import com.android.ide.common.rendering.api.ViewInfo; -import com.android.ide.common.rendering.api.RenderParams.RenderingMode; +import com.android.ide.common.rendering.api.SessionParams.RenderingMode; import com.android.ide.common.resources.ResourceResolver; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.editors.descriptors.DocumentDescriptor; diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java index 0fa0df9..f18ec36 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java @@ -19,10 +19,10 @@ package com.android.ide.eclipse.tests.functests.layoutRendering; import com.android.ide.common.rendering.LayoutLibrary; import com.android.ide.common.rendering.api.ILayoutPullParser; import com.android.ide.common.rendering.api.IProjectCallback; -import com.android.ide.common.rendering.api.RenderParams; import com.android.ide.common.rendering.api.RenderSession; import com.android.ide.common.rendering.api.ResourceValue; -import com.android.ide.common.rendering.api.RenderParams.RenderingMode; +import com.android.ide.common.rendering.api.SessionParams; +import com.android.ide.common.rendering.api.SessionParams.RenderingMode; import com.android.ide.common.resources.ResourceResolver; import com.android.ide.common.sdk.LoadStatus; import com.android.ide.eclipse.adt.internal.resources.configurations.FolderConfiguration; @@ -207,12 +207,12 @@ public class ApiDemosRenderingTest extends SdkTestCase { configuredProject, configuredFramework, "Theme", false /*isProjectTheme*/); - RenderSession session = layoutLib.createSession(new RenderParams( + RenderSession session = layoutLib.createSession(new SessionParams( parser, + RenderingMode.NORMAL, null /*projectKey*/, 320, 480, - RenderingMode.NORMAL, Density.MEDIUM, 160, //xdpi 160, // ydpi |