Made notification thumbnail smaller

This commit is contained in:
Avently 2020-09-23 15:20:25 +03:00
parent 5b8eda4805
commit c843e77183
2 changed files with 10 additions and 2 deletions

View File

@ -497,12 +497,19 @@ public abstract class BasePlayer implements
@Override @Override
public void onLoadingComplete(final String imageUri, final View view, public void onLoadingComplete(final String imageUri, final View view,
final Bitmap loadedImage) { final Bitmap loadedImage) {
final float width = Math.min(
context.getResources().getDimension(R.dimen.player_notification_thumbnail_width),
loadedImage.getWidth());
currentThumbnail = Bitmap.createScaledBitmap(loadedImage,
(int) width,
(int) (loadedImage.getHeight() / (loadedImage.getWidth() / width)), true);
if (DEBUG) { if (DEBUG) {
Log.d(TAG, "Thumbnail - onLoadingComplete() called with: " Log.d(TAG, "Thumbnail - onLoadingComplete() called with: "
+ "imageUri = [" + imageUri + "], view = [" + view + "], " + "imageUri = [" + imageUri + "], view = [" + view + "], "
+ "loadedImage = [" + loadedImage + "]"); + "loadedImage = [" + loadedImage + "], "
+ loadedImage.getWidth() + "x" + loadedImage.getHeight()
+ ", scaled width = " + width);
} }
currentThumbnail = loadedImage;
} }
@Override @Override

View File

@ -48,6 +48,7 @@
<dimen name="player_main_buttons_padding">6dp</dimen> <dimen name="player_main_buttons_padding">6dp</dimen>
<dimen name="player_popup_buttons_padding">1dp</dimen> <dimen name="player_popup_buttons_padding">1dp</dimen>
<dimen name="player_main_buttons_min_width">40dp</dimen> <dimen name="player_main_buttons_min_width">40dp</dimen>
<dimen name="player_notification_thumbnail_width">200dp</dimen>
<!-- Miscellaneous --> <!-- Miscellaneous -->
<dimen name="popup_default_width">180dp</dimen> <dimen name="popup_default_width">180dp</dimen>