本文整理汇总了Java中android.support.v4.view.ViewCompat.getPaddingStart方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.getPaddingStart方法的具体用法?Java ViewCompat.getPaddingStart怎么用?Java ViewCompat.getPaddingStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.ViewCompat
的用法示例。
在下文中一共展示了ViewCompat.getPaddingStart方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
if (event.getX() < handle.getX() - ViewCompat.getPaddingStart(handle)) return false;
if (currentAnimator != null) currentAnimator.cancel();
handle.setSelected(true);
notifyScrollStateChange(true);
showBubble();
case MotionEvent.ACTION_MOVE:
float y = event.getY();
setBubbleAndHandlePosition(y);
setRecyclerViewPosition(y);
return true;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
handle.setSelected(false);
notifyScrollStateChange(false);
hideBubble();
return true;
}
return super.onTouchEvent(event);
}
示例2: onTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
final int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
if (event.getX() < fastScroll.getX() - ViewCompat.getPaddingStart(fastScroll))
return false;
if (currentAnimator != null)
currentAnimator.cancel();
if (bubbleView != null && bubbleView.getVisibility() == GONE)
showBubble();
fastScroll.setSelected(true);
case MotionEvent.ACTION_MOVE:
isDragging = true;
setBubbleAndHandlePosition(event.getY());
setRecyclerViewPosition(event.getY());
return true;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
isDragging = false;
fastScroll.setSelected(false);
hideBubble();
return true;
}
return super.onTouchEvent(event);
}
示例3: findClosestColumn
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* Returns the column (0 indexed) closest to the previouslyFocusedRect or center if null.
* The 0 index is related to the first day of the week.
*/
private int findClosestColumn(@Nullable Rect previouslyFocusedRect) {
if (previouslyFocusedRect == null) {
return DAYS_IN_WEEK / 2;
} else {
int mPaddingLeft = ViewCompat.getPaddingStart(this); // TODO is this good?
int centerX = previouslyFocusedRect.centerX() - mPaddingLeft;
final int columnFromLeft =
mathConstrain(centerX / mCellWidth, 0, DAYS_IN_WEEK - 1);
return isLayoutRtl() ? DAYS_IN_WEEK - columnFromLeft - 1 : columnFromLeft;
}
}
示例4: onMeasure
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int padStart = ViewCompat.getPaddingStart(this);
int padEnd = ViewCompat.getPaddingEnd(this);
final int preferredHeight = mDesiredDayHeight * MAX_WEEKS_IN_MONTH
+ mDesiredDayOfWeekHeight + mDesiredMonthHeight
+ getPaddingTop() + getPaddingBottom();
final int preferredWidth = mDesiredCellWidth * DAYS_IN_WEEK
+ padStart + padEnd;
final int resolvedWidth = resolveSize(preferredWidth, widthMeasureSpec);
final int resolvedHeight = resolveSize(preferredHeight, heightMeasureSpec);
setMeasuredDimension(resolvedWidth, resolvedHeight);
}
示例5: indicatorStartX
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private float indicatorStartX(float gap, int page) {
return ViewCompat.getPaddingStart(this) + gap * page + indicatorRadius;
}
示例6: getPaddingStart
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
static int getPaddingStart(View v) {
if (v == null) {
return 0;
}
return ViewCompat.getPaddingStart(v);
}
示例7: getPaddingStart
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public int getPaddingStart() {
return this.mRecyclerView != null ? ViewCompat.getPaddingStart(this.mRecyclerView) : 0;
}
示例8: getPaddingStart
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
static int getPaddingStart(View v) {
if (v == null) {
return 0;
}
return ViewCompat.getPaddingStart(v);
}
示例9: getPaddingStart
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* Return the start padding of the parent RecyclerView
*
* @return Padding in pixels
*/
public int getPaddingStart() {
return mRecyclerView != null ? ViewCompat.getPaddingStart(mRecyclerView) : 0;
}