@Override public void setTextColor(int color) { if (mCurrentColor == color) { return; } mCurrentColor = color; super.setTextColor(color); }
@Override public void setTextColor(int color) { mTextColor = color; super.setTextColor(color); Drawable[] drawables = getCompoundDrawables(); setCompoundDrawablesWithIntrinsicBounds(drawables[0], drawables[1], drawables[2], drawables[3]); }
/** * 设置标签字体颜色 * * @param textColor 颜色值 */ public void setLabelTextColor(@ColorInt int textColor) { mYearTv.setTextColor(textColor); mMonthTv.setTextColor(textColor); mDayTv.setTextColor(textColor); }
/** * Sets text and small down arrow color of CCP. * * @param contentColor color to apply to text and down arrow */ public void setTextColor(int contentColor) { mTextColor = contentColor; mTvSelectedCountry.setTextColor(contentColor); mImvArrow.setColorFilter(contentColor, PorterDuff.Mode.SRC_IN); }
@Override public void setTextColor(@ColorInt int color) { super.setTextColor(color); ((GradientDrawable)getBackground()).setStroke(mStroke,color); }
private static AlertDialog createDialog(final Context context) { AppCompatTextView messageTextView = new AppCompatTextView(context); messageTextView.setTextSize(16f); messageTextView.setText(context.getString(R.string.download_manager_disabled)); messageTextView.setPadding(50, 50, 50, 0); messageTextView.setTextColor(ContextCompat.getColor(context, R.color.black)); return new AlertDialog.Builder(context) .setView(messageTextView) .setPositiveButton("ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { enableDownloadManager(context); } }) .setCancelable(false) .create(); }
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.permission_rationale, container, false); AppCompatTextView rationaleView = (AppCompatTextView) rootView.findViewById(R.id.permission_text); rationaleView.setText(getArguments().getString(TEXT_KEY)); rationaleView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getArguments().getFloat(TEXT_SIZE)); rationaleView.setTextColor(getArguments().getInt(TEXT_COLOR)); rationaleView.setTypeface(Typeface.createFromAsset(getResources().getAssets(), "fonts/" + getArguments().getString(TEXT_FONT))); return rootView; } }
@Override public void onBindViewHolder(ViewHolder holder, int position) { if (useDarkTheme) { holder.card.setCardBackgroundColor(Color.parseColor("#212121")); } holder.phone_card.setImageResource(R.drawable.round_phone_in_talk_white_48); holder.MobileNumber.setText(list.get(position).getNumber()); holder.MobileNumber.setTextColor(Color.WHITE); holder.time.setText(list.get(position).getTime()); holder.backupstatus.setImageResource(R.drawable.round_cloud_upload_white_48); if (list.get(position).getDriveid() != null) { holder.backupstatus.setImageResource(R.drawable.round_cloud_done_white_48); if (!new File(list.get(position).getLocalpath()).exists()) { holder.backupstatus.setImageResource(R.drawable.round_cloud_download_white_48); } } }
@Override public View getDropDownView(int position, View convertView, ViewGroup parent) { AppCompatTextView ret = new AppCompatTextView(parent.getContext()); ret.setText(displayText[position]); ret.setTextSize(16); ret.setPadding(0, 10, 0, 10); ret.setTextColor(Color.BLACK); return ret; }
@Override public View getView(int position, View convertView, ViewGroup parent) { AppCompatTextView ret = new AppCompatTextView(parent.getContext()); ret.setText(displayText[position]); ret.setTextSize(16); ret.setPadding(0, 10, 0, 10); ret.setTextColor(Color.BLACK); return ret; }
private void updatePermissionState(int position) { drawableView.setImageDrawable(ContextCompat.getDrawable(getContext(), getSmoothPermissions().get(position).getDrawable())); if (getSmoothPermissions().get(position).getState() == PermissionState.PERMANENTLY_DENIED) { permissionState.setText("Permanently Denied"); permissionState.setTextColor(rationaleColorIgnore); } else if (getSmoothPermissions().get(position).getState() == PermissionState.DENIED) { permissionState.setText("Denied"); permissionState.setTextColor(rationaleColorDeny); } }
private AlertDialog createExitDialog() { AppCompatTextView messageTextView = new AppCompatTextView(this); messageTextView.setTextSize(16f); messageTextView.setText(getString(R.string.really_quit_question)); messageTextView.setPadding(50, 50, 50, 0); messageTextView.setTextColor(ContextCompat.getColor(this, R.color.black)); return new AlertDialog.Builder(this) .setView(messageTextView) .setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }) .setNegativeButton(getString(R.string.no), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // nothing to do here } }) .setCancelable(true) .create(); }
int color = picker.getDialogTextColor(); if (color != picker.getDefaultContentColor()) { tvCode.setTextColor(color); tvName.setTextColor(color);
private void initRightOverlayTextView(int color) { mTvRightOverlay = new AppCompatTextView(mContext); mTvRightOverlay.setBackgroundResource(R.drawable.bg_right_overlay); mTvRightOverlay.setSupportBackgroundTintList(ColorStateList.valueOf(color)); mTvRightOverlay.setTextColor(Color.WHITE); mTvRightOverlay.setTextSize(38); mTvRightOverlay.setGravity(Gravity.CENTER); int size = IndexBar.dp2px(mContext, 72); LayoutParams params = new LayoutParams(size, size); params.rightMargin = IndexBar.dp2px(mContext, 33); params.gravity = Gravity.RIGHT; mTvRightOverlay.setLayoutParams(params); mTvRightOverlay.setVisibility(INVISIBLE); }
mTvTitle.setTextColor(color); mTvNoResult.setTextColor(color); mEdtSearch.setTextColor(color); mEdtSearch.setHintTextColor(adjustAlpha(color, 0.7f));