Loading core/java/android/content/res/Resources.java +7 −1 Original line number Diff line number Diff line Loading @@ -1625,7 +1625,7 @@ public class Resources { String locale = null; if (mConfiguration.locale != null) { locale = mConfiguration.locale.toLanguageTag(); locale = localeToLanguageTag(mConfiguration.locale); } int width, height; if (mMetrics.widthPixels >= mMetrics.heightPixels) { Loading Loading @@ -1706,6 +1706,12 @@ public class Resources { } } // Locale.toLanguageTag() is not available in Java6. LayoutLib overrides // this method to enable users to use Java6. private String localeToLanguageTag(Locale locale) { return locale.toLanguageTag(); } /** * Update the system resources configuration if they have previously * been initialized. Loading tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public final class BridgeTypedArray extends TypedArray { public BridgeTypedArray(BridgeResources resources, BridgeContext context, int len, boolean platformFile) { super(null, null, null, 0); super(resources, null, null, 0); mBridgeResources = resources; mContext = context; mPlatformFile = platformFile; Loading tools/layoutlib/bridge/src/android/content/res/Resources_Delegate.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 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.content.res; import java.util.Locale; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import com.ibm.icu.util.ULocale; /** * Delegate used to provide new implementation of a select few methods of {@link Resources} * * Through the layoutlib_create tool, the original methods of Resources have been replaced * by calls to methods of the same name in this delegate class. * */ public class Resources_Delegate { @LayoutlibDelegate /*package*/ static String localeToLanguageTag(Resources res, Locale locale) { return ULocale.forLocale(locale).toLanguageTag(); } } tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java +1 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ public final class CreateInfo implements ICreateInfo { "android.app.Fragment#instantiate", //(Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;)Landroid/app/Fragment;", "android.content.res.Resources$Theme#obtainStyledAttributes", "android.content.res.Resources$Theme#resolveAttribute", "android.content.res.Resources#localeToLanguageTag", "android.content.res.TypedArray#getValueAt", "android.graphics.BitmapFactory#finishDecode", "android.os.Handler#sendMessageAtTime", Loading Loading
core/java/android/content/res/Resources.java +7 −1 Original line number Diff line number Diff line Loading @@ -1625,7 +1625,7 @@ public class Resources { String locale = null; if (mConfiguration.locale != null) { locale = mConfiguration.locale.toLanguageTag(); locale = localeToLanguageTag(mConfiguration.locale); } int width, height; if (mMetrics.widthPixels >= mMetrics.heightPixels) { Loading Loading @@ -1706,6 +1706,12 @@ public class Resources { } } // Locale.toLanguageTag() is not available in Java6. LayoutLib overrides // this method to enable users to use Java6. private String localeToLanguageTag(Locale locale) { return locale.toLanguageTag(); } /** * Update the system resources configuration if they have previously * been initialized. Loading
tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public final class BridgeTypedArray extends TypedArray { public BridgeTypedArray(BridgeResources resources, BridgeContext context, int len, boolean platformFile) { super(null, null, null, 0); super(resources, null, null, 0); mBridgeResources = resources; mContext = context; mPlatformFile = platformFile; Loading
tools/layoutlib/bridge/src/android/content/res/Resources_Delegate.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 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.content.res; import java.util.Locale; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import com.ibm.icu.util.ULocale; /** * Delegate used to provide new implementation of a select few methods of {@link Resources} * * Through the layoutlib_create tool, the original methods of Resources have been replaced * by calls to methods of the same name in this delegate class. * */ public class Resources_Delegate { @LayoutlibDelegate /*package*/ static String localeToLanguageTag(Resources res, Locale locale) { return ULocale.forLocale(locale).toLanguageTag(); } }
tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java +1 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ public final class CreateInfo implements ICreateInfo { "android.app.Fragment#instantiate", //(Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;)Landroid/app/Fragment;", "android.content.res.Resources$Theme#obtainStyledAttributes", "android.content.res.Resources$Theme#resolveAttribute", "android.content.res.Resources#localeToLanguageTag", "android.content.res.TypedArray#getValueAt", "android.graphics.BitmapFactory#finishDecode", "android.os.Handler#sendMessageAtTime", Loading