実装整理

This commit is contained in:
ろむねこ 2024-01-25 12:19:37 +09:00
parent 7a9c81282f
commit dbd719368f
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -29,9 +29,9 @@ public class LacertaSelectDirDialog extends DialogFragment {
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity());
LayoutInflater inflater = requireActivity().getLayoutInflater(); LayoutInflater inflater = requireActivity().getLayoutInflater();
View view = inflater.inflate(one.nem.lacerta.shared.ui.R.layout.lacerta_dialog_select_dir, null); View view = inflater.inflate(R.layout.lacerta_dialog_select_dir, null);
RecyclerView recyclerView = view.findViewById(one.nem.lacerta.shared.ui.R.id.select_dir_recycler_view); RecyclerView recyclerView = view.findViewById(R.id.select_dir_recycler_view);
recyclerView.setHasFixedSize(true); recyclerView.setHasFixedSize(true);
showRecyclerViewItem(null); // get root folder list showRecyclerViewItem(null); // get root folder list
@ -45,12 +45,6 @@ public class LacertaSelectDirDialog extends DialogFragment {
recyclerView.setAdapter(this.adapter); recyclerView.setAdapter(this.adapter);
recyclerView.setLayoutManager(new androidx.recyclerview.widget.LinearLayoutManager(getContext())); recyclerView.setLayoutManager(new androidx.recyclerview.widget.LinearLayoutManager(getContext()));
Toolbar toolbar = view.findViewById(one.nem.lacerta.shared.ui.R.id.select_dir_toolbar);
toolbar.setNavigationOnClickListener(v -> {
Toast.makeText(getContext(), "Called", Toast.LENGTH_SHORT).show();
dismiss();
});
builder.setView(view); builder.setView(view);
builder.setTitle("Select Directory"); builder.setTitle("Select Directory");