當前位置: 首頁>>代碼示例>>Java>>正文


Java TextView.getCurrentTextColor方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:kristiyanP,項目名稱:anotherViewPager,代碼行數:20,代碼來源:TabbedViewPager.java

示例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();
}
 
開發者ID:googlesamples,項目名稱:android-instant-apps,代碼行數:11,代碼來源:TextResize.java

示例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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:ConnectbotMatchers.java

示例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;
}
 
開發者ID:david-szabo97,項目名稱:Android-Open-Shopping-List,代碼行數:15,代碼來源:ItemAnimator.java

示例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();
}
 
開發者ID:AppHero2,項目名稱:Raffler-Android,代碼行數:14,代碼來源:ChatListRecyclerViewAdapter.java

示例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();
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:66,代碼來源:MessageHeader.java


注:本文中的android.widget.TextView.getCurrentTextColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。