Improve code style
This commit is contained in:
parent
394eb92e71
commit
373ee53143
|
@ -19,8 +19,10 @@ public abstract class PlayQueueItemTouchCallback extends ItemTouchHelper.SimpleC
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int interpolateOutOfBoundsScroll(@NonNull final RecyclerView recyclerView,
|
public int interpolateOutOfBoundsScroll(@NonNull final RecyclerView recyclerView,
|
||||||
final int viewSize, final int viewSizeOutOfBounds,
|
final int viewSize,
|
||||||
final int totalSize, final long msSinceStartScroll) {
|
final int viewSizeOutOfBounds,
|
||||||
|
final int totalSize,
|
||||||
|
final long msSinceStartScroll) {
|
||||||
final int standardSpeed = super.interpolateOutOfBoundsScroll(recyclerView, viewSize,
|
final int standardSpeed = super.interpolateOutOfBoundsScroll(recyclerView, viewSize,
|
||||||
viewSizeOutOfBounds, totalSize, msSinceStartScroll);
|
viewSizeOutOfBounds, totalSize, msSinceStartScroll);
|
||||||
final int clampedAbsVelocity = MathUtils.clamp(Math.abs(standardSpeed),
|
final int clampedAbsVelocity = MathUtils.clamp(Math.abs(standardSpeed),
|
||||||
|
|
|
@ -80,10 +80,12 @@ public final class SeekbarPreviewThumbnailHelper {
|
||||||
// Resize original bitmap
|
// Resize original bitmap
|
||||||
try {
|
try {
|
||||||
final int srcWidth = srcBitmap.getWidth() > 0 ? srcBitmap.getWidth() : 1;
|
final int srcWidth = srcBitmap.getWidth() > 0 ? srcBitmap.getWidth() : 1;
|
||||||
|
final int newWidth = MathUtils.clamp(
|
||||||
// Use 1/4 of the width for the preview
|
// 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),
|
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));
|
Math.round(srcWidth * 2.5f));
|
||||||
|
|
||||||
final float scaleFactor = (float) newWidth / srcWidth;
|
final float scaleFactor = (float) newWidth / srcWidth;
|
||||||
|
|
Loading…
Reference in New Issue