From 93971a097aeb728aae9c0a6121f1f247a76100f0 Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 18 Dec 2023 00:07:06 +0900 Subject: [PATCH] =?UTF-8?q?Insert=E3=83=86=E3=82=B9=E3=83=88=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...DebugMenuDocumentTesterManageFragment.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuDocumentTesterManageFragment.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuDocumentTesterManageFragment.java index 08de764c..ec0157b0 100644 --- a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuDocumentTesterManageFragment.java +++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuDocumentTesterManageFragment.java @@ -8,12 +8,29 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import java.util.UUID; + +import javax.inject.Inject; + +import dagger.multibindings.IntKey; +import one.nem.lacerta.data.DocumentDebug; + +import one.nem.lacerta.model.document.DocumentMeta; +import one.nem.lacerta.model.document.DocumentDetail; + +import one.nem.lacerta.model.document.path.DocumentPath; +import one.nem.lacerta.model.document.tag.DocumentTag; + /** * A simple {@link Fragment} subclass. * Use the {@link DebugMenuDocumentTesterManageFragment#newInstance} factory method to * create an instance of this fragment. */ public class DebugMenuDocumentTesterManageFragment extends Fragment { + + @Inject + DocumentDebug documentDebug; + public DebugMenuDocumentTesterManageFragment() { // Required empty public constructor } @@ -34,6 +51,16 @@ public class DebugMenuDocumentTesterManageFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_debug_menu_document_tester_manage, container, false); + View view = inflater.inflate(R.layout.fragment_debug_menu_document_tester_manage, container, false); + + view.findViewById(R.id.button_insert_test_data).setOnClickListener( v -> { + DocumentMeta meta = new DocumentMeta("test_title"); + DocumentPath path = new DocumentPath("root", "test_path"); + DocumentDetail detail = new DocumentDetail(meta, path, "test_author", "test_default_branch"); + + documentDebug.insertDocument(meta, detail); + }); + + return view; } } \ No newline at end of file