Loading core/java/android/view/ContextThemeWrapper.java +10 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import android.annotation.StyleRes; import android.content.Context; import android.content.ContextWrapper; import android.content.res.AssetManager; import android.content.res.Configuration; import android.content.res.Resources; Loading Loading @@ -60,11 +61,12 @@ public class ContextThemeWrapper extends ContextWrapper { * information. * * <p>This method can only be called once, and must be called before any * calls to {@link #getResources()} are made. * calls to {@link #getResources()} or {@link #getAssets()} are made. */ public void applyOverrideConfiguration(Configuration overrideConfiguration) { if (mResources != null) { throw new IllegalStateException("getResources() has already been called"); throw new IllegalStateException( "getResources() or getAssets() has already been called"); } if (mOverrideConfiguration != null) { throw new IllegalStateException("Override configuration has already been set"); Loading @@ -72,6 +74,12 @@ public class ContextThemeWrapper extends ContextWrapper { mOverrideConfiguration = new Configuration(overrideConfiguration); } @Override public AssetManager getAssets() { // Ensure we're returning assets with the correct configuration. return getResources().getAssets(); } @Override public Resources getResources() { if (mResources != null) { Loading Loading
core/java/android/view/ContextThemeWrapper.java +10 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import android.annotation.StyleRes; import android.content.Context; import android.content.ContextWrapper; import android.content.res.AssetManager; import android.content.res.Configuration; import android.content.res.Resources; Loading Loading @@ -60,11 +61,12 @@ public class ContextThemeWrapper extends ContextWrapper { * information. * * <p>This method can only be called once, and must be called before any * calls to {@link #getResources()} are made. * calls to {@link #getResources()} or {@link #getAssets()} are made. */ public void applyOverrideConfiguration(Configuration overrideConfiguration) { if (mResources != null) { throw new IllegalStateException("getResources() has already been called"); throw new IllegalStateException( "getResources() or getAssets() has already been called"); } if (mOverrideConfiguration != null) { throw new IllegalStateException("Override configuration has already been set"); Loading @@ -72,6 +74,12 @@ public class ContextThemeWrapper extends ContextWrapper { mOverrideConfiguration = new Configuration(overrideConfiguration); } @Override public AssetManager getAssets() { // Ensure we're returning assets with the correct configuration. return getResources().getAssets(); } @Override public Resources getResources() { if (mResources != null) { Loading