当前位置: 首页>>代码示例>>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;未经允许,请勿转载。