不要になったデバッグメニューの画面を削除

This commit is contained in:
r-ca 2024-01-14 17:25:19 +09:00
parent 475e378b7c
commit bc74ee605e
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
6 changed files with 2 additions and 248 deletions

View File

@ -1,81 +0,0 @@
package one.nem.lacerta.feature.debug;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.data.Document;
import one.nem.lacerta.feature.debug.common.adapter.DebugMenuDocumentListItemAdapter;
import one.nem.lacerta.feature.debug.common.model.DebugMenuDocumentListItem;
import one.nem.lacerta.model.document.DocumentMeta;
import one.nem.lacerta.utils.LacertaLogger;
/**
* A simple {@link Fragment} subclass.
* Use the {@link DebugMenuDocumentTesterListFragment#newInstance} factory method to
* create an instance of this fragment.
*/
@AndroidEntryPoint
public class DebugMenuDocumentTesterListFragment extends Fragment {
@Inject
Document document;
@Inject
LacertaLogger logger;
public DebugMenuDocumentTesterListFragment() {
// Required empty public constructor
}
public static DebugMenuDocumentTesterListFragment newInstance() {
DebugMenuDocumentTesterListFragment fragment = new DebugMenuDocumentTesterListFragment();
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
View view = inflater.inflate(R.layout.fragment_debug_menu_document_tester_list, container, false);
RecyclerView recyclerView = view.findViewById(R.id.recycler_view_document_list);
recyclerView.setLayoutManager(new androidx.recyclerview.widget.LinearLayoutManager(getContext()));
ArrayList<DocumentMeta> documentMetas = document.getAllDocumentMetas(100);
logger.debug("Debug/DocList", "Document count: " + documentMetas.size());
List<DebugMenuDocumentListItem> debugMenuDocumentListItems = new ArrayList<>();
for (DocumentMeta documentMeta : documentMetas) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
debugMenuDocumentListItems.add(new DebugMenuDocumentListItem(documentMeta.getTitle(), "Internal Id: " + documentMeta.getId(), simpleDateFormat.format(documentMeta.getUpdatedAt())));
}
DebugMenuDocumentListItemAdapter adapter = new DebugMenuDocumentListItemAdapter(debugMenuDocumentListItems);
recyclerView.setAdapter(adapter);
return view;
}
}

View File

@ -1,72 +0,0 @@
package one.nem.lacerta.feature.debug;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.textfield.TextInputEditText;
import java.util.UUID;
import javax.inject.Inject;
import dagger.hilt.android.AndroidEntryPoint;
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.
*/
@AndroidEntryPoint
public class DebugMenuDocumentTesterManageFragment extends Fragment {
@Inject
DocumentDebug documentDebug;
public DebugMenuDocumentTesterManageFragment() {
// Required empty public constructor
}
public static DebugMenuDocumentTesterManageFragment newInstance() {
DebugMenuDocumentTesterManageFragment fragment = new DebugMenuDocumentTesterManageFragment();
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
View view = inflater.inflate(R.layout.fragment_debug_menu_document_tester_manage, container, false);
TextInputEditText editTextDocumentTitle = view.findViewById(R.id.edit_text_document_title);
view.findViewById(R.id.button_insert_test_data).setOnClickListener( v -> {
DocumentMeta meta = new DocumentMeta(editTextDocumentTitle != null ? editTextDocumentTitle.getText().toString() : "empty title"); // TODO-rca: Nullable
DocumentPath path = new DocumentPath("root", "test_path");
DocumentDetail detail = new DocumentDetail(meta, path, "test_author", "test_default_branch");
documentDebug.insertDocument(meta, detail);
});
return view;
}
}

View File

@ -47,8 +47,8 @@ public class DebugMenuDocumentTesterTopFragment extends Fragment {
List<DebugMenuListItem> debugMenuDocTesterListItems = new ArrayList<>(); List<DebugMenuListItem> debugMenuDocTesterListItems = new ArrayList<>();
debugMenuDocTesterListItems.add(new DebugMenuListItem("DocumentListFragment", "DocumentListFragment", R.id.action_debugMenuDocumentTesterTopFragment_to_debugMenuDocumentTesterListFragment, true)); // debugMenuDocTesterListItems.add(new DebugMenuListItem("DocumentListFragment", "DocumentListFragment", R.id.action_debugMenuDocumentTesterTopFragment_to_debugMenuDocumentTesterListFragment, true));
debugMenuDocTesterListItems.add(new DebugMenuListItem("DocumentManagerFragment", "DocumentManagerFragment", R.id.action_debugMenuDocumentTesterTopFragment_to_debugMenuDocumentTesterManageFragment, true)); // debugMenuDocTesterListItems.add(new DebugMenuListItem("DocumentManagerFragment", "DocumentManagerFragment", R.id.action_debugMenuDocumentTesterTopFragment_to_debugMenuDocumentTesterManageFragment, true));
DebugMenuListItemAdapter adapter = new DebugMenuListItemAdapter(debugMenuDocTesterListItems); DebugMenuListItemAdapter adapter = new DebugMenuListItemAdapter(debugMenuDocTesterListItems);

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DebugMenuDocumentTesterListFragment" >
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_document_list"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DebugMenuDocumentTesterManageFragment" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_margin="16dp"
android:background="@drawable/rounded_secondary_container">
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:textSize="16sp"
android:textColor="@color/colorOnSecondaryContainer"
android:text="Debug actions" />
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Document title"
android:id="@+id/edit_text_document_title"
android:layout_margin="16dp"
android:inputType="text"
android:textSize="16sp"
style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox" />
<com.google.android.material.button.MaterialButton
android:id="@+id/button_insert_test_data"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="Insert test data"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -28,23 +28,7 @@
android:name="one.nem.lacerta.feature.debug.DebugMenuDocumentTesterTopFragment" android:name="one.nem.lacerta.feature.debug.DebugMenuDocumentTesterTopFragment"
android:label="fragment_debug_menu_document_tester_top" android:label="fragment_debug_menu_document_tester_top"
tools:layout="@layout/fragment_debug_menu_document_tester_top" > tools:layout="@layout/fragment_debug_menu_document_tester_top" >
<action
android:id="@+id/action_debugMenuDocumentTesterTopFragment_to_debugMenuDocumentTesterListFragment"
app:destination="@id/debugMenuDocumentTesterListFragment" />
<action
android:id="@+id/action_debugMenuDocumentTesterTopFragment_to_debugMenuDocumentTesterManageFragment"
app:destination="@id/debugMenuDocumentTesterManageFragment" />
</fragment> </fragment>
<fragment
android:id="@+id/debugMenuDocumentTesterListFragment"
android:name="one.nem.lacerta.feature.debug.DebugMenuDocumentTesterListFragment"
android:label="fragment_debug_menu_document_tester_list"
tools:layout="@layout/fragment_debug_menu_document_tester_list" />
<fragment
android:id="@+id/debugMenuDocumentTesterManageFragment"
android:name="one.nem.lacerta.feature.debug.DebugMenuDocumentTesterManageFragment"
android:label="fragment_debug_menu_document_tester_manage"
tools:layout="@layout/fragment_debug_menu_document_tester_manage" />
<fragment <fragment
android:id="@+id/scannerDataManagerStubFragment" android:id="@+id/scannerDataManagerStubFragment"
android:name="one.nem.lacerta.component.scanner.ScannerDataManagerStubFragment" android:name="one.nem.lacerta.component.scanner.ScannerDataManagerStubFragment"