mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
デバッグメニュー作り直す
This commit is contained in:
parent
92ec3d31f4
commit
137316d95b
|
@ -1,58 +0,0 @@
|
|||
package one.nem.lacerta.feature.debug;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import one.nem.lacerta.feature.debug.common.model.SettingMenuItem;
|
||||
|
||||
public class DebugDocumentMenuAdapter extends RecyclerView.Adapter<DebugDocumentMenuAdapter.ViewHolder> {
|
||||
|
||||
private List<SettingMenuItem> menuItems;
|
||||
|
||||
public DebugDocumentMenuAdapter(List<SettingMenuItem> menuItems) {
|
||||
this.menuItems = menuItems;
|
||||
}
|
||||
|
||||
public DebugDocumentMenuAdapter() {
|
||||
// Empty constructor
|
||||
}
|
||||
|
||||
public void addMenuItem(SettingMenuItem menuItem) {
|
||||
this.menuItems.add(menuItem);
|
||||
}
|
||||
public void setMenuItems(List<SettingMenuItem> menuItems) {
|
||||
this.menuItems = menuItems;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
SettingMenuItem menuItem = menuItems.get(position);
|
||||
holder.itemView.setOnClickListener( v -> {
|
||||
Navigation.findNavController(v).navigate(menuItem.getDestinationId());
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return menuItems.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package one.nem.lacerta.feature.debug;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
public class DebugMenuContainerActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_debug_menu_container);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,138 +0,0 @@
|
|||
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 android.widget.Toolbar;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.UUID;
|
||||
|
||||
import dagger.hilt.android.AndroidEntryPoint;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
|
||||
|
||||
import one.nem.lacerta.data.DocumentDebug; // Debug
|
||||
|
||||
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 DebugMenuFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
|
||||
@AndroidEntryPoint
|
||||
public class DebugMenuFragment extends Fragment {
|
||||
@Inject
|
||||
DeviceInfoUtils deviceInfoUtils;
|
||||
|
||||
@Inject
|
||||
DocumentDebug documentDebug; // Debug
|
||||
|
||||
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);
|
||||
|
||||
// Toolbarの設定
|
||||
// TODO-rca: Toolbarの設定を共通化する
|
||||
androidx.appcompat.widget.Toolbar toolbar = view.findViewById(R.id.toolbar);
|
||||
toolbar.setTitle("DebugMenu");
|
||||
|
||||
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 -> {
|
||||
// テストデータ挿入
|
||||
DocumentMeta meta = new DocumentMeta();
|
||||
DocumentDetail detail = new DocumentDetail();
|
||||
|
||||
meta.setId(UUID.randomUUID().toString());
|
||||
meta.setTitle("testTitle");
|
||||
meta.setCreatedAt(new java.util.Date());
|
||||
meta.setUpdatedAt(new java.util.Date());
|
||||
meta.setTags(new java.util.ArrayList<DocumentTag>());
|
||||
|
||||
detail.setAuthor("testAuthor");
|
||||
detail.setDefaultBranch("testDefaultBranch");
|
||||
detail.setMeta(meta);
|
||||
detail.setPath(new DocumentPath("testRootPath", "testPath"));
|
||||
|
||||
documentDebug.insertDocument(meta, detail);
|
||||
});
|
||||
|
||||
view.findViewById(R.id.btn_debug_menu_select_test_data).setOnClickListener(v -> {
|
||||
Navigation.findNavController(view).navigate(R.id.action_debugMenuFragment_to_debugDocumentManageFragment);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,52 +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 android.widget.Toast;
|
||||
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import dagger.hilt.android.AndroidEntryPoint;
|
||||
|
||||
@AndroidEntryPoint // HiltのDIを有効にするアノテーション
|
||||
public class DebugPlayGroundFragment extends Fragment {
|
||||
|
||||
public DebugPlayGroundFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static DebugPlayGroundFragment newInstance() {
|
||||
DebugPlayGroundFragment fragment = new DebugPlayGroundFragment();
|
||||
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_play_ground, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
// ここがいままでのonCreateと同等のものです。
|
||||
// findViewById(R.id.hoge)とかは view.findViewById(R.id.hoge) と書き換える必要アリ
|
||||
// (viewは引数として受け取ってるviewなので、別メソッドに切り出したりするなら渡してあげる)
|
||||
|
||||
}
|
||||
}
|
|
@ -1,76 +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 android.widget.EditText;
|
||||
//import android.widget.Toast;
|
||||
//
|
||||
//import org.eclipse.jgit.lib.Repository;
|
||||
//import org.intellij.lang.annotations.JdkConstants;
|
||||
//
|
||||
//import java.util.UUID;
|
||||
//
|
||||
//import javax.inject.Inject;
|
||||
//
|
||||
//import dagger.hilt.android.AndroidEntryPoint;
|
||||
//
|
||||
//import one.nem.lacerta.data.repository.DebugFunc;
|
||||
//
|
||||
///**
|
||||
// * A simple {@link Fragment} subclass.
|
||||
// * Use the {@link DebugRepositoryDebuggerFragment#newInstance} factory method to
|
||||
// * create an instance of this fragment.
|
||||
// */
|
||||
//
|
||||
//@AndroidEntryPoint
|
||||
//public class DebugRepositoryDebuggerFragment extends Fragment {
|
||||
//
|
||||
// @Inject
|
||||
// DebugFunc debugFunc;
|
||||
//
|
||||
// public DebugRepositoryDebuggerFragment() {
|
||||
// // Required empty public constructor
|
||||
// }
|
||||
//
|
||||
// public static DebugRepositoryDebuggerFragment newInstance() {
|
||||
// DebugRepositoryDebuggerFragment fragment = new DebugRepositoryDebuggerFragment();
|
||||
// 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_repository_debugger, container, false);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
// super.onViewCreated(view, savedInstanceState);
|
||||
//
|
||||
// EditText editTextRepoId = view.findViewById(R.id.editTextRepoId);
|
||||
//
|
||||
// view.findViewById(R.id.buttonGenerateRepoId).setOnClickListener(v -> {
|
||||
// editTextRepoId.setText(UUID.randomUUID().toString()); //Generate random UUID
|
||||
// Toast.makeText(getContext(), "Generated random UUID", Toast.LENGTH_SHORT).show();
|
||||
// });
|
||||
//
|
||||
// view.findViewById(R.id.buttonGetCreateRepository).setOnClickListener(v -> {
|
||||
// String repoId = editTextRepoId.getText().toString();
|
||||
// Repository repo = debugFunc.getOrCreateRepositoryById(repoId);
|
||||
// Toast.makeText(getContext(), "Get or create repository: " + repoId, Toast.LENGTH_SHORT).show();
|
||||
// });
|
||||
// }
|
||||
//}
|
|
@ -1,111 +0,0 @@
|
|||
//package one.nem.lacerta.feature.debug;
|
||||
//
|
||||
//import android.os.Bundle;
|
||||
//
|
||||
//import androidx.fragment.app.Fragment;
|
||||
//import androidx.recyclerview.widget.RecyclerView;
|
||||
//
|
||||
//import android.util.Log;
|
||||
//import android.view.LayoutInflater;
|
||||
//import android.view.View;
|
||||
//import android.view.ViewGroup;
|
||||
//import android.widget.EditText;
|
||||
//import android.widget.RadioGroup;
|
||||
//import android.widget.TextView;
|
||||
//
|
||||
//import org.w3c.dom.Text;
|
||||
//
|
||||
//import java.util.Map;
|
||||
//
|
||||
//import one.nem.lacerta.data.model.shared_pref.enums.SharedPrefType;
|
||||
//
|
||||
//import one.nem.lacerta.data.repository.SharedPref;
|
||||
//
|
||||
//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
|
||||
// SharedPref sharedPref;
|
||||
//
|
||||
// SharedPrefType sharedPrefType = null;
|
||||
//
|
||||
// public DebugSharedPrefEditorFragment() {
|
||||
// // Required empty public constructor
|
||||
// }
|
||||
//
|
||||
// public static DebugSharedPrefEditorFragment newInstance() {
|
||||
// DebugSharedPrefEditorFragment fragment = new DebugSharedPrefEditorFragment();
|
||||
// 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_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);
|
||||
//
|
||||
// TextView prefItemTextView = view.findViewById(R.id.prefItemTextView);
|
||||
//
|
||||
// view.findViewById(R.id.loadButton).setOnClickListener(v -> {
|
||||
// String value = sharedPref.getSharedPreferencesByTag(sharedPrefType).getString(loadKeyEditText.getText().toString(), "null");
|
||||
// ((TextView) view.findViewById(R.id.loadValueTextView)).setText(value);
|
||||
// });
|
||||
//
|
||||
// view.findViewById(R.id.saveButton).setOnClickListener(v -> {
|
||||
// String[] split = saveKeyEditText.getText().toString().split(":");
|
||||
// sharedPref.getSharedPreferencesByTag(sharedPrefType).edit().putString(split[0], split[1]).apply();
|
||||
// updateList(prefItemTextView);
|
||||
// });
|
||||
//
|
||||
// // ラジオボタンの変更を監視
|
||||
// ((RadioGroup) view.findViewById(R.id.radioGroupPrefType)).setOnCheckedChangeListener((group, checkedId) -> {
|
||||
// if (checkedId == R.id.radioButtonCommon) {
|
||||
// sharedPrefType = SharedPrefType.COMMON;
|
||||
// updateList(prefItemTextView);
|
||||
// } else if (checkedId == R.id.radioButtonUserData) {
|
||||
// sharedPrefType = SharedPrefType.USERDATA;
|
||||
// updateList(prefItemTextView);
|
||||
// } else {
|
||||
// Log.e("DebugSharedPrefEditorFragment", "radioButtonのIDが不正です");
|
||||
// }
|
||||
// updateList(prefItemTextView);
|
||||
// });
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public void updateList(TextView textView) {
|
||||
// // リストの更新
|
||||
// Map<String, ?> resultMap = sharedPref.getSharedPreferencesByTag(sharedPrefType).getAll();
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// for (Map.Entry<String, ?> entry : resultMap.entrySet()) {
|
||||
// sb.append(entry.getKey()).append(":").append(entry.getValue().toString()).append("\n");
|
||||
// }
|
||||
//
|
||||
// textView.setText(sb.toString());
|
||||
// }
|
||||
//}
|
|
@ -1,58 +0,0 @@
|
|||
package one.nem.lacerta.feature.debug;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import one.nem.lacerta.feature.debug.common.model.SettingMenuItem;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Use the {@link DocumentManageDebugFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class DocumentManageDebugFragment extends Fragment {
|
||||
public DocumentManageDebugFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static DocumentManageDebugFragment newInstance() {
|
||||
DocumentManageDebugFragment fragment = new DocumentManageDebugFragment();
|
||||
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_document_manage_debug, container, false);
|
||||
|
||||
RecyclerView recyclerView = view.findViewById(R.id.doc_editor_menu_recycler_view);
|
||||
|
||||
List<SettingMenuItem> menuItems = List.of(
|
||||
new SettingMenuItem("test", )
|
||||
);
|
||||
|
||||
recyclerView.setAdapter(new DebugDocumentMenuAdapter());
|
||||
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package one.nem.lacerta.feature.debug.common.model;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.navigation.ActivityNavigator;
|
||||
|
||||
public class SettingMenuItem {
|
||||
private String title;
|
||||
private String description;
|
||||
private String destinationId;
|
||||
|
||||
public SettingMenuItem(String title, String description, String destinationId) {
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.destinationId = destinationId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getDestinationId() {
|
||||
return destinationId;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setDestinationId(String destinationId) {
|
||||
this.destinationId = destinationId;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,23 +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:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".DebugMenuContainerActivity">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragmentContainerView"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="409dp"
|
||||
android:layout_height="729dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navGraph="@navigation/feature_debug_navigation" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,207 +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"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/Theme.Material3.DayNight.NoActionBar"
|
||||
tools:context=".DebugMenuFragment">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:elevation="10dp"
|
||||
tools:title="Debug Menu"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<!-- <com.google.android.material.textview.MaterialTextView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="Debug Menu"-->
|
||||
<!-- android:textSize="36sp"-->
|
||||
<!-- android:padding="16dp" />-->
|
||||
|
||||
<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_toBottomOf="@id/toolbar">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Call Events -->
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="Call Debug Events"
|
||||
android:textSize="24sp" />
|
||||
<!-- android:textColor="@color/material_dynamic_primary10" />-->
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_debug_menu_scan"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="Start scan action" />
|
||||
|
||||
<!-- Padding -->
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="SharedPref"
|
||||
android:textSize="24sp" />
|
||||
<!-- android:textColor="@color/material_dynamic_primary10" />-->
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_debug_menu_clear_pref"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="Clear Preferences" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_debug_menu_shared_pref_editor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="Shared Preferences Editor" />
|
||||
|
||||
<!-- Padding -->
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="PlayGround"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_debug_menu_call_play_ground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="Playground" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="FileDebug"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_debug_menu_get_external_path"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="Get External Path" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="File Debug"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_debug_menu_file_write_test"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="Repository Debugger" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="Repository Debug"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_debug_menu_go_to_repository_debug"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="Repository Debugger" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="DatabaseDebug"
|
||||
android:textSize="24sp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_debug_menu_insert_test_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="InsertDebugData" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_debug_menu_select_test_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="SelectDebugData" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,48 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".DebugPlayGroundFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
</ScrollView>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
</ScrollView>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
</ScrollView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
|
@ -1,56 +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=".DebugRepositoryDebuggerFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
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="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextRepoId"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="RepositoryID" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonGenerateRepoId"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Generate" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonGetCreateRepository"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Get/Create Repository" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,121 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:orientation="vertical"
|
||||
tools:context=".DebugSharedPrefEditorFragment">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radioGroupPrefType"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButtonCommon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Common" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioButtonUserData"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="UserData" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Save pref" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/SaveLinearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/saveKeyEditText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="2"
|
||||
android:hint="Key:Value" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/saveButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
android:text="Save" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Load pref" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/LoadLinearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/loadKeyEditText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:hint="Key" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/loadButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Load" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loadValueTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="No value..."
|
||||
android:textSize="24sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/prefItemTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="None" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -1,27 +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"
|
||||
android:theme="@style/Theme.Material3.DayNight.NoActionBar">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:elevation="10dp"
|
||||
tools:title="Document Manage"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/doc_editor_menu_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="This is a CardView"
|
||||
android:padding="16dp"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@android:color/black"/>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -2,47 +2,6 @@
|
|||
<navigation 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:id="@+id/feature_debug_navigation"
|
||||
app:startDestination="@id/debugMenuFragment">
|
||||
<fragment
|
||||
android:id="@+id/debugMenuFragment"
|
||||
android:name="one.nem.lacerta.feature.debug.DebugMenuFragment"
|
||||
android:label="fragment_debug_menu"
|
||||
tools:layout="@layout/fragment_debug_menu" >
|
||||
<action
|
||||
android:id="@+id/action_debugMenuFragment_to_debugSharedPrefEditorFragment"
|
||||
app:destination="@id/debugSharedPrefEditorFragment" />
|
||||
<action
|
||||
android:id="@+id/action_debugMenuFragment_to_debugPlayGroundFragment"
|
||||
app:destination="@id/debugPlayGroundFragment" />
|
||||
<action
|
||||
android:id="@+id/action_debugMenuFragment_to_debugRepositoryDebuggerFragment"
|
||||
app:destination="@id/debugRepositoryDebuggerFragment" />
|
||||
<action
|
||||
android:id="@+id/action_debugMenuFragment_to_debugDocumentManageFragment"
|
||||
app:destination="@id/debugDocumentManageFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/debugSharedPrefEditorFragment"
|
||||
android:name="one.nem.lacerta.feature.debug.DebugSharedPrefEditorFragment"
|
||||
android:label="fragment_debug_shared_pref_editor"
|
||||
tools:layout="@layout/fragment_debug_shared_pref_editor" />
|
||||
android:id="@+id/feature_debug_navigation">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/debugPlayGroundFragment"
|
||||
android:name="one.nem.lacerta.feature.debug.DebugPlayGroundFragment"
|
||||
android:label="fragment_debug_play_ground"
|
||||
tools:layout="@layout/fragment_debug_play_ground" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/debugRepositoryDebuggerFragment"
|
||||
android:name="one.nem.lacerta.feature.debug.DebugRepositoryDebuggerFragment"
|
||||
android:label="fragment_debug_repository_debugger"
|
||||
tools:layout="@layout/fragment_debug_repository_debugger" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/debugDocumentManageFragment"
|
||||
android:name="one.nem.lacerta.feature.debug.DocumentManageDebugFragment"
|
||||
android:label="fragment_debug_document_manage"
|
||||
tools:layout="@layout/fragment_document_manage_debug" />
|
||||
</navigation>
|
Loading…
Reference in New Issue
Block a user