diff options
author | Xavier Ducrohet <xav@android.com> | 2011-01-27 15:30:39 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-01-27 15:41:38 -0800 |
commit | 16584225125acba18b74920b902c798dfead0328 (patch) | |
tree | 245cfd24438182060d147d827bbd3db76b688361 /tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java | |
parent | 64a2c359aeda59e4bc43d48f31ade919e918ea26 (diff) | |
download | frameworks_base-16584225125acba18b74920b902c798dfead0328.zip frameworks_base-16584225125acba18b74920b902c798dfead0328.tar.gz frameworks_base-16584225125acba18b74920b902c798dfead0328.tar.bz2 |
LayoutLib: Properly compute available space to layouts.
Also display placeholders for status/title/action bars depending
on if the app is a tablet and its theme.
Change-Id: I651c1a2e5cfde165e004c11b236e6df056853dec
Diffstat (limited to 'tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java')
-rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java index 108d183..efe6955 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java @@ -17,9 +17,9 @@ package android.graphics; import com.android.ide.common.rendering.api.LayoutLog; -import com.android.ide.common.rendering.api.ResourceDensity; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.impl.DelegateManager; +import com.android.resources.Density; import android.graphics.Bitmap.Config; import android.os.Parcel; @@ -89,12 +89,12 @@ public final class Bitmap_Delegate { * @see Bitmap#isMutable() * @see Bitmap#getDensity() */ - public static Bitmap createBitmap(File input, boolean isMutable, ResourceDensity density) + public static Bitmap createBitmap(File input, boolean isMutable, Density density) throws IOException { // create a delegate with the content of the file. Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input), Config.ARGB_8888); - return createBitmap(delegate, isMutable, density.getDpi()); + return createBitmap(delegate, isMutable, density.getDpiValue()); } /** @@ -107,12 +107,12 @@ public final class Bitmap_Delegate { * @see Bitmap#isMutable() * @see Bitmap#getDensity() */ - public static Bitmap createBitmap(InputStream input, boolean isMutable, ResourceDensity density) + public static Bitmap createBitmap(InputStream input, boolean isMutable, Density density) throws IOException { // create a delegate with the content of the stream. Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input), Config.ARGB_8888); - return createBitmap(delegate, isMutable, density.getDpi()); + return createBitmap(delegate, isMutable, density.getDpiValue()); } /** @@ -126,11 +126,11 @@ public final class Bitmap_Delegate { * @see Bitmap#getDensity() */ public static Bitmap createBitmap(BufferedImage image, boolean isMutable, - ResourceDensity density) throws IOException { + Density density) throws IOException { // create a delegate with the given image. Bitmap_Delegate delegate = new Bitmap_Delegate(image, Config.ARGB_8888); - return createBitmap(delegate, isMutable, density.getDpi()); + return createBitmap(delegate, isMutable, density.getDpiValue()); } /** @@ -425,7 +425,7 @@ public final class Bitmap_Delegate { // the density doesn't matter, it's set by the Java method. return createBitmap(delegate, false /*isMutable*/, - ResourceDensity.DEFAULT_DENSITY /*density*/); + Density.DEFAULT_DENSITY /*density*/); } /*package*/ static void nativePrepareToDraw(int nativeBitmap) { |