diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt index 49ddc16fb..cefaa55f4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt @@ -114,10 +114,7 @@ class CloudflareInterceptor(private val context: Context) : Interceptor { latch.countDown() } - // HTTP error codes are only received since M - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && - url == origRequestUrl && !challengeFound - ) { + if (url == origRequestUrl && !challengeFound) { // The first request didn't return the challenge, abort. latch.countDown() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt index ce9fbb586..736e63b2d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt @@ -21,11 +21,9 @@ fun Router.popControllerWithTag(tag: String): Boolean { fun Controller.requestPermissionsSafe(permissions: Array, requestCode: Int) { val activity = activity ?: return - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - permissions.forEach { permission -> - if (ContextCompat.checkSelfPermission(activity, permission) != PERMISSION_GRANTED) { - requestPermissions(arrayOf(permission), requestCode) - } + permissions.forEach { permission -> + if (ContextCompat.checkSelfPermission(activity, permission) != PERMISSION_GRANTED) { + requestPermissions(arrayOf(permission), requestCode) } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index 2e5b3f9e9..c12d8aaa5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -298,23 +298,17 @@ class MangaController : fab.setOnClickListener { val item = presenter.getNextUnreadChapter() if (item != null) { - // Create animation listener - val revealAnimationListener: Animator.AnimatorListener = object : AnimatorListenerAdapter() { - override fun onAnimationStart(animation: Animator?) { - openChapter(item.chapter, true) - } - } - // Get coordinates and start animation actionFab?.getCoordinates()?.let { coordinates -> - if (!binding.revealView.showRevealEffect( - coordinates.x, - coordinates.y, - revealAnimationListener - ) - ) { - openChapter(item.chapter) - } + binding.revealView.showRevealEffect( + coordinates.x, + coordinates.y, + object : AnimatorListenerAdapter() { + override fun onAnimationStart(animation: Animator?) { + openChapter(item.chapter, true) + } + } + ) } } else { view?.context?.toast(R.string.no_next_chapter) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt index ee3e6ddb3..422db9d60 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt @@ -304,18 +304,6 @@ class MangaInfoHeaderAdapter( initialLoad = false } } - - // backgroundTint attribute doesn't work properly on Android 5 - if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { - listOf(binding.backdropOverlay, binding.mangaInfoToggleMoreScrim) - .forEach { - @Suppress("DEPRECATION") - it.background.setColorFilter( - view.context.getResourceColor(android.R.attr.colorBackground), - PorterDuff.Mode.SRC_ATOP - ) - } - } } private fun showMangaInfo(visible: Boolean) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt index 47bb095a1..9e602bda1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt @@ -67,27 +67,25 @@ class SettingsAdvancedController : SettingsController() { } } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - preference { - key = "pref_disable_battery_optimization" - titleRes = R.string.pref_disable_battery_optimization - summaryRes = R.string.pref_disable_battery_optimization_summary + preference { + key = "pref_disable_battery_optimization" + titleRes = R.string.pref_disable_battery_optimization + summaryRes = R.string.pref_disable_battery_optimization_summary - onClick { - val packageName: String = context.packageName - if (!context.powerManager.isIgnoringBatteryOptimizations(packageName)) { - try { - val intent = Intent().apply { - action = Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS - data = "package:$packageName".toUri() - } - startActivity(intent) - } catch (e: ActivityNotFoundException) { - context.toast(R.string.battery_optimization_setting_activity_not_found) + onClick { + val packageName: String = context.packageName + if (!context.powerManager.isIgnoringBatteryOptimizations(packageName)) { + try { + val intent = Intent().apply { + action = Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS + data = "package:$packageName".toUri() } - } else { - context.toast(R.string.battery_optimization_disabled) + startActivity(intent) + } catch (e: ActivityNotFoundException) { + context.toast(R.string.battery_optimization_setting_activity_not_found) } + } else { + context.toast(R.string.battery_optimization_disabled) } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/BiometricUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/BiometricUtil.kt index c7e397bef..64f734e9e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/BiometricUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/BiometricUtil.kt @@ -33,7 +33,7 @@ object BiometricUtil { * Returns whether the device is secured with a PIN, pattern or password. */ private fun isLegacySecured(context: Context): Boolean { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q) { + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q) { if (context.keyguardManager.isDeviceSecure) { return true } diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt index 8d2eea7cf..5ccbb4f7e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt @@ -54,7 +54,6 @@ abstract class WebViewClientCompat : WebViewClient() { return shouldInterceptRequestCompat(view, url) } - @TargetApi(Build.VERSION_CODES.M) final override fun onReceivedError( view: WebView, request: WebResourceRequest, @@ -78,7 +77,6 @@ abstract class WebViewClientCompat : WebViewClient() { onReceivedErrorCompat(view, errorCode, description, failingUrl, failingUrl == view.url) } - @TargetApi(Build.VERSION_CODES.M) final override fun onReceivedHttpError( view: WebView, request: WebResourceRequest, diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/ElevationAppBarLayout.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/ElevationAppBarLayout.kt index 66057589f..dbaa58449 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/ElevationAppBarLayout.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/ElevationAppBarLayout.kt @@ -20,12 +20,7 @@ class ElevationAppBarLayout @JvmOverloads constructor( } fun enableElevation(liftOnScroll: Boolean) { - if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { - // Delay to avoid crash - post { setElevation(liftOnScroll) } - } else { - setElevation(liftOnScroll) - } + setElevation(liftOnScroll) } private fun setElevation(liftOnScroll: Boolean) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/RevealAnimationView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/RevealAnimationView.kt index 8201d3b4a..6bd1546f1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/RevealAnimationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/RevealAnimationView.kt @@ -49,10 +49,8 @@ class RevealAnimationView @JvmOverloads constructor(context: Context, attrs: Att * @param centerX x starting point * @param centerY y starting point * @param listener animation listener - * - * @return sdk version lower then 21 */ - fun showRevealEffect(centerX: Int, centerY: Int, listener: Animator.AnimatorListener): Boolean { + fun showRevealEffect(centerX: Int, centerY: Int, listener: Animator.AnimatorListener) { this.isVisible = true val height = this.height @@ -71,6 +69,5 @@ class RevealAnimationView @JvmOverloads constructor(context: Context, attrs: Att anim.addListener(listener) anim.start() - return true } } diff --git a/app/src/main/res/values-v23/themes.xml b/app/src/main/res/values-v23/themes.xml deleted file mode 100644 index 49f3e5ea6..000000000 --- a/app/src/main/res/values-v23/themes.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - -