diff --git a/.gitignore b/.gitignore index cda03a674..dcbfd2e89 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ /captures .externalNativeBuild .cxx +/.idea/deviceManager.xml diff --git a/app/build.gradle b/app/build.gradle index dc6be8aa8..945ecb7c5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -91,9 +91,9 @@ dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0' implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.core:core-ktx:1.13.0' + implementation 'androidx.core:core-ktx:1.13.1' implementation 'androidx.activity:activity-ktx:1.9.0' - implementation 'androidx.fragment:fragment-ktx:1.6.2' + implementation 'androidx.fragment:fragment-ktx:1.7.0' implementation 'androidx.collection:collection-ktx:1.4.0' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0' implementation 'androidx.lifecycle:lifecycle-service:2.7.0' @@ -101,12 +101,12 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.3.2' - implementation 'androidx.viewpager2:viewpager2:1.1.0-beta02' + implementation 'androidx.viewpager2:viewpager2:1.1.0-rc01' implementation 'androidx.preference:preference-ktx:1.2.1' implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha05' - implementation 'com.google.android.material:material:1.12.0-rc01' + implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.lifecycle:lifecycle-common-java8:2.7.0' - implementation 'androidx.webkit:webkit:1.10.0' + implementation 'androidx.webkit:webkit:1.11.0' implementation 'androidx.work:work-runtime:2.9.0' //noinspection GradleDependency @@ -146,6 +146,7 @@ dependencies { implementation 'org.conscrypt:conscrypt-android:2.5.2' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14' + debugImplementation 'com.github.Koitharu:WorkInspector:2c2919f9f1' testImplementation 'junit:junit:4.13.2' testImplementation 'org.json:json:20240303' diff --git a/app/src/debug/kotlin/org/koitharu/kotatsu/KotatsuApp.kt b/app/src/debug/kotlin/org/koitharu/kotatsu/KotatsuApp.kt index 93593fbda..4dd63e838 100644 --- a/app/src/debug/kotlin/org/koitharu/kotatsu/KotatsuApp.kt +++ b/app/src/debug/kotlin/org/koitharu/kotatsu/KotatsuApp.kt @@ -8,12 +8,14 @@ import org.koitharu.kotatsu.local.data.LocalMangaRepository import org.koitharu.kotatsu.local.data.PagesCache import org.koitharu.kotatsu.parsers.MangaLoaderContext import org.koitharu.kotatsu.reader.domain.PageLoader +import org.koitharu.workinspector.WorkInspector class KotatsuApp : BaseApp() { - override fun attachBaseContext(base: Context?) { + override fun attachBaseContext(base: Context) { super.attachBaseContext(base) enableStrictMode() + WorkInspector.setLauncherIconEnabled(base, false) } private fun enableStrictMode() { diff --git a/app/src/debug/res/menu/opt_settings.xml b/app/src/debug/res/menu/opt_settings.xml index b8bc2c309..0ad9f78bc 100644 --- a/app/src/debug/res/menu/opt_settings.xml +++ b/app/src/debug/res/menu/opt_settings.xml @@ -13,4 +13,9 @@ android:title="@string/check_for_new_chapters" app:showAsAction="never" /> + + diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/BaseApp.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/BaseApp.kt index c59bda7c2..9e617f81d 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/BaseApp.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/BaseApp.kt @@ -87,7 +87,7 @@ open class BaseApp : Application(), Configuration.Provider { WorkServiceStopHelper(workManagerProvider).setup() } - override fun attachBaseContext(base: Context?) { + override fun attachBaseContext(base: Context) { super.attachBaseContext(base) initAcra { buildConfigClass = BuildConfig::class.java diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Android.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Android.kt index a51c3e81b..b59e93a20 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Android.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Android.kt @@ -42,6 +42,8 @@ import androidx.fragment.app.DialogFragment import androidx.fragment.app.Fragment import androidx.lifecycle.Lifecycle import androidx.lifecycle.coroutineScope +import androidx.webkit.WebViewCompat +import androidx.webkit.WebViewFeature import androidx.work.CoroutineWorker import com.google.android.material.elevation.ElevationOverlayProvider import kotlinx.coroutines.Dispatchers @@ -59,7 +61,6 @@ import okio.use import org.json.JSONException import org.jsoup.internal.StringUtil.StringJoiner import org.koitharu.kotatsu.BuildConfig -import org.koitharu.kotatsu.R import org.koitharu.kotatsu.parsers.util.runCatchingCancellable import org.xmlpull.v1.XmlPullParser import org.xmlpull.v1.XmlPullParserException @@ -263,6 +264,9 @@ fun WebView.configureForParser(userAgentOverride: String?) = with(settings) { javaScriptEnabled = true domStorageEnabled = true mediaPlaybackRequiresUserGesture = false + if (WebViewFeature.isFeatureSupported(WebViewFeature.MUTE_AUDIO)) { + WebViewCompat.setAudioMuted(this@configureForParser, true) + } databaseEnabled = true if (userAgentOverride != null) { userAgentString = userAgentOverride diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/settings/SettingsActivity.kt b/app/src/main/kotlin/org/koitharu/kotatsu/settings/SettingsActivity.kt index b04cc0655..53a80b7c7 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/settings/SettingsActivity.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/settings/SettingsActivity.kt @@ -103,6 +103,13 @@ class SettingsActivity : true } + R.id.action_works -> { + val intent = Intent() + intent.component = ComponentName(this, "org.koitharu.workinspector.WorkInspectorActivity") + startActivity(intent) + true + } + else -> super.onOptionsItemSelected(item) } diff --git a/app/src/main/res/layout/activity_reader.xml b/app/src/main/res/layout/activity_reader.xml index 0a5900531..935edc3b3 100644 --- a/app/src/main/res/layout/activity_reader.xml +++ b/app/src/main/res/layout/activity_reader.xml @@ -58,7 +58,7 @@ android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_margin="8dp" - app:cardBackgroundColor="?colorBackgroundFloating" + app:cardBackgroundColor="?colorSurfaceContainer" app:layout_insetEdge="bottom"> + diff --git a/app/src/release/kotlin/org/koitharu/kotatsu/KotatsuApp.kt b/app/src/release/kotlin/org/koitharu/kotatsu/KotatsuApp.kt index d862b196f..983e1297c 100644 --- a/app/src/release/kotlin/org/koitharu/kotatsu/KotatsuApp.kt +++ b/app/src/release/kotlin/org/koitharu/kotatsu/KotatsuApp.kt @@ -2,6 +2,4 @@ package org.koitharu.kotatsu import org.koitharu.kotatsu.core.BaseApp -class KotatsuApp : BaseApp() { - -} +class KotatsuApp : BaseApp() diff --git a/build.gradle b/build.gradle index c6ea34076..78dbff684 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.3.2' + classpath 'com.android.tools.build:gradle:8.4.0' classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23' classpath 'com.google.dagger:hilt-android-gradle-plugin:2.51.1' classpath 'com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.23-1.0.19'