本文整理匯總了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();
}