[Android] VLC progress: fix float casting

Geoffrey Métais git at videolan.org
Thu Aug 8 13:53:41 CEST 2019


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Aug  1 16:46:50 2019 +0200| [2aefd25b165a7ccc352d8bdc54128f6e2732b821] | committer: Geoffrey Métais

VLC progress: fix float casting

(cherry picked from commit f56a376006dec20bcca567e2490a9db3888f14a2)

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

 vlc-android/src/org/videolan/vlc/gui/dialogs/VlcProgressDialog.kt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/VlcProgressDialog.kt b/vlc-android/src/org/videolan/vlc/gui/dialogs/VlcProgressDialog.kt
index de4a980f3..848c2d7dc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/VlcProgressDialog.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/VlcProgressDialog.kt
@@ -37,8 +37,8 @@ class VlcProgressDialog : VlcDialog<Dialog.ProgressDialog, VlcProgressDialogBind
         get() = R.layout.vlc_progress_dialog
 
     fun updateProgress() {
-        binding.progress.progress = (vlcDialog.position * 100) as Int
+        binding.progress.progress = (vlcDialog.position * 100f).toInt()
         binding.cancel.text = vlcDialog.cancelText
-        binding.cancel.visibility = if (TextUtils.isEmpty(vlcDialog?.cancelText)) View.GONE else View.VISIBLE
+        binding.cancel.visibility = if (TextUtils.isEmpty(vlcDialog.cancelText)) View.GONE else View.VISIBLE
     }
 }



More information about the Android mailing list