From c4bf92a49fc12af4aab4ae583ccba3aae175c4d1 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Wed, 17 Aug 2022 12:16:26 +0200 Subject: [PATCH] Fix Kotlin compilation errors from incorrect overloading of null-safe types --- .../emu/skyline/input/onscreen/OnScreenControllerView.kt | 4 ++-- .../main/java/emu/skyline/utils/ByteBufferSerializable.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/emu/skyline/input/onscreen/OnScreenControllerView.kt b/app/src/main/java/emu/skyline/input/onscreen/OnScreenControllerView.kt index f6b28f2f..9b581589 100644 --- a/app/src/main/java/emu/skyline/input/onscreen/OnScreenControllerView.kt +++ b/app/src/main/java/emu/skyline/input/onscreen/OnScreenControllerView.kt @@ -150,13 +150,13 @@ class OnScreenControllerView @JvmOverloads constructor(context : Context, attrs invalidate() } addListener(object : AnimatorListenerAdapter() { - override fun onAnimationCancel(animation : Animator?) { + override fun onAnimationCancel(animation : Animator) { super.onAnimationCancel(animation) onAnimationEnd(animation) onStickStateChangedListener?.invoke(joystick.stickId, PointF(0f, 0f)) } - override fun onAnimationEnd(animation : Animator?) { + override fun onAnimationEnd(animation : Animator) { super.onAnimationEnd(animation) if (joystick.shortDoubleTapped) onButtonStateChangedListener?.invoke(joystick.buttonId, ButtonState.Released) diff --git a/app/src/main/java/emu/skyline/utils/ByteBufferSerializable.kt b/app/src/main/java/emu/skyline/utils/ByteBufferSerializable.kt index db3935e0..d272fff6 100644 --- a/app/src/main/java/emu/skyline/utils/ByteBufferSerializable.kt +++ b/app/src/main/java/emu/skyline/utils/ByteBufferSerializable.kt @@ -52,9 +52,9 @@ interface ByteBufferSerializable : Parcelable { return 0 } - override fun writeToParcel(out : Parcel?, flags : Int) { - out?.writeString(this.javaClass.name) - out?.writeByteArray(this.writeToByteBuffer(ByteBuffer.allocate(ByteBufferSerializationData.getSerializationData(this::class).bytes)).array()) + override fun writeToParcel(out : Parcel, flags : Int) { + out.writeString(this.javaClass.name) + out.writeByteArray(this.writeToByteBuffer(ByteBuffer.allocate(ByteBufferSerializationData.getSerializationData(this::class).bytes)).array()) } class ParcelableCreator : Parcelable.ClassLoaderCreator {