diff options
4 files changed, 29 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index 369258e15454..15350fb19209 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -122,6 +122,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -247,6 +248,9 @@ public class BubbleController implements ConfigurationChangeListener, /** Saved font scale, used to detect font size changes in {@link #onConfigurationChanged}. */ private float mFontScale = 0; + /** Saved locale, used to detect local changes in {@link #onConfigurationChanged}. */ + private Locale mLocale = null; + /** Saved direction, used to detect layout direction changes @link #onConfigChanged}. */ private int mLayoutDirection = View.LAYOUT_DIRECTION_UNDEFINED; @@ -1068,6 +1072,11 @@ public class BubbleController implements ConfigurationChangeListener, mLayoutDirection = newConfig.getLayoutDirection(); mStackView.onLayoutDirectionChanged(mLayoutDirection); } + Locale newLocale = newConfig.locale; + if (newLocale != null && !newLocale.equals(mLocale)) { + mLocale = newLocale; + mStackView.updateLocale(); + } } } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java index 123693db3622..74f087b6d8f8 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java @@ -517,6 +517,15 @@ public class BubbleExpandedView extends LinearLayout { } } + void updateLocale() { + if (mManageButton != null) { + mManageButton.setText(mContext.getString(R.string.manage_bubbles_text)); + } + if (mOverflowView != null) { + mOverflowView.updateLocale(); + } + } + void applyThemeAttrs() { final TypedArray ta = mContext.obtainStyledAttributes(new int[]{ android.R.attr.dialogCornerRadius, diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java index b06de4f4002c..633b01bde4ca 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java @@ -242,6 +242,11 @@ public class BubbleOverflowContainerView extends LinearLayout { mEmptyStateSubtitle.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize); } + public void updateLocale() { + mEmptyStateTitle.setText(mContext.getString(R.string.bubble_overflow_empty_title)); + mEmptyStateSubtitle.setText(mContext.getString(R.string.bubble_overflow_empty_subtitle)); + } + private final BubbleData.Listener mDataListener = new BubbleData.Listener() { @Override diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index e7da034a7422..8fd6ffe15cfe 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -1452,6 +1452,12 @@ public class BubbleStackView extends FrameLayout } } + void updateLocale() { + if (mBubbleOverflow != null && mBubbleOverflow.getExpandedView() != null) { + mBubbleOverflow.getExpandedView().updateLocale(); + } + } + private void updateOverflow() { mBubbleOverflow.update(); mBubbleContainer.reorderView(mBubbleOverflow.getIconView(), |