Java Code Examples for android.widget.TextView.getCurrentTextColor()

The following are Jave code examples for showing how to use getCurrentTextColor() of the android.widget.TextView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: anotherViewPager   File: TabbedViewPager.java   View Source Code Vote up 6 votes
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);
    }
}
 
Example 2
Project: android-instant-apps   File: TextResize.java   View Source Code Vote up 5 votes
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();
}
 
Example 3
Project: GitHub   File: ConnectbotMatchers.java   View Source Code Vote up 5 votes
private static boolean hasTextColor(View view, @ColorInt final int expectedColor) {
	if (!(view instanceof TextView)) {
		return false;
	}

	TextView tv = (TextView) view;
	return tv.getCurrentTextColor() == expectedColor;
}
 
Example 4
Project: Android-Open-Shopping-List   File: ItemAnimator.java   View Source Code Vote up 5 votes
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;
}
 
Example 5
Project: Raffler-Android   File: ChatListRecyclerViewAdapter.java   View Source Code Vote up 5 votes
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();
}
 
Example 6
Project: LoginConcept   File: TextSizeTransition.java   View Source Code Vote up 5 votes
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();
}
 
Example 7
Project: q-mail   File: MessageHeader.java   View Source Code Vote up 4 votes
@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();
}