public class ShuttersConsumer extends SwipeConsumer
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
lastScreenDirection |
protected int |
mBaseAlpha |
protected android.graphics.Camera |
mCamera |
protected boolean |
mHorizontalSwiping |
protected int |
mLeavesCount |
protected android.graphics.Paint |
mPaint |
protected boolean |
mRefreshable |
protected boolean |
mRefreshing
internal mark: refreshBitmapRunnable is working or not
|
protected android.graphics.Bitmap[] |
mScreenshots |
protected int |
mScrimColor |
protected boolean |
mWaitForScreenshot |
protected int |
refreshDelay
refresh rate: 30 frames per second
|
DEFAULT_OPEN_DISTANCE_IN_DP, DIRECTION_ALL, DIRECTION_BOTTOM, DIRECTION_HORIZONTAL, DIRECTION_LEFT, DIRECTION_NONE, DIRECTION_RIGHT, DIRECTION_TOP, DIRECTION_VERTICAL, mCachedSwipeDistanceX, mCachedSwipeDistanceY, mCurDisplayDistanceX, mCurDisplayDistanceY, mCurSwipeDistanceX, mCurSwipeDistanceY, mDirection, mDisableSwipeOnSettling, mEdgeSize, mEnableNested, mHeight, mInterpolator, mListeners, mMaxSettleDuration, mOpenDistance, mOpenDistanceSpecified, mOverSwipeFactor, mProgress, mReleaseMode, mSwipeDistanceCalculator, mSwipeHelper, mSwipeMaxDistance, mSwipeOpenDistance, mSwiping, mTag, mWidth, mWrapper, PROGRESS_CLOSE, PROGRESS_OPEN, RELEASE_MODE_AUTO_CLOSE, RELEASE_MODE_AUTO_OPEN, RELEASE_MODE_AUTO_OPEN_CLOSE, RELEASE_MODE_HOLE_OPEN, RELEASE_MODE_NONE| 构造器和说明 |
|---|
ShuttersConsumer() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
clampDistanceHorizontal(int distanceX,
int dx) |
int |
clampDistanceVertical(int distanceY,
int dy) |
void |
dispatchDraw(android.graphics.Canvas canvas)
Called when Wrapper#dispatchDraw(Canvas) called
|
int |
getLeavesCount() |
int |
getScrimColor() |
boolean |
isRefreshable() |
boolean |
isWaitForScreenshot() |
protected void |
onClosed() |
void |
onDetachFromWrapper()
Called when removed from Wrapper
|
protected void |
onDisplayDistanceChanged(int distanceXToDisplay,
int distanceYToDisplay,
int dx,
int dy)
Called to refresh UI when swipe distance is changed. final value has clamped and modified by Resistor(if it not null)
|
boolean |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
Called when Wrapper#onLayout(boolean, int, int, int, int) called
|
void |
onSwipeAccepted(int activePointerId,
boolean settling,
float initialMotionX,
float initialMotionY) |
protected void |
recycleScreenshots() |
protected void |
refreshBitmap() |
ShuttersConsumer |
setLeavesCount(int leavesCount) |
ShuttersConsumer |
setRefreshable(boolean refreshable) |
ShuttersConsumer |
setRefreshFrameRate(int frameRate) |
ShuttersConsumer |
setScrimColor(int scrimColor) |
ShuttersConsumer |
setWaitForScreenshot(boolean wait)
if content view draw coat too much time, wait for screenshot is useful
|
addConsumer, addListener, addToExclusiveGroup, as, calSwipeDirection, canChildScroll, close, close, disableAllDirections, disableBottom, disableDirection, disableHorizontal, disableLeft, disableRight, disableTop, disableVertical, enableAllDirections, enableBottom, enableDirection, enableDirection, enableHorizontal, enableLeft, enableNestedFlyAllDirections, enableNestedFlyBottom, enableNestedFlyHorizontal, enableNestedFlyLeft, enableNestedFlyRight, enableNestedFlyTop, enableNestedFlyVertical, enableNestedScrollAllDirections, enableNestedScrollBottom, enableNestedScrollHorizontal, enableNestedScrollLeft, enableNestedScrollRight, enableNestedScrollTop, enableNestedScrollVertical, enableRight, enableTop, enableVertical, findTopChildUnder, getDirection, getDragState, getEdgeSize, getHeight, getHorizontalRange, getInterpolator, getMaxSettleDuration, getOpenDistance, getOverSwipeFactor, getProgress, getReleaseMode, getSensitivity, getSwipeDistanceCalculator, getSwipeHelper, getSwipeOpenDistance, getTag, getVerticalRange, getWidth, getWrapper, initChildrenFormXml, isAllDirectionsEnable, isAllDirectionsLocked, isBottomEnable, isBottomLocked, isClosed, isDirectionEnable, isDirectionLocked, isDisableSwipeOnSetting, isHorizontalDirection, isHorizontalEnable, isHorizontalLocked, isLeftEnable, isLeftLocked, isNestedAndDisabled, isNestedFlyEnable, isNestedScrollEnable, isOpened, isRightEnable, isRightLocked, isSwiping, isTopEnable, isTopLocked, isVerticalDirection, isVerticalEnable, isVerticalLocked, isViewUnder, lockAllDirections, lockBottom, lockDirection, lockDirection, lockHorizontal, lockLeft, lockRight, lockTop, lockVertical, notifyAttachToWrapper, notifyDetachFromWrapper, notifySwipeClosed, notifySwipeOpened, notifySwipeProgress, notifySwipeRelease, notifySwipeStart, notifySwipeStateChanged, onAttachToWrapper, onDraw, onMeasure, onOpened, onStateChanged, onSwipeDistanceChanged, onSwipeReleased, open, removeAllListeners, removeListener, reset, setBottomOpen, setCurrentStateAsClosed, setDisableSwipeOnSettling, setEdgeSize, setHeight, setInterpolator, setLeftOpen, setMaxSettleDuration, setOpenDistance, setOverSwipeFactor, setReleaseMode, setRightOpen, setSensitivity, setSwipeDistanceCalculator, setTag, setTopOpen, setWidth, slideTo, smoothBottomOpen, smoothClose, smoothLeftOpen, smoothOpenOrClose, smoothRightOpen, smoothSlideTo, smoothSlideTo, smoothSlideTo, smoothTopOpen, tryAcceptMoving, tryAcceptSettling, unlockAllDirections, unlockBottom, unlockDirection, unlockHorizontal, unlockLeft, unlockRight, unlockTop, unlockVerticalprotected final android.graphics.Camera mCamera
protected android.graphics.Paint mPaint
protected boolean mHorizontalSwiping
protected int mBaseAlpha
protected int lastScreenDirection
protected volatile boolean mRefreshing
protected volatile android.graphics.Bitmap[] mScreenshots
protected int mScrimColor
protected int mLeavesCount
protected volatile boolean mRefreshable
protected boolean mWaitForScreenshot
protected int refreshDelay
public void onDetachFromWrapper()
SwipeConsumeronDetachFromWrapper 在类中 SwipeConsumerpublic void onSwipeAccepted(int activePointerId,
boolean settling,
float initialMotionX,
float initialMotionY)
onSwipeAccepted 在类中 SwipeConsumerprotected void refreshBitmap()
public void dispatchDraw(android.graphics.Canvas canvas)
SwipeConsumerdispatchDraw 在类中 SwipeConsumercanvas - canvaspublic boolean onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
SwipeConsumeronLayout 在类中 SwipeConsumerchanged - changed or notleft - left positiontop - top positionright - right positionbottom - bottom positionprotected void onClosed()
onClosed 在类中 SwipeConsumerprotected void recycleScreenshots()
protected void onDisplayDistanceChanged(int distanceXToDisplay,
int distanceYToDisplay,
int dx,
int dy)
SwipeConsumeronDisplayDistanceChanged 在类中 SwipeConsumerdistanceXToDisplay - distance changed in pixels along the X axis to show UIdistanceYToDisplay - distance changed in pixels along the Y axis to show UIdx - Change in X position from the last calldy - Change in Y position from the last callSwipeDistanceCalculatorpublic int clampDistanceHorizontal(int distanceX,
int dx)
clampDistanceHorizontal 在类中 SwipeConsumerpublic int clampDistanceVertical(int distanceY,
int dy)
clampDistanceVertical 在类中 SwipeConsumerpublic int getScrimColor()
public ShuttersConsumer setScrimColor(int scrimColor)
public int getLeavesCount()
public ShuttersConsumer setLeavesCount(int leavesCount)
public boolean isRefreshable()
public ShuttersConsumer setRefreshable(boolean refreshable)
public boolean isWaitForScreenshot()
public ShuttersConsumer setWaitForScreenshot(boolean wait)
wait - default is false, if set as true, do real swipe after screenshot has been donepublic ShuttersConsumer setRefreshFrameRate(int frameRate)