Skip to content

Commit bfe8b29

Browse files
committed
Widget: Move to Material You Design
Signed-off-by: Hendrik Borghorst <[email protected]>
1 parent 46af68a commit bfe8b29

File tree

5 files changed

+177
-9
lines changed

5 files changed

+177
-9
lines changed

app/src/main/java/org/gateshipone/odyssey/widget/OdysseyWidgetProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private synchronized void setWidgetContent(@NonNull NowPlayingInformation info,
163163
// Check if the tracks album changed
164164
if (mLastInfo.getCurrentTrack().getTrackAlbumId() != item.getTrackAlbumId()) {
165165
// Album changed, it is necessary to start the image loader
166-
views.setImageViewResource(R.id.widget_covert_artwork, R.drawable.odyssey_notification);
166+
views.setImageViewResource(R.id.widget_covert_artwork, R.drawable.widget_icon);
167167

168168
mLastCover = null;
169169

@@ -176,14 +176,14 @@ private synchronized void setWidgetContent(@NonNull NowPlayingInformation info,
176176
} else {
177177
// Hide artwork requested
178178
mLastCover = null;
179-
views.setImageViewResource(R.id.widget_covert_artwork, R.drawable.odyssey_notification);
179+
views.setImageViewResource(R.id.widget_covert_artwork, R.drawable.widget_icon);
180180
}
181181
}
182182
break;
183183
case RESUMED:
184184
case STOPPED:
185185
mLastCover = null;
186-
views.setImageViewResource(R.id.widget_covert_artwork, R.drawable.odyssey_notification);
186+
views.setImageViewResource(R.id.widget_covert_artwork, R.drawable.widget_icon);
187187
break;
188188
}
189189

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Copyright (C) 2023 Team Gateship-One
3+
~ (Hendrik Borghorst & Frederik Luetkes)
4+
~
5+
~ The AUTHORS.md file contains a detailed contributors list:
6+
~ <https://github.com/gateship-one/odyssey/blob/master/AUTHORS.md>
7+
~
8+
~ This program is free software: you can redistribute it and/or modify
9+
~ it under the terms of the GNU General Public License as published by
10+
~ the Free Software Foundation, either version 3 of the License, or
11+
~ (at your option) any later version.
12+
~
13+
~ This program is distributed in the hope that it will be useful,
14+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
~ GNU General Public License for more details.
17+
~
18+
~ You should have received a copy of the GNU General Public License
19+
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
~
21+
-->
22+
23+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
24+
android:width="48dp"
25+
android:height="48dp"
26+
android:viewportWidth="783.90997"
27+
android:viewportHeight="783.90997">
28+
29+
<group
30+
android:translateX="41.943354"
31+
android:translateY="29.787482">
32+
<group
33+
android:translateX="0.01163315"
34+
android:translateY="-170.19468">
35+
<path
36+
android:fillColor="?android:attr/textColorPrimary"
37+
android:strokeColor="?android:attr/textColorSecondary"
38+
android:strokeWidth="1.36533332"
39+
android:pathData="M 434.08586,749.01059 c -7.72771,-3.38212 -13.13922,-6.34806 -20.0661,-10.99782
40+
-8.92957,-5.99409 -9.65301,-6.34781 -12.35889,-6.04282 -4.88506,0.55062
41+
-21.1012,10.53191 -26.53147,16.33055 -1.07339,1.1462 -1.79306,1.28558
42+
-4.62598,0.89596 -7.83338,-1.07737 -10.19395,-2.12243 -14.55317,-6.44289
43+
-2.28935,-2.269 -2.85987,-4.83974 -4.48212,-5.7326 -0.32612,-0.17949
44+
-2.52097,2.83595 -4.33844,4.33781 -1.81747,1.50187 -3.65503,2.73393
45+
-4.08348,2.7379 -0.42846,0.004 -4.65752,0.60594 -9.39794,1.33769
46+
-4.74041,0.73176 -13.05792,0.39573 -18.48336,0.78105 -5.42544,0.38532
47+
-14.10962,1.91057 -16.89736,2.29817 -9.37711,1.30376 -13.34652,0.53487
48+
-35.34382,-6.72283 -20.08198,-6.62577 -36.77097,-11.50723 -58.55519,-17.12716
49+
-6.7584,-1.74354 -20.1216,-5.74507 -29.696,-8.8923 -9.5744,-3.14723
50+
-22.784,-7.3244 -29.35467,-9.28259 -7.01398,-2.09032 -12.68934,-4.178
51+
-13.74539,-5.05625 -0.98929,-0.82274 -3.79284,-2.34341 -6.2301,-3.37926
52+
-3.27936,-1.39375 -4.97517,-2.62035 -6.52308,-4.71823 -1.15043,-1.55917
53+
-2.72686,-3.64775 -3.50318,-4.64127 l -1.41149,-1.80643 2.4628,-2.94777 c
54+
7.17387,-8.58656 8.16912,-9.41636 14.03606,-11.7027 6.87513,-2.67925
55+
22.08408,-10.6568 27.01809,-14.1718 2.34671,-1.67181 3.49667,-2.28744
56+
5.94734,-2.66452 0.88218,-0.13574 1.9329,-0.24057 3.26866,-0.35263
57+
3.10509,-0.26049 8.71762,-1.19284 12.47229,-2.07191 27.01835,-6.32567
58+
24.42942,-4.21374 30.4977,-5.30706 4.21893,-0.76012 7.76347,0.29446
59+
23.43297,-1.70371 20.85083,-2.65887 24.05789,-2.5541 34.24531,1.11874
60+
9.55397,3.44446 36.16007,6.05189 38.44437,3.76759 0.40892,-0.40892
61+
0.33727,-1.70047 -0.19418,-3.5004 l -0.84221,-2.85237 -32.41331,-16.33286
62+
-32.41332,-16.33286 -13.43697,-0.44265 c -11.75931,-0.38738 -28.48484,-1.44127
63+
-45.74171,-2.88223 l -5.248,-0.43821 -3.21927,-5.32527 -3.21926,-5.32527
64+
-32.1514,-13.11816 C 108.38101,572.68528 99.168211,568.50295 56.399864,547.77913
65+
5.4033141,523.06826 2.7988141,521.59463 -1.2695659,515.1499 c -0.91961,-1.45675
66+
-2.53596,-2.97474 -3.5919,-3.37331 -1.60251,-0.60489 -2.11139,-1.43218
67+
-3.0784,-5.0046 -0.76184,-2.81447 -2.1641601,-5.57498 -4.0955201,-8.06219
68+
-1.61535,-2.08025 -3.7914,-5.24405 -4.83566,-7.03065 -1.04426,-1.7866
69+
-5.31678,-8.00997 -9.49448,-13.8297 -4.1777,-5.81974 -12.26734,-16.61129
70+
-13.39365,-18.30663 -2.49954,-3.76237 -1.22347,-20.19128 -0.89749,-21.1692
71+
0.30168,-0.90504 18.91532,-5.59009 26.48348,-8.10039 5.7800101,-1.91718
72+
20.6487701,-6.16899 33.63516,-8.21539 6.07843,-0.95784 13.88431,-3.48606
73+
22.77322,-6.60045 1.6896,-0.59199 3.9168,-1.2402 4.94933,-1.44048 l
74+
1.87734,-0.36414 0,-7.15499 c 0,-5.94904 -0.20136,-7.33646 -1.19467,-8.23161
75+
-2.45776,-2.2149 -19.85503,-13.74 -48.9813299,-32.44848 -29.9848801,-19.25996
76+
-34.7279201,-22.42788 -34.2679201,-22.88789 0.32458,-0.32457 6.75071,3.20866
77+
48.15441,26.47635 19.27704,10.83315 35.62755,19.69663 36.33447,19.69663
78+
1.97748,0 3.27252,-3.33171 4.02336,-10.35075 0.37505,-3.50602 1.20488,-9.82601
79+
1.84408,-14.04441 0.63919,-4.21841 1.02959,-7.77955 0.86755,-7.91365
80+
-0.16204,-0.1341 -14.04182,-10.1571 -30.84395,-22.27334 C 8.1957241,322.4044
81+
-5.5514759,312.21834 -5.5514759,311.88495 c 0,-0.3334 0.2304,-0.60538
82+
0.512,-0.60442 1.04745,0.004 8.72597,4.98542 14.0869,9.1396 8.1713699,6.33196
83+
44.5150799,31.81865 45.3730199,31.81865 1.14558,0 2.43274,2.47923
84+
3.997207,-1.35878 l 1.22697,-3.01005 19.45693,-5.42842 c 10.01429,-2.79396
85+
12.88245,-2.02886 26.645209,-2.83237 l 5.92558,0.57573 23.13743,10.46094
86+
21.6222,11.21855 14.39853,8.2349 c 2.5534,1.46036 6.61982,4.83935
87+
13.47135,8.40565 9.87272,5.13886 15.95174,7.31404 17.72386,9.5192
88+
1.65695,2.06186 17.37346,-5.29688 23.11145,-2.40127 5.79564,2.92469
89+
22.3633,23.85031 68.74055,59.75861 9.19583,7.12002 11.20977,1.55852
90+
24.74082,12.0132 l 76.39401,59.02536 0.30402,7.37874 0.30402,7.37874
91+
6.76116,6.78664 6.76117,6.78663 7.70472,0 c 4.94583,0 9.96159,-0.46854
92+
14.00748,-1.30849 3.46651,-0.71966 9.52835,-1.4891 13.47075,-1.70987
93+
6.82356,-0.3821 8.90373,-0.10638 43.28946,5.73783 l 36.12148,6.1392
94+
4.27277,2.78383 c 4.89636,3.1901 11.14246,5.76173 11.97421,4.92999
95+
0.31093,-0.31094 0.6495,-6.08504 0.75237,-12.83134 l 0.18704,-12.266 c 0,0
96+
-0.0889,-1.64427 0.47865,-1.63416 0.66366,0.0118 0.4913,1.92974 0.4913,1.92974 l
97+
1.62192,9.22825 c 0,0 0.16755,0.53516 0.3895,0.54029 0.38628,0.009
98+
0.72054,-0.90798 0.72054,-0.90798 l -0.48185,-10.4744 c -0.0871,-1.893
99+
3.50032,4.79908 4.64415,4.01838 1.31216,-0.89559 0.40632,-9.35805
100+
-0.08,-14.48083 -0.94446,-9.94798 -0.56895,-12.86447 1.71248,-13.30059
101+
0.91241,-0.17442 2.30574,0.21439 3.2085,0.89534 1.48025,1.11655 2.02146,1.29386
102+
1.00443,2.45056 -0.60299,0.68581 -1.29627,1.90435 -1.54061,2.70787
103+
-0.0744,0.24448 -1.20323,1.35701 -1.13303,3.07307 0.33588,8.21143
104+
3.24278,30.24164 4.34122,37.10864 0.36036,2.2528 0.67,6.0928 0.6881,8.53334 l
105+
0.0329,4.43733 18.91624,11.25302 c 18.31133,10.89317 19.13453,11.47545
106+
25.7429,18.20876 l 6.82666,6.95573 6.48534,-0.91288 c 15.17418,-2.13595
107+
25.58828,-2.73663 47.44535,-2.73663 22.59211,0 27.68967,2.46929 37.21917,4.83055
108+
6.5641,1.62647 13.33405,0.37355 17.70495,2.71303 2.84457,1.52252 5.04958,4.59378
109+
7.2628,7.41185 4.7981,6.10913 4.8088,10.51781 7.1257,21.22591 1.2186,5.632
110+
2.958,12.6976 3.8654,15.70133 2.2753,7.53235 5.6385,32.31064 5.656,41.6699
111+
0.01,4.59202 -0.3949,9.12625 -1.0325,11.60534 -1.0425,4.05367 -5.2521,11.15379
112+
-6.7167,11.3288 -0.4236,0.0507 -4.6101,0.15855 -9.3035,0.23984 -26.3495,0.4564
113+
-61.60519,2.48591 -82.60265,4.75506 -12.20269,1.31872 -24.24517,2.40323
114+
-26.76109,2.41003 -8.27735,0.0224 -10.88293,0.96392 -15.76037,5.69513
115+
-2.39042,2.31875 -5.55138,5.01329 -7.02439,5.98789 -5.65656,3.74262
116+
-19.77693,10.95928 -21.54145,11.00945 -1.05436,0.03 -3.44746,-1.00795
117+
-5.56562,-2.41391 -5.36235,-3.55933 -9.69001,-4.93737 -21.99244,-7.00301
118+
-6.00746,-1.00868 -11.53706,-2.08671 -12.288,-2.39561 -0.75093,-0.3089
119+
-4.59093,-3.17136 -8.53333,-6.36101 -4.05052,-3.27712 -7.05984,-6.41496
120+
-9.40553,-7.73403 -3.57523,-2.01051 -6.08128,-1.21346 -12.09847,-1.39248
121+
-11.83732,-0.35218 -12.14054,-0.34297 -15.12406,0.46041 -2.91635,0.7853
122+
-3.91256,2.23496 -7.06092,10.27492 -1.69604,4.33119 -5.81502,11.87925
123+
-7.02143,12.86684 -0.45701,0.37412 -2.98132,1.44945 -5.60959,2.38963
124+
-2.62827,0.94017 -6.62187,2.3888 -8.87467,3.21917 -2.2528,0.83037
125+
-5.9392,1.62633 -8.192,1.76879 -3.82562,0.24193 -4.79446,-0.0467
126+
-14.67733,-4.37201 z M 60.657401,415.73202 c 0.69618,-0.37258 1.58397,-1.67818
127+
1.97285,-2.90133 0.96478,-3.03445 2.72291,-22.52476 3.25976,-36.13704
128+
0.40032,-10.15027 0.32921,-11.29599 -0.76929,-12.39448 -2.18302,-2.18303
129+
-4.01725,-1.20463 -4.90605,2.61694 -0.92354,3.97092 -2.862737,26.52442
130+
-3.448467,40.10667 -0.40375,9.36245 -0.40089,9.38667 1.11031,9.38667 0.833307,0
131+
2.084707,-0.30485 2.780887,-0.67743 z M 103.29485,380.7248 c 0.65889,-1.00559
132+
2.0346,-5.54246 2.06401,-12.98474 0.0556,-14.0715 0.0001,-14.2104
133+
0.20865,-19.33915 -0.32089,-2.45742 0.20971,-3.69603 -0.30746,-3.86811
134+
-1.78571,-0.5942 -8.360729,-0.43681 -23.975519,2.63577 -16.82918,3.31154
135+
-18.88386,5.83574 -18.448,9.63693 0.20879,1.82085 0.37654,1.90857
136+
3.29199,1.72144 1.6896,-0.10844 6.6048,-1.24268 10.92267,-2.52053
137+
8.47258,-2.5074 18.38702,-4.55868 19.30158,-3.99345 0.31152,0.19253 0.4737,6.49
138+
0.36041,13.99438 -0.20574,13.62798 -0.20406,13.64589 1.40565,14.95654
139+
2.137599,1.74049 3.933299,1.65755 5.176019,-0.23908 z" />
140+
</group>
141+
</group>
142+
</vector>

app/src/main/res/layout/widget_odyssey.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2424
android:layout_width="match_parent"
2525
android:layout_height="match_parent"
26-
android:background="@color/colorWidgetBackground">
26+
android:theme="@style/Theme.app.widget"
27+
android:background="?android:attr/colorBackground">
2728

2829
<ImageView
2930
android:id="@+id/widget_covert_artwork"
@@ -53,7 +54,6 @@
5354
android:layout_height="wrap_content"
5455
android:fontFamily="sans-serif-regular"
5556
android:singleLine="true"
56-
android:textColor="@android:color/primary_text_dark"
5757
android:textSize="@dimen/material_font_style_size_subheading" />
5858

5959
<TextView
@@ -62,7 +62,7 @@
6262
android:layout_height="wrap_content"
6363
android:fontFamily="sans-serif-regular"
6464
android:singleLine="true"
65-
android:textColor="@android:color/secondary_text_dark"
65+
android:textColor="?android:attr/textColorSecondary"
6666
android:textSize="@dimen/material_font_style_size_body_1" />
6767

6868
<LinearLayout
@@ -79,7 +79,7 @@
7979
android:background="?android:selectableItemBackground"
8080
android:scaleType="fitCenter"
8181
android:src="@drawable/ic_skip_previous_48dp"
82-
android:tint="@android:color/primary_text_dark"
82+
android:tint="?android:attr/textColorPrimary"
8383
android:contentDescription="@null" />
8484

8585
<ImageButton
@@ -90,7 +90,7 @@
9090
android:background="?android:selectableItemBackground"
9191
android:scaleType="fitCenter"
9292
android:src="@drawable/ic_play_arrow_48dp"
93-
android:tint="@android:color/primary_text_dark"
93+
android:tint="?android:attr/textColorPrimary"
9494
android:contentDescription="@null" />
9595

9696
<ImageButton
@@ -101,7 +101,7 @@
101101
android:background="?android:selectableItemBackground"
102102
android:scaleType="fitCenter"
103103
android:src="@drawable/ic_skip_next_48dp"
104-
android:tint="@android:color/primary_text_dark"
104+
android:tint="?android:attr/textColorPrimary"
105105
android:contentDescription="@null" />
106106
</LinearLayout>
107107
</LinearLayout>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
~ Copyright (C) 2023 Team Gateship-One
3+
~ (Hendrik Borghorst & Frederik Luetkes)
4+
~
5+
~ The AUTHORS.md file contains a detailed contributors list:
6+
~ <https://gitlab.com/gateship-one/malp/blob/master/AUTHORS.md>
7+
~
8+
~ This program is free software: you can redistribute it and/or modify
9+
~ it under the terms of the GNU General Public License as published by
10+
~ the Free Software Foundation, either version 3 of the License, or
11+
~ (at your option) any later version.
12+
~
13+
~ This program is distributed in the hope that it will be useful,
14+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
~ GNU General Public License for more details.
17+
~
18+
~ You should have received a copy of the GNU General Public License
19+
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
~
21+
-->
22+
23+
<resources xmlns:tools="http://schemas.android.com/tools">
24+
<style name="Theme.app.widget" parent="Theme.Material3.DynamicColors.DayNight" />
25+
</resources>

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,4 +680,5 @@
680680
<item name="colorSurfaceInverse">@color/md_theme_light_red_inverseSurface</item>
681681
<item name="colorPrimaryInverse">@color/md_theme_light_red_inversePrimary</item>
682682
</style>
683+
<style name="Theme.app.widget" parent="Theme.Material3.DynamicColors.Dark" />
683684
</resources>

0 commit comments

Comments
 (0)