diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/RevAdapter.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/RevAdapter.java index eb5c634f..4ad968c1 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/RevAdapter.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/RevAdapter.java @@ -12,6 +12,7 @@ import java.text.SimpleDateFormat; import java.time.format.DateTimeFormatter; import java.util.ArrayList; +import one.nem.lacerta.component.viewer.model.RevSelectListener; import one.nem.lacerta.model.VcsRevModel; import one.nem.lacerta.utils.FeatureSwitch; @@ -19,11 +20,14 @@ public class RevAdapter extends RecyclerView.Adapter{ private ArrayList revModels; + private RevSelectListener revSelectListener; + public RevAdapter(ArrayList revModels) { this.revModels = revModels; } - public RevAdapter() { + public RevAdapter(RevSelectListener revSelectListener) { + this.revSelectListener = revSelectListener; } public void setRevModels(ArrayList revModels) { @@ -52,6 +56,13 @@ public class RevAdapter extends RecyclerView.Adapter{ } holder.revId.setText("RevID: " + revModel.getId()); + holder.itemView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + revSelectListener.onRevSelect(revModel.getId()); + } + }); + } @Override