public class DrawerConsumer extends SwipeConsumer implements android.view.View.OnClickListener
SwipeConsumer.RELEASE_MODE_AUTO_OPEN_CLOSE| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
b |
protected int |
l |
protected android.view.View |
mCurDrawerView |
protected boolean |
mDrawerViewRequired |
protected android.view.View[] |
mDrawerViews |
protected int |
mScrimColor |
protected ScrimView |
mScrimView |
protected int |
mShadowColor |
protected int |
mShadowSize |
protected boolean |
mShowScrimAndShadowOutsideContentView |
protected int |
r |
protected int |
t |
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| 构造器和说明 |
|---|
DrawerConsumer() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
calculateDrawerDirectionInitPosition(int direction,
int w,
int h) |
protected boolean |
canChildScroll(android.view.ViewGroup parentView,
int direction,
int pointerId,
float downX,
float downY,
float dx,
float dy) |
protected void |
changeDrawerViewVisibility(int visibility) |
android.view.View |
getDrawerView(int direction) |
int |
getOpenDistance() |
int |
getShadowSize() |
protected void |
initChildrenFormXml()
init children via xml usage of
SmartSwipeWrapper |
protected void |
initScrimView() |
boolean |
isDrawerViewRequired() |
boolean |
isScrimAndShadowOutsideContentView() |
protected void |
layoutChildren() |
protected void |
layoutContentView(android.view.View contentView) |
protected void |
layoutDrawerView() |
protected void |
layoutScrimView() |
protected void |
notifySwipeProgress(boolean settling) |
protected void |
notifySwipeRelease(float xVelocity,
float yVelocity) |
protected void |
notifySwipeStart() |
void |
onAttachToWrapper(SmartSwipeWrapper wrapper,
SwipeHelper swipeHelper)
Called when SwipeConsumer add to Wrapper
|
void |
onClick(android.view.View v) |
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
|
protected void |
onOpened() |
void |
onSwipeAccepted(int activePointerId,
boolean settling,
float initialMotionX,
float initialMotionY) |
protected void |
orderChildren() |
DrawerConsumer |
setAllDirectionDrawerView(android.view.View drawerView) |
DrawerConsumer |
setBottomDrawerView(android.view.View drawerView) |
void |
setCurrentStateAsClosed() |
DrawerConsumer |
setDrawerView(int direction,
android.view.View drawerView)
set a extension to the direction, also set direction enable if drawerView is not null(otherwise, disable the direction)
direction can be a single direction or mixed direction(eg: DIRECTION_LEFT | DIRECTION_RIGHT)
|
DrawerConsumer |
setDrawerViewRequired(boolean required)
set the extension view as drawer is required or not
it useful inside this sdk framework,
developers who use this SDK do not call this function unless you really know what its mean
|
DrawerConsumer |
setHorizontalDrawerView(android.view.View drawerView) |
DrawerConsumer |
setLeftDrawerView(android.view.View drawerView) |
DrawerConsumer |
setRightDrawerView(android.view.View drawerView) |
DrawerConsumer |
setScrimColor(int color)
Set a color to use for the scrim that obscures primary content while a drawer is open.
|
DrawerConsumer |
setShadowColor(int shadowColor)
Set a color to use for the shadow at the edge of content view while a drawer is open.
|
DrawerConsumer |
setShadowSize(int size)
set the size of shadow at the edge of content view while a drawer is open.
|
DrawerConsumer |
setTopDrawerView(android.view.View drawerView) |
DrawerConsumer |
setVerticalDrawerView(android.view.View drawerView) |
DrawerConsumer |
showScrimAndShadowInsideContentView() |
DrawerConsumer |
showScrimAndShadowOutsideContentView() |
boolean |
tryAcceptMoving(int pointerId,
float downX,
float downY,
float dx,
float dy) |
addConsumer, addListener, addToExclusiveGroup, as, calSwipeDirection, clampDistanceHorizontal, clampDistanceVertical, close, close, disableAllDirections, disableBottom, disableDirection, disableHorizontal, disableLeft, disableRight, disableTop, disableVertical, dispatchDraw, 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, getOverSwipeFactor, getProgress, getReleaseMode, getSensitivity, getSwipeDistanceCalculator, getSwipeHelper, getSwipeOpenDistance, getTag, getVerticalRange, getWidth, getWrapper, 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, notifySwipeStateChanged, onDraw, onMeasure, onStateChanged, onSwipeDistanceChanged, onSwipeReleased, open, removeAllListeners, removeListener, reset, setBottomOpen, 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, tryAcceptSettling, unlockAllDirections, unlockBottom, unlockDirection, unlockHorizontal, unlockLeft, unlockRight, unlockTop, unlockVerticalprotected final android.view.View[] mDrawerViews
protected android.view.View mCurDrawerView
protected int l
protected int t
protected int r
protected int b
protected int mScrimColor
protected int mShadowColor
protected ScrimView mScrimView
protected int mShadowSize
protected boolean mDrawerViewRequired
protected boolean mShowScrimAndShadowOutsideContentView
public void onAttachToWrapper(SmartSwipeWrapper wrapper, SwipeHelper swipeHelper)
SwipeConsumeronAttachToWrapper 在类中 SwipeConsumerwrapper - Wrapper to add toswipeHelper - SwipeHelper bind to this SwipeConsumerprotected void initChildrenFormXml()
SwipeConsumerSmartSwipeWrapperinitChildrenFormXml 在类中 SwipeConsumerDrawerConsumer,
SlidingConsumerpublic void onDetachFromWrapper()
SwipeConsumeronDetachFromWrapper 在类中 SwipeConsumerprotected void onOpened()
onOpened 在类中 SwipeConsumerprotected void onClosed()
onClosed 在类中 SwipeConsumerpublic boolean tryAcceptMoving(int pointerId,
float downX,
float downY,
float dx,
float dy)
tryAcceptMoving 在类中 SwipeConsumerpublic void onSwipeAccepted(int activePointerId,
boolean settling,
float initialMotionX,
float initialMotionY)
onSwipeAccepted 在类中 SwipeConsumerprotected void changeDrawerViewVisibility(int visibility)
public void setCurrentStateAsClosed()
setCurrentStateAsClosed 在类中 SwipeConsumerprotected void initScrimView()
protected void calculateDrawerDirectionInitPosition(int direction,
int w,
int h)
public 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 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 callSwipeDistanceCalculatorprotected void orderChildren()
protected void layoutChildren()
protected void layoutContentView(android.view.View contentView)
protected void layoutDrawerView()
protected void layoutScrimView()
protected void notifySwipeStart()
notifySwipeStart 在类中 SwipeConsumerprotected void notifySwipeProgress(boolean settling)
notifySwipeProgress 在类中 SwipeConsumerprotected void notifySwipeRelease(float xVelocity,
float yVelocity)
notifySwipeRelease 在类中 SwipeConsumerpublic android.view.View getDrawerView(int direction)
public DrawerConsumer setLeftDrawerView(android.view.View drawerView)
public DrawerConsumer setRightDrawerView(android.view.View drawerView)
public DrawerConsumer setTopDrawerView(android.view.View drawerView)
public DrawerConsumer setBottomDrawerView(android.view.View drawerView)
public DrawerConsumer setHorizontalDrawerView(android.view.View drawerView)
public DrawerConsumer setVerticalDrawerView(android.view.View drawerView)
public DrawerConsumer setAllDirectionDrawerView(android.view.View drawerView)
public DrawerConsumer setDrawerView(int direction, android.view.View drawerView)
direction - direction to setdrawerView - viewpublic int getOpenDistance()
getOpenDistance 在类中 SwipeConsumerpublic DrawerConsumer setScrimColor(int color)
color - Color to use in 0xAARRGGBB format.public DrawerConsumer setShadowColor(int shadowColor)
shadowColor - Color to use in 0xAARRGGBB format.public int getShadowSize()
public DrawerConsumer setShadowSize(int size)
size - shadow size in pixelpublic boolean isDrawerViewRequired()
public DrawerConsumer setDrawerViewRequired(boolean required)
required - required or notpublic boolean isScrimAndShadowOutsideContentView()
public DrawerConsumer showScrimAndShadowOutsideContentView()
public DrawerConsumer showScrimAndShadowInsideContentView()
public void onClick(android.view.View v)
onClick 在接口中 android.view.View.OnClickListenerprotected boolean canChildScroll(android.view.ViewGroup parentView,
int direction,
int pointerId,
float downX,
float downY,
float dx,
float dy)
canChildScroll 在类中 SwipeConsumer