Most visited

Recently visited

ItemTouchHelper.ViewDropHandler

public static interface ItemTouchHelper.ViewDropHandler

android.support.v7.widget.helper.ItemTouchHelper.ViewDropHandler
Known Indirect Subclasses


一个可由LayoutManager实现的接口,用于更好地与 ItemTouchHelper集成。

Summary

Public methods

abstract void prepareForDrop(View view, View target, int x, int y)

在View被放到另一个View上之后由 ItemTouchHelper调用。

Public methods

prepareForDrop

void prepareForDrop (View view, 
                View target, 
                int x, 
                int y)

在View被放到另一个View上之后由 ItemTouchHelper调用。

一个LayoutManager应该实现这个接口来为即将到来的移动操作做好准备。

例如,LinearLayoutManager设置一个“scrollToPositionWithOffset”调用,以便在拖动时将视图作为锚视图使用,同时计算下一个布局,使布局保持一致。

Parameters
view View: The View which is being dragged. It is very likely that user is still dragging this View so there might be other prepareForDrop(View, View, int, int) after this one.
target View: The target view which is being dropped on.
x int: The left offset of the View that is being dragged. This value includes the movement caused by the user.
y int: The top offset of the View that is being dragged. This value includes the movement caused by the user.

Hooray!