diff options
| author | Xavier Ducrohet <xav@android.com> | 2011-08-11 10:16:17 -0700 |
|---|---|---|
| committer | Xavier Ducrohet <xav@android.com> | 2011-08-11 12:57:51 -0700 |
| commit | 7f9f99ea11051614a7727dfb9f9578b518e76e3c (patch) | |
| tree | d39b916bb092a717e028345813b53f6bcfa12f61 /tools/layoutlib/bridge/src/android/graphics | |
| parent | 7277f3b9b26f0011475b39da1298484a510aca29 (diff) | |
| download | frameworks_base-7f9f99ea11051614a7727dfb9f9578b518e76e3c.zip frameworks_base-7f9f99ea11051614a7727dfb9f9578b518e76e3c.tar.gz frameworks_base-7f9f99ea11051614a7727dfb9f9578b518e76e3c.tar.bz2 | |
Make some methods/fields package private so that layoutlib can access them.
Change-Id: I4aeadfbaf8a4f6a459fa19937c21ac23d9e5fb64
Diffstat (limited to 'tools/layoutlib/bridge/src/android/graphics')
| -rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java | 7 | ||||
| -rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Typeface_Accessor.java | 24 |
2 files changed, 27 insertions, 4 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java index 66e59d8..eadec02 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java @@ -22,7 +22,6 @@ import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.resources.Density; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; -import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.os.Parcel; @@ -149,7 +148,7 @@ public final class Bitmap_Delegate { } public static int getBufferedImageType(int nativeBitmapConfig) { - switch (Config.sConfigs[nativeBitmapConfig]) { + switch (Config.nativeToConfig(nativeBitmapConfig)) { case ALPHA_8: return BufferedImage.TYPE_INT_ARGB; case RGB_565: @@ -210,7 +209,7 @@ public final class Bitmap_Delegate { } // create a delegate with the content of the stream. - Bitmap_Delegate delegate = new Bitmap_Delegate(image, Config.sConfigs[nativeConfig]); + Bitmap_Delegate delegate = new Bitmap_Delegate(image, Config.nativeToConfig(nativeConfig)); return createBitmap(delegate, mutable, Bitmap.getDefaultDensity()); } @@ -238,7 +237,7 @@ public final class Bitmap_Delegate { image.setRGB(0, 0, width, height, argb, 0, width); // create a delegate with the content of the stream. - Bitmap_Delegate delegate = new Bitmap_Delegate(image, Config.sConfigs[nativeConfig]); + Bitmap_Delegate delegate = new Bitmap_Delegate(image, Config.nativeToConfig(nativeConfig)); return createBitmap(delegate, isMutable, Bitmap.getDefaultDensity()); } diff --git a/tools/layoutlib/bridge/src/android/graphics/Typeface_Accessor.java b/tools/layoutlib/bridge/src/android/graphics/Typeface_Accessor.java new file mode 100644 index 0000000..2745770 --- /dev/null +++ b/tools/layoutlib/bridge/src/android/graphics/Typeface_Accessor.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.graphics; + +public class Typeface_Accessor { + + public static void resetDefaults() { + Typeface.sDefaults = null; + } +} |
