diff options
author | Xavier Ducrohet <xav@android.com> | 2010-12-09 18:26:01 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-12-10 11:40:27 -0800 |
commit | ffb42f6c5043de226f02318a1311669d35a90711 (patch) | |
tree | c10b9172fe0f682c585fe35d49f20df373ae4ad3 /tools/layoutlib/bridge/src/android/graphics | |
parent | 436786e759ed5f5eee34137ea6bfe57414bb9ff4 (diff) | |
download | frameworks_base-ffb42f6c5043de226f02318a1311669d35a90711.zip frameworks_base-ffb42f6c5043de226f02318a1311669d35a90711.tar.gz frameworks_base-ffb42f6c5043de226f02318a1311669d35a90711.tar.bz2 |
LayoutLib: Adapt to new LayoutLib
API now uses ResourceValue instead of IResourceValue
Capabilities renamed Capability
Change-Id: Ia5d2b6c8d536e020a1f5496fb2285f67fc4346c4
Diffstat (limited to 'tools/layoutlib/bridge/src/android/graphics')
-rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/BitmapFactory.java | 6 | ||||
-rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/BitmapFactory.java b/tools/layoutlib/bridge/src/android/graphics/BitmapFactory.java index c36b37b..cd62baf 100644 --- a/tools/layoutlib/bridge/src/android/graphics/BitmapFactory.java +++ b/tools/layoutlib/bridge/src/android/graphics/BitmapFactory.java @@ -16,7 +16,7 @@ package android.graphics; -import com.android.layoutlib.api.IDensityBasedResourceValue.Density; +import com.android.layoutlib.api.ResourceDensity; import com.android.layoutlib.bridge.Bridge; import android.content.res.AssetManager; @@ -459,9 +459,9 @@ public class BitmapFactory { // into is.read(...) This number is not related to the value passed // to mark(...) above. try { - Density density = Density.MEDIUM; + ResourceDensity density = ResourceDensity.MEDIUM; if (opts != null) { - density = Density.getEnum(opts.inDensity); + density = ResourceDensity.getEnum(opts.inDensity); } bm = Bitmap_Delegate.createBitmap(is, true, density); } catch (IOException e) { diff --git a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java index b4c51b2..1823702 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java @@ -16,7 +16,7 @@ package android.graphics; -import com.android.layoutlib.api.IDensityBasedResourceValue.Density; +import com.android.layoutlib.api.ResourceDensity; import com.android.layoutlib.bridge.impl.DelegateManager; import android.graphics.Bitmap.Config; @@ -83,12 +83,12 @@ public class Bitmap_Delegate { * @see Bitmap#isMutable() * @see Bitmap#getDensity() */ - public static Bitmap createBitmap(File input, boolean isMutable, Density density) + public static Bitmap createBitmap(File input, boolean isMutable, ResourceDensity density) throws IOException { // create a delegate with the content of the file. Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input)); - return createBitmap(delegate, isMutable, density.getValue()); + return createBitmap(delegate, isMutable, density.getDpi()); } /** @@ -101,12 +101,12 @@ public class Bitmap_Delegate { * @see Bitmap#isMutable() * @see Bitmap#getDensity() */ - public static Bitmap createBitmap(InputStream input, boolean isMutable, Density density) + public static Bitmap createBitmap(InputStream input, boolean isMutable, ResourceDensity density) throws IOException { // create a delegate with the content of the stream. Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input)); - return createBitmap(delegate, isMutable, density.getValue()); + return createBitmap(delegate, isMutable, density.getDpi()); } /** @@ -119,12 +119,12 @@ public class Bitmap_Delegate { * @see Bitmap#isMutable() * @see Bitmap#getDensity() */ - public static Bitmap createBitmap(BufferedImage image, boolean isMutable, Density density) - throws IOException { + public static Bitmap createBitmap(BufferedImage image, boolean isMutable, + ResourceDensity density) throws IOException { // create a delegate with the given image. Bitmap_Delegate delegate = new Bitmap_Delegate(image); - return createBitmap(delegate, isMutable, density.getValue()); + return createBitmap(delegate, isMutable, density.getDpi()); } /** |