Code improvements

This commit is contained in:
TobiGr 2020-01-02 15:00:22 +01:00
parent 1aa763e86c
commit 718acb5059
2 changed files with 4 additions and 11 deletions

View file

@ -50,15 +50,8 @@ public class MediaSessionManager {
} }
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void setLockScreenArt( public void setLockScreenArt(NotificationCompat.Builder builder, @Nullable Bitmap thumbnailBitmap) {
NotificationCompat.Builder builder, if (thumbnailBitmap == null || !mediaSession.isActive()) {
@Nullable Bitmap thumbnailBitmap
) {
if (thumbnailBitmap == null) {
return;
}
if (!mediaSession.isActive()) {
return; return;
} }

View file

@ -22,11 +22,11 @@ public class BitmapUtils {
float newYScale; float newYScale;
if (yScale > xScale) { if (yScale > xScale) {
newXScale = (1.0f / yScale) * xScale; newXScale = xScale / yScale;
newYScale = 1.0f; newYScale = 1.0f;
} else { } else {
newXScale = 1.0f; newXScale = 1.0f;
newYScale = (1.0f / xScale) * yScale; newYScale = yScale / xScale;
} }
float scaledWidth = newXScale * sourceWidth; float scaledWidth = newXScale * sourceWidth;