Skip to content

Commit

Permalink
[Color] Update DynamicColors util to use activity.getTheme().applySty…
Browse files Browse the repository at this point in the history
…le() instead of activity.setTheme() to workaround Force Dark issue

Resolves #2521

PiperOrigin-RevId: 422816956
  • Loading branch information
dsn5ft committed Jan 19, 2022
1 parent 80e50de commit b84f35f
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -231,7 +231,8 @@ private static void applyIfAvailable(
theme = getDefaultThemeOverlay(activity);
}
if (theme != 0 && precondition.shouldApplyDynamicColors(activity, theme)) {
activity.setTheme(theme);
// Use applyStyle() instead of setTheme() due to Force Dark issue.
activity.getTheme().applyStyle(theme, /* force= */ true);
}
}

Expand Down

0 comments on commit b84f35f

Please sign in to comment.