|
@@ -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()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|