summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mady Mellor <madym@google.com> 2023-06-05 14:55:16 -0700
committer Mady Mellor <madym@google.com> 2023-06-05 15:07:12 -0700
commit3f30f9fb4e67c6c60c5245b35632be0be2e8f143 (patch)
tree0683f2e2cd2cf71d2fb8d6b4eb59ac872424f8f3
parent7b4ea8e2a363ae0c776831fdc70e6b0d209209c6 (diff)
Use context theme wrapper with specific theme when inflating button
This fixes the theme being incorrect after rotating. Test: manual - 1) have auto rotate on & change the theme 2) add some bubbles, expand them, check the manage button theme 3) rotate the device, observe that the manage button theme remains the same Bug: 284820786 Change-Id: I030bb26a93645537690ebb348771e325e327332c
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java5
1 files changed, 4 insertions, 1 deletions
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 9fcd207dc370..e1a3f3a1ac5d 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
@@ -55,6 +55,7 @@ import android.util.FloatProperty;
import android.util.IntProperty;
import android.util.Log;
import android.util.TypedValue;
+import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -459,7 +460,9 @@ public class BubbleExpandedView extends LinearLayout {
if (mManageButton != null) {
int visibility = mManageButton.getVisibility();
removeView(mManageButton);
- mManageButton = (AlphaOptimizedButton) LayoutInflater.from(getContext()).inflate(
+ ContextThemeWrapper ctw = new ContextThemeWrapper(getContext(),
+ com.android.internal.R.style.Theme_DeviceDefault_DayNight);
+ mManageButton = (AlphaOptimizedButton) LayoutInflater.from(ctw).inflate(
R.layout.bubble_manage_button, this /* parent */, false /* attach */);
addView(mManageButton);
mManageButton.setVisibility(visibility);