本文整理汇总了Java中android.widget.TextView.setHorizontalFadingEdgeEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java TextView.setHorizontalFadingEdgeEnabled方法的具体用法?Java TextView.setHorizontalFadingEdgeEnabled怎么用?Java TextView.setHorizontalFadingEdgeEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.TextView
的用法示例。
在下文中一共展示了TextView.setHorizontalFadingEdgeEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createListItem
import android.widget.TextView; //导入方法依赖的package包/类
public TextView createListItem() {
TextView view = new TextView(mContext);
view.setFadingEdgeLength(mFadeEdgeLength);
view.setHorizontalFadingEdgeEnabled(true);
view.setSingleLine();
view.setTextSize(TEXT_SIZE_SP);
view.setMinimumHeight(mListItemHeight);
view.setGravity(Gravity.CENTER_VERTICAL);
view.setCompoundDrawablePadding(mPadding);
if (!mIsLayoutDirectionRTL) {
view.setPadding(mPadding, 0, mPadding + mFadePadding , 0);
} else {
view.setPadding(mPadding + mFadePadding, 0, mPadding, 0);
}
return view;
}
示例2: WebappUrlBar
import android.widget.TextView; //导入方法依赖的package包/类
/**
* Creates a WebappUrlBar.
* @param context Context to grab resources from.
*/
public WebappUrlBar(Context context, AttributeSet attrSet) {
super(context, attrSet);
mIconResourceWidths = new SparseIntArray();
mUrlBar = new TextView(context);
mUrlBar.setSingleLine(true);
mUrlBar.setGravity(Gravity.CENTER_VERTICAL);
mUrlBar.setMovementMethod(ScrollingMovementMethod.getInstance());
mUrlBar.setHorizontalFadingEdgeEnabled(true);
mSeparator = new View(context);
addView(mUrlBar,
new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
Gravity.CENTER));
addView(mSeparator,
new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, 1, Gravity.BOTTOM));
// Set the colors.
mSeparator.setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
R.color.webapp_url_bar_separator));
setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
R.color.webapp_url_bar_bg));
// Listen for changes in the URL bar's size.
mUrlBar.addOnLayoutChangeListener(this);
}
示例3: 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();
}