diff --git a/common.gradle b/common.gradle index 00f944369..481780a54 100644 --- a/common.gradle +++ b/common.gradle @@ -63,7 +63,7 @@ repositories { dependencies { // Lib 1.2, but using specific commit so we don't need to bump up the version - compileOnly "com.github.tachiyomiorg:extensions-lib:84bfb8d" + compileOnly "com.github.tachiyomiorg:extensions-lib:a596412" // These are provided by the app itself compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" diff --git a/src/all/komga/build.gradle b/src/all/komga/build.gradle index 860e01fbc..905772a1b 100644 --- a/src/all/komga/build.gradle +++ b/src/all/komga/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Komga' pkgNameSuffix = 'all.komga' extClass = '.KomgaFactory' - extVersionCode = 10 + extVersionCode = 11 libVersion = '1.2' } diff --git a/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt b/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt index 37fc43f80..4789293ce 100644 --- a/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt +++ b/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt @@ -4,6 +4,7 @@ import android.app.Application import android.content.SharedPreferences import android.support.v7.preference.EditTextPreference import android.support.v7.preference.PreferenceScreen +import android.text.InputType import android.widget.Toast import com.github.salomonbrys.kotson.fromJson import com.google.gson.Gson @@ -22,6 +23,10 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.HttpSource +import java.text.DecimalFormat +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale import okhttp3.Credentials import okhttp3.Headers import okhttp3.HttpUrl @@ -33,10 +38,6 @@ import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import java.text.DecimalFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() { override fun popularMangaRequest(page: Int): Request = @@ -236,10 +237,10 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() { override fun setupPreferenceScreen(screen: androidx.preference.PreferenceScreen) { screen.addPreference(screen.editTextPreference(ADDRESS_TITLE, ADDRESS_DEFAULT, baseUrl)) screen.addPreference(screen.editTextPreference(USERNAME_TITLE, USERNAME_DEFAULT, username)) - screen.addPreference(screen.editTextPreference(PASSWORD_TITLE, PASSWORD_DEFAULT, password)) + screen.addPreference(screen.editTextPreference(PASSWORD_TITLE, PASSWORD_DEFAULT, password, true)) } - private fun androidx.preference.PreferenceScreen.editTextPreference(title: String, default: String, value: String): androidx.preference.EditTextPreference { + private fun androidx.preference.PreferenceScreen.editTextPreference(title: String, default: String, value: String, isPassword: Boolean = false): androidx.preference.EditTextPreference { return androidx.preference.EditTextPreference(context).apply { key = title this.title = title @@ -247,6 +248,12 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() { this.setDefaultValue(default) dialogTitle = title + if (isPassword) { + setOnBindEditTextListener { + it.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD + } + } + setOnPreferenceChangeListener { _, newValue -> try { val res = preferences.edit().putString(title, newValue as String).commit() diff --git a/src/en/madokami/build.gradle b/src/en/madokami/build.gradle index 38d527c2e..9d0652089 100644 --- a/src/en/madokami/build.gradle +++ b/src/en/madokami/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Madokami' pkgNameSuffix = 'en.madokami' extClass = '.Madokami' - extVersionCode = 2 + extVersionCode = 3 libVersion = '1.2' } diff --git a/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt b/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt index 85e61dd12..4f79a1217 100644 --- a/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt +++ b/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt @@ -4,6 +4,7 @@ import android.app.Application import android.content.SharedPreferences import android.support.v7.preference.EditTextPreference import android.support.v7.preference.PreferenceScreen +import android.text.InputType import com.github.salomonbrys.kotson.fromJson import com.google.gson.Gson import com.google.gson.JsonArray @@ -19,7 +20,6 @@ import java.net.URLEncoder import java.text.SimpleDateFormat import java.util.Calendar import java.util.Locale -import kotlin.collections.ArrayList import okhttp3.Credentials import okhttp3.HttpUrl import okhttp3.Request @@ -187,6 +187,10 @@ class Madokami : ConfigurableSource, ParsedHttpSource() { key = "password" title = "Password" + setOnBindEditTextListener { + it.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD + } + setOnPreferenceChangeListener { _, newValue -> preferences.edit().putString(key, newValue as String).commit() }