Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix progress bar colors when using dynamic #1496

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/progress_horizontal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<item android:id="@android:id/progress">
<scale android:scaleWidth="100%">
<shape>
<solid android:color="?attr/colorPrimaryAlternative"/>
<solid android:color="?attr/colorProgressbar"/>
<corners
android:topLeftRadius="0dp"
android:topRightRadius="2dp"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<attr name="dropdownStyle" format="reference" />
<attr name="colorFavorite" format="color" />
<attr name="colorPrimaryAlternative" format="color" />
<attr name="colorProgressbar" format="color" />
<attr name="colorOnDark" />
<attr name="colorSuccess" />
<attr name="colorOnSurfaceDim" />
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<!-- Custom colors -->
<item name="colorFavorite">@color/aegis_theme_all_favorite</item>
<item name="colorPrimaryAlternative">?attr/colorPrimary</item>
<item name="colorProgressbar">?attr/colorPrimaryAlternative</item>
<item name="colorOnDark">@android:color/white</item>
<item name="colorSuccess">@color/aegis_theme_light_success</item>
<item name="colorOnSurfaceDim">@color/aegis_theme_light_onSurfaceDim</item>
Expand Down Expand Up @@ -126,6 +127,7 @@
<!-- Custom colors -->
<item name="colorFavorite">@color/aegis_theme_all_favorite</item>
<item name="colorPrimaryAlternative">?attr/colorPrimaryInverse</item>
<item name="colorProgressbar">?attr/colorPrimaryAlternative</item>
<item name="colorOnDark">@android:color/white</item>
<item name="colorSuccess">@color/aegis_theme_dark_success</item>
<item name="colorOnSurfaceDim">@color/aegis_theme_dark_onSurfaceDim</item>
Expand Down Expand Up @@ -157,6 +159,11 @@
<item name="colorSurfaceDim">#000000</item>
<item name="colorSurfaceBright">#000000</item>
<item name="colorCode">@android:color/white</item>
<item name="colorProgressbar">@android:color/white</item>
</style>

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

<style name="ThemeOverlay.Aegis.Dynamic.Amoled" parent="ThemeOverlay.Material3.DynamicColors.Dark">
Expand All @@ -172,6 +179,7 @@
<item name="colorSurfaceDim">#000000</item>
<item name="colorSurfaceBright">#000000</item>
<item name="colorCode">@android:color/white</item>
<item name="colorProgressbar">@android:color/white</item>
</style>

<style name="Theme.Aegis.Light" parent="Base.Theme.Aegis.Light">
Expand Down