diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2015-01-27 11:14:20 -0800 |
---|---|---|
committer | Deepanshu Gupta <deepanshu@google.com> | 2015-01-28 22:18:57 +0000 |
commit | 135286ea0812d4f98f3def927f8891087110a9b7 (patch) | |
tree | 69002e3e81b4aeaf2231954174f4853c794fc211 | |
parent | 892f37b7b2b59bcb1a83cf415dc378d2a997fc0c (diff) | |
download | sdk-135286ea0812d4f98f3def927f8891087110a9b7.zip sdk-135286ea0812d4f98f3def927f8891087110a9b7.tar.gz sdk-135286ea0812d4f98f3def927f8891087110a9b7.tar.bz2 |
Add AssetRepository to render params.
By adding the asset repository, we ensure that LayoutLib knows that the
IDE doesn't support assets and doesn't log an error.
Change-Id: Ie4dd8fecbb358c7977ab0568832d37de81ac256d
(cherry picked from commit 4368aeabecbe6356940477ec4fdfaa8d5017e10c)
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderService.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderService.java index ffcb258..3b9e2fc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderService.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderService.java @@ -24,6 +24,7 @@ import com.android.ide.common.api.Rect; import com.android.ide.common.rendering.HardwareConfigHelper; import com.android.ide.common.rendering.LayoutLibrary; import com.android.ide.common.rendering.RenderSecurityManager; +import com.android.ide.common.rendering.api.AssetRepository; import com.android.ide.common.rendering.api.Capability; import com.android.ide.common.rendering.api.DrawableParams; import com.android.ide.common.rendering.api.HardwareConfig; @@ -471,6 +472,7 @@ public class RenderService { params.setExtendedViewInfoMode(true); params.setLocale(mLocale.toLocaleId()); + params.setAssetRepository(new AssetRepository()); ManifestInfo manifestInfo = ManifestInfo.get(mProject); try { @@ -546,6 +548,7 @@ public class RenderService { DrawableParams params = new DrawableParams(drawableResourceValue, mProject, hardwareConfig, mResourceResolver, mProjectCallback, mMinSdkVersion, mTargetSdkVersion, mLogger); + params.setAssetRepository(new AssetRepository()); params.setForceNoDecor(); Result result = mLayoutLib.renderDrawable(params); if (result != null && result.isSuccess()) { @@ -619,6 +622,7 @@ public class RenderService { mLogger); params.setLayoutOnly(); params.setForceNoDecor(); + params.setAssetRepository(new AssetRepository()); RenderSession session = null; mProjectCallback.setLogger(mLogger); |