-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
163 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.44 KB
android/app/src/main/res/drawable-nodpi/example_appwidget_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions
10
android/app/src/main/res/drawable-v21/app_widget_background.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
Background for widgets to make the rounded corners based on the | ||
appWidgetRadius attribute value | ||
--> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<corners android:radius="?attr/appWidgetRadius" /> | ||
<solid android:color="?android:attr/colorBackground" /> | ||
</shape> |
10 changes: 10 additions & 0 deletions
10
android/app/src/main/res/drawable-v21/app_widget_inner_view_background.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
Background for views inside widgets to make the rounded corners based on the | ||
appWidgetInnerRadius attribute value | ||
--> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<corners android:radius="?attr/appWidgetInnerRadius" /> | ||
<solid android:color="?android:attr/colorAccent" /> | ||
</shape> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!-- res/layout/widget_layout.xml --> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
style="@style/Widget.Android.AppWidget.Container" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:theme="@style/Theme.Android.AppWidgetContainer"> | ||
|
||
|
||
<ImageView | ||
android:id="@+id/appwidget_image" | ||
android:layout_width="match_parent" | ||
android:layout_height="200dp" | ||
android:scaleType="centerCrop" | ||
tools:srcCompat="@tools:sample/backgrounds/scenic[0]" /> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_below="@id/appwidget_image" | ||
android:orientation="vertical" | ||
android:padding="8dp"> | ||
|
||
<TextView | ||
android:id="@+id/appwidget_title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginBottom="4dp" | ||
android:ellipsize="end" | ||
android:maxLines="1" | ||
android:textColor="@android:color/black" | ||
android:textSize="18sp" | ||
android:textStyle="bold" /> | ||
|
||
<TextView | ||
android:id="@+id/appwidget_artist" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:ellipsize="end" | ||
android:maxLines="1" | ||
android:textColor="@android:color/darker_gray" | ||
android:textSize="16sp" /> | ||
|
||
<TextView | ||
android:id="@+id/appwidget_medium" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textColor="@android:color/darker_gray" | ||
android:textSize="14sp" /> | ||
</LinearLayout> | ||
</RelativeLayout> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- | ||
Having themes.xml for night-v31 because of the priority order of the resource qualifiers. | ||
--> | ||
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault.DayNight"> | ||
<item name="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item> | ||
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item> | ||
</style> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<resources> | ||
|
||
<style name="Widget.Android.AppWidget.Container" parent="android:Widget"> | ||
<item name="android:id">@android:id/background</item> | ||
<item name="android:padding">?attr/appWidgetPadding</item> | ||
<item name="android:background">@drawable/app_widget_background</item> | ||
</style> | ||
|
||
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget"> | ||
<item name="android:padding">?attr/appWidgetPadding</item> | ||
<item name="android:background">@drawable/app_widget_inner_view_background</item> | ||
<item name="android:textColor">?android:attr/textColorPrimary</item> | ||
</style> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- | ||
Having themes.xml for v31 variant because @android:dimen/system_app_widget_background_radius | ||
and @android:dimen/system_app_widget_internal_padding requires API level 31 | ||
--> | ||
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault.DayNight"> | ||
<item name="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item> | ||
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item> | ||
</style> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<resources> | ||
<declare-styleable name="AppWidgetAttrs"> | ||
<attr name="appWidgetPadding" format="dimension" /> | ||
<attr name="appWidgetInnerRadius" format="dimension" /> | ||
<attr name="appWidgetRadius" format="dimension" /> | ||
</declare-styleable> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<resources> | ||
<color name="light_blue_50">#FFE1F5FE</color> | ||
<color name="light_blue_200">#FF81D4FA</color> | ||
<color name="light_blue_600">#FF039BE5</color> | ||
<color name="light_blue_900">#FF01579B</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<!-- | ||
Refer to App Widget Documentation for margin information | ||
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout | ||
--> | ||
<dimen name="widget_margin">0dp</dimen> | ||
|
||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<resources> | ||
|
||
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault"> | ||
<!-- Radius of the outer bound of widgets to make the rounded corners --> | ||
<item name="appWidgetRadius">16dp</item> | ||
<!-- | ||
Radius of the inner view's bound of widgets to make the rounded corners. | ||
It needs to be 8dp or less than the value of appWidgetRadius | ||
--> | ||
<item name="appWidgetInnerRadius">8dp</item> | ||
</style> | ||
|
||
<style name="Theme.Android.AppWidgetContainer" parent="Theme.Android.AppWidgetContainerParent"> | ||
<!-- Apply padding to avoid the content of the widget colliding with the rounded corners --> | ||
<item name="appWidgetPadding">16dp</item> | ||
</style> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters