当前位置: 首页>>代码示例>>Java>>正文


Java TextView.setHintTextColor方法代码示例

本文整理汇总了Java中android.widget.TextView.setHintTextColor方法的典型用法代码示例。如果您正苦于以下问题:Java TextView.setHintTextColor方法的具体用法?Java TextView.setHintTextColor怎么用?Java TextView.setHintTextColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.TextView的用法示例。


在下文中一共展示了TextView.setHintTextColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: apply

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public void apply(View view) {
    if (view == null) {
        return;
    }
    if (view instanceof TextView) {
        TextView tv = (TextView) view;
        if ((RES_TYPE_NAME_COLOR.equals(attrValueTypeName)) || (RES_TYPE_NAME_HINT_COLOR.equals(attrValueTypeName))) {
            ColorStateList color =
                AndroidSkin.getInstance()
                    .getSkinColorStateList(attrValueTypeName, attrValueRefName, attrValueRefId);
            tv.setHintTextColor(color);

        }
    }
}
 
开发者ID:MeetYouDevs,项目名称:Android-Skin,代码行数:17,代码来源:TextHintColorAttr.java

示例2: process

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public void process(@NonNull Context context, @Nullable String key, @NonNull View view, @NonNull String suffix) {
    final TextView tv = (TextView) view;
    final ColorResult result = getColorFromSuffix(context, key, view, suffix);
    if (result == null) return;

    if (mHintMode)
        result.adjustAlpha(0.5f);

    final ColorStateList sl = getTextSelector(result.getColor(), view, false);
    if (mLinkMode) {
        tv.setLinkTextColor(sl);
    } else if (mHintMode) {
        tv.setHintTextColor(sl);
        // Sets parent TextInputLayout hint color
        if (view.getParent() != null && view.getParent() instanceof TextInputLayout) {
            final TextInputLayout til = (TextInputLayout) view.getParent();
            TextInputLayoutUtil.setHint(til, result.getColor());
        }
    } else {
        tv.setTextColor(sl);
    }
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:24,代码来源:TextColorTagProcessor.java

示例3: applyStyle_TextView

import android.widget.TextView; //导入方法依赖的package包/类
public static void applyStyle_TextView(TextView v, int styleId) {
    TypedArray a = v.getContext().getTheme().obtainStyledAttributes(styleId,
            STYLEABLE_ARRAY_TextView);
    int N = a.getIndexCount();
    for (int i = 0; i < N; i++) {
        int attr = a.getIndex(i);
        if (attr == STYLEABLE_TextView_textSize) {
            int textSize = a.getDimensionPixelSize(attr, 0);
            if (textSize != 0) {
                v.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
            }
        } else if (attr == STYLEABLE_TextView_textColor) {
            ColorStateList textColor = a.getColorStateList(attr);
            v.setTextColor(textColor);
        } else if (attr == STYLEABLE_TextView_textColorHint) {
            ColorStateList textColorHint = a.getColorStateList(attr);
            v.setHintTextColor(textColorHint);
        } else if (attr == STYLEABLE_TextView_privateImeOptions) {
            String imeOpt = a.getString(attr);
            v.setPrivateImeOptions(imeOpt);
        } else if(attr == STYLEABLE_TextView_textCursorDrawable){
            int  mCursorDrawableRes = a.getResourceId(attr, 0);
            if(mCursorDrawableRes != 0){
                setCursorDrawable(v,mCursorDrawableRes);
            }
        }
    }
    a.recycle();
}
 
开发者ID:swustmuzi,项目名称:PNightMode,代码行数:30,代码来源:ThemeUtils.java

示例4: onFinishInflate

import android.widget.TextView; //导入方法依赖的package包/类
@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    final Context context = getContext();

    textView = (TextView) getChildAt(0);
    textView.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
    textView.setHintTextColor(lessSignificantColor);
    textView.setHorizontalFadingEdgeEnabled(true);
    textView.setSingleLine();
    setValidateAmount(textView instanceof EditText);
    textView.addTextChangedListener(textViewListener);
    textView.setOnFocusChangeListener(textViewListener);

    contextButton = new View(context) {
        @Override
        protected void onMeasure(final int wMeasureSpec, final int hMeasureSpec) {
            setMeasuredDimension(textView.getCompoundPaddingRight(), textView.getMeasuredHeight());
        }
    };
    final LayoutParams chooseViewParams = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT);
    chooseViewParams.gravity = Gravity.RIGHT;
    contextButton.setLayoutParams(chooseViewParams);
    this.addView(contextButton);

    updateAppearance();
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:30,代码来源:CurrencyAmountView.java


注:本文中的android.widget.TextView.setHintTextColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。