diff --git a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java index 1f914bfd30..ea5d5a40b6 100644 --- a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java +++ b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java @@ -27,7 +27,6 @@ import android.text.Layout; import android.text.StaticLayout; import android.text.TextPaint; import android.util.AttributeSet; -import android.view.ContextThemeWrapper; import android.view.View; import android.view.accessibility.AccessibilityManager; @@ -56,8 +55,8 @@ public class AppsDividerView extends View implements FloatingHeaderRow { private final TextPaint mPaint = new TextPaint(); private DividerType mDividerType = DividerType.NONE; - private @ColorInt int mStrokeColor; - private @ColorInt int mAllAppsLabelTextColor; + private final @ColorInt int mStrokeColor; + private final @ColorInt int mAllAppsLabelTextColor; private final AccessibilityManager mAccessibilityManager; private Layout mAllAppsLabelLayout; @@ -103,19 +102,6 @@ public class AppsDividerView extends View implements FloatingHeaderRow { updateDividerType(); } - @Override - public void updateTheme(ContextThemeWrapper contextThemeWrapper) { - mStrokeColor = Themes.getAttrColor(contextThemeWrapper, R.attr.bottomSheetDragHandleColor); - mAllAppsLabelTextColor = - contextThemeWrapper.getColor(R.color.materialColorOnSurfaceVariant); - if (mDividerType == DividerType.LINE) { - mPaint.setColor(mStrokeColor); - } else if (mDividerType == DividerType.ALL_APPS_LABEL) { - mPaint.setColor(mAllAppsLabelTextColor); - } - invalidate(); - } - /** {@code true} if all apps label should be shown in place of divider. */ public void setShowAllAppsLabel(boolean showAllAppsLabel) { if (mAccessibilityManager.isEnabled() && !Utilities.isRunningInTestHarness()) { diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 86113841c3..13d6dc43fe 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -88,7 +88,6 @@ import android.os.Trace; import android.os.UserHandle; import android.text.TextUtils; import android.util.AttributeSet; -import android.view.ContextThemeWrapper; import android.view.Display; import android.view.HapticFeedbackConstants; import android.view.KeyEvent; @@ -471,16 +470,14 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, /** Apply the blur or blur fallback style to the current theme. */ public void updateBlurStyle() { - if (Flags.allAppsBlur()) { - int allAppsBlurStyleResId = getAllAppsBlurStyleResId(); - getTheme().applyStyle(allAppsBlurStyleResId, true); - getAppsView().onThemeChanged( - new ContextThemeWrapper(getApplicationContext(), allAppsBlurStyleResId)); - } if (enableOverviewBackgroundWallpaperBlur()) { if (isOverviewBackgroundBlurEnabled() != mOverviewBlurEnabled) { mWallpaperThemeManager.recreateToUpdateTheme(); } + } else if (Flags.allAppsBlur()) { + // For all apps, we only need to update the scrim, which draws the panel. But if the + // activity was recreated above, this is unnecessary. + getAppsView().invalidateHeader(); } } diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index 1e9ab0b2a2..e79dd2e60a 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -50,7 +50,6 @@ import android.os.UserManager; import android.util.AttributeSet; import android.util.Log; import android.util.SparseArray; -import android.view.ContextThemeWrapper; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -857,17 +856,6 @@ public class ActivityAllAppsContainerView return Flags.allAppsBlur() && mActivityContext.isAllAppsBackgroundBlurEnabled(); } - /** Refresh the UI according to the current theme. */ - public void onThemeChanged(ContextThemeWrapper contextThemeWrapper) { - updateHeaderScroll(getActiveRecyclerView().computeVerticalScrollOffset()); - invalidateHeader(); - forAllRecyclerViews(RecyclerView::invalidateItemDecorations); - getSearchUiManager().onThemeChanged(); - getFloatingHeaderView().updateTheme(contextThemeWrapper); - mBottomSheetHandle.setBackground(contextThemeWrapper.getDrawable( - R.drawable.bg_rounded_corner_bottom_sheet_handle)); - } - /** * @return true if the search bar is floating above this container (at the bottom of the screen) */ diff --git a/src/com/android/launcher3/allapps/FloatingHeaderRow.java b/src/com/android/launcher3/allapps/FloatingHeaderRow.java index c64e720c75..75e527aaa8 100644 --- a/src/com/android/launcher3/allapps/FloatingHeaderRow.java +++ b/src/com/android/launcher3/allapps/FloatingHeaderRow.java @@ -15,7 +15,6 @@ */ package com.android.launcher3.allapps; -import android.view.ContextThemeWrapper; import android.view.View; /** @@ -61,7 +60,4 @@ public interface FloatingHeaderRow { default boolean isVisible() { return shouldDraw(); } - - /** Update colors using the provided theme wrapper. */ - default void updateTheme(ContextThemeWrapper contextThemeWrapper) {} } diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java index 040d6cf33d..896a4e1073 100644 --- a/src/com/android/launcher3/allapps/FloatingHeaderView.java +++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java @@ -23,7 +23,6 @@ import android.graphics.Point; import android.graphics.Rect; import android.util.ArrayMap; import android.util.AttributeSet; -import android.view.ContextThemeWrapper; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; @@ -276,14 +275,6 @@ public class FloatingHeaderView extends LinearLayout implements mTabLayout.setVisibility(mTabsHidden ? GONE : visibility); } - /** Update colors using the provided theme wrapper. */ - void updateTheme(ContextThemeWrapper contextThemeWrapper) { - getTabLayout().updateTheme(contextThemeWrapper); - for (FloatingHeaderRow row : mAllRows) { - row.updateTheme(contextThemeWrapper); - } - } - /** Returns whether search bar has multi-line support, and is currently in multi-line state. */ private boolean isSearchBarMultiline() { return Flags.multilineSearchBar() && mSearchBarOffset > 0; diff --git a/src/com/android/launcher3/allapps/SearchUiManager.java b/src/com/android/launcher3/allapps/SearchUiManager.java index 1f7532c3e4..bfd89678df 100644 --- a/src/com/android/launcher3/allapps/SearchUiManager.java +++ b/src/com/android/launcher3/allapps/SearchUiManager.java @@ -48,9 +48,6 @@ public interface SearchUiManager { @Nullable ExtendedEditText getEditText(); - /** Indicates the UI should refresh according to the current theme. */ - default void onThemeChanged() {} - /** * Hint to the edit text that it is about to be focused or unfocused. This can be used to start * animating the edit box accordingly, e.g. after a gesture completes. diff --git a/src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java b/src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java index f95ac7ce1a..5fce8bfba3 100644 --- a/src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java +++ b/src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java @@ -18,7 +18,6 @@ package com.android.launcher3.workprofile; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; -import android.view.ContextThemeWrapper; import android.widget.Button; import android.widget.LinearLayout; @@ -47,14 +46,6 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout implements PageInd typedArray.recycle(); } - /** Update the buttons background to match the theme. */ - public void updateTheme(ContextThemeWrapper contextThemeWrapper) { - for (int i = 0; i < getChildCount(); i++) { - Button tab = (Button) getChildAt(i); - tab.setBackground(contextThemeWrapper.getDrawable(R.drawable.all_apps_tabs_background)); - } - } - /** * Highlights tab with index pos */