Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ffa15d2d7 | ||
|
|
e11e890818 |
@@ -15,8 +15,8 @@ android {
|
|||||||
applicationId 'org.koitharu.kotatsu'
|
applicationId 'org.koitharu.kotatsu'
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 511
|
versionCode 513
|
||||||
versionName '4.3'
|
versionName '4.3.2'
|
||||||
generatedDensities = []
|
generatedDensities = []
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ afterEvaluate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation('com.github.KotatsuApp:kotatsu-parsers:cf00732023') {
|
implementation('com.github.KotatsuApp:kotatsu-parsers:7f630184c0') {
|
||||||
exclude group: 'org.json', module: 'json'
|
exclude group: 'org.json', module: 'json'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ dependencies {
|
|||||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||||
implementation 'androidx.work:work-runtime-ktx:2.7.1'
|
implementation 'androidx.work:work-runtime-ktx:2.7.1'
|
||||||
implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha05'
|
implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha05'
|
||||||
implementation 'com.google.android.material:material:1.8.0-rc01'
|
implementation 'com.google.android.material:material:1.8.0'
|
||||||
//noinspection LifecycleAnnotationProcessorWithJava8
|
//noinspection LifecycleAnnotationProcessorWithJava8
|
||||||
kapt 'androidx.lifecycle:lifecycle-compiler:2.5.1'
|
kapt 'androidx.lifecycle:lifecycle-compiler:2.5.1'
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class SourceSettings(context: Context, source: MangaSource) : MangaSourceConfig
|
|||||||
override fun <T> get(key: ConfigKey<T>): T {
|
override fun <T> get(key: ConfigKey<T>): T {
|
||||||
return when (key) {
|
return when (key) {
|
||||||
is ConfigKey.Domain -> prefs.getString(key.key, key.defaultValue).ifNullOrEmpty { key.defaultValue }
|
is ConfigKey.Domain -> prefs.getString(key.key, key.defaultValue).ifNullOrEmpty { key.defaultValue }
|
||||||
|
is ConfigKey.ShowSuspiciousContent -> prefs.getBoolean(key.key, key.defaultValue)
|
||||||
} as T
|
} as T
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.view.inputmethod.EditorInfo
|
|||||||
import androidx.preference.EditTextPreference
|
import androidx.preference.EditTextPreference
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import androidx.preference.SwitchPreferenceCompat
|
||||||
import org.koitharu.kotatsu.R
|
import org.koitharu.kotatsu.R
|
||||||
import org.koitharu.kotatsu.core.parser.RemoteMangaRepository
|
import org.koitharu.kotatsu.core.parser.RemoteMangaRepository
|
||||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||||
@@ -29,15 +30,22 @@ fun PreferenceFragmentCompat.addPreferencesFromRepository(repository: RemoteMang
|
|||||||
inputType = EditorInfo.TYPE_CLASS_TEXT or EditorInfo.TYPE_TEXT_VARIATION_URI,
|
inputType = EditorInfo.TYPE_CLASS_TEXT or EditorInfo.TYPE_TEXT_VARIATION_URI,
|
||||||
hint = key.defaultValue,
|
hint = key.defaultValue,
|
||||||
validator = DomainValidator(),
|
validator = DomainValidator(),
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
setTitle(R.string.domain)
|
setTitle(R.string.domain)
|
||||||
setDialogTitle(R.string.domain)
|
setDialogTitle(R.string.domain)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is ConfigKey.ShowSuspiciousContent -> {
|
||||||
|
SwitchPreferenceCompat(requireContext()).apply {
|
||||||
|
setDefaultValue(key.defaultValue)
|
||||||
|
setTitle(R.string.show_suspicious_content)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
preference.isIconSpaceReserved = false
|
preference.isIconSpaceReserved = false
|
||||||
preference.key = key.key
|
preference.key = key.key
|
||||||
screen.addPreference(preference)
|
screen.addPreference(preference)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -405,4 +405,5 @@
|
|||||||
<string name="share_logs">Share logs</string>
|
<string name="share_logs">Share logs</string>
|
||||||
<string name="enable_logging">Enable logging</string>
|
<string name="enable_logging">Enable logging</string>
|
||||||
<string name="enable_logging_summary">Record some actions for debug purposes</string>
|
<string name="enable_logging_summary">Record some actions for debug purposes</string>
|
||||||
|
<string name="show_suspicious_content">Show suspicious content</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user