mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
fix: limits image size to prevent widget crash #172
This commit is contained in:
parent
18cd84f820
commit
9d01d2057a
1 changed files with 4 additions and 2 deletions
|
|
@ -27,6 +27,8 @@ import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
public final class WidgetUpdateManager {
|
public final class WidgetUpdateManager {
|
||||||
|
|
||||||
|
private static final int WIDGET_SAFE_ART_SIZE = 512;
|
||||||
|
|
||||||
public static void updateFromState(Context ctx,
|
public static void updateFromState(Context ctx,
|
||||||
String title,
|
String title,
|
||||||
String artist,
|
String artist,
|
||||||
|
|
@ -95,7 +97,7 @@ public final class WidgetUpdateManager {
|
||||||
CustomGlideRequest.loadAlbumArtBitmap(
|
CustomGlideRequest.loadAlbumArtBitmap(
|
||||||
appCtx,
|
appCtx,
|
||||||
coverArtId,
|
coverArtId,
|
||||||
com.cappielloantonio.tempo.util.Preferences.getImageSize(),
|
WIDGET_SAFE_ART_SIZE,
|
||||||
new CustomTarget<Bitmap>() {
|
new CustomTarget<Bitmap>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {
|
public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {
|
||||||
|
|
@ -304,4 +306,4 @@ public final class WidgetUpdateManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue