Fix Kotlin compilation errors from incorrect overloading of null-safe types

This commit is contained in:
lynxnb 2022-08-17 12:16:26 +02:00
parent bf491f71f9
commit c4bf92a49f
2 changed files with 5 additions and 5 deletions

View File

@ -150,13 +150,13 @@ class OnScreenControllerView @JvmOverloads constructor(context : Context, attrs
invalidate() invalidate()
} }
addListener(object : AnimatorListenerAdapter() { addListener(object : AnimatorListenerAdapter() {
override fun onAnimationCancel(animation : Animator?) { override fun onAnimationCancel(animation : Animator) {
super.onAnimationCancel(animation) super.onAnimationCancel(animation)
onAnimationEnd(animation) onAnimationEnd(animation)
onStickStateChangedListener?.invoke(joystick.stickId, PointF(0f, 0f)) onStickStateChangedListener?.invoke(joystick.stickId, PointF(0f, 0f))
} }
override fun onAnimationEnd(animation : Animator?) { override fun onAnimationEnd(animation : Animator) {
super.onAnimationEnd(animation) super.onAnimationEnd(animation)
if (joystick.shortDoubleTapped) if (joystick.shortDoubleTapped)
onButtonStateChangedListener?.invoke(joystick.buttonId, ButtonState.Released) onButtonStateChangedListener?.invoke(joystick.buttonId, ButtonState.Released)

View File

@ -52,9 +52,9 @@ interface ByteBufferSerializable : Parcelable {
return 0 return 0
} }
override fun writeToParcel(out : Parcel?, flags : Int) { override fun writeToParcel(out : Parcel, flags : Int) {
out?.writeString(this.javaClass.name) out.writeString(this.javaClass.name)
out?.writeByteArray(this.writeToByteBuffer(ByteBuffer.allocate(ByteBufferSerializationData.getSerializationData(this::class).bytes)).array()) out.writeByteArray(this.writeToByteBuffer(ByteBuffer.allocate(ByteBufferSerializationData.getSerializationData(this::class).bytes)).array())
} }
class ParcelableCreator : Parcelable.ClassLoaderCreator<ByteBufferSerializable> { class ParcelableCreator : Parcelable.ClassLoaderCreator<ByteBufferSerializable> {