From 5639117e0ee941722dc0a6effea6efd8766a903b Mon Sep 17 00:00:00 2001 From: r-ca Date: Wed, 24 Jan 2024 17:32:58 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88=E3=83=AA?= =?UTF-8?q?=E3=82=B9=E3=83=8A=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/component/viewer/RevAdapter.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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