Added first beta of the E-Hentai Language filtering option
This commit is contained in:
parent
8a192473c7
commit
e3d7900cb7
@ -246,4 +246,6 @@ object PreferenceKeys {
|
||||
const val eh_use_auto_webtoon = "eh_use_auto_webtoon"
|
||||
|
||||
const val eh_watched_list_default_state = "eh_watched_list_default_state"
|
||||
|
||||
const val eh_settings_languages = "eh_settings_languages"
|
||||
}
|
||||
|
@ -352,4 +352,6 @@ class PreferencesHelper(val context: Context) {
|
||||
fun eh_useAutoWebtoon() = flowPrefs.getBoolean(Keys.eh_use_auto_webtoon, true)
|
||||
|
||||
fun eh_watchedListDefaultState() = flowPrefs.getBoolean(Keys.eh_watched_list_default_state, false)
|
||||
|
||||
fun eh_settingsLanguages() = flowPrefs.getString(Keys.eh_settings_languages, "false,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false\nfalse,false,false")
|
||||
}
|
||||
|
@ -2,11 +2,13 @@ package eu.kanade.tachiyomi.ui.setting
|
||||
|
||||
import android.os.Handler
|
||||
import android.text.InputType
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.preference.PreferenceScreen
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.afollestad.materialdialogs.WhichButton
|
||||
import com.afollestad.materialdialogs.actions.setActionButtonEnabled
|
||||
import com.afollestad.materialdialogs.customview.customView
|
||||
import com.afollestad.materialdialogs.input.getInputField
|
||||
import com.afollestad.materialdialogs.input.input
|
||||
import com.bluelinelabs.conductor.RouterTransaction
|
||||
@ -49,6 +51,57 @@ import exh.util.await
|
||||
import exh.util.trans
|
||||
import humanize.Humanize
|
||||
import java.util.Date
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.chinese_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.chinese_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.chinese_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.dutch_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.dutch_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.dutch_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.english_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.english_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.english_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.french_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.french_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.french_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.german_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.german_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.german_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.hungarian_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.hungarian_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.hungarian_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.italian_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.italian_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.italian_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.japanese_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.japanese_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.japanese_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.korean_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.korean_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.korean_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.not_available_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.not_available_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.not_available_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.other_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.other_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.other_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.polish_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.polish_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.polish_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.portuguese_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.portuguese_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.portuguese_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.russian_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.russian_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.russian_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.spanish_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.spanish_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.spanish_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.thai_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.thai_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.thai_translated
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.vietnamese_original
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.vietnamese_rewrite
|
||||
import kotlinx.android.synthetic.main.eh_dialog_languages.view.vietnamese_translated
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
@ -229,6 +282,47 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
preference {
|
||||
title = "Language Filtering"
|
||||
summary = "If you wish to hide galleries in certain languages from the gallery list and searches, select them in the dialog that will popup.\nNote that matching galleries will never appear regardless of your search query."
|
||||
|
||||
onClick {
|
||||
MaterialDialog(activity!!)
|
||||
.title(text = "Language Filtering")
|
||||
.customView(R.layout.eh_dialog_languages, scrollable = true)
|
||||
.positiveButton(android.R.string.ok) {
|
||||
val customView = it.view.contentLayout.customView!!
|
||||
|
||||
val languages = listOfNotNull(
|
||||
"${customView.japanese_original.isChecked}*${customView.japanese_translated.isChecked}*${customView.japanese_rewrite.isChecked}",
|
||||
"${customView.english_original.isChecked}*${customView.english_translated.isChecked}*${customView.english_rewrite.isChecked}",
|
||||
"${customView.chinese_original.isChecked}*${customView.chinese_translated.isChecked}*${customView.chinese_rewrite.isChecked}",
|
||||
"${customView.dutch_original.isChecked}*${customView.dutch_translated.isChecked}*${customView.dutch_rewrite.isChecked}",
|
||||
"${customView.french_original.isChecked}*${customView.french_translated.isChecked}*${customView.french_rewrite.isChecked}",
|
||||
"${customView.german_original.isChecked}*${customView.german_translated.isChecked}*${customView.german_rewrite.isChecked}",
|
||||
"${customView.hungarian_original.isChecked}*${customView.hungarian_translated.isChecked}*${customView.hungarian_rewrite.isChecked}",
|
||||
"${customView.italian_original.isChecked}*${customView.italian_translated.isChecked}*${customView.italian_rewrite.isChecked}",
|
||||
"${customView.korean_original.isChecked}*${customView.korean_translated.isChecked}*${customView.korean_rewrite.isChecked}",
|
||||
"${customView.polish_original.isChecked}*${customView.polish_translated.isChecked}*${customView.polish_rewrite.isChecked}",
|
||||
"${customView.portuguese_original.isChecked}*${customView.portuguese_translated.isChecked}*${customView.portuguese_rewrite.isChecked}",
|
||||
"${customView.russian_original.isChecked}*${customView.russian_translated.isChecked}*${customView.russian_rewrite.isChecked}",
|
||||
"${customView.spanish_original.isChecked}*${customView.spanish_translated.isChecked}*${customView.spanish_rewrite.isChecked}",
|
||||
"${customView.thai_original.isChecked}*${customView.thai_translated.isChecked}*${customView.thai_rewrite.isChecked}",
|
||||
"${customView.vietnamese_original.isChecked}*${customView.vietnamese_translated.isChecked}*${customView.vietnamese_rewrite.isChecked}",
|
||||
"${customView.not_available_original.isChecked}*${customView.not_available_translated.isChecked}*${customView.not_available_rewrite.isChecked}",
|
||||
"${customView.other_original.isChecked}*${customView.other_translated.isChecked}*${customView.other_rewrite.isChecked}"
|
||||
).joinToString("\n")
|
||||
|
||||
Log.d("Test", languages)
|
||||
|
||||
preferences.eh_settingsLanguages().set(languages)
|
||||
|
||||
preferences.eh_settingsLanguages().reconfigure()
|
||||
}
|
||||
.show()
|
||||
}
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
switchPreference {
|
||||
defaultValue = false
|
||||
key = PreferenceKeys.eh_watched_list_default_state
|
||||
|
@ -63,6 +63,8 @@ class EhUConfigBuilder {
|
||||
configItems += Entry.TagFilteringThreshold(prefs.ehTagFilterValue().get())
|
||||
configItems += Entry.TagWatchingThreshold(prefs.ehTagWatchingValue().get())
|
||||
|
||||
configItems += Entry.LanguageSystem().getLanguages(prefs.eh_settingsLanguages().get().split("\n"))
|
||||
|
||||
// Actually build form body
|
||||
val formBody = FormBody.Builder()
|
||||
configItems.forEach {
|
||||
@ -151,6 +153,396 @@ object Entry {
|
||||
override val key = "wt"
|
||||
override val value = "$value"
|
||||
}
|
||||
|
||||
class LanguageSystem {
|
||||
|
||||
fun getLanguages(values: List<String>): List<ConfigItem> {
|
||||
return Japanese(values[0].split("*").map { it.toBoolean() }).configs +
|
||||
English(values[1].split("*").map { it.toBoolean() }).configs +
|
||||
Chinese(values[2].split("*").map { it.toBoolean() }).configs +
|
||||
Dutch(values[3].split("*").map { it.toBoolean() }).configs +
|
||||
French(values[4].split("*").map { it.toBoolean() }).configs +
|
||||
German(values[5].split("*").map { it.toBoolean() }).configs +
|
||||
Hungarian(values[6].split("*").map { it.toBoolean() }).configs +
|
||||
Italian(values[7].split("*").map { it.toBoolean() }).configs +
|
||||
Korean(values[8].split("*").map { it.toBoolean() }).configs +
|
||||
Polish(values[9].split("*").map { it.toBoolean() }).configs +
|
||||
Portuguese(values[10].split("*").map { it.toBoolean() }).configs +
|
||||
Russian(values[11].split("*").map { it.toBoolean() }).configs +
|
||||
Spanish(values[12].split("*").map { it.toBoolean() }).configs +
|
||||
Thai(values[13].split("*").map { it.toBoolean() }).configs +
|
||||
Vietnamese(values[14].split("*").map { it.toBoolean() }).configs +
|
||||
NotAvailable(values[15].split("*").map { it.toBoolean() }).configs +
|
||||
Other(values[16].split("*").map { it.toBoolean() }).configs
|
||||
}
|
||||
|
||||
class Japanese(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1024"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2048"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
class English(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1025"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2049"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
class Chinese(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_10"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1034"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2058"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Dutch(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_20"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1044"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2068"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class French(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_30"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1054"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2078"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class German(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_40"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1064"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2088"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Hungarian(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_50"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1074"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2098"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Italian(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_60"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1084"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2108"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Korean(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_70"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1094"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2118"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Polish(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_80"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1104"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2128"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Portuguese(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_90"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1114"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2138"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Russian(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_100"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1124"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2148"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Spanish(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_110"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1134"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2158"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Thai(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_120"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1144"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2168"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Vietnamese(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_130"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1154"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2178"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class NotAvailable(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_254"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1278"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2302"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
|
||||
class Other(values: List<Boolean>) {
|
||||
|
||||
val configs = listOf(
|
||||
Original(values[0]),
|
||||
Translated(values[1]),
|
||||
Rewrite(values[2])
|
||||
)
|
||||
|
||||
class Original(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_255"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Translated(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_1279"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
class Rewrite(value: Boolean) : ConfigItem {
|
||||
override val key = "xl_2303"
|
||||
override val value = if (value) "checked" else ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ConfigItem {
|
||||
|
475
app/src/main/res/layout/eh_dialog_languages.xml
Normal file
475
app/src/main/res/layout/eh_dialog_languages.xml
Normal file
@ -0,0 +1,475 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_row="0"
|
||||
android:layout_column="0">
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Language" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Original" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Translated" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Rewrite" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/japanese"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Japanese" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/japanese_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/japanese_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/japanese_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/english"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="English" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/english_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/english_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/english_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chinese"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Chinese" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chinese_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chinese_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chinese_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dutch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Dutch" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/dutch_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/dutch_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/dutch_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/french"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="French" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/french_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/french_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/french_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/german"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="German" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/german_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/german_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/german_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hungarian"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hungarian" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/hungarian_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/hungarian_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/hungarian_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/italian"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Italian" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/italian_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/italian_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/italian_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/korean"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Korean" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/korean_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/korean_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/korean_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/polish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Polish" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/polish_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/polish_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/polish_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/portuguese"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Portuguese" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/portuguese_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/portuguese_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/portuguese_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/russian"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Russian" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/russian_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/russian_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/russian_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/spanish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Spanish" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/spanish_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/spanish_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/spanish_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/thai"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Thai" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/thai_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/thai_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/thai_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vietnamese"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Vietnamese" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/vietnamese_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/vietnamese_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/vietnamese_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/not_available"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="N/A" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/not_available_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/not_available_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/not_available_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/other"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Other" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/other_original"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/other_translated"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/other_rewrite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
Loading…
x
Reference in New Issue
Block a user