Android: Remember last entered Artic Base server address (#113)

* Android: Remember last entered Artic Base server address

* Android: Updated string key for last Artic Base address

`lastArticBaseAddr` --> `last_artic_base_addr`

Co-authored-by: PabloMK7 <hackyglitch2@gmail.com>

---------

Co-authored-by: PabloMK7 <hackyglitch2@gmail.com>
This commit is contained in:
OpenSauce 2024-05-15 11:25:56 +00:00 committed by GitHub
parent 5d2150c67c
commit 893dad57b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,7 +89,7 @@ class HomeSettingsFragment : Fragment() {
{ {
val inflater = LayoutInflater.from(context) val inflater = LayoutInflater.from(context)
val inputBinding = DialogSoftwareKeyboardBinding.inflate(inflater) val inputBinding = DialogSoftwareKeyboardBinding.inflate(inflater)
var textInputValue: String = "" var textInputValue: String = preferences.getString("last_artic_base_addr", "")!!
inputBinding.editTextInput.setText(textInputValue) inputBinding.editTextInput.setText(textInputValue)
inputBinding.editTextInput.doOnTextChanged { text, _, _, _ -> inputBinding.editTextInput.doOnTextChanged { text, _, _, _ ->
@ -102,6 +102,9 @@ class HomeSettingsFragment : Fragment() {
.setTitle(getString(R.string.artic_base_enter_address)) .setTitle(getString(R.string.artic_base_enter_address))
.setPositiveButton(android.R.string.ok) { _, _ -> .setPositiveButton(android.R.string.ok) { _, _ ->
if (textInputValue.isNotEmpty()) { if (textInputValue.isNotEmpty()) {
preferences.edit()
.putString("last_artic_base_addr", textInputValue)
.apply()
val menu = Game( val menu = Game(
title = getString(R.string.artic_base), title = getString(R.string.artic_base),
path = "articbase://$textInputValue", path = "articbase://$textInputValue",