Holder(Context context) { super(new AppCompatTextView(context)); final AppCompatTextView text = (AppCompatTextView) itemView; text.setGravity(Gravity.CENTER); text.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 64); }
private AppCompatTextView createTextView(Context context) { final float density = context.getResources().getDisplayMetrics().density; AppCompatTextView text = new AppCompatTextView(context); text.setTextColor(0xff999999); text.setGravity(Gravity.CENTER); text.setMinimumWidth((int) (64 * density)); text.setMinimumHeight((int) (48 * density)); text.setBackgroundResource(R.drawable.bg_headerfootergridview_item); return text; }
float density = context.getResources().getDisplayMetrics().density; AppCompatTextView itemView = new AppCompatTextView(context);
private void createLabels() { final Context context = BROKEN_LABEL_STYLE ? getContext() : new ContextThemeWrapper(getContext(), mLabelsStyle); for (int i = 0; i < mButtonsCount; i++) { final FloatingActionButton button = (FloatingActionButton) getChildAt(i); if (button instanceof LabeledFloatingActionButton) { final String title = ((LabeledFloatingActionButton) button).getTitle(); final AppCompatTextView label = new AppCompatTextView(context); if (!BROKEN_LABEL_STYLE) label.setTextAppearance(context, mLabelsStyle); label.setText(title); addView(label); button.setTag(R.id.fab_label, label); } } }
ContextCompat.getColor(this, android.R.color.holo_purple)); mVLoading = loading; final AppCompatTextView error = new AppCompatTextView(this); error.setText(R.string.sl_change_state_error); error.setTextColor(0xffff4081); error.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 64); mVError = error; final AppCompatTextView empty = new AppCompatTextView(this); empty.setText(R.string.sl_change_state_empty); empty.setTextColor(0xff092d6d);