dimanche 22 novembre 2020

I have a RecyclerView and have multiple checkboxes

I have a RecyclerView and have multiple checkboxes with the date and want to check the checkbox if i click on 10-05-2020 checkbox then want to check the all other checkboxes with less the given date like 10-01-2020,10-02-2020,10-03-2020 and so on. Please help me i am new to android.

((VHItem) viewHolder).checkbox.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    int pos = ((VHItem) viewHolder).getAdapterPosition();
                    Log.d("selectedDueDate", "due date selected " + clickedDataItem.getDueDate());
                    Log.d("selectedDueDate", "due date selected hhhh " + duedateList.get(pos));
                                   
                    if (((VHItem) viewHolder).checkbox.isChecked()) {
                        ((VHItem) viewHolder).balanceAmount.setTextColor(Color.parseColor("#05B313"));
                        ((VHItem) viewHolder).top.setBackgroundResource(R.drawable.btncorner);
                        FeePaymentActivity.totalAmount = FeePaymentActivity.totalAmount + Float.parseFloat(clickedDataItem.getBalanceAmount());


                        paidAmountTv.setText("" + FeePaymentActivity.totalAmount);

                        pfd_sid = clickedDataItem.getPfdSid();
                        comp_id = clickedDataItem.getCompId();
                        component_name = clickedDataItem.getComponentName();
                        fee_type = clickedDataItem.getFeeType();
                        fee_duration = clickedDataItem.getFeeDuration();
                        deferred_amount = clickedDataItem.getDeferredAmount();
                        prog_id = clickedDataItem.getProgId();
                        program_name = clickedDataItem.getProgramName();
                        assign_id = clickedDataItem.getAssignId();
                        plan_id = clickedDataItem.getPlanId();
                        plan_name = clickedDataItem.getPlanName();
                        account_bucket = clickedDataItem.getAccountBucket();
                        amount_t = clickedDataItem.getBalanceAmount();

                        pfd_sidlist.add(pfd_sid);
                        comp_idlist.add(comp_id);
                        component_namelist.add(component_name);
                        fee_typelist.add(fee_type);
                        fee_durationlist.add(fee_duration);
                        deferred_amountlist.add(deferred_amount);
                        prog_idlist.add(prog_id);
                        program_namelist.add(program_name);
                        assign_idlist.add(assign_id);
                        plan_idlist.add(plan_id);
                        plan_namelist.add(plan_name);
                        account_bucketlist.add(account_bucket);
                        amount_tlist.add(amount_t);
                        adapter_positionlist.add(Integer.parseInt(pfd_sid));
                        indexList.add(i);
                    } else {
                        ((VHItem) viewHolder).balanceAmount.setTextColor(Color.parseColor("#2E2E2D"));
                        ((VHItem) viewHolder).top.setBackgroundResource(R.drawable.gradientbtn);
                        FeePaymentActivity.totalAmount = FeePaymentActivity.totalAmount - Float.parseFloat(clickedDataItem.getBalanceAmount());
                        paidAmountTv.setText("" + FeePaymentActivity.totalAmount);

                        pfd_sid = clickedDataItem.getPfdSid();


                    }
              
            });



Aucun commentaire:

Enregistrer un commentaire