Skip to content

Commit

Permalink
Fix progress gradient colors, fixes #1019 (#1021)
Browse files Browse the repository at this point in the history
Before Android 10, colors in drawables must either all use attr
references or colors, not a mix of both, see https://stackoverflow.com/questions/35363335/gradient-crashes-with-illegalargumentexception-on-android-m
  • Loading branch information
dmfs authored Mar 21, 2021
1 parent 08aabf9 commit a053c78
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions opentasks-theme/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@

<attr name="opentasks_progress_gradient_end_color"
format="color" />
<attr name="opentasks_progress_gradient_start_color"
format="color" />
</resources>
2 changes: 2 additions & 0 deletions opentasks-theme/src/main/res/values/theme_dark.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<item name="tabIconTint">?attr/colorPrimary</item>
<item name="tabIndicatorColor">?attr/colorPrimary</item>

<item name="opentasks_progress_gradient_start_color">#00000000</item>
<item name="opentasks_progress_gradient_end_color">@color/white_6_percent</item>

<item name="android:scrollbarTrackVertical">@null</item>
Expand Down Expand Up @@ -67,6 +68,7 @@
<item name="tabIconTint">?attr/colorPrimary</item>
<item name="tabIndicatorColor">?attr/colorPrimary</item>

<item name="opentasks_progress_gradient_start_color">#00000000</item>
<item name="opentasks_progress_gradient_end_color">@color/white_6_percent</item>

<item name="android:scrollbarTrackVertical">@null</item>
Expand Down
2 changes: 2 additions & 0 deletions opentasks-theme/src/main/res/values/theme_light.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<item name="tabIconTint">?attr/colorPrimary</item>
<item name="tabIndicatorColor">?attr/colorPrimary</item>

<item name="opentasks_progress_gradient_start_color">#00000000</item>
<item name="opentasks_progress_gradient_end_color">@color/black_3_percent</item>

<item name="android:scrollbarTrackVertical">@null</item>
Expand Down Expand Up @@ -73,6 +74,7 @@
<item name="tabIconTint">?attr/colorPrimary</item>
<item name="tabIndicatorColor">?attr/colorPrimary</item>

<item name="opentasks_progress_gradient_start_color">#00000000</item>
<item name="opentasks_progress_gradient_end_color">@color/black_3_percent</item>

<item name="android:scrollbarTrackVertical">@null</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<shape android:shape="rectangle">
<gradient
android:angle="180"
android:centerColor="#00000000"
android:endColor="#00000000"
android:centerColor="?attr/opentasks_progress_gradient_start_color"
android:endColor="?attr/opentasks_progress_gradient_start_color"
android:startColor="?attr/opentasks_progress_gradient_end_color" />
</shape>
</item>
Expand Down

0 comments on commit a053c78

Please sign in to comment.