diff --git a/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt b/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt index 0d28f2f585b..d184282127f 100644 --- a/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt +++ b/app/src/main/java/org/schabi/newpipe/player/gesture/MainPlayerGestureListener.kt @@ -161,12 +161,11 @@ class MainPlayerGestureListener( } override fun onScroll( - initialEvent: MotionEvent, + initialEvent: MotionEvent?, movingEvent: MotionEvent, distanceX: Float, distanceY: Float ): Boolean { - if (!playerUi.isFullscreen) { return false } @@ -176,7 +175,7 @@ class MainPlayerGestureListener( val navigationBarHeight = getAndroidDimenPx(player.context, "navigation_bar_height") // Do not handle this event if initially it started from status or navigation bars - val isTouchingStatusBar = initialEvent.y < statusBarHeight + val isTouchingStatusBar = initialEvent!!.y < statusBarHeight val isTouchingNavigationBar = initialEvent.y > (binding.root.height - navigationBarHeight) if (isTouchingStatusBar || isTouchingNavigationBar) { return false diff --git a/app/src/main/java/org/schabi/newpipe/player/gesture/PopupPlayerGestureListener.kt b/app/src/main/java/org/schabi/newpipe/player/gesture/PopupPlayerGestureListener.kt index a540c0ab02f..d95a6f07284 100644 --- a/app/src/main/java/org/schabi/newpipe/player/gesture/PopupPlayerGestureListener.kt +++ b/app/src/main/java/org/schabi/newpipe/player/gesture/PopupPlayerGestureListener.kt @@ -167,7 +167,7 @@ class PopupPlayerGestureListener( } override fun onFling( - e1: MotionEvent, + e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float @@ -218,12 +218,11 @@ class PopupPlayerGestureListener( } override fun onScroll( - initialEvent: MotionEvent, + initialEvent: MotionEvent?, movingEvent: MotionEvent, distanceX: Float, distanceY: Float ): Boolean { - if (isResizing) { return super.onScroll(initialEvent, movingEvent, distanceX, distanceY) } @@ -234,7 +233,7 @@ class PopupPlayerGestureListener( isMoving = true - val diffX = (movingEvent.rawX - initialEvent.rawX) + val diffX = (movingEvent.rawX - initialEvent!!.rawX) val posX = MathUtils.clamp( initialPopupX + diffX, 0f, (playerUi.screenWidth - playerUi.popupLayoutParams.width).toFloat() diff --git a/app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java b/app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java index 05c2e3af6dd..3fa7c26233c 100644 --- a/app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java +++ b/app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java @@ -364,7 +364,7 @@ private void setLargeIcon(final NotificationCompat.Builder builder) { final Bitmap thumbnail = player.getThumbnail(); if (thumbnail == null || !showThumbnail) { // since the builder is reused, make sure the thumbnail is unset if there is not one - builder.setLargeIcon(null); + builder.setLargeIcon((Bitmap) null); return; } diff --git a/app/src/main/java/org/schabi/newpipe/views/player/CircleClipTapView.kt b/app/src/main/java/org/schabi/newpipe/views/player/CircleClipTapView.kt index e3d14291694..8554e71943d 100644 --- a/app/src/main/java/org/schabi/newpipe/views/player/CircleClipTapView.kt +++ b/app/src/main/java/org/schabi/newpipe/views/player/CircleClipTapView.kt @@ -80,10 +80,10 @@ class CircleClipTapView(context: Context?, attrs: AttributeSet) : View(context, updatePathShape() } - override fun onDraw(canvas: Canvas?) { + override fun onDraw(canvas: Canvas) { super.onDraw(canvas) - canvas?.clipPath(shapePath) - canvas?.drawPath(shapePath, backgroundPaint) + canvas.clipPath(shapePath) + canvas.drawPath(shapePath, backgroundPaint) } }