本文整理汇总了Java中android.widget.TextView.getCurrentTextColor方法的典型用法代码示例。如果您正苦于以下问题:Java TextView.getCurrentTextColor方法的具体用法?Java TextView.getCurrentTextColor怎么用?Java TextView.getCurrentTextColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.TextView
的用法示例。
在下文中一共展示了TextView.getCurrentTextColor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTabTextColor
import android.widget.TextView; //导入方法依赖的package包/类
private void setTabTextColor(int textViewId, @ColorInt int color, int position) {
if (color == 0)
return;
TabLayout.Tab tab = tabLayout.getTabAt(position);
if (tab != null) {
View tabCustomView = tab.getCustomView();
TextView title;
if (tabCustomView != null)
title = tabCustomView.findViewById(textViewId);
else
title = tabLayout.getChildAt(position).findViewById(android.R.id.title);
if (tabDefaultTextColor == 0) {
tabDefaultTextColor = title.getCurrentTextColor();
}
title.setTextColor(color);
}
}
示例2: TextResizeData
import android.widget.TextView; //导入方法依赖的package包/类
public TextResizeData(TextView textView) {
this.paddingLeft = textView.getPaddingLeft();
this.paddingTop = textView.getPaddingTop();
this.paddingRight = textView.getPaddingRight();
this.paddingBottom = textView.getPaddingBottom();
this.width = textView.getWidth();
this.height = textView.getHeight();
this.gravity = textView.getGravity();
this.textColor = textView.getCurrentTextColor();
}
示例3: hasTextColor
import android.widget.TextView; //导入方法依赖的package包/类
private static boolean hasTextColor(View view, @ColorInt final int expectedColor) {
if (!(view instanceof TextView)) {
return false;
}
TextView tv = (TextView) view;
return tv.getCurrentTextColor() == expectedColor;
}
示例4: createTextColorAnimator
import android.widget.TextView; //导入方法依赖的package包/类
private ColorAnimator createTextColorAnimator(final TextView view, int targetColor) {
ColorAnimator anim = new ColorAnimator(view.getCurrentTextColor(), targetColor);
anim.setInterpolator(TEXT_COLOR_INTERPOLATOR);
anim.setDuration(TEXT_COLOR_ANIM_DURATION);
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
view.setTextColor((int) valueAnimator.getAnimatedValue());
}
});
return anim;
}
示例5: ViewHolder
import android.widget.TextView; //导入方法依赖的package包/类
public ViewHolder(View view) {
super(view);
mView = view;
tvUsername = (TextView) view.findViewById(R.id.tv_username);
tvMessage = (TextView) view.findViewById(R.id.tv_message);
tvDate = (TextView) view.findViewById(R.id.tv_date);
tvUnreadCount = (TextView) view.findViewById(R.id.tv_unreadcount);
countImageView = (ImageView) view.findViewById(R.id.imageView_count);
countLayout = view.findViewById(R.id.layout_count);
imgProfile = (ImageView) view.findViewById(R.id.img_profile);
typeTextColor = tvDate.getCurrentTextColor();
}
示例6: onFinishInflate
import android.widget.TextView; //导入方法依赖的package包/类
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mAnsweredIcon = findViewById(R.id.answered);
mForwardedIcon = findViewById(R.id.forwarded);
mFromView = (TextView) findViewById(R.id.from);
mSenderView = (TextView) findViewById(R.id.sender);
mToView = (TextView) findViewById(R.id.to);
mToLabel = (TextView) findViewById(R.id.to_label);
mCcView = (TextView) findViewById(R.id.cc);
mCcLabel = (TextView) findViewById(R.id.cc_label);
mBccView = (TextView) findViewById(R.id.bcc);
mBccLabel = (TextView) findViewById(R.id.bcc_label);
mContactBadge = (ContactBadge) findViewById(R.id.contact_badge);
mSubjectView = (TextView) findViewById(R.id.subject);
mAdditionalHeadersView = (TextView) findViewById(R.id.additional_headers_view);
mChip = findViewById(R.id.chip);
mDateView = (TextView) findViewById(R.id.date);
mFlagged = (CheckBox) findViewById(R.id.flagged);
mAttachments = findViewById(R.id.attachments);
mAttachmentsList = findViewById(R.id.attachmentList);
mAttachments.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if(mAttachmentsList.getVisibility() != VISIBLE) {
mAttachmentsList.setVisibility(VISIBLE);
} else {
mAttachmentsList.setVisibility(GONE);
}
}
});
defaultSubjectColor = mSubjectView.getCurrentTextColor();
mFontSizes.setViewTextSize(mSubjectView, mFontSizes.getMessageViewSubject());
mFontSizes.setViewTextSize(mDateView, mFontSizes.getMessageViewDate());
mFontSizes.setViewTextSize(mAdditionalHeadersView, mFontSizes.getMessageViewAdditionalHeaders());
mFontSizes.setViewTextSize(mFromView, mFontSizes.getMessageViewSender());
mFontSizes.setViewTextSize(mToView, mFontSizes.getMessageViewTo());
mFontSizes.setViewTextSize(mToLabel, mFontSizes.getMessageViewTo());
mFontSizes.setViewTextSize(mCcView, mFontSizes.getMessageViewCC());
mFontSizes.setViewTextSize(mCcLabel, mFontSizes.getMessageViewCC());
mFontSizes.setViewTextSize(mBccView, mFontSizes.getMessageViewBCC());
mFontSizes.setViewTextSize(mBccLabel, mFontSizes.getMessageViewBCC());
mFromView.setOnClickListener(this);
mToView.setOnClickListener(this);
mCcView.setOnClickListener(this);
mBccView.setOnClickListener(this);
mFromView.setOnLongClickListener(this);
mToView.setOnLongClickListener(this);
mCcView.setOnLongClickListener(this);
mBccView.setOnLongClickListener(this);
mCryptoStatusIcon = (MessageCryptoStatusView) findViewById(R.id.crypto_status_icon);
mCryptoStatusIcon.setOnClickListener(this);
mMessageHelper = MessageHelper.getInstance(mContext);
hideAdditionalHeaders();
}