[Android] Fix casting for division

Geoffrey Métais git at videolan.org
Wed Feb 18 13:42:34 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Feb 18 13:37:11 2015 +0100| [b67e407c649bd6572441261095b446e676b864a8] | committer: Geoffrey Métais

Fix casting for division

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=b67e407c649bd6572441261095b446e676b864a8
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 991fc7a..e49bfd1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -244,7 +244,7 @@ public class VideoGridFragment extends BrowserFragment implements ISortable, IVi
         // Compute the left/right padding dynamically
         DisplayMetrics outMetrics = new DisplayMetrics();
         getActivity().getWindowManager().getDefaultDisplay().getMetrics(outMetrics);
-        int sidePadding = (int) (outMetrics.widthPixels / 100. * Math.pow(outMetrics.density, 3) / 2.);
+        int sidePadding = (int) ((float)outMetrics.widthPixels / 100f * (float)Math.pow(outMetrics.density, 3) / 2f);
         sidePadding = Math.max(0, Math.min(100, sidePadding));
         mGridView.setPadding(sidePadding, mGridView.getPaddingTop(),
                 sidePadding, mGridView.getPaddingBottom());



More information about the Android mailing list