本文整理了Java中android.widget.TextView.getPaddingStart()
方法的一些代码示例,展示了TextView.getPaddingStart()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.getPaddingStart()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:getPaddingStart
暂无
代码示例来源:origin: googlecodelabs/android-topeka
@Override
public void onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements,
List<View> sharedElementSnapshots) {
TextView targetView = getTextView(sharedElements);
if (targetView == null) {
Log.w(TAG, "onSharedElementStart: No shared TextView, skipping.");
return;
}
mTargetViewTextSize = targetView.getTextSize();
mTargetViewPaddingStart = targetView.getPaddingStart();
// Setup the TextView's start values.
targetView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mInitialTextSize);
ViewUtils.setPaddingStart(targetView, mInitialPaddingStart);
}
代码示例来源: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();
}
});
内容来源于网络,如有侵权,请联系作者删除!