当前位置: 首页>>代码示例>>Java>>正文


Java ViewCompat.getPaddingStart方法代码示例

本文整理汇总了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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:FastScroller.java

示例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);
}
 
开发者ID:xxczaki,项目名称:music-player,代码行数:27,代码来源:RecyclerViewFastScroller.java

示例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;
    }
}
 
开发者ID:Gericop,项目名称:DateTimePicker,代码行数:16,代码来源:SimpleMonthView.java

示例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);
}
 
开发者ID:Gericop,项目名称:DateTimePicker,代码行数:15,代码来源:SimpleMonthView.java

示例5: indicatorStartX

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private float indicatorStartX(float gap, int page) {
    return ViewCompat.getPaddingStart(this) + gap * page + indicatorRadius;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:MaterialIndicator.java

示例6: getPaddingStart

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
static int getPaddingStart(View v) {
  if (v == null) {
    return 0;
  }
  return ViewCompat.getPaddingStart(v);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:Utils.java

示例7: getPaddingStart

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public int getPaddingStart() {
    return this.mRecyclerView != null ? ViewCompat.getPaddingStart(this.mRecyclerView) : 0;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:RecyclerView.java

示例8: getPaddingStart

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
static int getPaddingStart(View v) {
    if (v == null) {
        return 0;
    }
    return ViewCompat.getPaddingStart(v);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:7,代码来源:BooheeTabUtils.java

示例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;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:9,代码来源:RecyclerView.java


注:本文中的android.support.v4.view.ViewCompat.getPaddingStart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。