diff --git a/shared/ui/src/main/java/one/nem/lacerta/shared/ui/LacertaSelectDirDialog.java b/shared/ui/src/main/java/one/nem/lacerta/shared/ui/LacertaSelectDirDialog.java deleted file mode 100644 index 4faebf45..00000000 --- a/shared/ui/src/main/java/one/nem/lacerta/shared/ui/LacertaSelectDirDialog.java +++ /dev/null @@ -1,47 +0,0 @@ -package one.nem.lacerta.shared.ui; - -import android.app.Dialog; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.Toast; - -import androidx.appcompat.widget.Toolbar; -import androidx.fragment.app.DialogFragment; -import androidx.recyclerview.widget.RecyclerView; - -import com.google.android.material.dialog.MaterialAlertDialogBuilder; - -public class LacertaSelectDirDialog extends DialogFragment { - - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); - LayoutInflater inflater = requireActivity().getLayoutInflater(); - View view = inflater.inflate(R.layout.lacerta_dialog_select_dir, null); - - RecyclerView recyclerView = view.findViewById(R.id.select_dir_recycler_view); - recyclerView.setHasFixedSize(true); - - SelectDirDialogItemAdapter adapter = new SelectDirDialogItemAdapter((name, itemId) -> { - Toast.makeText(getContext(), "Called", Toast.LENGTH_SHORT).show(); - dismiss(); - }); - recyclerView.setAdapter(adapter); - recyclerView.setLayoutManager(new androidx.recyclerview.widget.LinearLayoutManager(getContext())); - - Toolbar toolbar = view.findViewById(R.id.select_dir_toolbar); - toolbar.setNavigationOnClickListener(v -> { - Toast.makeText(getContext(), "Called", Toast.LENGTH_SHORT).show(); - dismiss(); - }); - - builder.setView(view); - - builder.setTitle("Select Directory"); - builder.setMessage("Please select a directory."); - builder.setPositiveButton("OK", null); - builder.setNegativeButton("Cancel", null); - return builder.create(); - } -} diff --git a/shared/ui/src/main/java/one/nem/lacerta/shared/ui/LacertaSelectDirDialogEventListener.java b/shared/ui/src/main/java/one/nem/lacerta/shared/ui/LacertaSelectDirDialogEventListener.java deleted file mode 100644 index a2fb8fdb..00000000 --- a/shared/ui/src/main/java/one/nem/lacerta/shared/ui/LacertaSelectDirDialogEventListener.java +++ /dev/null @@ -1,5 +0,0 @@ -package one.nem.lacerta.shared.ui; - -public interface LacertaSelectDirDialogEventListener { - void onDirSelected(String name, String itemId); -} diff --git a/shared/ui/src/main/java/one/nem/lacerta/shared/ui/SelectDirDialogItemAdapter.java b/shared/ui/src/main/java/one/nem/lacerta/shared/ui/SelectDirDialogItemAdapter.java deleted file mode 100644 index 81ffc6ec..00000000 --- a/shared/ui/src/main/java/one/nem/lacerta/shared/ui/SelectDirDialogItemAdapter.java +++ /dev/null @@ -1,63 +0,0 @@ -package one.nem.lacerta.shared.ui; - -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; - -import java.util.ArrayList; - -import one.nem.lacerta.model.ListItem; - -public class SelectDirDialogItemAdapter extends RecyclerView.Adapter { - - ArrayList listItems; - LacertaSelectDirDialogEventListener listener; - - public SelectDirDialogItemAdapter(LacertaSelectDirDialogEventListener listener) { - this.listener = listener; - } - - public void setListItems(ArrayList listItems) { - this.listItems = listItems; - } - - @Override - public SelectDirDialogItemAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.common_list_item, parent, false); - return new SelectDirDialogItemAdapter.ViewHolder(view); - } - - @Override - public void onBindViewHolder(SelectDirDialogItemAdapter.ViewHolder holder, int position) { - ListItem listItem = listItems.get(position); - holder.title.setText(listItem.getTitle()); - holder.description.setText(listItem.getDescription()); - holder.itemView.setOnClickListener(v -> { - listener.onDirSelected(listItem.getTitle(), listItem.getItemId()); - }); - } - - @Override - public int getItemCount() { - return listItems.size(); - } - - public class ViewHolder extends RecyclerView.ViewHolder { - - TextView title; - TextView description; - - - public ViewHolder(@NonNull View itemView) { - super(itemView); - - title = itemView.findViewById(R.id.item_title); - description = itemView.findViewById(R.id.item_description); - - } - } -} diff --git a/shared/ui/src/main/res/layout/lacerta_dialog_select_dir.xml b/shared/ui/src/main/res/layout/lacerta_dialog_select_dir.xml deleted file mode 100644 index b62a4868..00000000 --- a/shared/ui/src/main/res/layout/lacerta_dialog_select_dir.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - \ No newline at end of file