mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-06 03:50:22 +02:00
Use Math.floorDiv().
This commit is contained in:
parent
95a65d5704
commit
feb03f7e30
4 changed files with 7 additions and 9 deletions
|
@ -215,8 +215,7 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I>
|
|||
final Resources resources = activity.getResources();
|
||||
int width = resources.getDimensionPixelSize(R.dimen.video_item_grid_thumbnail_image_width);
|
||||
width += (24 * resources.getDisplayMetrics().density);
|
||||
final int spanCount = (int) Math.floor(resources.getDisplayMetrics().widthPixels
|
||||
/ (double) width);
|
||||
final int spanCount = Math.floorDiv(resources.getDisplayMetrics().widthPixels, width);
|
||||
final GridLayoutManager lm = new GridLayoutManager(activity, spanCount);
|
||||
lm.setSpanSizeLookup(infoListAdapter.getSpanSizeLookup(spanCount));
|
||||
return lm;
|
||||
|
|
|
@ -104,8 +104,7 @@ public abstract class BaseLocalListFragment<I, N> extends BaseStateFragment<I>
|
|||
final Resources resources = activity.getResources();
|
||||
int width = resources.getDimensionPixelSize(R.dimen.video_item_grid_thumbnail_image_width);
|
||||
width += (24 * resources.getDisplayMetrics().density);
|
||||
final int spanCount = (int) Math.floor(resources.getDisplayMetrics().widthPixels
|
||||
/ (double) width);
|
||||
final int spanCount = Math.floorDiv(resources.getDisplayMetrics().widthPixels, width);
|
||||
final GridLayoutManager lm = new GridLayoutManager(activity, spanCount);
|
||||
lm.setSpanSizeLookup(itemListAdapter.getSpanSizeLookup(spanCount));
|
||||
return lm;
|
||||
|
|
|
@ -652,7 +652,7 @@ public class WebMWriter implements Closeable {
|
|||
|
||||
final int offset = withLength ? 1 : 0;
|
||||
final byte[] buffer = new byte[offset + length];
|
||||
final long marker = (long) Math.floor((length - 1f) / 8f);
|
||||
final long marker = Math.floorDiv(length - 1, 8);
|
||||
|
||||
int shift = 0;
|
||||
for (int i = length - 1; i >= 0; i--, shift += 8) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue