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


Java RecyclerViewSwipeManager.REACTION_CAN_SWIPE_RIGHT属性代码示例

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


在下文中一共展示了RecyclerViewSwipeManager.REACTION_CAN_SWIPE_RIGHT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ExampleExpandableDataProvider

public ExampleExpandableDataProvider() {
    final String groupItems = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    final String childItems = "abc";

    mData = new LinkedList<>();

    for (int i = 0; i < groupItems.length(); i++) {
        //noinspection UnnecessaryLocalVariable
        final long groupId = i;
        final String groupText = Character.toString(groupItems.charAt(i));
        final int groupSwipeReaction = RecyclerViewSwipeManager.REACTION_CAN_SWIPE_LEFT | RecyclerViewSwipeManager.REACTION_CAN_SWIPE_RIGHT;
        final ConcreteGroupData group = new ConcreteGroupData(groupId, groupText, groupSwipeReaction);
        final List<ChildData> children = new ArrayList<>();

        for (int j = 0; j < childItems.length(); j++) {
            final long childId = group.generateNewChildId();
            final String childText = Character.toString(childItems.charAt(j));
            final int childSwipeReaction = RecyclerViewSwipeManager.REACTION_CAN_SWIPE_LEFT | RecyclerViewSwipeManager.REACTION_CAN_SWIPE_RIGHT;

            children.add(new ConcreteChildData(childId, childText, childSwipeReaction));
        }

        mData.add(new Pair<GroupData, List<ChildData>>(group, children));
    }
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:25,代码来源:ExampleExpandableDataProvider.java

示例2: DebugDataProvider

public DebugDataProvider() {
    final String atoz = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    mData = new LinkedList<>();
    @SuppressWarnings("PointlessBitwiseExpression")
    final int[] swipeReactionTable = {
            RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_LEFT | RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_RIGHT,
            RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_LEFT | RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_RIGHT_WITH_RUBBER_BAND_EFFECT,
            RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_LEFT | RecyclerViewSwipeManager.REACTION_CAN_SWIPE_RIGHT,
            RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_LEFT_WITH_RUBBER_BAND_EFFECT | RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_RIGHT,
            RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_LEFT_WITH_RUBBER_BAND_EFFECT | RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_RIGHT_WITH_RUBBER_BAND_EFFECT,
            RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_LEFT_WITH_RUBBER_BAND_EFFECT | RecyclerViewSwipeManager.REACTION_CAN_SWIPE_RIGHT,
            RecyclerViewSwipeManager.REACTION_CAN_SWIPE_LEFT | RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_RIGHT,
            RecyclerViewSwipeManager.REACTION_CAN_SWIPE_LEFT | RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_RIGHT_WITH_RUBBER_BAND_EFFECT,
            RecyclerViewSwipeManager.REACTION_CAN_SWIPE_LEFT | RecyclerViewSwipeManager.REACTION_CAN_SWIPE_RIGHT,
    };

    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < atoz.length(); j++) {
            final long id = mData.size();
            final int viewType = j % 2;
            final String text = Character.toString(atoz.charAt(j));
            final int swipeReaction = swipeReactionTable[j % swipeReactionTable.length];
            mData.add(new ConcreteData(id, viewType, text, swipeReaction));
        }
    }
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:27,代码来源:DebugDataProvider.java

示例3: makeText

private static String makeText(long id, String text, int swipeReaction) {
    final StringBuilder sb = new StringBuilder();

    sb.append(id);
    sb.append(" - ");
    sb.append(text);

    sb.append("\n");

    sb.append("(LEFT: ");
    switch (swipeReaction & 0x03) {
        case RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_LEFT:
            sb.append("disabled");
            break;
        case RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_LEFT_WITH_RUBBER_BAND_EFFECT:
            sb.append("rubber band effect");
            break;
        case RecyclerViewSwipeManager.REACTION_CAN_SWIPE_LEFT:
            sb.append("enabled");
            break;
    }
    sb.append(", RIGHT: ");
    switch (swipeReaction & (0x03 << 16)) {
        case RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_RIGHT:
            sb.append("disabled");
            break;
        case RecyclerViewSwipeManager.REACTION_CAN_NOT_SWIPE_RIGHT_WITH_RUBBER_BAND_EFFECT:
            sb.append("rubber band effect");
            break;
        case RecyclerViewSwipeManager.REACTION_CAN_SWIPE_RIGHT:
            sb.append("enabled");
            break;
    }
    sb.append(")");

    return sb.toString();
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:37,代码来源:DebugDataProvider.java

示例4: ExampleDataProvider

public ExampleDataProvider() {
    final String atoz = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    mData = new LinkedList<>();

    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < atoz.length(); j++) {
            final long id = mData.size();
            final int viewType = 0;
            final String text = Character.toString(atoz.charAt(j));
            final int swipeReaction = RecyclerViewSwipeManager.REACTION_CAN_SWIPE_LEFT | RecyclerViewSwipeManager.REACTION_CAN_SWIPE_RIGHT;
            mData.add(new ConcreteData(id, viewType, text, swipeReaction));
        }
    }
}
 
开发者ID:pczhu,项目名称:android-advancedrecyclerview-master,代码行数:15,代码来源:ExampleDataProvider.java


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