Delete obsolete sdk version checks

This commit is contained in:
TacoTheDank 2020-05-31 02:15:53 -04:00
parent 6fc3aed810
commit d6a60ba638
6 changed files with 3 additions and 27 deletions

View File

@ -47,14 +47,9 @@ public final class ViewSupport {
}
}
@SuppressWarnings("deprecation")
public static void setBackground(final View view, final Drawable background) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
view.setBackgroundDrawable(background);
} else {
ViewAccessorJB.setBackground(view, background);
}
}
public static void setButtonTintList(CompoundButton view, ColorStateList list) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return;
@ -130,7 +125,6 @@ public final class ViewSupport {
}
static void setBackground(final View view, final Drawable background) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
view.setBackground(background);
}
}

View File

@ -29,14 +29,12 @@ public class WebSettingsSupport {
}
public static void setAllowUniversalAccessFromFileURLs(final WebSettings settings, final boolean flag) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
WebSettingsAccessorSDK16.setAllowUniversalAccessFromFileURLs(settings, flag);
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private static class WebSettingsAccessorSDK16 {
private static void setAllowUniversalAccessFromFileURLs(final WebSettings settings, final boolean flag) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
settings.setAllowUniversalAccessFromFileURLs(flag);
}
}

View File

@ -451,11 +451,7 @@ class MediaViewerActivity : BaseActivity(), IMediaViewerActivity, MediaSwipeClos
}
private fun instantiateMediaViewerFragment(args: Bundle): MediaViewerFragment {
return if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
Fragment.instantiate(this, VideoPageFragment::class.java.name, args) as MediaViewerFragment
} else {
Fragment.instantiate(this, ExoPlayerPageFragment::class.java.name, args) as MediaViewerFragment
}
return Fragment.instantiate(this, ExoPlayerPageFragment::class.java.name, args) as MediaViewerFragment
}
private fun processShareIntent(intent: Intent) {

View File

@ -204,7 +204,6 @@ class ExoPlayerPageFragment : MediaViewerFragment(), IBaseFragment<ExoPlayerPage
playerView.useController = !isControlDisabled
playerView.controllerShowTimeoutMs = 0
playerView.setOnSystemUiVisibilityChangeListener {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return@setOnSystemUiVisibilityChangeListener
val visible = MediaViewerActivity.FLAG_SYSTEM_UI_HIDE_BARS !in
requireActivity().window.decorView.systemUiVisibility
if (visible) {

View File

@ -118,11 +118,7 @@ object Utils {
// events. Jelly Bean (SDK 16) added support for speaking text verbatim
// using the ANNOUNCEMENT event type.
val eventType: Int
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
eventType = AccessibilityEvent.TYPE_VIEW_FOCUSED
} else {
eventType = AccessibilityEventCompat.TYPE_ANNOUNCEMENT
}
// Construct an accessibility event with the minimum recommended
// attributes. An event without a class name or package may be dropped.
@ -213,7 +209,6 @@ object Utils {
}
fun isComposeNowSupported(context: Context): Boolean {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return false
return hasNavBar(context)
}

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="has_font_family">true</bool>
</resources>