當前位置: 首頁>>代碼示例>>Java>>正文


Java TextView.setHorizontalFadingEdgeEnabled方法代碼示例

本文整理匯總了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;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:17,代碼來源:NavigationPopup.java

示例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);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:33,代碼來源:WebappUrlBar.java

示例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();
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:30,代碼來源:CurrencyAmountView.java


注:本文中的android.widget.TextView.setHorizontalFadingEdgeEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。