Skip to content

Commit 65a6bd5

Browse files
committed
Added widget preview
Signed-off-by: Arnau Mora <[email protected]>
1 parent 7df50f8 commit 65a6bd5

5 files changed

+60
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
3+
-->
4+
5+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
6+
<solid android:color="@color/primaryColor"/>
7+
<corners android:radius="15dp"/>
8+
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
9+
</shape>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
3+
-->
4+
5+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
6+
xmlns:app="http://schemas.android.com/apk/res-auto"
7+
android:orientation="vertical"
8+
android:layout_width="30dp"
9+
android:layout_height="30dp"
10+
android:layout_gravity="center"
11+
android:background="@drawable/shape_rounded_primary">
12+
13+
<ImageView
14+
android:layout_width="match_parent"
15+
android:layout_height="match_parent"
16+
android:contentDescription="@string/widget_sync_all_accounts"
17+
android:src="@drawable/ic_sync"
18+
android:padding="4dp"
19+
app:tint="@android:color/white" />
20+
21+
</LinearLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
3+
-->
4+
5+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
6+
xmlns:app="http://schemas.android.com/apk/res-auto"
7+
android:orientation="horizontal"
8+
android:layout_width="150dp"
9+
android:layout_height="30dp"
10+
android:layout_gravity="center"
11+
android:gravity="center_vertical"
12+
android:background="@drawable/shape_rounded_primary">
13+
14+
<ImageView
15+
android:layout_width="24dp"
16+
android:layout_height="match_parent"
17+
android:contentDescription="@string/widget_sync_all_accounts"
18+
android:src="@drawable/ic_sync"
19+
android:padding="4dp"
20+
app:tint="@android:color/white" />
21+
22+
<TextView
23+
android:layout_width="fill_parent"
24+
android:layout_height="wrap_content"
25+
android:textColor="@android:color/white"
26+
android:text="@string/widget_sync_all"/>
27+
28+
</LinearLayout>

app/src/main/res/xml/widget_info_icon_sync_button.xml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
android:targetCellWidth="1"
88
android:targetCellHeight="1"
99
android:resizeMode="none"
10+
android:previewLayout="@layout/widget_preview_icon_sync_button"
1011
android:description="@string/widget_icon_sync_description"
1112
tools:ignore="UnusedAttribute">
1213
</appwidget-provider>

app/src/main/res/xml/widget_info_labeled_sync_button.xml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
android:maxResizeWidth="250dp"
1010
android:maxResizeHeight="30dp"
1111
android:resizeMode="horizontal"
12+
android:previewLayout="@layout/widget_preview_labeled_sync_button"
1213
android:description="@string/widget_labeled_sync_description"
1314
tools:ignore="UnusedAttribute">
1415
</appwidget-provider>

0 commit comments

Comments
 (0)