From 504e0a76d59d7a49d7dff188de915088143c43d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 11 Dec 2023 13:08:16 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E3=81=8C?= =?UTF-8?q?=E6=84=8F=E5=91=B3=E4=B8=8D=E6=98=8E=E3=81=A0=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../debug/DebugSharedPrefEditorFragment.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugSharedPrefEditorFragment.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugSharedPrefEditorFragment.java index 043a92fc..9495779d 100644 --- a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugSharedPrefEditorFragment.java +++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugSharedPrefEditorFragment.java @@ -10,6 +10,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; +import android.widget.RadioGroup; import android.widget.TextView; import org.w3c.dom.Text; @@ -86,12 +87,16 @@ public class DebugSharedPrefEditorFragment extends Fragment { }); // ラジオボタンの変更を監視 - view.findViewById(R.id.radioButtonCommon).setOnClickListener(v -> { - sharedPrefType = SharedPrefType.COMMON; - updateList(prefItemTextView); - }); - view.findViewById(R.id.radioButtonUserData).setOnClickListener(v -> { - sharedPrefType = SharedPrefType.USERDATA; + ((RadioGroup) view.findViewById(R.id.radioGroupPrefType)).setOnCheckedChangeListener((group, checkedId) -> { + if (checkedId == R.id.radioButtonCommon) { + sharedPrefType = SharedPrefType.COMMON; + view.findViewById(R.id.radioButtonUserData).setSelected(false); + } else if (checkedId == R.id.radioButtonUserData) { + sharedPrefType = SharedPrefType.USERDATA; + view.findViewById(R.id.radioButtonCommon).setSelected(false); + } else { + Log.e("DebugSharedPrefEditorFragment", "radioButtonのIDが不正です"); + } updateList(prefItemTextView); });