Improve code style

This commit is contained in:
Stypox 2022-07-20 15:05:25 +02:00 committed by GitHub
parent 394eb92e71
commit 373ee53143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -19,8 +19,10 @@ public abstract class PlayQueueItemTouchCallback extends ItemTouchHelper.SimpleC
@Override
public int interpolateOutOfBoundsScroll(@NonNull final RecyclerView recyclerView,
final int viewSize, final int viewSizeOutOfBounds,
final int totalSize, final long msSinceStartScroll) {
final int viewSize,
final int viewSizeOutOfBounds,
final int totalSize,
final long msSinceStartScroll) {
final int standardSpeed = super.interpolateOutOfBoundsScroll(recyclerView, viewSize,
viewSizeOutOfBounds, totalSize, msSinceStartScroll);
final int clampedAbsVelocity = MathUtils.clamp(Math.abs(standardSpeed),

View File

@ -80,10 +80,12 @@ public final class SeekbarPreviewThumbnailHelper {
// Resize original bitmap
try {
final int srcWidth = srcBitmap.getWidth() > 0 ? srcBitmap.getWidth() : 1;
final int newWidth = MathUtils.clamp(
// Use 1/4 of the width for the preview
final int newWidth = MathUtils.clamp(Math.round(baseViewWidthSupplier.getAsInt() / 4f),
Math.round(baseViewWidthSupplier.getAsInt() / 4f),
// But have a min width of 10dp
DeviceUtils.dpToPx(10, context),
// Scaling more than that factor looks really pixelated -> max
// And scaling more than that factor looks really pixelated -> max
Math.round(srcWidth * 2.5f));
final float scaleFactor = (float) newWidth / srcWidth;