title: applying rounded corners to checkbox and radiogroup android
body: <p><strong>I have checkbox and radiogroup which are currently square shape. I want to apply rounded corners or edges. The checkbox and radiogroup change colors on selection and deselecttion. I tried applying rounded corners through xml and coding programatically. The checkbox and radiogroup become unclickable. Both metthods not working. What could be the solution</strong></p>
  <pre><code> @Override
  public void onBindViewHolder(@NonNull final OptionsViewHolder holder, int p) {
  
      final int position = p;
  
  
      RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(
              RadioGroup.LayoutParams.WRAP_CONTENT,
              RadioGroup.LayoutParams.MATCH_PARENT);
      final ArrayList&lt;SlotOption&gt; slotOptionArrayList = daySlotModelArrayList.get(position).getOpt();
  
  
      holder.dayNameCheckbox.setText(daySlotModelArrayList.get(position).getDayName());
      holder.dayNameCheckbox.setTag(daySlotModelArrayList.get(position).getDayId());
  
         GradientDrawable gd = new GradientDrawable();
      gd.setCornerRadius(20);
      holder.dayNameCheckbox.setBackground(gd);
  
      for (int i = 0; i &lt; slotOptionArrayList.size(); i++) {
          RadioButton radioButton = new RadioButton(holder.item_view.getContext());
          radioButton.setText(slotOptionArrayList.get(i).getOptionName());
          radioButton.setTag(slotOptionArrayList.get(i).getOptionId());
  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.LOLLIPOP) {
              radioButton.setBackground(holder.item_view.getContext().getDrawable(R.drawable.button_style));
          }
          layoutParams.setMargins(0, 0, 4, 0);
          radioButton.setPadding(3, 0, 3, 0);
          radioButton.setLayoutParams(layoutParams);
          radioButton.setGravity(Gravity.CENTER);
          radioButton.setEnabled(false);
          radioButton.setTextColor(holder.item_view.getResources().getColor(R.color.white));
          radioButton.setMaxWidth(120);
          radioButton.setButtonDrawable(null);
          holder.slotradiogroup.addView(radioButton);
  
  
      }
  </code></pre>
  <p><strong>XML FILE</strong></p>
  <pre><code>&lt;CheckBox
      android:id=&quot;@+id/dayButton&quot;
      style=&quot;@style/checkBoxButtonStyle&quot;
      android:layout_width=&quot;90dp&quot;
      android:paddingLeft=&quot;2dp&quot;
      android:button=&quot;@null&quot;
      android:layout_marginRight=&quot;10dp&quot;
      android:layout_height=&quot;match_parent&quot;
      android:background=&quot;@drawable/rounded_corner&quot;/&gt;    
  </code></pre>