remove hardcoded padding

This commit is contained in:
Adrian Ulrich 2020-08-30 16:02:58 +02:00
parent 7b4753150d
commit 8856693a7b

@ -311,7 +311,6 @@ public final class CoverView extends View implements Handler.Callback {
int height = getHeight();
int x = 0;
int scrollX = mScrollX;
double padding = -14 * sDensity;
boolean snapshot = !mScroller.isFinished();
Bitmap bitmap;
@ -319,7 +318,7 @@ public final class CoverView extends View implements Handler.Callback {
bitmap = snapshot ? mBitmapBucket.getSnapshot(i) : mBitmapBucket.getBitmap(i);
if (bitmap != null && scrollX + width > x && scrollX < x + width) {
final int xOffset = (width - bitmap.getWidth()) / 2;
final int yOffset = (int)(padding + (height - bitmap.getHeight()) / 2);
final int yOffset = (int)(height - bitmap.getHeight()) / 2;
canvas.drawBitmap(bitmap, x + xOffset - scrollX, yOffset, null);
}
x += width;