Update dependencies

This commit is contained in:
Koitharu
2022-02-04 08:18:01 +02:00
parent 4be514b754
commit 10ec72047c
13 changed files with 32 additions and 29 deletions

View File

@@ -8,6 +8,7 @@ plugins {
android {
compileSdkVersion 31
buildToolsVersion '30.0.3'
namespace 'org.koitharu.kotatsu'
defaultConfig {
applicationId 'org.koitharu.kotatsu'
@@ -48,14 +49,15 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += [
'-Xjvm-default=enable',
'-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
'-Xopt-in=kotlinx.coroutines.FlowPreview',
'-Xopt-in=kotlin.contracts.ExperimentalContracts',
]
}
lintOptions {
disable 'MissingTranslation'
lint {
abortOnError false
disable 'MissingTranslation'
}
testOptions {
unitTests.includeAndroidResources = true
@@ -69,7 +71,7 @@ dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.activity:activity-ktx:1.4.0'
implementation 'androidx.fragment:fragment-ktx:1.4.0'
implementation 'androidx.fragment:fragment-ktx:1.4.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
@@ -79,7 +81,7 @@ dependencies {
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.work:work-runtime-ktx:2.7.1'
implementation 'com.google.android.material:material:1.5.0'
//noinspection LifecycleAnnotationProcessorWithJava8
@@ -89,8 +91,8 @@ dependencies {
implementation 'androidx.room:room-ktx:2.4.1'
kapt 'androidx.room:room-compiler:2.4.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'com.squareup.okio:okio:2.10.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.squareup.okio:okio:3.0.0'
implementation 'org.jsoup:jsoup:1.14.3'
implementation 'com.hannesdorfmann:adapterdelegates4-kotlin-dsl:4.3.1'

View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.koitharu.kotatsu">
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

View File

@@ -108,12 +108,12 @@ class MainSettingsFragment : BasePreferenceFragment(R.string.settings),
}
}
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
return when (preference?.key) {
override fun onPreferenceTreeClick(preference: Preference): Boolean {
return when (preference.key) {
AppSettings.KEY_LOCAL_STORAGE -> {
val ctx = context ?: return false
StorageSelectDialog.Builder(ctx, settings.getStorageDir(ctx), this)
.setTitle(preference.title)
.setTitle(preference.title ?: "")
.setNegativeButton(android.R.string.cancel)
.create()
.show()

View File

@@ -37,8 +37,8 @@ class NotificationSettingsLegacyFragment : BasePreferenceFragment(R.string.notif
}
}
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
return when (preference?.key) {
override fun onPreferenceTreeClick(preference: Preference): Boolean {
return when (preference.key) {
AppSettings.KEY_NOTIFICATIONS_SOUND -> {
ringtonePickContract.launch(settings.notificationSound.toUriOrNull())
true

View File

@@ -53,7 +53,7 @@ class SettingsActivity : BaseActivity<ActivitySettingsBinding>(),
pref: Preference
): Boolean {
val fm = supportFragmentManager
val fragment = fm.fragmentFactory.instantiate(classLoader, pref.fragment)
val fragment = fm.fragmentFactory.instantiate(classLoader, pref.fragment ?: return false)
fragment.arguments = pref.extras
fragment.setTargetFragment(caller, 0)
openFragment(fragment)

View File

@@ -51,8 +51,8 @@ class SourceSettingsFragment : PreferenceFragmentCompat() {
}
}
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
return when (preference?.key) {
override fun onPreferenceTreeClick(preference: Preference): Boolean {
return when (preference.key) {
SourceSettings.KEY_AUTH -> {
startActivity(
SourceAuthActivity.newIntent(

View File

@@ -35,8 +35,8 @@ class TrackerSettingsFragment : BasePreferenceFragment(R.string.new_chapters_che
}
}
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
return when (preference?.key) {
override fun onPreferenceTreeClick(preference: Preference): Boolean {
return when (preference.key) {
AppSettings.KEY_NOTIFICATIONS_SETTINGS -> {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val intent = Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)

View File

@@ -30,8 +30,8 @@ class AboutSettingsFragment : BasePreferenceFragment(R.string.about) {
}
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
return when (preference?.key) {
override fun onPreferenceTreeClick(preference: Preference): Boolean {
return when (preference.key) {
AppSettings.KEY_APP_VERSION -> {
checkForUpdates()
true

View File

@@ -9,10 +9,11 @@ class EditTextDefaultSummaryProvider(
) : Preference.SummaryProvider<EditTextPreference> {
override fun provideSummary(preference: EditTextPreference): CharSequence {
return if (preference.text.isNullOrEmpty()) {
val text = preference.text
return if (text.isNullOrEmpty()) {
preference.context.getString(R.string.default_s, defaultValue)
} else {
preference.text
text
}
}
}

View File

@@ -8,10 +8,11 @@ class EditTextSummaryProvider(@StringRes private val emptySummaryId: Int) :
Preference.SummaryProvider<EditTextPreference> {
override fun provideSummary(preference: EditTextPreference): CharSequence {
return if (preference.text.isNullOrEmpty()) {
val text = preference.text
return if (text.isNullOrEmpty()) {
preference.context.getString(emptySummaryId)
} else {
preference.text
text
}
}
}

View File

@@ -8,7 +8,7 @@ import androidx.preference.Preference
import androidx.preference.PreferenceViewHolder
class LinksPreference @JvmOverloads constructor(
context: Context?,
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = androidx.preference.R.attr.preferenceStyle,
defStyleRes: Int = 0,