本文整理汇总了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);
}
}
}
示例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);
}
}
示例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();
}
示例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();
}