package skin.support.widget; import android.content.Context; import android.util.AttributeSet; import android.widget.RadioGroup; /** * Created by ximsf on 2017/3/23. */ public class SkinCompatRadioGroup extends RadioGroup implements SkinCompatSupportable { private SkinCompatBackgroundHelper mBackgroundTintHelper; public SkinCompatRadioGroup(Context context) { this(context, null); } public SkinCompatRadioGroup(Context context, AttributeSet attrs) { super(context, attrs); mBackgroundTintHelper = new SkinCompatBackgroundHelper(this); mBackgroundTintHelper.loadFromAttributes(attrs, 0); } @Override public void setBackgroundResource(int resId) { super.setBackgroundResource(resId); if (mBackgroundTintHelper != null) { mBackgroundTintHelper.onSetBackgroundResource(resId); } } @Override public void applySkin() { if (mBackgroundTintHelper != null) { mBackgroundTintHelper.applySkin(); } } }