Redesigned widget (#225)

* Changed widget layout, added vibrant color support for button

* Added preview image. Show also albums name after artists name

* Updated also small widget with vibrant color support. Added preview images for small and big widgets

* Fixed wrong height

* Revert classic widget padding, update preview image

* Replaced dash with dot, changed background color, show the album name also on big widget.

* Updated preview images, switched to jpg

* Fixed dot instead of dash for small widget

* Changed ripple color for white background

* Dark ripple for big widget

* Standardize layout

* Fix image resizing

* Improve image resizing

* Fix for songs without album art

* Set centerCrop for albums art

* Card layout for small widget

* Updated preview images

* Fix incorrectly rounded corner
This commit is contained in:
Materight 2017-08-03 01:05:33 +02:00 committed by Eugene Cheung
commit 0377e43475
19 changed files with 132 additions and 101 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -4,10 +4,10 @@
<item>
<shape>
<padding
android:top="8dp"
android:right="8dp"
android:bottom="5dp"
android:left="8dp"/>
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
android:left="0dp"/>
<solid android:color="@android:color/transparent"/>
</shape>
</item>

View file

@ -28,7 +28,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
android:background="@drawable/widget_selector_dark"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_skip_previous_white_24dp"
tools:tint="@color/ate_primary_text_dark" />
@ -38,7 +38,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
android:background="@drawable/widget_selector_dark"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_play_arrow_white_24dp"
tools:tint="@color/ate_primary_text_dark" />
@ -48,7 +48,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
android:background="@drawable/widget_selector_dark"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_skip_next_white_24dp"
tools:tint="@color/ate_primary_text_dark" />

View file

@ -3,17 +3,19 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="@dimen/app_widget_classic_height"
android:background="#AA000000"
android:layout_height="match_parent"
android:background="@drawable/card"
android:orientation="horizontal"
tools:ignore="ContentDescription">
<ImageView
android:id="@+id/image"
android:layout_width="@dimen/app_widget_classic_image_size"
android:layout_height="@dimen/app_widget_classic_image_size"
android:background="@drawable/default_album_art"
android:scaleType="centerCrop" />
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
tools:ignore="ContentDescription"
tools:src="@drawable/default_album_art" />
<RelativeLayout
android:layout_width="match_parent"
@ -23,70 +25,72 @@
android:id="@+id/media_actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:layoutDirection="ltr"
android:orientation="horizontal"
android:padding="8dp">
android:layout_marginBottom="8dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<ImageButton
android:id="@+id/button_prev"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
android:background="@drawable/widget_selector_light"
tools:src="@drawable/ic_skip_previous_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
tools:tint="@color/ate_secondary_text_light" />
<ImageButton
android:id="@+id/button_toggle_play_pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
android:background="@drawable/widget_selector_light"
tools:src="@drawable/ic_play_arrow_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
tools:tint="@color/ate_secondary_text_light" />
<ImageButton
android:id="@+id/button_next"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/widget_selector"
android:background="@drawable/widget_selector_light"
tools:src="@drawable/ic_skip_next_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
tools:tint="@color/ate_secondary_text_light" />
</LinearLayout>
<LinearLayout
android:id="@+id/media_titles"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/media_actions"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:padding="8dp">
android:gravity="center"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/ate_primary_text_dark"
android:textColor="@color/ate_primary_text_light"
tools:text="Title" />
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textColor="@color/ate_secondary_text_dark"
android:textColor="@color/ate_secondary_text_light"
tools:text="Text" />
</LinearLayout>

View file

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#AA000000"
android:background="@drawable/card"
android:columnCount="2"
android:gravity="top"
android:rowCount="3">
@ -13,7 +13,8 @@
android:layout_width="@dimen/app_widget_small_image_size"
android:layout_height="@dimen/app_widget_small_image_size"
android:scaleType="centerInside"
tools:ignore="ContentDescription" />
tools:ignore="ContentDescription"
tools:src="@drawable/default_album_art" />
<LinearLayout
android:id="@+id/media_actions"
@ -28,30 +29,30 @@
android:layout_width="0dp"
android:layout_height="@dimen/app_widget_small_button_height"
android:layout_weight="1"
android:background="@drawable/widget_selector"
android:background="@drawable/widget_selector_light"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_skip_previous_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
tools:tint="@color/ate_secondary_text_light" />
<ImageButton
android:id="@+id/button_toggle_play_pause"
android:layout_width="0dp"
android:layout_height="@dimen/app_widget_small_button_height"
android:layout_weight="1"
android:background="@drawable/widget_selector"
android:background="@drawable/widget_selector_light"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_play_arrow_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
tools:tint="@color/ate_secondary_text_light" />
<ImageButton
android:id="@+id/button_next"
android:layout_width="0dp"
android:layout_height="@dimen/app_widget_small_button_height"
android:layout_weight="1"
android:background="@drawable/widget_selector"
android:background="@drawable/widget_selector_light"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_skip_next_white_24dp"
tools:tint="@color/ate_secondary_text_dark" />
tools:tint="@color/ate_secondary_text_light" />
</LinearLayout>
@ -81,7 +82,7 @@
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="@color/ate_primary_text_dark"
android:textColor="@color/ate_primary_text_light"
tools:text="Title" />
<TextView
@ -93,7 +94,7 @@
android:paddingRight="4dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/ate_secondary_text_dark"
android:textColor="@color/ate_secondary_text_light"
tools:ignore="HardcodedText"
tools:text="•" />
@ -104,7 +105,7 @@
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/ate_secondary_text_dark"
android:textColor="@color/ate_secondary_text_light"
tools:text="Text" />
</LinearLayout>

View file

@ -60,7 +60,6 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
<dimen name="mini_player_height">56dp</dimen>
<!--App Widgets-->
<dimen name="app_widget_classic_height">96dp</dimen>
<dimen name="app_widget_classic_image_size">96dp</dimen>
<dimen name="app_widget_classic_min_width">250dp</dimen>
<dimen name="app_widget_classic_min_height">40dp</dimen>
@ -75,7 +74,7 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
<dimen name="app_widget_card_image_size">56dp</dimen>
<dimen name="app_widget_card_min_width">250dp</dimen>
<dimen name="app_widget_card_min_height">64dp</dimen>
<dimen name="app_widget_card_min_height">40dp</dimen>
<dimen name="app_widget_card_buttons_width">128dp</dimen>
<dimen name="app_widget_card_radius">2dp</dimen>

View file

@ -7,6 +7,5 @@
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="0"
android:widgetCategory="keyguard|home_screen"
tools:ignore="UnusedAttribute" />
<!--android:previewImage="@drawable/app_widget_classic"-->
tools:ignore="UnusedAttribute"
android:previewImage="@drawable/app_widget_big"/>

View file

@ -7,6 +7,5 @@
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="0"
android:widgetCategory="keyguard|home_screen"
tools:ignore="UnusedAttribute"/>
<!--android:previewImage="@drawable/app_widget_classic"-->
tools:ignore="UnusedAttribute"
android:previewImage="@drawable/app_widget_card"/>

View file

@ -7,6 +7,5 @@
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="0"
android:widgetCategory="keyguard|home_screen"
tools:ignore="UnusedAttribute" />
<!--android:previewImage="@drawable/app_widget_classic"-->
tools:ignore="UnusedAttribute"
android:previewImage="@drawable/app_widget_classic" />

View file

@ -7,6 +7,5 @@
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="0"
android:widgetCategory="keyguard|home_screen"
tools:ignore="UnusedAttribute" />
<!--android:previewImage="@drawable/app_widget_classic"-->
tools:ignore="UnusedAttribute"
android:previewImage="@drawable/app_widget_small"/>