class HoverDrawable extends BitmapDrawable
View.Drawable.Callback, Drawable.ConstantState| Constructor and Description |
|---|
HoverDrawable(View view,
float downY)
|
HoverDrawable(View view,
MotionEvent ev)
|
| Modifier and Type | Method and Description |
|---|---|
(package private) int |
getDeltaY()
Returns the number of pixels between the original y coordinate of the view, and the current y coordinate.
|
(package private) int |
getTop()
Returns the top coordinate of this
HoverDrawable. |
(package private) void |
handleMoveEvent(MotionEvent ev)
Calculates the new position for this
HoverDrawable using given MotionEvent. |
(package private) boolean |
isMovingUpwards()
Returns whether the user is currently dragging this
HoverDrawable upwards. |
(package private) void |
onScroll(float mobileViewTopY)
Updates the original y position of the view, and calculates the scroll distance.
|
(package private) void |
setTop(int top)
Sets the top coordinate of this
HoverDrawable. |
(package private) void |
shift(int height)
Shifts the original y coordinates of this
HoverDrawable {code height} pixels upwards or downwards,
depending on the move direction. |
draw, getAlpha, getBitmap, getChangingConfigurations, getConstantState, getGravity, getIntrinsicHeight, getIntrinsicWidth, getOpacity, getPaint, getTileModeX, getTileModeY, hasAntiAlias, hasMipMap, inflate, isAutoMirrored, mutate, onBoundsChange, setAlpha, setAntiAlias, setAutoMirrored, setColorFilter, setDither, setFilterBitmap, setGravity, setMipMap, setTargetDensity, setTargetDensity, setTargetDensity, setTileModeX, setTileModeXY, setTileModeYclearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXmlInner, getBounds, getCallback, getCurrent, getLevel, getMinimumHeight, getMinimumWidth, getPadding, getState, getTransparentRegion, invalidateSelf, isStateful, isVisible, jumpToCurrentState, onLevelChange, onStateChange, resolveOpacity, scheduleSelf, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setLevel, setState, setVisible, unscheduleSelfHoverDrawable(View view, MotionEvent ev)
view - the View to represent.ev - the MotionEvent to use as down position.HoverDrawable(View view, float downY)
view - the View to represent.downY - the y coordinate of the down event.void handleMoveEvent(MotionEvent ev)
HoverDrawable using given MotionEvent.ev - the MotionEvent.
ev.getActionMasked() should typically equal MotionEvent.ACTION_MOVE.void onScroll(float mobileViewTopY)
mobileViewTopY - the top y coordinate of the mobile view this HoverDrawable represents.boolean isMovingUpwards()
HoverDrawable upwards.int getDeltaY()
HoverDrawable is moving upwards.int getTop()
HoverDrawable.void setTop(int top)
HoverDrawable.void shift(int height)
HoverDrawable {code height} pixels upwards or downwards,
depending on the move direction.height - the number of pixels this HoverDrawable should be moved. Should be positive.