[Android] prevent ArithmeticException

Geoffrey Métais git at videolan.org
Tue Mar 7 11:09:24 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar  7 11:09:01 2017 +0100| [7a40011d29edb147c28003242098d609464b8ae3] | committer: Geoffrey Métais

prevent ArithmeticException

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

 vlc-android/res/layout/info_activity.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/res/layout/info_activity.xml b/vlc-android/res/layout/info_activity.xml
index 4754d72..10442da 100644
--- a/vlc-android/res/layout/info_activity.xml
+++ b/vlc-android/res/layout/info_activity.xml
@@ -71,7 +71,7 @@
                 android:background="@color/transparent"
                 android:indeterminate="false"
                 android:max="100"
-                android:progress="@{(int)((long)100*item.time/item.length)}"
+                android:progress="@{item.length == 0 ? 0 : (int)((long)100*item.time/item.length)}"
                 android:secondaryProgress="100"
                 vlc:layout_constraintStart_toStartOf="parent"
                 vlc:layout_constraintEnd_toEndOf="parent"



More information about the Android mailing list