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

View file

@ -45,7 +45,7 @@ public class AppWidgetBig extends BaseAppWidget {
final RemoteViews appWidgetView = new RemoteViews(context.getPackageName(), R.layout.app_widget_big); final RemoteViews appWidgetView = new RemoteViews(context.getPackageName(), R.layout.app_widget_big);
appWidgetView.setViewVisibility(R.id.media_titles, View.INVISIBLE); appWidgetView.setViewVisibility(R.id.media_titles, View.INVISIBLE);
appWidgetView.setViewVisibility(R.id.image, View.INVISIBLE); appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art);
appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getPrimaryTextColor(context, false)), 1f)); appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getPrimaryTextColor(context, false)), 1f));
appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getPrimaryTextColor(context, false)), 1f)); appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getPrimaryTextColor(context, false)), 1f));
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, MaterialValueHelper.getPrimaryTextColor(context, false)), 1f)); appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, MaterialValueHelper.getPrimaryTextColor(context, false)), 1f));
@ -69,7 +69,7 @@ public class AppWidgetBig extends BaseAppWidget {
} else { } else {
appWidgetView.setViewVisibility(R.id.media_titles, View.VISIBLE); appWidgetView.setViewVisibility(R.id.media_titles, View.VISIBLE);
appWidgetView.setTextViewText(R.id.title, song.title); appWidgetView.setTextViewText(R.id.title, song.title);
appWidgetView.setTextViewText(R.id.text, song.artistName); appWidgetView.setTextViewText(R.id.text, song.artistName + "" +song.albumName);
} }
// Set correct drawable for pause state // Set correct drawable for pause state

View file

@ -109,6 +109,7 @@ public class AppWidgetCard extends BaseAppWidget {
target = SongGlideRequest.Builder.from(Glide.with(service), song) target = SongGlideRequest.Builder.from(Glide.with(service), song)
.checkIgnoreMediaStore(service) .checkIgnoreMediaStore(service)
.generatePalette(service).build() .generatePalette(service).build()
.centerCrop()
.into(new SimpleTarget<BitmapPaletteWrapper>(imageSize, imageSize) { .into(new SimpleTarget<BitmapPaletteWrapper>(imageSize, imageSize) {
@Override @Override
public void onResourceReady(BitmapPaletteWrapper resource, GlideAnimation<? super BitmapPaletteWrapper> glideAnimation) { public void onResourceReady(BitmapPaletteWrapper resource, GlideAnimation<? super BitmapPaletteWrapper> glideAnimation) {

View file

@ -5,8 +5,10 @@ import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.graphics.Palette;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.RemoteViews; import android.widget.RemoteViews;
@ -18,6 +20,7 @@ import com.bumptech.glide.request.target.Target;
import com.kabouzeid.appthemehelper.util.MaterialValueHelper; import com.kabouzeid.appthemehelper.util.MaterialValueHelper;
import com.kabouzeid.gramophone.R; import com.kabouzeid.gramophone.R;
import com.kabouzeid.gramophone.glide.SongGlideRequest; import com.kabouzeid.gramophone.glide.SongGlideRequest;
import com.kabouzeid.gramophone.glide.palette.BitmapPaletteWrapper;
import com.kabouzeid.gramophone.model.Song; import com.kabouzeid.gramophone.model.Song;
import com.kabouzeid.gramophone.service.MusicService; import com.kabouzeid.gramophone.service.MusicService;
import com.kabouzeid.gramophone.ui.activities.MainActivity; import com.kabouzeid.gramophone.ui.activities.MainActivity;
@ -27,7 +30,9 @@ public class AppWidgetClassic extends BaseAppWidget {
public static final String NAME = "app_widget_classic"; public static final String NAME = "app_widget_classic";
private static AppWidgetClassic mInstance; private static AppWidgetClassic mInstance;
private Target<Bitmap> target; // for cancellation private static int imageSize = 0;
private static float cardRadius = 0f;
private Target<BitmapPaletteWrapper> target; // for cancellation
public static synchronized AppWidgetClassic getInstance() { public static synchronized AppWidgetClassic getInstance() {
if (mInstance == null) { if (mInstance == null) {
@ -44,10 +49,10 @@ public class AppWidgetClassic extends BaseAppWidget {
final RemoteViews appWidgetView = new RemoteViews(context.getPackageName(), R.layout.app_widget_classic); final RemoteViews appWidgetView = new RemoteViews(context.getPackageName(), R.layout.app_widget_classic);
appWidgetView.setViewVisibility(R.id.media_titles, View.INVISIBLE); appWidgetView.setViewVisibility(R.id.media_titles, View.INVISIBLE);
appWidgetView.setViewVisibility(R.id.image, View.INVISIBLE); appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art);
appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, false)), 1f)); appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true)), 1f));
appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, false)), 1f)); appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true)), 1f));
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, false)), 1f)); appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true)), 1f));
linkButtons(context, appWidgetView); linkButtons(context, appWidgetView);
pushUpdate(context, appWidgetIds, appWidgetView); pushUpdate(context, appWidgetIds, appWidgetView);
@ -68,23 +73,19 @@ public class AppWidgetClassic extends BaseAppWidget {
} else { } else {
appWidgetView.setViewVisibility(R.id.media_titles, View.VISIBLE); appWidgetView.setViewVisibility(R.id.media_titles, View.VISIBLE);
appWidgetView.setTextViewText(R.id.title, song.title); appWidgetView.setTextViewText(R.id.title, song.title);
appWidgetView.setTextViewText(R.id.text, song.artistName); appWidgetView.setTextViewText(R.id.text, song.artistName + "" +song.albumName);
} }
// Set correct drawable for pause state
int playPauseRes = isPlaying ? R.drawable.ic_pause_white_24dp : R.drawable.ic_play_arrow_white_24dp;
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(service, playPauseRes, MaterialValueHelper.getSecondaryTextColor(service, false)), 1f));
// Set prev/next button drawables
appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(service, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(service, false)), 1f));
appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(service, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getSecondaryTextColor(service, false)), 1f));
// Link actions buttons to intents // Link actions buttons to intents
linkButtons(service, appWidgetView); linkButtons(service, appWidgetView);
if (imageSize == 0)
imageSize = service.getResources().getDimensionPixelSize(R.dimen.app_widget_classic_image_size);
if (cardRadius == 0f)
cardRadius = service.getResources().getDimension(R.dimen.app_widget_card_radius);
// Load the album cover async and push the update on completion // Load the album cover async and push the update on completion
final Context appContext = service.getApplicationContext(); final Context appContext = service.getApplicationContext();
final int widgetImageSize = service.getResources().getDimensionPixelSize(R.dimen.app_widget_classic_image_size);
service.runOnUiThread(new Runnable() { service.runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -93,26 +94,40 @@ public class AppWidgetClassic extends BaseAppWidget {
} }
target = SongGlideRequest.Builder.from(Glide.with(appContext), song) target = SongGlideRequest.Builder.from(Glide.with(appContext), song)
.checkIgnoreMediaStore(appContext) .checkIgnoreMediaStore(appContext)
.asBitmap().build() .generatePalette(service).build()
.into(new SimpleTarget<Bitmap>(widgetImageSize, widgetImageSize) { .centerCrop()
.into(new SimpleTarget<BitmapPaletteWrapper>(imageSize, imageSize) {
@Override @Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) { public void onResourceReady(BitmapPaletteWrapper resource, GlideAnimation<? super BitmapPaletteWrapper> glideAnimation) {
update(resource); Palette palette = resource.getPalette();
update(resource.getBitmap(), palette.getVibrantColor(palette.getMutedColor(MaterialValueHelper.getSecondaryTextColor(appContext, true))));
} }
@Override @Override
public void onLoadFailed(Exception e, Drawable errorDrawable) { public void onLoadFailed(Exception e, Drawable errorDrawable) {
super.onLoadFailed(e, errorDrawable); super.onLoadFailed(e, errorDrawable);
update(null); update(null, MaterialValueHelper.getSecondaryTextColor(appContext, true));
} }
private void update(@Nullable Bitmap bitmap) { private void update(@Nullable Bitmap bitmap,int color) {
appWidgetView.setViewVisibility(R.id.image, View.VISIBLE); appWidgetView.setViewVisibility(R.id.image, View.VISIBLE);
// Set correct drawable for pause state
int playPauseRes = isPlaying ? R.drawable.ic_pause_white_24dp : R.drawable.ic_play_arrow_white_24dp;
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(service, playPauseRes, color), 1f));
// Set prev/next button drawables
appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(service, R.drawable.ic_skip_next_white_24dp, color), 1f));
appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(service, R.drawable.ic_skip_previous_white_24dp, color), 1f));
Drawable image;
if (bitmap == null) { if (bitmap == null) {
appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art); image = service.getResources().getDrawable(R.drawable.default_album_art);
} else { } else {
appWidgetView.setImageViewBitmap(R.id.image, bitmap); image = new BitmapDrawable(bitmap);
} }
appWidgetView.setImageViewBitmap(R.id.image, createRoundedBitmap(image, imageSize, imageSize, cardRadius, 0, cardRadius, 0));
pushUpdate(appContext, appWidgetIds, appWidgetView); pushUpdate(appContext, appWidgetIds, appWidgetView);
} }
}); });

View file

@ -5,8 +5,10 @@ import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.graphics.Palette;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.RemoteViews; import android.widget.RemoteViews;
@ -18,6 +20,7 @@ import com.bumptech.glide.request.target.Target;
import com.kabouzeid.appthemehelper.util.MaterialValueHelper; import com.kabouzeid.appthemehelper.util.MaterialValueHelper;
import com.kabouzeid.gramophone.R; import com.kabouzeid.gramophone.R;
import com.kabouzeid.gramophone.glide.SongGlideRequest; import com.kabouzeid.gramophone.glide.SongGlideRequest;
import com.kabouzeid.gramophone.glide.palette.BitmapPaletteWrapper;
import com.kabouzeid.gramophone.model.Song; import com.kabouzeid.gramophone.model.Song;
import com.kabouzeid.gramophone.service.MusicService; import com.kabouzeid.gramophone.service.MusicService;
import com.kabouzeid.gramophone.ui.activities.MainActivity; import com.kabouzeid.gramophone.ui.activities.MainActivity;
@ -27,7 +30,9 @@ public class AppWidgetSmall extends BaseAppWidget {
public static final String NAME = "app_widget_small"; public static final String NAME = "app_widget_small";
private static AppWidgetSmall mInstance; private static AppWidgetSmall mInstance;
private Target<Bitmap> target; // for cancellation private static int imageSize = 0;
private static float cardRadius = 0f;
private Target<BitmapPaletteWrapper> target; // for cancellation
public static synchronized AppWidgetSmall getInstance() { public static synchronized AppWidgetSmall getInstance() {
if (mInstance == null) { if (mInstance == null) {
@ -44,10 +49,10 @@ public class AppWidgetSmall extends BaseAppWidget {
final RemoteViews appWidgetView = new RemoteViews(context.getPackageName(), R.layout.app_widget_small); final RemoteViews appWidgetView = new RemoteViews(context.getPackageName(), R.layout.app_widget_small);
appWidgetView.setViewVisibility(R.id.media_titles, View.INVISIBLE); appWidgetView.setViewVisibility(R.id.media_titles, View.INVISIBLE);
appWidgetView.setViewVisibility(R.id.image, View.INVISIBLE); appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art);
appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, false)), 1f)); appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true)), 1f));
appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, false)), 1f)); appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true)), 1f));
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, false)), 1f)); appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(context, R.drawable.ic_play_arrow_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true)), 1f));
linkButtons(context, appWidgetView); linkButtons(context, appWidgetView);
pushUpdate(context, appWidgetIds, appWidgetView); pushUpdate(context, appWidgetIds, appWidgetView);
@ -77,20 +82,16 @@ public class AppWidgetSmall extends BaseAppWidget {
appWidgetView.setTextViewText(R.id.text, song.artistName); appWidgetView.setTextViewText(R.id.text, song.artistName);
} }
// Set correct drawable for pause state
int playPauseRes = isPlaying ? R.drawable.ic_pause_white_24dp : R.drawable.ic_play_arrow_white_24dp;
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(service, playPauseRes, MaterialValueHelper.getSecondaryTextColor(service, false)), 1f));
// Set prev/next button drawables
appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(service, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(service, false)), 1f));
appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(service, R.drawable.ic_skip_previous_white_24dp, MaterialValueHelper.getSecondaryTextColor(service, false)), 1f));
// Link actions buttons to intents // Link actions buttons to intents
linkButtons(service, appWidgetView); linkButtons(service, appWidgetView);
if (imageSize == 0)
imageSize = service.getResources().getDimensionPixelSize(R.dimen.app_widget_small_image_size);
if (cardRadius == 0f)
cardRadius = service.getResources().getDimension(R.dimen.app_widget_card_radius);
// Load the album cover async and push the update on completion // Load the album cover async and push the update on completion
final Context appContext = service.getApplicationContext(); final Context appContext = service.getApplicationContext();
final int widgetImageSize = service.getResources().getDimensionPixelSize(R.dimen.app_widget_small_image_size);
service.runOnUiThread(new Runnable() { service.runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -99,26 +100,40 @@ public class AppWidgetSmall extends BaseAppWidget {
} }
target = SongGlideRequest.Builder.from(Glide.with(appContext), song) target = SongGlideRequest.Builder.from(Glide.with(appContext), song)
.checkIgnoreMediaStore(appContext) .checkIgnoreMediaStore(appContext)
.asBitmap().build() .generatePalette(service).build()
.into(new SimpleTarget<Bitmap>(widgetImageSize, widgetImageSize) { .centerCrop()
.into(new SimpleTarget<BitmapPaletteWrapper>(imageSize, imageSize) {
@Override @Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) { public void onResourceReady(BitmapPaletteWrapper resource, GlideAnimation<? super BitmapPaletteWrapper> glideAnimation) {
update(resource); Palette palette = resource.getPalette();
update(resource.getBitmap(), palette.getVibrantColor(palette.getMutedColor(MaterialValueHelper.getSecondaryTextColor(appContext, true))));
} }
@Override @Override
public void onLoadFailed(Exception e, Drawable errorDrawable) { public void onLoadFailed(Exception e, Drawable errorDrawable) {
super.onLoadFailed(e, errorDrawable); super.onLoadFailed(e, errorDrawable);
update(null); update(null, MaterialValueHelper.getSecondaryTextColor(appContext, true));
} }
private void update(@Nullable Bitmap bitmap) { private void update(@Nullable Bitmap bitmap, int color) {
appWidgetView.setViewVisibility(R.id.image, View.VISIBLE); appWidgetView.setViewVisibility(R.id.image, View.VISIBLE);
// Set correct drawable for pause state
int playPauseRes = isPlaying ? R.drawable.ic_pause_white_24dp : R.drawable.ic_play_arrow_white_24dp;
appWidgetView.setImageViewBitmap(R.id.button_toggle_play_pause, createBitmap(Util.getTintedVectorDrawable(service, playPauseRes, color), 1f));
// Set prev/next button drawables
appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(Util.getTintedVectorDrawable(service, R.drawable.ic_skip_next_white_24dp, color), 1f));
appWidgetView.setImageViewBitmap(R.id.button_prev, createBitmap(Util.getTintedVectorDrawable(service, R.drawable.ic_skip_previous_white_24dp, color), 1f));
Drawable image;
if (bitmap == null) { if (bitmap == null) {
appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art); image = service.getResources().getDrawable(R.drawable.default_album_art);
} else { } else {
appWidgetView.setImageViewBitmap(R.id.image, bitmap); image = new BitmapDrawable(bitmap);
} }
appWidgetView.setImageViewBitmap(R.id.image, createRoundedBitmap(image, imageSize, imageSize, cardRadius, 0, 0, 0));
pushUpdate(appContext, appWidgetIds, appWidgetView); pushUpdate(appContext, appWidgetIds, appWidgetView);
} }
}); });

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> <item>
<shape> <shape>
<padding <padding
android:top="8dp" android:top="0dp"
android:right="8dp" android:right="0dp"
android:bottom="5dp" android:bottom="0dp"
android:left="8dp"/> android:left="0dp"/>
<solid android:color="@android:color/transparent"/> <solid android:color="@android:color/transparent"/>
</shape> </shape>
</item> </item>

View file

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

View file

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

View file

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

View file

@ -60,7 +60,6 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
<dimen name="mini_player_height">56dp</dimen> <dimen name="mini_player_height">56dp</dimen>
<!--App Widgets--> <!--App Widgets-->
<dimen name="app_widget_classic_height">96dp</dimen>
<dimen name="app_widget_classic_image_size">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_width">250dp</dimen>
<dimen name="app_widget_classic_min_height">40dp</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_image_size">56dp</dimen>
<dimen name="app_widget_card_min_width">250dp</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_buttons_width">128dp</dimen>
<dimen name="app_widget_card_radius">2dp</dimen> <dimen name="app_widget_card_radius">2dp</dimen>

View file

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

View file

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

View file

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

View file

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