Require Android 8+
Given that the next stable version of Chrome (120) will require Android 8+, it's inevitable that the WebView functionality will gradually break. As always, newer OS versions are recommended for better support with evolving Internet technologies. According to https://apilevels.com/, Android 8+ still covers 93.7% of Android users.
This commit is contained in:
@@ -2,7 +2,6 @@ package eu.kanade.presentation.manga.components
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Row
|
||||
@@ -176,14 +175,9 @@ fun MangaCoverDialog(
|
||||
// Copy bitmap in case it came from memory cache
|
||||
// Because SSIV needs to thoroughly read the image
|
||||
val copy = (drawable as? BitmapDrawable)?.let {
|
||||
val config = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
Bitmap.Config.HARDWARE
|
||||
} else {
|
||||
Bitmap.Config.ARGB_8888
|
||||
}
|
||||
BitmapDrawable(
|
||||
view.context.resources,
|
||||
it.bitmap.copy(config, false),
|
||||
it.bitmap.copy(Bitmap.Config.HARDWARE, false),
|
||||
)
|
||||
} ?: drawable
|
||||
view.setImage(copy, ReaderPageImageView.Config(zoomDuration = 500))
|
||||
|
||||
@@ -3,7 +3,6 @@ package eu.kanade.presentation.more.settings.screen
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.provider.Settings
|
||||
import android.webkit.WebStorage
|
||||
import android.webkit.WebView
|
||||
@@ -81,62 +80,50 @@ object SettingsAdvancedScreen : SearchableSettings {
|
||||
val basePreferences = remember { Injekt.get<BasePreferences>() }
|
||||
val networkPreferences = remember { Injekt.get<NetworkPreferences>() }
|
||||
|
||||
return buildList {
|
||||
addAll(
|
||||
listOf(
|
||||
Preference.PreferenceItem.SwitchPreference(
|
||||
pref = basePreferences.acraEnabled(),
|
||||
title = stringResource(R.string.pref_enable_acra),
|
||||
subtitle = stringResource(R.string.pref_acra_summary),
|
||||
enabled = isPreviewBuildType || isReleaseBuildType,
|
||||
),
|
||||
Preference.PreferenceItem.TextPreference(
|
||||
title = stringResource(R.string.pref_dump_crash_logs),
|
||||
subtitle = stringResource(R.string.pref_dump_crash_logs_summary),
|
||||
onClick = {
|
||||
scope.launch {
|
||||
CrashLogUtil(context).dumpLogs()
|
||||
}
|
||||
},
|
||||
),
|
||||
Preference.PreferenceItem.SwitchPreference(
|
||||
pref = networkPreferences.verboseLogging(),
|
||||
title = stringResource(R.string.pref_verbose_logging),
|
||||
subtitle = stringResource(R.string.pref_verbose_logging_summary),
|
||||
onValueChanged = {
|
||||
context.toast(R.string.requires_app_restart)
|
||||
true
|
||||
},
|
||||
),
|
||||
Preference.PreferenceItem.TextPreference(
|
||||
title = stringResource(R.string.pref_debug_info),
|
||||
onClick = { navigator.push(DebugInfoScreen()) },
|
||||
),
|
||||
),
|
||||
)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
add(
|
||||
Preference.PreferenceItem.TextPreference(
|
||||
title = stringResource(R.string.pref_manage_notifications),
|
||||
onClick = {
|
||||
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
|
||||
putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
|
||||
}
|
||||
context.startActivity(intent)
|
||||
},
|
||||
),
|
||||
)
|
||||
}
|
||||
addAll(
|
||||
listOf(
|
||||
getBackgroundActivityGroup(),
|
||||
getDataGroup(),
|
||||
getNetworkGroup(networkPreferences = networkPreferences),
|
||||
getLibraryGroup(),
|
||||
getExtensionsGroup(basePreferences = basePreferences),
|
||||
),
|
||||
)
|
||||
}
|
||||
return listOf(
|
||||
Preference.PreferenceItem.SwitchPreference(
|
||||
pref = basePreferences.acraEnabled(),
|
||||
title = stringResource(R.string.pref_enable_acra),
|
||||
subtitle = stringResource(R.string.pref_acra_summary),
|
||||
enabled = isPreviewBuildType || isReleaseBuildType,
|
||||
),
|
||||
Preference.PreferenceItem.TextPreference(
|
||||
title = stringResource(R.string.pref_dump_crash_logs),
|
||||
subtitle = stringResource(R.string.pref_dump_crash_logs_summary),
|
||||
onClick = {
|
||||
scope.launch {
|
||||
CrashLogUtil(context).dumpLogs()
|
||||
}
|
||||
},
|
||||
),
|
||||
Preference.PreferenceItem.SwitchPreference(
|
||||
pref = networkPreferences.verboseLogging(),
|
||||
title = stringResource(R.string.pref_verbose_logging),
|
||||
subtitle = stringResource(R.string.pref_verbose_logging_summary),
|
||||
onValueChanged = {
|
||||
context.toast(R.string.requires_app_restart)
|
||||
true
|
||||
},
|
||||
),
|
||||
Preference.PreferenceItem.TextPreference(
|
||||
title = stringResource(R.string.pref_debug_info),
|
||||
onClick = { navigator.push(DebugInfoScreen()) },
|
||||
),
|
||||
Preference.PreferenceItem.TextPreference(
|
||||
title = stringResource(R.string.pref_manage_notifications),
|
||||
onClick = {
|
||||
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
|
||||
putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
|
||||
}
|
||||
context.startActivity(intent)
|
||||
},
|
||||
),
|
||||
getBackgroundActivityGroup(),
|
||||
getDataGroup(),
|
||||
getNetworkGroup(networkPreferences = networkPreferences),
|
||||
getLibraryGroup(),
|
||||
getExtensionsGroup(basePreferences = basePreferences),
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -2,7 +2,6 @@ package eu.kanade.presentation.more.settings.screen
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -81,18 +80,11 @@ object SettingsAppearanceScreen : SearchableSettings {
|
||||
Preference.PreferenceItem.ListPreference(
|
||||
pref = themeModePref,
|
||||
title = stringResource(R.string.pref_theme_mode),
|
||||
entries = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
mapOf(
|
||||
ThemeMode.SYSTEM to stringResource(R.string.theme_system),
|
||||
ThemeMode.LIGHT to stringResource(R.string.theme_light),
|
||||
ThemeMode.DARK to stringResource(R.string.theme_dark),
|
||||
)
|
||||
} else {
|
||||
mapOf(
|
||||
ThemeMode.LIGHT to stringResource(R.string.theme_light),
|
||||
ThemeMode.DARK to stringResource(R.string.theme_dark),
|
||||
)
|
||||
},
|
||||
entries = mapOf(
|
||||
ThemeMode.SYSTEM to stringResource(R.string.theme_system),
|
||||
ThemeMode.LIGHT to stringResource(R.string.theme_light),
|
||||
ThemeMode.DARK to stringResource(R.string.theme_dark),
|
||||
),
|
||||
),
|
||||
Preference.PreferenceItem.CustomPreference(
|
||||
title = stringResource(R.string.pref_app_theme),
|
||||
|
||||
@@ -58,7 +58,6 @@ object SettingsReaderScreen : SearchableSettings {
|
||||
pref = readerPref.trueColor(),
|
||||
title = stringResource(R.string.pref_true_color),
|
||||
subtitle = stringResource(R.string.pref_true_color_summary),
|
||||
enabled = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O,
|
||||
),
|
||||
Preference.PreferenceItem.SwitchPreference(
|
||||
pref = readerPref.pageTransitions(),
|
||||
|
||||
@@ -79,6 +79,7 @@ fun ScreenTransition(
|
||||
targetState = navigator.lastItem,
|
||||
transitionSpec = transition,
|
||||
modifier = modifier,
|
||||
label = "ScreenTransition",
|
||||
) { screen ->
|
||||
navigator.saveableState("transition", screen) {
|
||||
content(screen)
|
||||
|
||||
Reference in New Issue
Block a user