Update icon tint color when the user toggles Dark theme

- Reload theme in slice provider when Dark theme mode changes for slices
- Reload theme in onCreate of Panel activity for its non-slice header
- Remove applyTheme from individual slices

Test: robotest
Fixes: 153700819
Change-Id: I40a7d2817c4b9100d7b2f2962a69c8a9ce6f7906
This commit is contained in:
Jason Chiu
2020-05-11 16:13:47 +08:00
parent 7a31f2da60
commit 8ac1e4d49d
11 changed files with 83 additions and 32 deletions

View File

@@ -73,8 +73,6 @@ public class SliceBuilderUtils {
* {@param sliceData} is an inline controller.
*/
public static Slice buildSlice(Context context, SliceData sliceData) {
// Reload theme for switching dark mode on/off
context.getTheme().applyStyle(R.style.Theme_Settings_Home, true /* force */);
Log.d(TAG, "Creating slice for: " + sliceData.getPreferenceController());
final BasePreferenceController controller = getPreferenceController(context, sliceData);
FeatureFactory.getFactory(context).getMetricsFeatureProvider()