1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 19:12:45 +01:00

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
public void onLoadingComplete(final String imageUri, final View view,
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) {
Log.d(TAG, "Thumbnail - onLoadingComplete() called with: "
+ "imageUri = [" + imageUri + "], view = [" + view + "], "
+ "loadedImage = [" + loadedImage + "]");
+ "loadedImage = [" + loadedImage + "], "
+ loadedImage.getWidth() + "x" + loadedImage.getHeight()
+ ", scaled width = " + width);
}
currentThumbnail = loadedImage;
}
@Override

View File

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