当前位置: 首页>>代码示例>>Java>>正文


Java RecyclerViewSwipeManager.RESULT_CANCELED属性代码示例

本文整理汇总了Java中com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager.RESULT_CANCELED属性的典型用法代码示例。如果您正苦于以下问题:Java RecyclerViewSwipeManager.RESULT_CANCELED属性的具体用法?Java RecyclerViewSwipeManager.RESULT_CANCELED怎么用?Java RecyclerViewSwipeManager.RESULT_CANCELED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager的用法示例。


在下文中一共展示了RecyclerViewSwipeManager.RESULT_CANCELED属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
    }
}
 
开发者ID:hanks-zyh,项目名称:RecylerView,代码行数:23,代码来源:MyDraggableSwipeableItemAdapter.java

示例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;
    }
}
 
开发者ID:hanks-zyh,项目名称:RecylerView,代码行数:23,代码来源:MyAdapter.java

示例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;
    }
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:23,代码来源:MyTaskAdapter.java

示例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;
    }
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:23,代码来源:MySwipeableItemAdapter.java

示例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;
    }
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:17,代码来源:MyUnderSwipeableItemAdapter.java

示例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();
    }
}
 
开发者ID:gandulf,项目名称:DsaTab,代码行数:17,代码来源:TabInfoDraggableItemAdapter.java


注:本文中的com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager.RESULT_CANCELED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。