优化
This commit is contained in:
@@ -16,6 +16,7 @@ import io.legado.app.constant.EventBus
|
|||||||
import io.legado.app.constant.PreferKey
|
import io.legado.app.constant.PreferKey
|
||||||
import io.legado.app.databinding.DialogEditTextBinding
|
import io.legado.app.databinding.DialogEditTextBinding
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
|
import io.legado.app.help.config.LocalConfig
|
||||||
import io.legado.app.lib.dialogs.alert
|
import io.legado.app.lib.dialogs.alert
|
||||||
import io.legado.app.lib.prefs.fragment.PreferenceFragment
|
import io.legado.app.lib.prefs.fragment.PreferenceFragment
|
||||||
import io.legado.app.lib.theme.primaryColor
|
import io.legado.app.lib.theme.primaryColor
|
||||||
@@ -131,7 +132,9 @@ class OtherConfigFragment : PreferenceFragment(),
|
|||||||
AppConfig.sourceEditMaxLine = it
|
AppConfig.sourceEditMaxLine = it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferKey.clearWebViewData -> clearWebViewData()
|
PreferKey.clearWebViewData -> clearWebViewData()
|
||||||
|
"localPassword" -> alertLocalPassword()
|
||||||
}
|
}
|
||||||
return super.onPreferenceTreeClick(preference)
|
return super.onPreferenceTreeClick(preference)
|
||||||
}
|
}
|
||||||
@@ -258,4 +261,19 @@ class OtherConfigFragment : PreferenceFragment(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun alertLocalPassword() {
|
||||||
|
context?.alert(R.string.set_local_password, R.string.set_local_password_summary) {
|
||||||
|
val editTextBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
|
||||||
|
editView.hint = "password"
|
||||||
|
}
|
||||||
|
customView {
|
||||||
|
editTextBinding.root
|
||||||
|
}
|
||||||
|
okButton {
|
||||||
|
LocalConfig.password = editTextBinding.editView.text.toString()
|
||||||
|
}
|
||||||
|
cancelButton()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -52,6 +52,11 @@
|
|||||||
app:iconSpaceReserved="false"
|
app:iconSpaceReserved="false"
|
||||||
app:layout="@layout/view_preference_category">
|
app:layout="@layout/view_preference_category">
|
||||||
|
|
||||||
|
<io.legado.app.lib.prefs.Preference
|
||||||
|
android:key="localPassword"
|
||||||
|
android:title="@string/set_local_password"
|
||||||
|
android:summary="@string/set_local_password_summary" />
|
||||||
|
|
||||||
<io.legado.app.lib.prefs.Preference
|
<io.legado.app.lib.prefs.Preference
|
||||||
android:key="userAgent"
|
android:key="userAgent"
|
||||||
android:title="@string/user_agent" />
|
android:title="@string/user_agent" />
|
||||||
|
|||||||
Reference in New Issue
Block a user