Interaction between the recyclerview - java

there are two recyclerview and two adapters. Both recyclerview contain text fields and buttons. I have below pressing in one recyclerview item jumped to another recyclerview and vice versa. How to do it?
First adapter:
public class RVAdapterStart extends RecyclerView.Adapter<RVAdapterStart.TaskViewHolder> {
public static class TaskViewHolder extends RecyclerView.ViewHolder {
RelativeLayout relativeLayout;
private TextView title;
private TextView status;
private Button button;
TaskViewHolder(View view) {
super(view);
relativeLayout = (RelativeLayout) view.findViewById(R.id.frameLayout);
title = (TextView) view.findViewById(R.id.title);
status = (TextView) view.findViewById(R.id.status);
button = (Button) view.findViewById(R.id.tasks_finish);
}
}
private List<Task> tasksStart;
RVAdapterStart() {
}
#Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
}
#Override
public void onBindViewHolder(TaskViewHolder holder, final int position) {
holder.title.setText(tasksStart.get(position).getTitle());
holder.status.setText(tasksStart.get(position).getStatus());
holder.button.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
}
});
}
#Override
public int getItemCount() {
return tasksStart.size();
}
#Override
public TaskViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_tasks_start, viewGroup, false);
TaskViewHolder tvh = new TaskViewHolder(view);
return tvh;
}
Second adapter:
public class RVAdapterProcces extends RecyclerView.Adapter<RVAdapterProcces.TasksViewHolder> {
public static class TasksViewHolder extends RecyclerView.ViewHolder {
RelativeLayout relativeLayout;
private TextView title;
private TextView status;
private Button TaskFinishBtn;
private Button TaskCancelBtn;
TasksViewHolder(View view) {
super(view);
relativeLayout = (RelativeLayout) view.findViewById(R.id.relative_tasks_procces);
title = (TextView) view.findViewById(R.id.title_procces);
status = (TextView) view.findViewById(R.id.status_procces);
TaskFinishBtn = (Button) view.findViewById(R.id.tasks_finish);
TaskCancelBtn = (Button) view.findViewById(R.id.tasks_procces_cancel);
}
}
private List<Task> tasksProcces = new ArrayList<Task>();
RVAdapterProcces() {
}
#Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
}
#Override
public void onBindViewHolder(TasksViewHolder holder, final int position) {
holder.title.setText(tasksProcces.get(position).getTitle());
holder.status.setText(tasksProcces.get(position).getStatus());
}
#Override
public int getItemCount() {
return tasksProcces.size();
}
#Override
public TasksViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.list_tasks_procces, viewGroup, false);
TasksViewHolder tvh = new TasksViewHolder(view);
return tvh;
}

Related

On Clicking one button, it Triggers another button in recycle view

I'm currently working on a attandance management Android app. In my recyclerview there are list of student detail being populated dynamically from database. When i click the first button in the list, it also change the button colour of the 11th button of the list Like wise to 2nd button click changes the colour of 12th View button
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> {
Context context;`enter code here`
List<StudentDetails> MainImageUploadInfoList;
public RecyclerViewAdapter(Context context, List<StudentDetails> TempList) {
this.MainImageUploadInfoList = TempList;
this.context = context;
}
#Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recyclerview_items, parent, false);
ViewHolder viewHolder = new ViewHolder(view);
return viewHolder;
}
#Override
public void onBindViewHolder(ViewHolder holder, int position) {
StudentDetails studentDetails = MainImageUploadInfoList.get(position);
holder.StudentNameTextView.setText(studentDetails.getName());
holder.StudentNumberTextView.setText(studentDetails.getPhoneNumber());
holder.st.setText(studentDetails.getRollno());
holder.cardView.setCardBackgroundColor(getcolor(position));
}
private int getcolor(int position) {
return Color.parseColor("#" + Integer.toHexString(ContextCompat.getColor(context, R.color.normal)));
}
#Override
public int getItemCount() {
return MainImageUploadInfoList.size();
}
class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
public TextView StudentNameTextView;
public TextView StudentNumberTextView;
public TextView st;
DatabaseReference databaseReference;
String se,wh,su,d;
Button b;
CardView cardView;
public ViewHolder(View itemView) {
super(itemView);
itemView.setOnClickListener(this);
StudentNameTextView = (TextView) itemView.findViewById(R.id.ShowStudentNameTextView);
StudentNumberTextView = (TextView) itemView.findViewById(R.id.ShowStudentNumberTextView);
st = (TextView) itemView.findViewById(R.id.studentrollno);
cardView=itemView.findViewById(R.id.cardview1);
se=Teacher.getInstance().getSe();
wh=Teacher.getInstance().getWh();
su=Teacher.getInstance().getSu();
d=Teacher.getInstance().getD();
b=itemView.findViewById(R.id.button3);
itemView.findViewById(R.id.button3).setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(final View view ) {
int position=getAdapterPosition();
String message = String.valueOf(position) ;
databaseReference= FirebaseDatabase.getInstance().getReference("attandance").child(wh).child(se).child(su).child(d).child(message);
databaseReference.setValue("p");
itemView.findViewById(R.id.button3).setBackgroundColor(Color.GREEN);
itemView.findViewById(R.id.button4).setEnabled(false);
itemView.findViewById(R.id.button3).setEnabled(false);
Toast.makeText( context,"position is "+String.valueOf(position), Toast.LENGTH_SHORT).show();
}
});
itemView.findViewById(R.id.button4).setOnClickListener( new View.OnClickListener() {
#Override
public void onClick(final View view ) {
int position=getAdapterPosition();
String message = String.valueOf(position) ;
databaseReference= FirebaseDatabase.getInstance().getReference("attandance").child(wh).child(se).child(su).child(d).child(message);
databaseReference.setValue("A");
itemView.findViewById(R.id.button4).setBackgroundColor(Color.RED);
itemView.findViewById(R.id.button3).setEnabled(false);
itemView.findViewById(R.id.button4).setEnabled(false);
}
});
}
#Override
public void onClick(View view) {
// int position=this.getAdapterPosition();
// Intent intent=new Intent(context,mark.class);
// String message = String.valueOf(position);
// intent.putExtra("attan",message);
// context.startActivity(intent);
// Intent intent = new Intent(context,mark.class);
//String message = String.valueOf(position) ;
//intent.putExtra("attan",message);
//context.startActivity(intent);
// Toast.makeText( context,"position is "+String.valueOf(position), Toast.LENGTH_SHORT).show();
}
}
}
}

I want to implement a recyler view in the dialog

I made a recycler view inside the recycler view. And when I select the inside recycler view, the dialog is displayed, and I want to configure the recycler view in that dialog. I made a dialog and succeeded in displaying the dialog. but I don't know how to make a recycler view in a dialog. please help me.
Dialog class
public class RoomDialog extends Dialog {
private EditText etStudentName, etStudentNumber;
private Button btnConfirm, btnCancel;
private Context context;
private CustomDialogClickListener clickListener;
private Retrofit retrofit;
public EditText getEtStudentName() {
return etStudentName;
}
public EditText getEtStudentNumber() {
return etStudentNumber;
}
public Button getBtnConfirm() {
return btnConfirm;
}
public Button getBtnCancel() {
return btnCancel;
}
public RoomDialog(#NonNull Context context) {
super(context);
this.context = context;
}
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_room);
etStudentName = findViewById(R.id.et_room_Studentname);
etStudentNumber = findViewById(R.id.et_room_studentNumber);
btnConfirm = findViewById(R.id.btn_room_confrim);
btnCancel = findViewById(R.id.btn_room_cancel);
btnConfirm.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
dismiss();
}
}) ;
btnCancel.setOnClickListener( new View.OnClickListener(){
#Override
public void onClick(View v) {
dismiss();
}
});
}
}
Inner recycler view
public class RoomAdapter extends RecyclerView.Adapter<RoomAdapter.CustomViewHolder> {
private Context context;
private ArrayList<RoomData> rooms;
public ArrayList<StudnetInRoomData> students;
private LayoutInflater inflater;
public RoomAdapter(Context context, ArrayList<RoomData> rooms) {
this.context = context;
this.rooms = rooms;
this.inflater = LayoutInflater.from(context);
students = new ArrayList<>();
}
#Override
public CustomViewHolder onCreateViewHolder(#NonNull ViewGroup parent, int viewType) {
View view;
view = inflater.inflate(R.layout.single_room, parent, false);
return new CustomViewHolder(view);
}
#Override
public void onBindViewHolder(#NonNull CustomViewHolder holder, int position) {
RoomData room = rooms.get(position);
holder.tvRoomNum.setText(String.valueOf(room.roomNum));
}
#Override
public int getItemCount() {
return rooms.size();
}
public class CustomViewHolder extends RecyclerView.ViewHolder {
public TextView tvRoomNum;
public TextView tvRoomTitle;
public CustomViewHolder(View itemView) {
super(itemView);
tvRoomNum = (TextView) itemView.findViewById(R.id.tvRoomNumber);
tvRoomTitle = (TextView) itemView.findViewById(R.id.tv_room_title);
tvRoomNum.setOnClickListener(new View.OnClickListener(){
#Override
public void onClick(View view) {
RoomDialog roomDialog = new RoomDialog(context);
roomDialog.setCanceledOnTouchOutside(true);
roomDialog.setCancelable(true);
roomDialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
roomDialog.show();
}
});
}
}
}

How to add a onItemclicklistener method to recycleview of buttons

I want to make a onItemclicklistener method to recycleview of buttons and every button intent to Activity
but the Activity has Textview (every button has different Textview )
public class RecAdapter extends RecyclerView.Adapter<RecAdapter.ViewHolder> {
public class ViewHolder extends RecyclerView.ViewHolder {
Button button;
public ViewHolder(View itemView) {
super(itemView);
button = itemView.findViewById(R.id.buttonn);
}
}
private Context context;
private List<items> items;
public RecAdapter(Context c, List<items> itemList) {
this.context = c;
items = itemList;
}
#Override
public RecAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.buttonss, parent, false);
return new ViewHolder(v);
}
#Override
public void onBindViewHolder(RecAdapter.ViewHolder holder, int position) {
items p = items.get(position);
holder.button.setText(p.getName());
}
#Override
public int getItemCount() {
return items.size();
}
}`
Add OnClickListener on itemView of holder like below:
#Override
public void onBindViewHolder(RecAdapter.ViewHolder holder, int position) {
items p = items.get(position);
holder.button.setText(p.getName());
holder.itemView.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// Do here
}
});
}

How to set onClickListener on RecyclerView

I have a simple problem that I can't set onClickListener on recyclerview , i don't want to set onClickListener on items of recyclerview , just the recyclerview itself , I tried the ordinary way and it didn't work
( i tried to set an onClickListener on the parent Layout but the strange things it doesn't work because of the LinearLayoutManager that i set on recyclerview :| )
here's my code :
mRecyclerView.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Log.d("onClick","Clicked");
}
});
Adapter :
public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> {
private List<Message> mMessage;
public static class ViewHolder extends RecyclerView.ViewHolder{
private TextView txtSender;
private TextView txtMessage;
public ViewHolder(View v) {
super(v);
txtSender = (TextView) v.findViewById(R.id.txtSender);
txtMessage = (TextView) v.findViewById(R.id.txtText);
}
}
#Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View inflatedView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.recyclerview_item_row, parent, false);
return new ViewHolder(inflatedView);
}
public RecyclerAdapter(List<Message> messages) {
mMessage = messages;
}
#Override
public void onBindViewHolder(ViewHolder holder, int position) {
Message msg = mMessage.get(position);
holder.txtSender.setText(msg.getSender());
holder.txtMessage.setText(msg.getmessage());
}
#Override
public int getItemCount() {
return mMessage.size();
}
As per your need, you need to modify R.layout.recyclerview_item_row. Use a android LinearLayout put both of TextView(R.id.txtSender and R.id.txtText) inside that.
Modify your ViewHolder as below:
public static class ViewHolder extends RecyclerView.ViewHolder
{
private LinearLayout lvContainer;
private TextView txtSender;
private TextView txtMessage;
public ViewHolder(View v) {
super(v);
lvContainer = (LinearLayout) v.findViewById(R.id.lv_container); // R.id.lv_container this should be in your R.layout.recyclerview_item_row
txtSender = (TextView) v.findViewById(R.id.txtSender);
txtMessage = (TextView) v.findViewById(R.id.txtText);
}
}
Modify your onBindViewHolder as below
#Override
public void onBindViewHolder(ViewHolder holder, int position) {
Message msg = mMessage.get(position);
holder.txtSender.setText(msg.getSender());
holder.txtMessage.setText(msg.getmessage());
holder.lvContainer.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
//Handle your click here
}
});
}

onClickListener in RecyclerView.ViewHolder

I've got a RecyclerView.ViewHolder and RecyclerView.Adapter, I need after click on item and then send information about this item to another Activity.
PlacesAdapter.java
public class PlacesAdapter extends RecyclerView.Adapter<PlacesViewHolder> {
private PlacesActivity placesActivity;
Context context;
private int position;
List<Places> places;
public PlacesAdapter(List<Places> places) {
this.places = places;}
#Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
}
#Override
public PlacesViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.places_view, viewGroup, false);
PlacesViewHolder pvh = new PlacesViewHolder(v);
return pvh;
}
#Override
public void onBindViewHolder(PlacesViewHolder personViewHolder, int i) {
personViewHolder.name.setText(places.get(i).name);
personViewHolder.address.setText(places.get(i).address);
Picasso.with(personViewHolder.itemView.getContext())
.load(places.get(i).photo)
.into(personViewHolder.getPhoto());
}
#Override
public int getItemCount() {
return places.size();
}
}
PlacesViewHolder.java
In this line "intent.putExtra(PlacesDetail.PLACES_NAME,);" How can I send name?
public class PlacesViewHolder extends RecyclerView.ViewHolder {
CardView cv;
public TextView name;
public TextView address;
public ImageView photo;
public PlacesViewHolder(final View itemView) {
super(itemView);
cv = (CardView)itemView.findViewById(R.id.cv);
name = (TextView)itemView.findViewById(R.id.person_name);
address = (TextView)itemView.findViewById(R.id.person_age);
photo = (ImageView)itemView.findViewById(R.id.person_photo);
itemView.setOnClickListener(new View.OnClickListener(){
#Override
public void onClick(View v) {
Context context = v.getContext();
Intent intent = new Intent(context, PlacesDetail.class);
intent.putExtra(PlacesDetail.PLACES_NAME,);
context.startActivity(intent);
}
});
}
public TextView getAddress() {
return address;
}
public TextView getName() {
return name;
}
public ImageView getPhoto() {
return photo;
}
}
This is the complete example of custom Adapter where i'm able to get the details of particular items. In MainActivity you need to set the adapter :
adapter = new MyAdapter(getApplicationContext(), account_no, title, aFN1, aLN1,aFN2, aLN2,aFN3, aLN3,isavilable,waitlist,flag);
adapter.notifyDataSetChanged();
mRecyclerView.setAdapter(adapter);
Now see the code for the custom Adapter :
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> {
String TAG = "MyAdapter";
Context context;
private String[] accountNo;
private String[] title;
private String[] afn1;
private String[] aln1;
private String[] afn2;
private String[] aln2;
private String[] afn3;
private String[] aln3;
private String[] isAvailable;
private String[] waitlist;
private int flag;
public static class ViewHolder extends RecyclerView.ViewHolder {
public TextView account_no,title,afn1,afn2,aln1,aln2,color,is_available;
private ImageView img_android;
CardView cardView;
public ViewHolder(CardView v) {
super(v);
account_no = (TextView)v.findViewById(R.id.acctno);
title = (TextView)v.findViewById(R.id.title);
afn1 = (TextView) v.findViewById(R.id.afn1);
cardView = v;
}
}
// Provide a suitable constructor (depends on the kind of dataset)
public MyAdapter(Context context, String[] accountNo,String[] title,String[] afn1,String[] aln1,String[] afn2,String[] aln2,String[] afn3,String[] aln3,String[] isAvailable, String[] waitlist,int flag) {
this.context = context;
this.accountNo = accountNo;
this.title = title;
this.afn1 = afn1;
this.aln1 = aln1;
this.afn2 = afn2;
this.aln2 = aln2;
this.afn3 = afn3;
this.aln3 = aln3;
this.isAvailable = isAvailable;
this.waitlist = waitlist;
this.flag = flag;
Log.d(TAG,afn1.toString() +aln1+afn2+aln2+afn3+aln3.toString()+waitlist);
}
#Override
public ViewHolder onCreateViewHolder(ViewGroup parent,int viewType) {
CardView cv = (CardView) LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item, parent, false);
return new ViewHolder(cv);
}
#Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
final CardView cardView = holder.cardView;
final TextView accountno = (TextView)cardView.findViewById(R.id.acctno);
accountno.setText(accountNo[position]);
final TextView titletxt = (TextView)cardView.findViewById(R.id.title);
titletxt.setText(title[position]);
final TextView afn1txt = (TextView) cardView.findViewById(R.id.afn1);
afn1txt.setText(afn1[position]+" "+aln1[position]);
Log.d(TAG,waitlist[position]);
cardView.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
int id = getItemViewType(position);
SharedPreferences sharedPreferences = context.getSharedPreferences(Constant.MYPREFERENCE,Context.MODE_PRIVATE);
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putString(Constant.ACCOUNT,accountNo[position]);
edit.putString(Constant.TITLE,title[position]);
edit.putString(Constant.AFN1,afn1[position]);
edit.putString(Constant.ALN1,aln1[position]);
edit.putString(Constant.AFN2,afn2[position]);
edit.putString(Constant.ALN2,aln2[position]);
edit.putString(Constant.AFN3,afn3[position]);
edit.putString(Constant.ALN3,aln3[position]);
edit.putBoolean(Constant.IS_AVAILABLE, Boolean.parseBoolean(isAvailable[position].toUpperCase()));
edit.putString(Constant.WAITLIST,waitlist[position]);
Log.d("WaitingNo2 :",""+String.valueOf(waitlist[position]));
edit.commit();
Intent intent = new Intent(v.getContext(), DetailsActivity.class);
v.getContext().startActivity(intent);
}
});
}
// Return the size of your dataset (invoked by the layout manager)
#Override
public int getItemCount() {
return accountNo.length;
}
}
After All that get the value from sharedPreferences in the Activity which is called on Card Click:
preferences = getSharedPreferences("myshared", Context.MODE_PRIVATE);
AccountNo = sharedPreferences.getString(Constant.ACCOUNT,null).toUpperCase();
title = sharedPreferences.getString(Constant.TITLE,null).toUpperCase();
afn1 = sharedPreferences.getString(Constant.AFN1,null).toUpperCase();
aln1 = sharedPreferences.getString(Constant.ALN1,null).toUpperCase();
afn2 = sharedPreferences.getString(Constant.AFN2,null).toUpperCase();
aln2 = sharedPreferences.getString(Constant.ALN2,null).toUpperCase();
afn3 = sharedPreferences.getString(Constant.AFN3,null).toUpperCase();
aln3 = sharedPreferences.getString(Constant.ALN3,null).toUpperCase();
isAvailable = sharedPreferences.getBoolean(Constant.IS_AVAILABLE,isAvailable);
waitlist = sharedPreferences.getString(Constant.WAITLIST,waitlist);
Now do whatever you want and enjoy the code.
You can achieve this by creating an interface inside your adapter for an itemclicklistener and then you can set onItemClickListener from your PlacesActivity.
Somewhere inside your PlacesAdapter you would need the following:
private onRecyclerViewItemClickListener mItemClickListener;
public void setOnItemClickListener(onRecyclerViewItemClickListener mItemClickListener) {
this.mItemClickListener = mItemClickListener;
}
public interface onRecyclerViewItemClickListener {
void onItemClickListener(View view, int position, String places_name);
}
Then inside your ViewHolder (which I've added as an inner class inside my adapter), you would apply the listener to the components you'd like the user to click, like so:
class PlacesViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
PlacesViewHolder(View view) {
super(view);
view.setOnClickListener(this);
}
#Override
public void onClick(View v) {
if (mItemClickListener != null) {
mItemClickListener.onItemClickListener(v, getAdapterPosition(), PlacesDetail.PLACES_NAME);
}
}
}
This example shows an onClickListener being applied to the view inside PlacesViewHolder.
recyclerView.setAdapter(adapter);// set adapter on recyclerview
adapter.notifyDataSetChanged();// Notify the adapter
adapter.setOnItemClickListener(new PlacesAdapter.onRecyclerViewItemClickListener() {
#Override
public void onItemClickListener(View view, int position, String places_name) {
//perform click logic here (places_name is passed)
}
});
To implement this code, you would setOnItemClickListener to your adapter inside PlacesActivity as shown above.
try this , it's work with me correctly
Create a new class and this code
public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener {
private OnItemClickListener mListener;
public interface OnItemClickListener {
public void onItemClick(View view, int position);
public void onLongItemClick(View view, int position);
}
GestureDetector mGestureDetector;
public RecyclerItemClickListener(Context context, final RecyclerView recyclerView, OnItemClickListener listener) {
mListener = listener;
mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
#Override
public boolean onSingleTapUp(MotionEvent e) {
return true;
}
#Override
public void onLongPress(MotionEvent e) {
View child = recyclerView.findChildViewUnder(e.getX(), e.getY());
if (child != null && mListener != null) {
mListener.onLongItemClick(child, recyclerView.getChildAdapterPosition(child));
}
}
});
}
#Override public boolean onInterceptTouchEvent(RecyclerView view, MotionEvent e) {
View childView = view.findChildViewUnder(e.getX(), e.getY());
if (childView != null && mListener != null && mGestureDetector.onTouchEvent(e)) {
mListener.onItemClick(childView, view.getChildAdapterPosition(childView));
return true;
}
return false;
}
#Override public void onTouchEvent(RecyclerView view, MotionEvent motionEvent) { }
#Override
public void onRequestDisallowInterceptTouchEvent (boolean disallowIntercept){}
}
And in your Activity add this to your adapter implementation
mRecyclerView.addOnItemTouchListener(
new RecyclerItemClickListener(getActivity(), mRecyclerView, new RecyclerItemClickListener.OnItemClickListener() {
#Override
public void onItemClick(View view, int position) {
// do something
}
}
}
#Override
public void onLongItemClick(View view, int position) {
// do whatever
}
})
);

Categories