diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugDocumentMenuAdapter.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugDocumentMenuAdapter.java new file mode 100644 index 00000000..305d3e0e --- /dev/null +++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugDocumentMenuAdapter.java @@ -0,0 +1,46 @@ +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 { + + private List menuItems; + + public DebugDocumentMenuAdapter(List 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); + } + } +}