- Common ways to obtain RadioButton
private void myMethod () {RadioButton r =
View view;(RadioButton) view.findViewById(id)
RadioGroup radioGroup;(RadioButton) radioGroup.getChildAt(int1)
Context context;new RadioButton(context)
- Smart code suggestions by Codota
}
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (delegate != null && delegate.getWidthHeightEqualEnable() && getWidth() > 0 && getHeight() > 0) { int max = Math.max(getWidth(), getHeight()); int measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY); super.onMeasure(measureSpec, measureSpec); return; } super.onMeasure(widthMeasureSpec, heightMeasureSpec); }
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); int iconSide = Math.min(getMeasuredWidth() - getPaddingLeft() - getPaddingRight(), getMeasuredHeight() - getPaddingTop() - getPaddingBottom() - mTextRect.height()); int left = getMeasuredWidth() / 2 - iconSide / 2; int top = (getMeasuredHeight() - mTextRect.height()) / 2 - iconSide / 2; int right = left + iconSide; int bottom = top + iconSide; mIconRect.set(left, top, right, bottom); }