static int getPaddingEnd(View v) { if (v == null) { return 0; } return ViewCompat.getPaddingEnd(v); }
private void adjustIndicatorPadding() { // Add padding to the error and character counter so that they match the EditText ViewCompat.setPaddingRelative(indicatorArea, ViewCompat.getPaddingStart(editText), 0, ViewCompat.getPaddingEnd(editText), editText.getPaddingBottom()); }
static int getPaddingEnd(View v) { if (v == null) { return 0; } return ViewCompat.getPaddingEnd(v); }
static int getPaddingEnd(View v) { if (v == null) { return 0; } return ViewCompat.getPaddingEnd(v); }
private static void updateTopBottomPadding(View view, int topPadding, int bottomPadding) { if (ViewCompat.isPaddingRelative(view)) { ViewCompat.setPaddingRelative(view, ViewCompat.getPaddingStart(view), topPadding, ViewCompat.getPaddingEnd(view), bottomPadding); } else { view.setPadding(view.getPaddingLeft(), topPadding, view.getPaddingRight(), bottomPadding); } }
private static void updateTopBottomPadding(View view, int topPadding, int bottomPadding) { if (ViewCompat.isPaddingRelative(view)) { ViewCompat.setPaddingRelative(view, ViewCompat.getPaddingStart(view), topPadding, ViewCompat.getPaddingEnd(view), bottomPadding); } else { view.setPadding(view.getPaddingLeft(), topPadding, view.getPaddingRight(), bottomPadding); } }
private static void updateTopBottomPadding(View view, int topPadding, int bottomPadding) { if (ViewCompat.isPaddingRelative(view)) { ViewCompat.setPaddingRelative(view, ViewCompat.getPaddingStart(view), topPadding, ViewCompat.getPaddingEnd(view), bottomPadding); } else { view.setPadding(view.getPaddingLeft(), topPadding, view.getPaddingRight(), bottomPadding); } } }
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int widthMode = MeasureSpec.getMode(widthMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); int widthSize = MeasureSpec.getSize(widthMeasureSpec); int heightSize = MeasureSpec.getSize(heightMeasureSpec); int width; int height; int boxHeight = otpViewItemHeight; if (widthMode == MeasureSpec.EXACTLY) { width = widthSize; } else { int boxesWidth = (otpViewItemCount - 1) * otpViewItemSpacing + otpViewItemCount * otpViewItemWidth; width = boxesWidth + ViewCompat.getPaddingEnd(this) + ViewCompat.getPaddingStart(this); if (otpViewItemSpacing == 0) { width -= (otpViewItemCount - 1) * lineWidth; } } height = heightMode == MeasureSpec.EXACTLY ? heightSize : boxHeight + getPaddingTop() + getPaddingBottom(); setMeasuredDimension(width, height); }
@Override public void setValue(TextView view, int paddingStart) { ViewCompat.setPaddingRelative(view, paddingStart, view.getPaddingTop(), ViewCompat.getPaddingEnd(view), view.getPaddingBottom()); } };
public static void setPaddingStart(TextView target, int paddingStart) { ViewCompat.setPaddingRelative(target, paddingStart, target.getPaddingTop(), ViewCompat.getPaddingEnd(target), target.getPaddingBottom()); }
public static FlexItem fromFlexView(View view, int index) { FlexboxLayout.LayoutParams lp = (FlexboxLayout.LayoutParams) view.getLayoutParams(); FlexItem flexItem = new FlexItem(); flexItem.index = index; flexItem.order = lp.order; flexItem.flexGrow = lp.flexGrow; flexItem.flexShrink = lp.flexShrink; flexItem.alignSelf = lp.alignSelf; flexItem.flexBasisPercent = lp.flexBasisPercent; flexItem.width = Util.pixelToDp(view.getContext(), lp.width); flexItem.height = Util.pixelToDp(view.getContext(), lp.height); flexItem.topMargin = lp.topMargin; flexItem.startMargin = MarginLayoutParamsCompat.getMarginStart(lp); flexItem.endMargin = MarginLayoutParamsCompat.getMarginEnd(lp); flexItem.bottomMargin = lp.bottomMargin; flexItem.paddingTop = view.getPaddingTop(); flexItem.paddingStart = ViewCompat.getPaddingStart(view); flexItem.paddingEnd = ViewCompat.getPaddingEnd(view); flexItem.paddingBottom = view.getPaddingBottom(); return flexItem; }
int paddingEnd = ViewCompat.getPaddingEnd(this); int largestHeightInRow = Integer.MIN_VALUE; FlexLine flexLine = new FlexLine();
- ViewCompat.getPaddingEnd(mStoreLocallyTooltipIcon) - MarginLayoutParamsCompat.getMarginStart((RelativeLayout.LayoutParams) mStoreLocallyCheckbox.getLayoutParams())
public void setHelperTextEnabled(boolean _enabled) { if (mHelperTextEnabled == _enabled) return; if (_enabled && mErrorEnabled) { setErrorEnabled(false); } if (this.mHelperTextEnabled != _enabled) { if (_enabled) { this.mHelperView = new TextView(this.getContext()); this.mHelperView.setTextAppearance(this.getContext(), this.mHelperTextAppearance); if (mHelperTextColor != null){ this.mHelperView.setTextColor(mHelperTextColor); } this.mHelperView.setVisibility(INVISIBLE); this.addView(this.mHelperView); if (this.mHelperView != null) { ViewCompat.setPaddingRelative( this.mHelperView, ViewCompat.getPaddingStart(getEditText()), 0, ViewCompat.getPaddingEnd(getEditText()), getEditText().getPaddingBottom()); } } else { this.removeView(this.mHelperView); this.mHelperView = null; } this.mHelperTextEnabled = _enabled; } }