示例#1
0
 @Override
 public void toggle() {
   // we override to prevent toggle when the radio is already
   // checked (as opposed to check boxes widgets)
   if (!isChecked()) {
     super.toggle();
   }
 }
示例#2
0
  @Override
  protected void applyStyle(
      Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super.applyStyle(context, attrs, defStyleAttr, defStyleRes);

    RadioButtonDrawable drawable =
        new RadioButtonDrawable.Builder(context, attrs, defStyleAttr, defStyleRes).build();
    drawable.setInEditMode(isInEditMode());
    drawable.setAnimEnable(false);
    setButtonDrawable(drawable);
    drawable.setAnimEnable(true);
  }