From f3b458c803eb1f565d5d16913d37e26cd95992fc Mon Sep 17 00:00:00 2001 From: Isira Seneviratne <31027858+isira-seneviratne@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:31:16 -0400 Subject: [PATCH] Bump compileSdk to 34 --- app/build.gradle | 2 +- .../newpipe/player/gesture/MainPlayerGestureListener.kt | 5 ++--- .../newpipe/player/gesture/PopupPlayerGestureListener.kt | 7 +++++-- .../newpipe/player/notification/NotificationUtil.java | 2 +- .../org/schabi/newpipe/views/player/CircleClipTapView.kt | 6 +++--- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 131bcaf0f..d6b49f232 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,7 +12,7 @@ plugins { } android { - compileSdk 33 + compileSdk 34 namespace 'org.schabi.newpipe' defaultConfig { 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 8acd70413..ff0bb269d 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 @@ -160,13 +160,12 @@ class MainPlayerGestureListener( } override fun onScroll( - initialEvent: MotionEvent, + initialEvent: MotionEvent?, movingEvent: MotionEvent, distanceX: Float, distanceY: Float ): Boolean { - - if (!playerUi.isFullscreen) { + if (initialEvent == null || !playerUi.isFullscreen) { 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 23edcaeb8..0b94bf364 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,11 +218,14 @@ class PopupPlayerGestureListener( } override fun onScroll( - initialEvent: MotionEvent, + initialEvent: MotionEvent?, movingEvent: MotionEvent, distanceX: Float, distanceY: Float ): Boolean { + if (initialEvent == null) { + return false + } if (isResizing) { return super.onScroll(initialEvent, movingEvent, distanceX, distanceY) 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 05c2e3af6..3fa7c2623 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 @@ public final class NotificationUtil { 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 e3d142916..8554e7194 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) } }