本文整理汇总了Java中com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager.RESULT_SWIPED_LEFT属性的典型用法代码示例。如果您正苦于以下问题:Java RecyclerViewSwipeManager.RESULT_SWIPED_LEFT属性的具体用法?Java RecyclerViewSwipeManager.RESULT_SWIPED_LEFT怎么用?Java RecyclerViewSwipeManager.RESULT_SWIPED_LEFT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager
的用法示例。
在下文中一共展示了RecyclerViewSwipeManager.RESULT_SWIPED_LEFT属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
}
示例3: 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;
}
}
示例4: 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;
}
}
示例5: 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
示例6: onSwipeItem
@Override
public int onSwipeItem(MyViewHolder holder, int position, int result) {
Log.d(TAG, "onSwipeItem(position = " + position + ", result = " + result + ")");
switch (result) {
// swipe right --- remove
case RecyclerViewSwipeManager.RESULT_SWIPED_RIGHT:
return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
// 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;
}
}
示例7: 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
示例8: 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
示例9: onSwipeItem
@Override
public SwipeResultAction onSwipeItem(TabViewHolder holder, final int position, int result) {
switch (result) {
// swipe left -- remove
case RecyclerViewSwipeManager.RESULT_SWIPED_LEFT:
return new SwipeResultActionRemoveItem() {
@Override
protected void onPerformAction() {
super.onPerformAction();
remove(position);
}
};
case RecyclerViewSwipeManager.RESULT_CANCELED:
default:
return new SwipeResultActionDefault();
}
}
示例10: 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
示例11: 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_RIGHT)) &&
(reaction == RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_REMOVE_ITEM);
}