mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
イベントリスナ実装
This commit is contained in:
parent
1b60b15187
commit
5639117e0e
|
@ -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<RevAdapter.RevViewHolder>{
|
|||
|
||||
private ArrayList<VcsRevModel> revModels;
|
||||
|
||||
private RevSelectListener revSelectListener;
|
||||
|
||||
public RevAdapter(ArrayList<VcsRevModel> revModels) {
|
||||
this.revModels = revModels;
|
||||
}
|
||||
|
||||
public RevAdapter() {
|
||||
public RevAdapter(RevSelectListener revSelectListener) {
|
||||
this.revSelectListener = revSelectListener;
|
||||
}
|
||||
|
||||
public void setRevModels(ArrayList<VcsRevModel> revModels) {
|
||||
|
@ -52,6 +56,13 @@ public class RevAdapter extends RecyclerView.Adapter<RevAdapter.RevViewHolder>{
|
|||
}
|
||||
holder.revId.setText("RevID: " + revModel.getId());
|
||||
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
revSelectListener.onRevSelect(revModel.getId());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user