From 10ec72047cc1c960ed94a3ea6e9a6aedd44b335e Mon Sep 17 00:00:00 2001 From: Koitharu Date: Fri, 4 Feb 2022 08:18:01 +0200 Subject: [PATCH] Update dependencies --- app/build.gradle | 14 ++++++++------ app/src/main/AndroidManifest.xml | 3 +-- .../kotatsu/settings/MainSettingsFragment.kt | 6 +++--- .../settings/NotificationSettingsLegacyFragment.kt | 4 ++-- .../koitharu/kotatsu/settings/SettingsActivity.kt | 2 +- .../kotatsu/settings/SourceSettingsFragment.kt | 4 ++-- .../kotatsu/settings/TrackerSettingsFragment.kt | 4 ++-- .../settings/about/AboutSettingsFragment.kt | 4 ++-- .../utils/EditTextDefaultSummaryProvider.kt | 5 +++-- .../settings/utils/EditTextSummaryProvider.kt | 5 +++-- .../kotatsu/settings/utils/LinksPreference.kt | 2 +- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 13 files changed, 32 insertions(+), 29 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b46a5067a..4cb60f833 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 04826207b..7d9cc1e44 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,7 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt index 94d58fb6a..e35b505b5 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/MainSettingsFragment.kt @@ -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() diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/NotificationSettingsLegacyFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/NotificationSettingsLegacyFragment.kt index 923a7e8bf..5c021a39f 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/NotificationSettingsLegacyFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/NotificationSettingsLegacyFragment.kt @@ -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 diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/SettingsActivity.kt b/app/src/main/java/org/koitharu/kotatsu/settings/SettingsActivity.kt index 0bbf93799..562462b82 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/SettingsActivity.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/SettingsActivity.kt @@ -53,7 +53,7 @@ class SettingsActivity : BaseActivity(), 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) diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/SourceSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/SourceSettingsFragment.kt index da9115e80..750d66013 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/SourceSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/SourceSettingsFragment.kt @@ -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( diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/TrackerSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/TrackerSettingsFragment.kt index a4c489f8b..4c7870e57 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/TrackerSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/TrackerSettingsFragment.kt @@ -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) diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt index 19107be54..e295d3bfa 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/about/AboutSettingsFragment.kt @@ -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 diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/utils/EditTextDefaultSummaryProvider.kt b/app/src/main/java/org/koitharu/kotatsu/settings/utils/EditTextDefaultSummaryProvider.kt index 7083b6bdb..b2f448b1b 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/utils/EditTextDefaultSummaryProvider.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/utils/EditTextDefaultSummaryProvider.kt @@ -9,10 +9,11 @@ class EditTextDefaultSummaryProvider( ) : Preference.SummaryProvider { 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 } } } \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/utils/EditTextSummaryProvider.kt b/app/src/main/java/org/koitharu/kotatsu/settings/utils/EditTextSummaryProvider.kt index 1e2976dc6..447092234 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/utils/EditTextSummaryProvider.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/utils/EditTextSummaryProvider.kt @@ -8,10 +8,11 @@ class EditTextSummaryProvider(@StringRes private val emptySummaryId: Int) : Preference.SummaryProvider { 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 } } } \ No newline at end of file diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/utils/LinksPreference.kt b/app/src/main/java/org/koitharu/kotatsu/settings/utils/LinksPreference.kt index cd61ba247..4317f93ea 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/utils/LinksPreference.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/utils/LinksPreference.kt @@ -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, diff --git a/build.gradle b/build.gradle index c7d903dc5..b0699cf5a 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31' + classpath 'com.android.tools.build:gradle:7.1.0' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 24415a607..d4ad160ac 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,8 @@ #Mon Sep 13 08:29:18 EEST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME # https://gradle.org/release-checksums/ -distributionSha256Sum=0e46229820205440b48a5501122002842b82886e76af35f0f3a069243dca4b3c +distributionSha256Sum=f581709a9c35e9cb92e16f585d2c4bc99b2b1a5f85d2badbd3dc6bff59e1e6dd