mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
アイテムにタッチリスナーを追加
This commit is contained in:
parent
cf257a44ec
commit
542c04b908
|
@ -78,11 +78,10 @@ public class LacertaSelectRevDialog extends DialogFragment {
|
||||||
SelectRevDialogItemAdapter adapter = new SelectRevDialogItemAdapter(revId -> {
|
SelectRevDialogItemAdapter adapter = new SelectRevDialogItemAdapter(revId -> {
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.onItemSelected(revId);
|
listener.onItemSelected(revId);
|
||||||
|
dismiss();
|
||||||
}
|
}
|
||||||
dismiss();
|
|
||||||
});
|
});
|
||||||
|
recyclerView.setAdapter(adapter);
|
||||||
recyclerView.setAdapter(adapter);
|
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
builder.setView(view);
|
builder.setView(view);
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,8 @@ public class SelectRevDialogItemAdapter extends RecyclerView.Adapter<SelectRevDi
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||||
holder.description.setText(simpleDateFormat.format(rev.getCreatedAt()));
|
holder.description.setText(simpleDateFormat.format(rev.getCreatedAt()));
|
||||||
holder.revId.setText("RevID: " + rev.getId());
|
holder.revId.setText("RevID: " + rev.getId());
|
||||||
|
|
||||||
|
holder.itemView.setOnClickListener(v -> listener.onItemSelected(rev.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user