[Android] Fix variable declaration redundancies

Nicolas Pomepuy git at videolan.org
Mon Nov 14 09:54:16 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Nov  4 09:13:33 2022 +0100| [e0f50d6bea02dd6c2485c8358ca20b8acfb284f8] | committer: Nicolas Pomepuy

Fix variable declaration redundancies

> https://code.videolan.org/videolan/vlc-android/commit/e0f50d6bea02dd6c2485c8358ca20b8acfb284f8
---

 .../vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.kt      | 2 +-
 .../vlc-android/src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt  | 2 +-
 application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt        | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.kt
index 6943db3e4..5dc79d301 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/TalkbackUtil.kt
@@ -79,7 +79,7 @@ object TalkbackUtil {
 
     fun getDir(context: Context, folder: MediaLibraryItem, favorite: Boolean): String {
         if (folder !is MediaWrapper) return context.getString(R.string.talkback_folder, folder.title)
-        var text = ""
+        var text: String
         if (folder.type == MediaWrapper.TYPE_DIR) {
             val folders = folder.description?.getFolderNumber() ?: 0
             val files = folder.description?.getFilesNumber() ?: 0
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt
index 26fb41f98..6e464b29f 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoDelayDelegate.kt
@@ -132,7 +132,7 @@ class VideoDelayDelegate(private val player: VideoPlayerActivity) : View.OnClick
     private fun initPlaybackSettingInfo() {
         player.overlayDelegate.initInfoOverlay()
         delayContainer.setVisible()
-        var text = ""
+        val text: String
         val title = when (playbackSetting) {
             IPlaybackSettingsController.DelayState.AUDIO -> {
                 text = "${player.service!!.audioDelay / 1000L} ms"
diff --git a/application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt b/application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt
index 0330f1046..f987a9f53 100644
--- a/application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt
+++ b/application/vlc-android/src/org/videolan/vlc/util/FileUtils.kt
@@ -274,7 +274,7 @@ object FileUtils {
         runIO(Runnable {
             if (!fileOrDirectory.exists() || !fileOrDirectory.canWrite())
                 return at Runnable
-            var success = true
+            val success: Boolean
             if (fileOrDirectory.isDirectory) {
                 for (child in fileOrDirectory.listFiles())
                     asyncRecursiveDelete(child, null)
@@ -483,7 +483,7 @@ object FileUtils {
     const val BUFFER = 2048
     fun zip(files: Array<String>, zipFileName: String):Boolean {
         return try {
-            var origin: BufferedInputStream? = null
+            var origin: BufferedInputStream?
             val dest = FileOutputStream(zipFileName)
             val out = ZipOutputStream(BufferedOutputStream(
                     dest))



More information about the Android mailing list