0

I want to disable firebase recyclerview item in onclick. when user clicks on time slot then selected time should be freeze. how to achieve this

    firebaseNextTimeadapter = new FirebaseRecyclerAdapter<TimeSlot, FirebaseNextTimeViewHolder>(
            TimeSlot.class,
            R.layout.time_slot_next_layout,
            FirebaseNextTimeViewHolder.class,
            timeSlot.child(Common.BikeId)) {
        int row_index = -1;


        @Override
        protected void populateViewHolder(final FirebaseNextTimeViewHolder firebaseTimeViewHolder, TimeSlot slot, final int i) {
            firebaseTimeViewHolder.time_slot.setText(slot.getTime_slot());
            firebaseTimeViewHolder.txt_time_slot_description.setText(ConvertToAvailableorNotAvailable(slot.isAvailable()));
            firebaseTimeViewHolder.setItemClickListener(new ItemClickListener() {
                @Override
                public void onClick(View view, int position, boolean isLongClick) {
                    view.setClickable(false);
                    date = new SimpleDateFormat("dd-MMM").format(new Date());
                    txt_end_date.setText(date+" "+slot.getTime_slot());
                    Toast.makeText(BookingCalender.this, "Clicked"+slot.getTime_slot(), Toast.LENGTH_SHORT).show();
                }
            });
        }
    };
    recycler_next_time_list.setAdapter(firebaseNextTimeadapter);
Karthick Jai
  • 61
  • 1
  • 11

0 Answers0