Skip to content

Commit

Permalink
Fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Sep 18, 2023
1 parent 9d88bb2 commit 0969129
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class PopupPlayerGestureListener(
}

override fun onFling(
e1: MotionEvent,
e1: MotionEvent?,
e2: MotionEvent,
velocityX: Float,
velocityY: Float
Expand Down Expand Up @@ -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)
}
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 0969129

Please sign in to comment.