@Override public void onCheckedChanged(boolean isChecked) { mButtonText.setChecked(isChecked); if (mBroadcasting) { return; } mBroadcasting = true; if (mOnButtonCheckedChangeListener != null) { mOnButtonCheckedChangeListener.onCheckedChanged(MaterialCompoundButton.this, isChecked); } if (mOnCheckedChangeWidgetListener != null) { mOnCheckedChangeWidgetListener.onCheckedChanged(MaterialCompoundButton.this, isChecked); } mBroadcasting = false; if (isAnimator()) { if (isChecked()) { start(); } else { end(); } } }
@Override public void setChecked(boolean checked) { mButtonView.setChecked(checked); mButtonText.setChecked(checked); }