Slightly updated the appwidget appearance, use smaller bitmap size for palette.

This commit is contained in:
Karim Abou Zeid 2015-07-05 17:39:10 +02:00
commit bd69dc1d43
13 changed files with 111 additions and 87 deletions

View file

@ -1,65 +0,0 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/app_widget_small_artwork_height"
android:background="#FFFFFF"
tools:ignore="ContentDescription">
<ImageView
android:src="@drawable/default_album_art"
android:id="@+id/album_art"
android:layout_width="@dimen/app_widget_small_artwork_height"
android:layout_height="@dimen/app_widget_small_artwork_height"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:gravity="center"
android:id="@+id/song_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@style/Theme.MaterialMusic.Notification.Title"
android:layout_margin="4dp"
android:text="@string/nothing_playing" />
<LinearLayout
android:id="@+id/media_actions"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<ImageButton
android:layout_weight="1"
android:background="@drawable/notification_selector"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_prev"
android:src="@drawable/ic_skip_previous_black_36dp" />
<ImageButton
android:layout_weight="1"
android:background="@drawable/notification_selector"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_toggle_play_pause"
android:src="@drawable/ic_play_arrow_black_36dp" />
<ImageButton
android:layout_weight="1"
android:background="@drawable/notification_selector"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button_next"
android:src="@drawable/ic_skip_next_black_36dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,85 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="96dp"
android:background="#AAFFFFFF"
tools:ignore="ContentDescription">
<ImageView
android:id="@+id/album_art"
android:layout_width="96dp"
android:layout_height="96dp"
android:scaleType="centerCrop"
android:src="@drawable/default_album_art" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/media_actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:orientation="horizontal">
<ImageButton
android:id="@+id/button_prev"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/notification_selector"
android:src="@drawable/ic_skip_previous_black_36dp" />
<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/notification_selector"
android:src="@drawable/ic_play_arrow_black_36dp" />
<ImageButton
android:id="@+id/button_next"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/notification_selector"
android:src="@drawable/ic_skip_next_black_36dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/media_titles"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/media_actions"
android:layout_alignParentTop="true"
android:layout_margin="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/song_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:singleLine="true"
android:text="@string/nothing_playing"
android:textAppearance="@style/Theme.MaterialMusic.Notification.Title" />
<TextView
android:id="@+id/song_secondary_information"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/Theme.MaterialMusic.Notification" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="180dp"
android:minHeight="40dp"
android:updatePeriodMillis="86400000"
android:previewImage="@drawable/example_appwidget_preview"
android:initialLayout="@layout/music_player_widget"
android:resizeMode="horizontal|vertical"
android:widgetCategory="home_screen|keyguard"
android:initialKeyguardLayout="@layout/music_player_widget">
</appwidget-provider>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:initialLayout="@layout/widget_medium"
android:minHeight="40dp"
android:minWidth="250dp"
android:resizeMode="none"
android:updatePeriodMillis="0"
android:widgetCategory="home_screen|keyguard"
tools:ignore="UnusedAttribute" />