diff options
author | Xavier Ducrohet <xav@android.com> | 2012-04-23 17:41:37 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-04-23 17:41:37 -0700 |
commit | cb092e2b7fa46477651c8b8733d50307b0de9d6d (patch) | |
tree | c021b1e8481f91b00c2f34230abbc84bf41d1c37 /tools/layoutlib/bridge | |
parent | a8d6ddee98e09a68030f4226b94f631e3b4c83c1 (diff) | |
download | frameworks_base-cb092e2b7fa46477651c8b8733d50307b0de9d6d.zip frameworks_base-cb092e2b7fa46477651c8b8733d50307b0de9d6d.tar.gz frameworks_base-cb092e2b7fa46477651c8b8733d50307b0de9d6d.tar.bz2 |
Fix Paint_Delegate with missing native method.
Change-Id: I39638dcb323fdd1ec3cb58dcad05757145d09026
Diffstat (limited to 'tools/layoutlib/bridge')
-rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java index 9ebec61..1382641 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java @@ -36,6 +36,7 @@ import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Locale; /** * Delegate implementing the native methods of android.graphics.Paint @@ -91,6 +92,8 @@ public class Paint_Delegate { private MaskFilter_Delegate mMaskFilter; private Rasterizer_Delegate mRasterizer; + private Locale mLocale = Locale.getDefault(); + // ---- Public Helper methods ---- @@ -254,6 +257,8 @@ public class Paint_Delegate { return delegate.mFlags; } + + @LayoutlibDelegate /*package*/ static void setFlags(Paint thisPaint, int flags) { // get the delegate from the native int. @@ -904,6 +909,17 @@ public class Paint_Delegate { } @LayoutlibDelegate + /*package*/ static void native_setTextLocale(int native_object, String locale) { + // get the delegate from the native int. + Paint_Delegate delegate = sManager.getDelegate(native_object); + if (delegate == null) { + return; + } + + delegate.setTextLocale(locale); + } + + @LayoutlibDelegate /*package*/ static int native_getTextWidths(int native_object, char[] text, int index, int count, float[] widths) { // get the delegate from the native int. @@ -1243,7 +1259,9 @@ public class Paint_Delegate { return 0; } - + private void setTextLocale(String locale) { + mLocale = new Locale(locale); + } private static void setFlag(Paint thisPaint, int flagMask, boolean flagValue) { // get the delegate from the native int. @@ -1258,4 +1276,5 @@ public class Paint_Delegate { delegate.mFlags &= ~flagMask; } } + } |