From 899bb822a56237915b5c17470cd1c6d7fa8a1728 Mon Sep 17 00:00:00 2001 From: Krzysztof Moch Date: Wed, 7 Aug 2024 14:39:41 +0200 Subject: [PATCH] fix(android): build warnings (#4058) --- .../src/main/java/com/brentvatne/common/api/ResizeMode.kt | 5 ++--- .../java/com/brentvatne/common/react/VideoEventEmitter.kt | 4 ++-- .../src/main/java/com/brentvatne/react/VideoManagerModule.kt | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/com/brentvatne/common/api/ResizeMode.kt b/android/src/main/java/com/brentvatne/common/api/ResizeMode.kt index c873a04e..18f35d94 100644 --- a/android/src/main/java/com/brentvatne/common/api/ResizeMode.kt +++ b/android/src/main/java/com/brentvatne/common/api/ResizeMode.kt @@ -1,8 +1,7 @@ package com.brentvatne.common.api import androidx.annotation.IntDef -import java.lang.annotation.Retention -import java.lang.annotation.RetentionPolicy +import kotlin.annotation.Retention internal object ResizeMode { /** @@ -42,7 +41,7 @@ internal object ResizeMode { else -> RESIZE_MODE_FIT } - @Retention(RetentionPolicy.SOURCE) + @Retention(AnnotationRetention.SOURCE) @IntDef( RESIZE_MODE_FIT, RESIZE_MODE_FIXED_WIDTH, diff --git a/android/src/main/java/com/brentvatne/common/react/VideoEventEmitter.kt b/android/src/main/java/com/brentvatne/common/react/VideoEventEmitter.kt index b227bfc1..91c3a06d 100644 --- a/android/src/main/java/com/brentvatne/common/react/VideoEventEmitter.kt +++ b/android/src/main/java/com/brentvatne/common/react/VideoEventEmitter.kt @@ -209,7 +209,7 @@ class VideoEventEmitter { putArray( "metadata", Arguments.createArray().apply { - metadataArrayList.forEachIndexed { i, metadata -> + metadataArrayList.forEachIndexed { _, metadata -> pushMap( Arguments.createMap().apply { putString("identifier", metadata.identifier) @@ -303,7 +303,7 @@ class VideoEventEmitter { private fun videoTracksToArray(videoTracks: java.util.ArrayList?): WritableArray = Arguments.createArray().apply { - videoTracks?.forEachIndexed { i, vTrack -> + videoTracks?.forEachIndexed { _, vTrack -> pushMap( Arguments.createMap().apply { putInt("width", vTrack.width) diff --git a/android/src/main/java/com/brentvatne/react/VideoManagerModule.kt b/android/src/main/java/com/brentvatne/react/VideoManagerModule.kt index 1e624e7c..f6c0affe 100644 --- a/android/src/main/java/com/brentvatne/react/VideoManagerModule.kt +++ b/android/src/main/java/com/brentvatne/react/VideoManagerModule.kt @@ -42,6 +42,7 @@ class VideoManagerModule(reactContext: ReactApplicationContext?) : ReactContextB } @ReactMethod + @Suppress("UNUSED_PARAMETER") // codegen compatibility fun seekCmd(reactTag: Int, time: Float, tolerance: Float) { performOnPlayerView(reactTag) { it?.seekTo((time * 1000f).roundToInt().toLong())