本文整理匯總了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;
}