本文整理汇总了Java中com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM属性的典型用法代码示例。如果您正苦于以下问题:Java RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM属性的具体用法?Java RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM怎么用?Java RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager
的用法示例。
在下文中一共展示了RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSwipeItem
@Override
public int onSwipeItem(MyViewHolder holder, int position, int result) {
Log.d(TAG, "onSwipeItem(result = " + result + ")");
switch (result) {
// swipe right
case RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT:
if (mProvider.get(position).isPinedToSwipeLeft()) {
// pinned --- back to default position
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
} else {
// not pinned --- remove
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM;
}
// swipe left -- pin
case RecyclerViewSwipeManager.RESULT_SWIPED_LEFT:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION;
// other --- do nothing
case RecyclerViewSwipeManager.RESULT_CANCELED:
default:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
}
}
示例2: onPerformAfterSwipeReaction
@Override
public void onPerformAfterSwipeReaction(MyViewHolder holder, int position, int result, int reaction) {
Log.d(TAG, "onPerformAfterSwipeReaction(result = " + result + ", reaction = " + reaction + ")");
final MyItem item = mProvider.get(position);
if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM) {
mProvider.remove(position);
notifyItemRemoved(position);
} else if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION) {
item.setPinedToSwipeLeft(true);
notifyItemChanged(position);
} else {
item.setPinedToSwipeLeft(false);
}
}
示例3: onSwipeItem
@Override
public int onSwipeItem(MyViewHolder holder, int position, int result) {
Log.d("zyh", "onSwipeItem(result = " + result + ")");
switch (result) {
// swipe right
case RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT:
if (dataList.get(position).isPinedToSwipeLeft()) {
// pinned --- back to default position
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
} else {
// not pinned --- remove
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM;
}
// swipe left -- pin
case RecyclerViewSwipeManager.RESULT_SWIPED_LEFT:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION;
// other --- do nothing
case RecyclerViewSwipeManager.RESULT_CANCELED:
default:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
}
}
示例4: onPerformAfterSwipeReaction
@Override
public void onPerformAfterSwipeReaction(MyViewHolder holder, int position, int result, int reaction) {
Log.d("zyh", "onPerformAfterSwipeReaction(result = " + result + ", reaction = " + reaction + ")");
final MyItem item = dataList.get(position);
if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM) {
dataList.remove(position);
notifyItemRemoved(position);
} else if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION) {
item.setPinedToSwipeLeft(true);
notifyItemChanged(position);
} else {
item.setPinedToSwipeLeft(false);
}
}
示例5: onSwipeItem
@Override
public int onSwipeItem(TaskViewHolder holder, int position, int result) {
switch (result) {
// swipe right
case RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT:
if (list.get(position).isPinedToSwipeLeft()) {
// pinned --- back to default position
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
} else {
// not pinned --- remove
deleteTask(position);
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM;
}
// swipe left -- pin
case RecyclerViewSwipeManager.RESULT_SWIPED_LEFT:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION;
// other --- do nothing
case RecyclerViewSwipeManager.RESULT_CANCELED:
default:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
}
}
示例6: onPerformAfterSwipeReaction
@Override
public void onPerformAfterSwipeReaction(TaskViewHolder holder, int position, int result, int reaction) {
final Task item = list.get(position);
if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM) {
list.remove(position);
notifyItemRemoved(position);
if (mEventListener != null) {
mEventListener.onItemRemoved(position);
}
} else if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION) {
item.setPinedToSwipeLeft(true);
notifyItemChanged(position);
if (mEventListener != null) {
mEventListener.onItemPinned(position);
}
} else {
item.setPinedToSwipeLeft(false);
}
}
示例7: onSwipeItem
@Override
public int onSwipeItem(MyViewHolder holder, int position, int result) {
Log.d(TAG, "onSwipeItem(position = " + position + ", result = " + result + ")");
switch (result) {
// swipe right
case RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT:
if (mProvider.getItem(position).isPinnedToSwipeLeft()) {
// pinned --- back to default position
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
} else {
// not pinned --- remove
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM;
}
// swipe left -- pin
case RecyclerViewSwipeManager.RESULT_SWIPED_LEFT:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION;
// other --- do nothing
case RecyclerViewSwipeManager.RESULT_CANCELED:
default:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
}
}
示例8: onPerformAfterSwipeReaction
@Override
public void onPerformAfterSwipeReaction(MyViewHolder holder, int position, int result, int reaction) {
Log.d(TAG, "onPerformAfterSwipeReaction(position = " + position + ", result = " + result + ", reaction = " + reaction + ")");
final AbstractDataProvider.Data item = mProvider.getItem(position);
if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM) {
mProvider.removeItem(position);
notifyItemRemoved(position);
if (mEventListener != null) {
mEventListener.onItemRemoved(position);
}
} else if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION) {
item.setPinnedToSwipeLeft(true);
notifyItemChanged(position);
if (mEventListener != null) {
mEventListener.onItemPinned(position);
}
} else {
item.setPinnedToSwipeLeft(false);
}
}
示例9: onSwipeItem
@Override
public int onSwipeItem(MyViewHolder holder, int position, int result) {
Log.d(TAG, "onSwipeItem(result = " + result + ")");
switch (result) {
// swipe right
case RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT:
if (mProvider.getItem(position).isPinnedToSwipeLeft()) {
// pinned --- back to default position
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
} else {
// not pinned --- remove
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM;
}
// swipe left -- pin
case RecyclerViewSwipeManager.RESULT_SWIPED_LEFT:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION;
// other --- do nothing
case RecyclerViewSwipeManager.RESULT_CANCELED:
default:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
}
}
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:23,代码来源:MyDraggableSwipeableItemAdapter.java
示例10: onPerformAfterSwipeReaction
@Override
public void onPerformAfterSwipeReaction(MyViewHolder holder, int position, int result, int reaction) {
Log.d(TAG, "onPerformAfterSwipeReaction(result = " + result + ", reaction = " + reaction + ")");
final AbstractDataProvider.Data item = mProvider.getItem(position);
if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM) {
mProvider.removeItem(position);
notifyItemRemoved(position);
if (mEventListener != null) {
mEventListener.onItemRemoved(position);
}
} else if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION) {
item.setPinnedToSwipeLeft(true);
notifyItemChanged(position);
if (mEventListener != null) {
mEventListener.onItemPinned(position);
}
} else {
item.setPinnedToSwipeLeft(false);
}
}
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:24,代码来源:MyDraggableSwipeableItemAdapter.java
示例11: onSwipeGroupItem
@Override
public int onSwipeGroupItem(MyGroupViewHolder holder, int groupPosition, int result) {
Log.d(TAG, "onSwipeGroupItem(groupPosition = " + groupPosition + ", result = " + result + ")");
switch (result) {
// swipe right
case RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT:
if (mProvider.getGroupItem(groupPosition).isPinnedToSwipeLeft()) {
// pinned --- back to default position
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
} else {
// not pinned --- remove
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM;
}
// swipe left -- pin
case RecyclerViewSwipeManager.RESULT_SWIPED_LEFT:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION;
// other --- do nothing
case RecyclerViewSwipeManager.RESULT_CANCELED:
default:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
}
}
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:23,代码来源:MyExpandableDraggableSwipeableItemAdapter.java
示例12: onSwipeChildItem
@Override
public int onSwipeChildItem(MyChildViewHolder holder, int groupPosition, int childPosition, int result) {
Log.d(TAG, "onSwipeChildItem(groupPosition = " + groupPosition + ", childPosition = " + childPosition + ", result = " + result + ")");
switch (result) {
// swipe right
case RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT:
if (mProvider.getChildItem(groupPosition, childPosition).isPinnedToSwipeLeft()) {
// pinned --- back to default position
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
} else {
// not pinned --- remove
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM;
}
// swipe left -- pin
case RecyclerViewSwipeManager.RESULT_SWIPED_LEFT:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION;
// other --- do nothing
case RecyclerViewSwipeManager.RESULT_CANCELED:
default:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
}
}
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:23,代码来源:MyExpandableDraggableSwipeableItemAdapter.java
示例13: onPerformAfterSwipeGroupReaction
@Override
public void onPerformAfterSwipeGroupReaction(MyGroupViewHolder holder, int groupPosition, int result, int reaction) {
Log.d(TAG, "onPerformAfterSwipeGroupReaction(groupPosition = " + groupPosition + ", result = " + result + ", reaction = " + reaction + ")");
final AbstractExpandableDataProvider.GroupData item = mProvider.getGroupItem(groupPosition);
final long expandablePosition = RecyclerViewExpandableItemManager.getPackedPositionForGroup(groupPosition);
final int flatPosition = mExpandableItemManager.getFlatPosition(expandablePosition);
if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM) {
mProvider.removeGroupItem(groupPosition);
notifyItemRemoved(flatPosition);
if (mEventListener != null) {
mEventListener.onGroupItemRemoved(groupPosition);
}
} else if (reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION) {
item.setPinnedToSwipeLeft(true);
notifyItemChanged(flatPosition);
if (mEventListener != null) {
mEventListener.onGroupItemPinned(groupPosition);
}
} else {
item.setPinnedToSwipeLeft(false);
}
}
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:26,代码来源:MyExpandableDraggableSwipeableItemAdapter.java
示例14: isSwipeDismissed
private static boolean isSwipeDismissed(RecyclerView.ViewHolder item) {
if (!(item instanceof SwipeableItemViewHolder)) {
return false;
}
final SwipeableItemViewHolder item2 = (SwipeableItemViewHolder) item;
final int result = item2.getSwipeResult();
final int reaction = item2.getAfterSwipeReaction();
return ((result == RecyclerViewSwipeManager.RESULT_SWIPED_LEFT) ||
(result == RecyclerViewSwipeManager.RESULT_SWIPED_UP) ||
(result == RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT) ||
(result == RecyclerViewSwipeManager.RESULT_SWIPED_DOWN)) &&
(reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM);
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:15,代码来源:SwipeDismissItemAnimator.java
示例15: invokeOnSwipeItem
@SuppressWarnings("unchecked")
public static SwipeResultAction invokeOnSwipeItem(
BaseExpandableSwipeableItemAdapter<?, ?> adapter, RecyclerView.ViewHolder holder,
int groupPosition, int childPosition, int result) {
if (adapter instanceof LegacyExpandableSwipeableItemAdapter) {
int reaction;
if (childPosition == RecyclerView.NO_POSITION) {
reaction = ((LegacyExpandableSwipeableItemAdapter) adapter).onSwipeGroupItem(
holder, groupPosition, result);
} else {
reaction = ((LegacyExpandableSwipeableItemAdapter) adapter).onSwipeChildItem(
holder, groupPosition, childPosition, result);
}
switch (reaction) {
case RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT:
case RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_MOVE_TO_SWIPED_DIRECTION:
case RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM:
//noinspection deprecation
return new LegacyExpandableSwipeResultAction<>(
(LegacyExpandableSwipeableItemAdapter<RecyclerView.ViewHolder, RecyclerView.ViewHolder>) adapter,
holder, groupPosition, childPosition, result, reaction);
default:
throw new IllegalStateException("Unexpected reaction type: " + reaction);
}
} else {
if (childPosition == RecyclerView.NO_POSITION) {
return ((ExpandableSwipeableItemAdapter) adapter).onSwipeGroupItem(holder, groupPosition, result);
} else {
return ((ExpandableSwipeableItemAdapter) adapter).onSwipeChildItem(holder, groupPosition, childPosition, result);
}
}
}
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:35,代码来源:ExpandableSwipeableItemInternalUtils.java