android.widget.TextView.setHorizontalFadingEdgeEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中android.widget.TextView.setHorizontalFadingEdgeEnabled()方法的一些代码示例,展示了TextView.setHorizontalFadingEdgeEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.setHorizontalFadingEdgeEnabled()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:setHorizontalFadingEdgeEnabled

TextView.setHorizontalFadingEdgeEnabled介绍

暂无

代码示例

代码示例来源:origin: derry/delion

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;
  }
}

代码示例来源:origin: derry/delion

/**
 * 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);
}

代码示例来源:origin: wasdennnoch/AndroidN-ify

newTitle.setSingleLine();
newTitle.setEllipsize(TextUtils.TruncateAt.END);
newTitle.setHorizontalFadingEdgeEnabled(true);
textLine1.setSingleLine();
textLine1.setEllipsize(TextUtils.TruncateAt.END);
textLine1.setHorizontalFadingEdgeEnabled(true);

相关文章

TextView类方法