From 7e262b6b571dfe4cdc18814e6600378b39c3200b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Tue, 12 Dec 2023 12:24:14 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E6=9B=B8?= =?UTF-8?q?=E3=81=8D=E8=BE=BC=E3=81=BF=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/debug/DebugMenuFragment.java | 18 ++++++++++++--- .../main/res/layout/fragment_debug_menu.xml | 22 ++++++++++++++++++- 2 files changed, 36 insertions(+), 4 deletions(-) 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 a3729901..82870f2b 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 @@ -4,14 +4,15 @@ import android.os.Bundle; import androidx.fragment.app.Fragment; import androidx.navigation.Navigation; -import androidx.navigation.ui.NavigationUI; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.Toast; +import java.io.File; +import java.io.IOException; + import dagger.hilt.android.AndroidEntryPoint; import javax.inject.Inject; @@ -82,7 +83,18 @@ public class DebugMenuFragment extends Fragment { Toast.makeText(getContext(), getContext().getExternalFilesDir(null).toPath().toString(), Toast.LENGTH_SHORT).show(); }); - view.findViewById(R.id.btn_debug_menu_go_to_repository_debugger).setOnClickListener( v -> { + view.findViewById(R.id.btn_debug_menu_file_write_test).setOnClickListener( v -> { + File file = getContext().getExternalFilesDir(null); + // ファイル書き込みテスト + try { + File testFile = new File(file, "test.txt"); + testFile.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + }); + + view.findViewById(R.id.btn_debug_menu_go_to_repository_debug).setOnClickListener(v -> { Navigation.findNavController(view).navigate(R.id.action_debugMenuFragment_to_debugRepositoryDebuggerFragment); }); diff --git a/feature/debug/src/main/res/layout/fragment_debug_menu.xml b/feature/debug/src/main/res/layout/fragment_debug_menu.xml index 73334037..9c6f6793 100644 --- a/feature/debug/src/main/res/layout/fragment_debug_menu.xml +++ b/feature/debug/src/main/res/layout/fragment_debug_menu.xml @@ -119,6 +119,26 @@ android:layout_width="match_parent" android:layout_height="16dp" /> + + + + + +