1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-01-11 01:40:59 +00:00

Fix some version checks to use android.os.Build

This commit is contained in:
TacoTheDank 2020-10-31 15:54:02 -04:00
parent 008eb5ba4a
commit 1e1fb32558
3 changed files with 5 additions and 5 deletions

View File

@ -186,7 +186,7 @@ public final class Localization {
} }
public static String shortCount(final Context context, final long count) { public static String shortCount(final Context context, final long count) {
if (Build.VERSION.SDK_INT >= 24) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return CompactDecimalFormat.getInstance(getAppLocale(context), return CompactDecimalFormat.getInstance(getAppLocale(context),
CompactDecimalFormat.CompactStyle.SHORT).format(count); CompactDecimalFormat.CompactStyle.SHORT).format(count);
} }

View File

@ -1,8 +1,7 @@
package org.schabi.newpipe.views; package org.schabi.newpipe.views;
import android.content.Context; import android.content.Context;
import android.os.Build.VERSION; import android.os.Build;
import android.os.Build.VERSION_CODES;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.SurfaceView; import android.view.SurfaceView;
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout; import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
@ -47,7 +46,8 @@ public class ExpandableSurfaceView extends SurfaceView {
if (resizeMode == RESIZE_MODE_FIT if (resizeMode == RESIZE_MODE_FIT
// KitKat doesn't work well when a view has a scale like needed for ZOOM // KitKat doesn't work well when a view has a scale like needed for ZOOM
|| (resizeMode == RESIZE_MODE_ZOOM && VERSION.SDK_INT < VERSION_CODES.LOLLIPOP)) { || (resizeMode == RESIZE_MODE_ZOOM
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)) {
if (aspectDeformation > 0) { if (aspectDeformation > 0) {
height = (int) (width / videoAspectRatio); height = (int) (width / videoAspectRatio);
} else { } else {

View File

@ -270,7 +270,7 @@ public final class FocusOverlayView extends Drawable implements
clearFocusObstacles((ViewGroup) decor); clearFocusObstacles((ViewGroup) decor);
} }
@RequiresApi(api = 26) @RequiresApi(api = Build.VERSION_CODES.O)
private static void clearFocusObstacles(final ViewGroup viewGroup) { private static void clearFocusObstacles(final ViewGroup viewGroup) {
viewGroup.setTouchscreenBlocksFocus(false); viewGroup.setTouchscreenBlocksFocus(false);