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


Java RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT属性代码示例

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


在下文中一共展示了RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT属性的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;
    }
}
 
开发者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

@SuppressWarnings("unchecked")
@Override
public int onSwipeItem(RecyclerView.ViewHolder holder, int position, int result) {
    if (!(mExpandableItemAdapter instanceof ExpandableSwipeableItemAdapter)) {
        return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
    }

    final ExpandableSwipeableItemAdapter adapter = (ExpandableSwipeableItemAdapter) mExpandableItemAdapter;

    final int flatPosition = position;
    final long expandablePosition = mPositionTranslator.getExpandablePosition(flatPosition);
    final int groupPosition = ExpandableAdapterHelper.getPackedPositionGroup(expandablePosition);
    final int childPosition = ExpandableAdapterHelper.getPackedPositionChild(expandablePosition);

    if (childPosition == RecyclerView.NO_POSITION) {
        return adapter.onSwipeGroupItem(holder, groupPosition, result);
    } else {
        return adapter.onSwipeChildItem(holder, groupPosition, childPosition, result);
    }
}
 
开发者ID:WriterOfAlicrow,项目名称:OpenCVTour,代码行数:20,代码来源:ExpandableRecyclerViewWrapperAdapter.java

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: onGetSwipeReactionType

@SuppressWarnings("unchecked")
@Override
public int onGetSwipeReactionType(VH holder, int position, int x, int y) {
    RecyclerView.Adapter adapter = getWrappedAdapter();
    if (!(adapter instanceof BaseSwipeableItemAdapter)) {
        return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
    }

    int correctedPosition = getOriginalPosition(position);

    BaseSwipeableItemAdapter<VH> swipeableItemAdapter = (BaseSwipeableItemAdapter<VH>) adapter;
    return swipeableItemAdapter.onGetSwipeReactionType(holder, correctedPosition, x, y);
}
 
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:13,代码来源:DraggableItemWrapperAdapter.java

示例11: 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

示例12: onGetSwipeReactionType

@Override
public int onGetSwipeReactionType(VH holder, int position, int x, int y) {
    RecyclerView.Adapter adapter = getWrappedAdapter();
    if (!(adapter instanceof SwipeableItemAdapter)) {
        return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
    }

    int correctedPosition = getOriginalPosition(position);

    SwipeableItemAdapter<VH> swipeableItemAdapter = (SwipeableItemAdapter<VH>) adapter;
    return swipeableItemAdapter.onGetSwipeReactionType(holder, correctedPosition, x, y);
}
 
开发者ID:WriterOfAlicrow,项目名称:OpenCVTour,代码行数:12,代码来源:DraggableItemWrapperAdapter.java

示例13: onSwipeItem

@Override
public int onSwipeItem(VH holder, int position, int result) {
    RecyclerView.Adapter adapter = getWrappedAdapter();
    if (!(adapter instanceof SwipeableItemAdapter)) {
        return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
    }

    int correctedPosition = getOriginalPosition(position);

    SwipeableItemAdapter<VH> swipeableItemAdapter = (SwipeableItemAdapter<VH>) adapter;
    return swipeableItemAdapter.onSwipeItem(holder, correctedPosition, result);
}
 
开发者ID:WriterOfAlicrow,项目名称:OpenCVTour,代码行数:12,代码来源:DraggableItemWrapperAdapter.java

示例14: onGetSwipeReactionType

@SuppressWarnings("unchecked")
@Override
public int onGetSwipeReactionType(VH holder, int position, int x, int y) {
    RecyclerView.Adapter adapter = getWrappedAdapter();
    if (!(adapter instanceof SwipeableItemAdapter)) {
        return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
    }

    int correctedPosition = getOriginalPosition(position);

    SwipeableItemAdapter<VH> swipeableItemAdapter = (SwipeableItemAdapter<VH>) adapter;
    return swipeableItemAdapter.onGetSwipeReactionType(holder, correctedPosition, x, y);
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:13,代码来源:DraggableItemWrapperAdapter.java

示例15: onSwipeItem

@SuppressWarnings("unchecked")
@Override
public int onSwipeItem(VH holder, int position, int result) {
    RecyclerView.Adapter adapter = getWrappedAdapter();
    if (!(adapter instanceof SwipeableItemAdapter)) {
        return RecyclerViewSwipeManager.AFTER_SWIPE_REACTION_DEFAULT;
    }

    int correctedPosition = getOriginalPosition(position);

    SwipeableItemAdapter<VH> swipeableItemAdapter = (SwipeableItemAdapter<VH>) adapter;
    return swipeableItemAdapter.onSwipeItem(holder, correctedPosition, result);
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:13,代码来源:DraggableItemWrapperAdapter.java


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