Skip to content

Commit bbfb735

Browse files
Ricky Cheungd4rken
Ricky Cheung
authored andcommitted
Enlarge the icons on wide widgets
* Also move the case details to the centre and separate the text a little Signed-off-by: Ricky Cheung <[email protected]>
1 parent 7b474fb commit bbfb735

File tree

3 files changed

+33
-24
lines changed

3 files changed

+33
-24
lines changed

app/src/main/java/eu/darken/capod/main/ui/widget/WidgetProvider.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ class WidgetProvider : AppWidgetProvider() {
135135
.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH)
136136
val columns = getCellsForSize(minWidth)
137137

138-
/* Enable wide widgets only when we are provided with 4 or
138+
/* Enable wide widgets only when we are provided with 5 or
139139
* more columns of space.
140140
* Although the minimum size is only 2x1, the safeguards are
141141
* added if these restrictions will ever be loosened in the future.
142142
*/
143143
val layout = when (columns) {
144-
in 1 .. 3 -> R.layout.widget_pod_dual_compact_layout
144+
in 1 .. 4 -> R.layout.widget_pod_dual_compact_layout
145145
else -> R.layout.widget_pod_dual_wide_layout
146146
}
147147

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

+26-22
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
android:layout_width="wrap_content"
1515
android:layout_height="wrap_content"
1616
android:layout_gravity="center"
17-
android:layout_marginEnd="24dp"
17+
android:layout_marginEnd="12dp"
18+
android:gravity="center_vertical"
1819
android:orientation="horizontal">
1920

2021
<ImageView
2122
android:id="@+id/pod_left_icon"
22-
style="@style/PodInfoItemIcon.Notification"
23+
style="@style/PodInfoItemIcon.Notification.Large"
2324
android:src="@drawable/devic_airpods_pro2_left"
2425
tools:ignore="ContentDescription" />
2526

@@ -49,17 +50,18 @@
4950
android:layout_width="wrap_content"
5051
android:layout_height="wrap_content"
5152
android:layout_gravity="center"
52-
android:layout_marginEnd="24dp"
53+
android:layout_marginEnd="12dp"
54+
android:gravity="center_vertical"
5355
android:orientation="horizontal">
5456

5557
<ImageView
56-
android:id="@+id/pod_right_icon"
57-
style="@style/PodInfoItemIcon.Notification"
58-
android:src="@drawable/devic_airpods_pro2_right"
58+
android:id="@+id/pod_case_icon"
59+
style="@style/PodInfoItemIcon.Notification.Large"
60+
android:src="@drawable/devic_airpods_gen1_case"
5961
tools:ignore="ContentDescription" />
6062

6163
<TextView
62-
android:id="@+id/pod_right_label"
64+
android:id="@+id/pod_case_label"
6365
style="@style/PodInfoItemText.Notification"
6466
android:layout_width="wrap_content"
6567
android:layout_height="wrap_content"
@@ -68,32 +70,26 @@
6870
tools:text="100%" />
6971

7072
<ImageView
71-
android:id="@+id/pod_right_charging"
72-
style="@style/PodInfoItemIcon.Notification"
73-
android:src="@drawable/ic_baseline_power_24"
74-
tools:ignore="ContentDescription" />
75-
76-
<ImageView
77-
android:id="@+id/pod_right_ear"
73+
android:id="@+id/pod_case_charging"
7874
style="@style/PodInfoItemIcon.Notification"
79-
android:src="@drawable/ic_baseline_hearing_24"
80-
tools:ignore="ContentDescription" />
75+
android:src="@drawable/ic_baseline_power_24" />
8176
</LinearLayout>
8277

8378
<LinearLayout
8479
android:layout_width="wrap_content"
8580
android:layout_height="wrap_content"
8681
android:layout_gravity="center"
82+
android:gravity="center_vertical"
8783
android:orientation="horizontal">
8884

8985
<ImageView
90-
android:id="@+id/pod_case_icon"
91-
style="@style/PodInfoItemIcon.Notification"
92-
android:src="@drawable/devic_airpods_gen1_case"
86+
android:id="@+id/pod_right_icon"
87+
style="@style/PodInfoItemIcon.Notification.Large"
88+
android:src="@drawable/devic_airpods_pro2_right"
9389
tools:ignore="ContentDescription" />
9490

9591
<TextView
96-
android:id="@+id/pod_case_label"
92+
android:id="@+id/pod_right_label"
9793
style="@style/PodInfoItemText.Notification"
9894
android:layout_width="wrap_content"
9995
android:layout_height="wrap_content"
@@ -102,9 +98,16 @@
10298
tools:text="100%" />
10399

104100
<ImageView
105-
android:id="@+id/pod_case_charging"
101+
android:id="@+id/pod_right_charging"
106102
style="@style/PodInfoItemIcon.Notification"
107-
android:src="@drawable/ic_baseline_power_24" />
103+
android:src="@drawable/ic_baseline_power_24"
104+
tools:ignore="ContentDescription" />
105+
106+
<ImageView
107+
android:id="@+id/pod_right_ear"
108+
style="@style/PodInfoItemIcon.Notification"
109+
android:src="@drawable/ic_baseline_hearing_24"
110+
tools:ignore="ContentDescription" />
108111
</LinearLayout>
109112

110113
</LinearLayout>
@@ -115,6 +118,7 @@
115118
android:layout_width="wrap_content"
116119
android:layout_height="wrap_content"
117120
android:layout_gravity="center"
121+
android:layout_marginTop="8dp"
118122
android:gravity="center"
119123
android:textSize="12sp"
120124
android:textStyle="bold"

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

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
<item name="tint">?android:attr/colorAccent</item>
2525
</style>
2626

27+
<style name="PodInfoItemIcon.Notification.Large" parent="PodInfoItemIcon.Notification">
28+
<item name="android:layout_height">40dp</item>
29+
<item name="android:layout_width">40dp</item>
30+
</style>
31+
2732
<style name="PodInfoItemText.Notification" parent="TextAppearance.Compat.Notification.Title">
2833
<item name="android:singleLine">true</item>
2934
<item name="android:ellipsize">end</item>

0 commit comments

Comments
 (0)