From cda0974d99cd1269a1403f6af4e08de8d902e6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 14 Dec 2023 11:43:45 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=B8=80=E6=97=A6=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=A2=E3=82=A6=E3=83=88"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c1ce3e0625cbe73786bf8144efb1c8d9252070f0. --- .../feature/debug/DebugMenuFragment.java | 210 +++++++++--------- 1 file changed, 105 insertions(+), 105 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 553e603c..85535412 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 @@ -1,105 +1,105 @@ -//package one.nem.lacerta.feature.debug; -// -//import android.os.Bundle; -// -//import androidx.fragment.app.Fragment; -//import androidx.navigation.Navigation; -// -//import android.view.LayoutInflater; -//import android.view.View; -//import android.view.ViewGroup; -//import android.widget.Toast; -// -//import java.io.File; -//import java.io.IOException; -// -//import dagger.hilt.android.AndroidEntryPoint; -//import javax.inject.Inject; -// -//import one.nem.lacerta.utils.repository.DeviceInfoUtils; -// -//import one.nem.lacerta.data.Document; -// -// -///** -// * A simple {@link Fragment} subclass. -// * Use the {@link DebugMenuFragment#newInstance} factory method to -// * create an instance of this fragment. -// */ -// -//@AndroidEntryPoint -//public class DebugMenuFragment extends Fragment { -// @Inject -// DeviceInfoUtils deviceInfoUtils; -// -// -// public DebugMenuFragment() { -// // Required empty public constructor -// } -// -// public static DebugMenuFragment newInstance() { -// DebugMenuFragment fragment = new DebugMenuFragment(); -// Bundle args = new Bundle(); -// fragment.setArguments(args); -// return fragment; -// } -// -// @Override -// public void onCreate(Bundle savedInstanceState) { -// super.onCreate(savedInstanceState); -// } -// -// @Override -// public View onCreateView(LayoutInflater inflater, ViewGroup container, -// Bundle savedInstanceState) { -// // Inflate the layout for this fragment -// return inflater.inflate(R.layout.fragment_debug_menu, container, false); -// } -// -// @Override -// public void onViewCreated(View view, Bundle savedInstanceState) { -// super.onViewCreated(view, savedInstanceState); -// -// view.findViewById(R.id.btn_debug_menu_scan).setOnClickListener( v -> { -// // スキャン機能呼び出し -// Toast.makeText(getContext(), "testMessage", Toast.LENGTH_SHORT).show(); -// }); -// -// view.findViewById(R.id.btn_debug_menu_shared_pref_editor).setOnClickListener( v -> { -// // Fragment移動 -// Navigation.findNavController(view).navigate(R.id.action_debugMenuFragment_to_debugSharedPrefEditorFragment); -// }); -// -// view.findViewById(R.id.btn_debug_menu_clear_pref).setOnClickListener( v -> { -// // SharedPrefClear -// }); -// -// view.findViewById(R.id.btn_debug_menu_call_play_ground).setOnClickListener( v -> { -// Navigation.findNavController(view).navigate(R.id.action_debugMenuFragment_to_debugPlayGroundFragment); -// }); -// -// view.findViewById(R.id.btn_debug_menu_get_external_path).setOnClickListener( v -> { -// Toast.makeText(getContext(), deviceInfoUtils.getExternalStorageDirectory().toString(), Toast.LENGTH_SHORT).show(); -// }); -// -// 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); -// }); -// -// view.findViewById(R.id.btn_debug_menu_insert_test_data).setOnClickListener(v -> { -// Navigation.findNavController(view).navigate(R.id.action_debugMenuFragment_to_debugInsertTestDataFragment); -// } -// -// } -//} \ No newline at end of file +package one.nem.lacerta.feature.debug; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; +import androidx.navigation.Navigation; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Toast; + +import java.io.File; +import java.io.IOException; + +import dagger.hilt.android.AndroidEntryPoint; +import javax.inject.Inject; + +import one.nem.lacerta.utils.repository.DeviceInfoUtils; + +import one.nem.lacerta.data.Document; + + +/** + * A simple {@link Fragment} subclass. + * Use the {@link DebugMenuFragment#newInstance} factory method to + * create an instance of this fragment. + */ + +@AndroidEntryPoint +public class DebugMenuFragment extends Fragment { + @Inject + DeviceInfoUtils deviceInfoUtils; + + + public DebugMenuFragment() { + // Required empty public constructor + } + + public static DebugMenuFragment newInstance() { + DebugMenuFragment fragment = new DebugMenuFragment(); + Bundle args = new Bundle(); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_debug_menu, container, false); + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + view.findViewById(R.id.btn_debug_menu_scan).setOnClickListener( v -> { + // スキャン機能呼び出し + Toast.makeText(getContext(), "testMessage", Toast.LENGTH_SHORT).show(); + }); + + view.findViewById(R.id.btn_debug_menu_shared_pref_editor).setOnClickListener( v -> { + // Fragment移動 + Navigation.findNavController(view).navigate(R.id.action_debugMenuFragment_to_debugSharedPrefEditorFragment); + }); + + view.findViewById(R.id.btn_debug_menu_clear_pref).setOnClickListener( v -> { + // SharedPrefClear + }); + + view.findViewById(R.id.btn_debug_menu_call_play_ground).setOnClickListener( v -> { + Navigation.findNavController(view).navigate(R.id.action_debugMenuFragment_to_debugPlayGroundFragment); + }); + + view.findViewById(R.id.btn_debug_menu_get_external_path).setOnClickListener( v -> { + Toast.makeText(getContext(), deviceInfoUtils.getExternalStorageDirectory().toString(), Toast.LENGTH_SHORT).show(); + }); + + 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); + }); + + view.findViewById(R.id.btn_debug_menu_insert_test_data).setOnClickListener(v -> { + Navigation.findNavController(view).navigate(R.id.action_debugMenuFragment_to_debugInsertTestDataFragment); + } + + } +} \ No newline at end of file