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

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

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

TextView.getPaddingEnd介绍

暂无

代码示例

代码示例来源:origin: geniusgithub/AndroidDialer

/**
 * Set the top padding on the header view dynamically, based on whether the header is in
 * the first row or not.
 */
public static void setHeaderViewBottomPadding(Context context, TextView textView,
    boolean isFirstRow) {
  final int topPadding;
  if (isFirstRow) {
    topPadding = (int) context.getResources().getDimension(
        R.dimen.frequently_contacted_title_top_margin_when_first_row);
  } else {
    topPadding = (int) context.getResources().getDimension(
        R.dimen.frequently_contacted_title_top_margin);
  }
  textView.setPaddingRelative(textView.getPaddingStart(), topPadding,
      textView.getPaddingEnd(), textView.getPaddingBottom());
}

代码示例来源:origin: freedom10086/Ruisi

public void into(TextView target) {
  if (this.target == null) {
    this.target = new WeakReference<>(target);
  }
  if (imageGetter == null) {
    WindowManager wm = (WindowManager) target.getContext()
        .getSystemService(Context.WINDOW_SERVICE);
    Point p = new Point();
    wm.getDefaultDisplay().getSize(p);
    VIEW_WIDTH = p.x - target.getPaddingStart() - target.getPaddingEnd();
    imageGetter = new DefaultImageGetter(target.getContext(), VIEW_WIDTH);
  }
  if (clickListener == null) {
    clickListener = new DefaultClickHandler(target.getContext());
  }
  FONT_SIZE = target.getTextSize();
  spanned = SpanConverter.convert(source, imageGetter, clickListener, this);
  target.setMovementMethod(LinkMovementMethod.getInstance());
  target.setLinkTextColor(URL_COLOR);
  target.setLineSpacing(0, LINE_HEIGHT);
  target.setText(spanned);
  isViewSet = true;
}

代码示例来源:origin: kollerlukas/Camera-Roll-Android-App

@RequiresApi(api = Build.VERSION_CODES.KITKAT_WATCH)
  @Override
  public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
    toolbar.setPadding(toolbar.getPaddingStart() /*+ insets.getSystemWindowInsetLeft()*/,
        toolbar.getPaddingTop() + insets.getSystemWindowInsetTop(),
        toolbar.getPaddingEnd() /*+ insets.getSystemWindowInsetRight()*/,
        toolbar.getPaddingBottom());
    aboutText.setPadding(aboutText.getPaddingStart(),
        aboutText.getPaddingTop(),
        aboutText.getPaddingEnd(),
        aboutText.getPaddingBottom() + insets.getSystemWindowInsetBottom());
    View viewGroup = findViewById(R.id.swipeBackView);
    ViewGroup.MarginLayoutParams viewGroupParams
        = (ViewGroup.MarginLayoutParams) viewGroup.getLayoutParams();
    viewGroupParams.leftMargin += insets.getSystemWindowInsetLeft();
    viewGroupParams.rightMargin += insets.getSystemWindowInsetRight();
    viewGroup.setLayoutParams(viewGroupParams);
    // clear this listener so insets aren't re-applied
    rootView.setOnApplyWindowInsetsListener(null);
    return insets.consumeSystemWindowInsets();
  }
});

相关文章

TextView类方法