Skip to content

Commit

Permalink
Fix progress bar colors when using dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelschattgen committed Nov 11, 2024
1 parent 17f106f commit fcd4d52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ public void setTheme(Map<Theme, Integer> themeMap) {
DynamicColorsOptions.Builder optsBuilder = new DynamicColorsOptions.Builder();
if (getConfiguredTheme().equals(Theme.AMOLED)) {
optsBuilder.setThemeOverlay(R.style.ThemeOverlay_Aegis_Dynamic_Amoled);
} else if (getConfiguredTheme().equals(Theme.DARK)) {
optsBuilder.setThemeOverlay(R.style.ThemeOverlay_Aegis_Dynamic_Dark);
}

DynamicColors.applyToActivityIfAvailable(_activity, optsBuilder.build());
}
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,14 @@
<item name="colorCode">@android:color/white</item>
</style>

<style name="ThemeOverlay.Aegis.Dynamic.Dark" parent="ThemeOverlay.Material3.DynamicColors.Dark">
<item name="colorPrimaryAlternative">?attr/colorPrimary</item>
</style>

<style name="ThemeOverlay.Aegis.Dynamic.Amoled" parent="ThemeOverlay.Material3.DynamicColors.Dark">
<!-- Setting android:colorBackground to #000000 on API 28 and below causes smearing -->
<item name="android:colorBackground">@android:color/black</item>
<item name="colorPrimaryAlternative">@android:color/white</item>
<item name="colorSurface">#000000</item>
<item name="colorSurfaceVariant">#000000</item>
<item name="colorSurfaceContainerHighest">#000000</item>
Expand Down

0 comments on commit fcd4d52

Please sign in to comment.