@Override public View onCreateView(String name, Context context, AttributeSet attrs) { // Allow super to try and create a view first final View result = super.onCreateView(name, context, attrs); if (result != null) { return result; } if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { // If we're running pre-L, we need to 'inject' our tint aware Views in place of the // standard framework versions switch (name) { case "EditText": return new AppCompatEditText(this, attrs); case "Spinner": return new AppCompatSpinner(this, attrs); case "CheckBox": return new AppCompatCheckBox(this, attrs); case "RadioButton": return new AppCompatRadioButton(this, attrs); case "CheckedTextView": return new AppCompatCheckedTextView(this, attrs); } } Api.fixFolderPermissionsAsync(context); return null; }
private void setQuestionsGroupView(){ LinearLayout.LayoutParams rglp = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams rblp = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); mQuestionsGroup.setLayoutParams(rglp); ColorStateList colorStateList = new ColorStateList( new int[][]{ new int[]{mRadioBtnColor}, new int[]{mRadioBtnColor} }, new int[]{mRadioBtnColor, mRadioBtnColor} ); for (int i = 0; i < mQuestionsArray.length; i++) { AppCompatRadioButton rb = new AppCompatRadioButton(mContext); setQuestionItem(i, rb, rblp, colorStateList); mQuestionsGroup.addView(rb); } }
AppCompatRadioButton tempButton = new AppCompatRadioButton(context); tempButton.setTextColor(ColorUtil.getColor(context, R.attr.colorPrimary)); tempButton.setText(time);
@Override public View onCreateView(String name, Context context, AttributeSet attrs) { // Allow super to try and create a view first final View result = super.onCreateView(name, context, attrs); if (result != null) { return result; } if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { // If we're running pre-L, we need to 'inject' our tint aware Views in place of the // standard framework versions switch (name) { case "EditText": return new AppCompatEditText(this, attrs); case "Spinner": return new AppCompatSpinner(this, attrs); case "CheckBox": return new AppCompatCheckBox(this, attrs); case "RadioButton": return new AppCompatRadioButton(this, attrs); case "CheckedTextView": return new AppCompatCheckedTextView(this, attrs); } } return null; }
return new AppCompatCheckBox(this, attrs); case "RadioButton": return new AppCompatRadioButton(this, attrs); case "CheckedTextView": return new AppCompatCheckedTextView(this, attrs);
break; case "RadioButton": view = new AppCompatRadioButton(context, attrs); break; case "CheckedTextView":
AppCompatRadioButton arb = new AppCompatRadioButton(getActivity());