mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 18:11:50 +01:00
Fallback to preference title if dialog title isn't set
This commit is contained in:
parent
d04d676d2f
commit
47723042c5
@ -248,7 +248,7 @@ dependencies {
|
|||||||
val conductorVersion = "3.1.1"
|
val conductorVersion = "3.1.1"
|
||||||
implementation("com.bluelinelabs:conductor:$conductorVersion")
|
implementation("com.bluelinelabs:conductor:$conductorVersion")
|
||||||
implementation("com.bluelinelabs:conductor-viewpager:$conductorVersion")
|
implementation("com.bluelinelabs:conductor-viewpager:$conductorVersion")
|
||||||
implementation("com.github.tachiyomiorg:conductor-support-preference:$conductorVersion")
|
implementation("com.github.tachiyomiorg:conductor-support-preference:3.1.2")
|
||||||
|
|
||||||
// FlowBinding
|
// FlowBinding
|
||||||
val flowbindingVersion = "1.2.0"
|
val flowbindingVersion = "1.2.0"
|
||||||
|
@ -5,7 +5,6 @@ import androidx.appcompat.content.res.AppCompatResources
|
|||||||
import androidx.biometric.BiometricPrompt
|
import androidx.biometric.BiometricPrompt
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import androidx.preference.CheckBoxPreference
|
import androidx.preference.CheckBoxPreference
|
||||||
import androidx.preference.DialogPreference
|
|
||||||
import androidx.preference.EditTextPreference
|
import androidx.preference.EditTextPreference
|
||||||
import androidx.preference.ListPreference
|
import androidx.preference.ListPreference
|
||||||
import androidx.preference.MultiSelectListPreference
|
import androidx.preference.MultiSelectListPreference
|
||||||
@ -66,19 +65,19 @@ inline fun PreferenceGroup.checkBoxPreference(block: (@DSL CheckBoxPreference).(
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline fun PreferenceGroup.editTextPreference(block: (@DSL EditTextPreference).() -> Unit): EditTextPreference {
|
inline fun PreferenceGroup.editTextPreference(block: (@DSL EditTextPreference).() -> Unit): EditTextPreference {
|
||||||
return initThenAdd(EditTextPreference(context), block).also(::initDialog)
|
return initThenAdd(EditTextPreference(context), block)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun PreferenceGroup.listPreference(block: (@DSL ListPreference).() -> Unit): ListPreference {
|
inline fun PreferenceGroup.listPreference(block: (@DSL ListPreference).() -> Unit): ListPreference {
|
||||||
return initThenAdd(ListPreference(context), block).also(::initDialog)
|
return initThenAdd(ListPreference(context), block)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun PreferenceGroup.intListPreference(block: (@DSL IntListPreference).() -> Unit): IntListPreference {
|
inline fun PreferenceGroup.intListPreference(block: (@DSL IntListPreference).() -> Unit): IntListPreference {
|
||||||
return initThenAdd(IntListPreference(context), block).also(::initDialog)
|
return initThenAdd(IntListPreference(context), block)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun PreferenceGroup.multiSelectListPreference(block: (@DSL MultiSelectListPreference).() -> Unit): MultiSelectListPreference {
|
inline fun PreferenceGroup.multiSelectListPreference(block: (@DSL MultiSelectListPreference).() -> Unit): MultiSelectListPreference {
|
||||||
return initThenAdd(MultiSelectListPreference(context), block).also(::initDialog)
|
return initThenAdd(MultiSelectListPreference(context), block)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun PreferenceScreen.preferenceCategory(block: (@DSL PreferenceCategory).() -> Unit): PreferenceCategory {
|
inline fun PreferenceScreen.preferenceCategory(block: (@DSL PreferenceCategory).() -> Unit): PreferenceCategory {
|
||||||
@ -89,14 +88,6 @@ inline fun PreferenceScreen.preferenceScreen(block: (@DSL PreferenceScreen).() -
|
|||||||
return addThenInit(preferenceManager.createPreferenceScreen(context), block)
|
return addThenInit(preferenceManager.createPreferenceScreen(context), block)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun initDialog(dialogPreference: DialogPreference) {
|
|
||||||
with(dialogPreference) {
|
|
||||||
if (dialogTitle == null) {
|
|
||||||
dialogTitle = title
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fun <P : Preference> PreferenceGroup.add(p: P): P {
|
inline fun <P : Preference> PreferenceGroup.add(p: P): P {
|
||||||
return p.apply {
|
return p.apply {
|
||||||
this.isIconSpaceReserved = false
|
this.isIconSpaceReserved = false
|
||||||
|
Loading…
Reference in New Issue
Block a user