From 6515b2d3a7881c315402f3f7ea8d1b0e82662804 Mon Sep 17 00:00:00 2001 From: andrekir Date: Mon, 8 May 2023 17:34:06 -0300 Subject: [PATCH] fix #629: keep saved names when editing actions --- .../com/geeksville/mesh/ui/QuickChatSettingsFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/QuickChatSettingsFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/QuickChatSettingsFragment.kt index a2f43a55..d4c8c71f 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/QuickChatSettingsFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/QuickChatSettingsFragment.kt @@ -140,8 +140,7 @@ class QuickChatSettingsFragment : ScreenFragment("Quick Chat Settings"), Logging val builder = MaterialAlertDialogBuilder(context) builder.setTitle(title) - val layout = - LayoutInflater.from(requireContext()).inflate(R.layout.dialog_add_quick_chat, null) + val layout = LayoutInflater.from(context).inflate(R.layout.dialog_add_quick_chat, null) val nameInput: EditText = layout.findViewById(R.id.addQuickChatName) val messageInput: EditText = layout.findViewById(R.id.addQuickChatMessage) @@ -149,7 +148,8 @@ class QuickChatSettingsFragment : ScreenFragment("Quick Chat Settings"), Logging val instantImage: ImageView = layout.findViewById(R.id.addQuickChatInsant) instantImage.visibility = if (modeSwitch.isChecked) View.VISIBLE else View.INVISIBLE - var nameHasChanged = false + // don't change action name on edits + var nameHasChanged = title == getString(R.string.quick_chat_edit) modeSwitch.setOnCheckedChangeListener { _, _ -> if (modeSwitch.isChecked) {