s/portrait/vertical/

This commit is contained in:
Adrian Ulrich 2020-09-01 09:18:14 +02:00
parent 99946b12e7
commit d3453032b7

View File

@ -225,8 +225,8 @@ public final class CoverBitmap {
int colors[] = ThemeHelper.getDefaultCoverColors(context); int colors[] = ThemeHelper.getDefaultCoverColors(context);
// inverted cover background color. // inverted cover background color.
int textColor = 0xFF000000 + (0xFFFFFF - (colors[0] & 0xFFFFFF)); int textColor = 0xFF000000 + (0xFFFFFF - (colors[0] & 0xFFFFFF));
// Whether or not the image is rendered in portrait mode. // Whether or not the image is rendered in vertical mode.
boolean portraitMode = width > height; boolean verticalMode = width > height;
// Prepare text and calculate minimum height, so we can ensure // Prepare text and calculate minimum height, so we can ensure
// that the cover doesn't 'eat' into it. // that the cover doesn't 'eat' into it.
@ -236,7 +236,7 @@ public final class CoverBitmap {
// Space required to draw the bottom text. // Space required to draw the bottom text.
int textTotalHeight = padding + textSizeBig + (padding+textSize) * 2 + padding; int textTotalHeight = padding + textSizeBig + (padding+textSize) * 2 + padding;
// Y coord where text shall be placed. // Y coord where text shall be placed.
int textStart = (portraitMode ? (height-textTotalHeight)/2 : height - bottomPadding - textTotalHeight); int textStart = (verticalMode ? (height-textTotalHeight)/2 : height - bottomPadding - textTotalHeight);
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap); Canvas canvas = new Canvas(bitmap);
@ -250,7 +250,7 @@ public final class CoverBitmap {
if (cover != null) { if (cover != null) {
Bitmap scaled; Bitmap scaled;
if (portraitMode) { if (verticalMode) {
int hh = height/2; int hh = height/2;
int hw = width/2; int hw = width/2;
scaled = createScaledBitmap(cover, Math.min(hw, height), Math.min(hw, height)); scaled = createScaledBitmap(cover, Math.min(hw, height), Math.min(hw, height));
@ -270,7 +270,7 @@ public final class CoverBitmap {
paint.setAntiAlias(true); paint.setAntiAlias(true);
// how much to shift text to the right forcefully. // how much to shift text to the right forcefully.
int tshift = (portraitMode ? width/2 : 0); int tshift = (verticalMode ? width/2 : 0);
// Title // Title
paint.setColorFilter(filter); paint.setColorFilter(filter);
paint.setTextSize(textSizeBig); paint.setTextSize(textSizeBig);