當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。