Commit 1f7b88a7 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

VideoGridFragment: do all the computation in float

parent a0d51ff4
......@@ -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());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment