public class ItemTouchExpand extends ListAdornment
ListAdornment.ListAdornmentCleaner| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
DOWN |
Indicates the downward direction, which is used in swiping and dragging.
|
static int |
DRAG_ANIMATION_TYPE |
An animation indicating that the component is dragged.
|
static int |
END |
Indicates the horizontal end direction, which is used in swiping and dragging.
|
static int |
ITEM_TOUCH_DRAG_STATE |
Indicates that the component is being dragged.
|
static int |
ITEM_TOUCH_IDLE_STATE |
Indicates that the
ItemTouchHelper is in the idle state. |
static int |
ITEM_TOUCH_SWIPE_STATE |
Indicates that the component is being swiped.
|
static int |
LEFT |
Indicates the leftward direction, which is used in swiping and dragging.
|
static int |
RIGHT |
Indicates the rightward direction, which is used in swiping and dragging.
|
static int |
START |
Indicates the horizontal start direction, which is used in swiping and dragging.
|
static int |
SWIPE_CANCEL_ANIMATION_TYPE |
An animation indicating that component swiping has been canceled.
|
static int |
SWIPE_SUCCESS_ANIMATION_TYPE |
An animation indicating the component that can be swiped successfully.
|
static int |
UP |
Indicates the upward direction, which is used in swiping and dragging.
|
mNativePtr| 构造器 | 说明 |
|---|---|
ItemTouchExpand(ItemTouchExpandCallback callback) |
A constructor used to create an
ItemTouchExpand instance based on an ItemTouchExpandCallback. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
beginDrag(ComponentOwner componentOwner) |
Starts to drag a component.
|
void |
beginSwipe(ComponentOwner componentOwner) |
Starts to swipe a component.
|
void |
boundToListComponent(ListComponent listComponent) |
Binds this
ItemTouchExpand instance to a ListComponent. |
protected void |
createNativePtr() |
Creates a native pointer to this
ItemTouchExpand instance. |
float |
getSwipeEscapeSpeed() |
Obtains the minimum speed of the swipe operation.
|
void |
setSwipeEscapeSpeed(float swipeSpeed) |
Sets the minimum speed of the swipe operation.
|
void |
startMoveItem(int fromPos,
int toPos) |
Move item from fromPos to toPos.
|
afterDrawCallback, beforeDrawCallback, getItemDeltas, getNativePtrpublic static final int DOWN
public static final int DRAG_ANIMATION_TYPE
public static final int END
It can be LEFT or RIGHT based on the layout orientation of the ListComponent.
public static final int ITEM_TOUCH_DRAG_STATE
public static final int ITEM_TOUCH_IDLE_STATE
ItemTouchHelper is in the idle state.
In this state, the user does not swipe or drag a component, or the latest swipe or drag action has not been triggered.
public static final int ITEM_TOUCH_SWIPE_STATE
public static final int LEFT
public static final int RIGHT
public static final int START
It can be LEFT or RIGHT based on the layout orientation of the ListComponent.
public static final int SWIPE_CANCEL_ANIMATION_TYPE
public static final int SWIPE_SUCCESS_ANIMATION_TYPE
public static final int UP
public ItemTouchExpand(ItemTouchExpandCallback callback)
ItemTouchExpand instance based on an ItemTouchExpandCallback.
You can call boundToListComponent(ohos.agp.components.ListComponent) to bind an ItemTouchExpand instance to a
ListComponent.
callback - Indicates the callback for the behavior of the ItemTouchExpand instance.protected void createNativePtr()
ItemTouchExpand instance.createNativePtr 在类中 ListAdornmentpublic void boundToListComponent(ListComponent listComponent)
ItemTouchExpand instance to a ListComponent. If the ItemTouchExpand
instance has been bound to another ListComponent, it will be unbound from that ListComponent
first.
ListComponent - Indicates the ListComponent to which the ItemTouchExpand instance will be
bound.public void setSwipeEscapeSpeed(float swipeSpeed)
swipeSpeed - Indicates the minimum speed to set.public float getSwipeEscapeSpeed()
0.F if an exception occurs.public void beginDrag(ComponentOwner componentOwner)
componentOwner - Indicates the ComponentOwner of the component.public void beginSwipe(ComponentOwner componentOwner)
componentOwner - Indicates the ComponentOwner of the component.public void startMoveItem(int fromPos,
int toPos)
fromPos - Start point.toPos - End point.