[Android] VideoGridFragment: do all the computation in float
Jean-Baptiste Kempf
git at videolan.org
Fri Jul 18 21:32:13 CEST 2014
vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jul 18 21:31:14 2014 +0200| [1f7b88a7fe115303405a7123bb60c96a4527aca8] | committer: Jean-Baptiste Kempf
VideoGridFragment: do all the computation in float
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=1f7b88a7fe115303405a7123bb60c96a4527aca8
---
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 bec35cd..7f03e2c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -230,7 +230,7 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
// 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) (outMetrics.widthPixels / 100. * Math.pow(outMetrics.density, 3) / 2.);
sidePadding = Math.max(0, Math.min(100, sidePadding));
mGridView.setPadding(sidePadding, mGridView.getPaddingTop(),
sidePadding, mGridView.getPaddingBottom());
More information about the Android
mailing list