Tencent / QMUI_Android

提高 Android UI 开发效率的 UI 库
http://qmuiteam.com/android
Other
14.42k stars 2.67k forks source link

recylverview上拉刷新下拉加载更多,mPullLayout.setActionListener无效 #1028

Open beartistic opened 3 years ago

beartistic commented 3 years ago

运行环境

具体问题描述

无法实现上拉刷新下拉加载更多

    mPullLayout.setActionListener(new QMUIPullLayout.ActionListener() {
        @Override
        public void onActionTriggered(@NonNull QMUIPullLayout.PullAction pullAction) {
            mPullLayout.postDelayed(new Runnable() {
                @Override
                public void run() {
                    if (pullAction.getPullEdge() == QMUIPullLayout.PULL_EDGE_TOP) {
                        onRefreshData();
                    } else if (pullAction.getPullEdge() == QMUIPullLayout.PULL_EDGE_BOTTOM) {
                        onLoadMore();
                    }
                    mPullLayout.finishActionRun(pullAction);
                }
            }, 3000);
        }
    });

<com.qmuiteam.qmui.widget.pullLayout.QMUIPullLayout android:id="@+id/pull_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="?attr/qmui_skin_support_color_background"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/recyclerView" android:background="@android:color/transparent" android:layout_width="match_parent" android:layout_height="match_parent" app:qmui_is_target="true"/> <com.qmuiteam.qmui.widget.pullLayout.QMUIPullRefreshView android:layout_width="wrap_content" android:layout_height="wrap_content" app:qmui_action_view_init_offset="-20dp" app:qmui_pull_edge="top" app:qmui_target_view_trigger_offset="wrap" app:qmui_pull_rate="0.45" app:qmui_can_over_pull="true" app:qmui_need_receive_fling_from_target_view="true"/>

    <com.qmuiteam.qmui.widget.pullLayout.QMUIPullLoadMoreView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:qmui_action_view_init_offset="0dp"
        app:qmui_pull_edge="bottom"
        app:qmui_target_view_trigger_offset="wrap"
        app:qmui_pull_rate="0.45"
        app:qmui_can_over_pull="true"
        app:qmui_need_receive_fling_from_target_view="true"/>

</com.qmuiteam.qmui.widget.pullLayout.QMUIPullLayout>

问题

mPullLayout.setActionListener,上拉下拉无效

异常日志(堆栈)