diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFragment.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFragment.java
index f0050726..d52a720a 100644
--- a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFragment.java
+++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuFragment.java
@@ -3,6 +3,7 @@ package one.nem.lacerta.feature.debug;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
+import androidx.navigation.ui.NavigationUI;
import android.view.LayoutInflater;
import android.view.View;
@@ -86,13 +87,11 @@ public class DebugMenuFragment extends Fragment {
});
view.findViewById(R.id.btn_debug_menu_shared_pref_editor).setOnClickListener( v -> {
- // SharedPrefEditor機能呼び出し
- Toast.makeText(getContext(), "textMessage", Toast.LENGTH_SHORT).show();
+ // Fragment移動
});
view.findViewById(R.id.btn_debug_menu_clear_pref).setOnClickListener( v -> {
// SharedPrefClear
- Toast.makeText(getContext(), "textMessage", Toast.LENGTH_SHORT).show();
});
}
}
\ No newline at end of file
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 ebbf68ba..6fc384d2 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
@@ -7,14 +7,25 @@ import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.EditText;
+
+import one.nem.lacerta.source.pref.repository.Common; //TODO-rca: 名前変えるべきかも
+
+import javax.inject.Inject;
+
+import dagger.hilt.android.AndroidEntryPoint;
/**
* A simple {@link Fragment} subclass.
* Use the {@link DebugSharedPrefEditorFragment#newInstance} factory method to
* create an instance of this fragment.
*/
+@AndroidEntryPoint
public class DebugSharedPrefEditorFragment extends Fragment {
+ @Inject
+ Common prefCommon;
+
public DebugSharedPrefEditorFragment() {
// Required empty public constructor
}
@@ -38,4 +49,25 @@ public class DebugSharedPrefEditorFragment extends Fragment {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_debug_shared_pref_editor, container, false);
}
+
+ @Override
+ public void onViewCreated(View view, Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+
+ EditText loadKeyEditText = view.findViewById(R.id.loadKeyEditText);
+ EditText saveKeyEditText = view.findViewById(R.id.saveKeyEditText);
+
+ view.findViewById(R.id.loadButton).setOnClickListener(v -> {
+ String key = loadKeyEditText.getText().toString();
+ String value = prefCommon.getStringValue(key);
+ view.findViewById(R.id.loadValueTextView).setContentDescription(value);
+ });
+
+ view.findViewById(R.id.saveButton).setOnClickListener(v -> {
+ String KeyValue = saveKeyEditText.getText().toString();
+ String[] split = KeyValue.split(":", 2);
+ prefCommon.setStringValue(split[0], split[1]);
+ });
+
+ }
}
\ No newline at end of file
diff --git a/feature/debug/src/main/res/layout/fragment_debug_shared_pref_editor.xml b/feature/debug/src/main/res/layout/fragment_debug_shared_pref_editor.xml
index 7982d0ba..d275c81d 100644
--- a/feature/debug/src/main/res/layout/fragment_debug_shared_pref_editor.xml
+++ b/feature/debug/src/main/res/layout/fragment_debug_shared_pref_editor.xml
@@ -25,7 +25,7 @@
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:layout_weight="2"
- android:hint="Key" />
+ android:hint="Key:Value" />
+ android:orientation="vertical">
-
+ android:orientation="horizontal"
+ android:weightSum="3">
-
+
+
+
+
+
+
+ android:text="No value..."
+ android:textSize="24sp" />
diff --git a/feature/debug/src/main/res/navigation/feature_debug_navigation.xml b/feature/debug/src/main/res/navigation/feature_debug_navigation.xml
index b9ed6182..7f6ca85a 100644
--- a/feature/debug/src/main/res/navigation/feature_debug_navigation.xml
+++ b/feature/debug/src/main/res/navigation/feature_debug_navigation.xml
@@ -8,5 +8,14 @@
android:id="@+id/debugMenuFragment"
android:name="one.nem.lacerta.feature.debug.DebugMenuFragment"
android:label="fragment_debug_menu"
- tools:layout="@layout/fragment_debug_menu" />
+ tools:layout="@layout/fragment_debug_menu" >
+
+
+
\ No newline at end of file