diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 9f16857b6d..0917827197 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -16,6 +16,7 @@ package com.android.launcher3; +import static android.content.pm.ActivityInfo.CONFIG_LOCALE; import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION; import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; @@ -85,6 +86,7 @@ import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.dragndrop.DragView; +import com.android.launcher3.folder.Folder; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.folder.FolderIconPreviewVerifier; import com.android.launcher3.keyboard.CustomActionsPopup; @@ -349,6 +351,11 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, @Override public void onConfigurationChanged(Configuration newConfig) { int diff = newConfig.diff(mOldConfig); + + if ((diff & CONFIG_LOCALE) != 0) { + Folder.setLocaleDependentFields(getResources(), true /* force */); + } + if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) { mUserEventDispatcher = null; initDeviceProfile(mDeviceProfile.inv); diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 6b13da70cb..6a3ebcfb00 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -25,6 +25,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.annotation.SuppressLint; import android.content.Context; +import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; import android.text.InputType; @@ -191,14 +192,9 @@ public class Folder extends AbstractFloatingView implements DragSource, public Folder(Context context, AttributeSet attrs) { super(context, attrs); setAlwaysDrawnWithCacheEnabled(false); - Resources res = getResources(); - if (sDefaultFolderName == null) { - sDefaultFolderName = res.getString(R.string.folder_name); - } - if (sHintText == null) { - sHintText = res.getString(R.string.folder_hint_text); - } + setLocaleDependentFields(getResources(), false /* force */); + mLauncher = Launcher.getLauncher(context); // We need this view to be focusable in touch mode so that when text editing of the folder // name is complete, we have something to focus on, thus hiding the cursor and giving @@ -1473,4 +1469,13 @@ public class Folder extends AbstractFloatingView implements DragSource, } return false; } + + public static void setLocaleDependentFields(Resources res, boolean force) { + if (sDefaultFolderName == null || force) { + sDefaultFolderName = res.getString(R.string.folder_name); + } + if (sHintText == null || force) { + sHintText = res.getString(R.string.folder_hint_text); + } + } } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index cb5d872ab6..95a6bbd206 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -77,7 +77,6 @@ public class FolderIcon extends FrameLayout implements FolderListener { @Thunk Launcher mLauncher; @Thunk Folder mFolder; private FolderInfo mInfo; - @Thunk static boolean sStaticValuesDirty = true; private CheckLongPressHelper mLongPressHelper; private StylusEventHelper mStylusEventHelper; @@ -185,12 +184,6 @@ public class FolderIcon extends FrameLayout implements FolderListener { return icon; } - @Override - protected Parcelable onSaveInstanceState() { - sStaticValuesDirty = true; - return super.onSaveInstanceState(); - } - public Folder getFolder() { return mFolder; }