mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-01-16 16:42:11 +01:00
Android: Remember last entered Artic Base server address
This commit is contained in:
parent
b1262f4768
commit
b786c4b1e6
@ -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("lastArticBaseAddr", "")!!
|
||||||
|
|
||||||
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("lastArticBaseAddr", 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",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user