scwang90 / SmartRefreshLayout

🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
https://segmentfault.com/a/1190000010066071
Apache License 2.0
24.8k stars 4.93k forks source link

Coord view里面使用不正常发现超多bug,横屏的情况下上拉加载更多的view不出来,调用finishmore无效果调用finishmorenotdata死循环。下拉会看到view提示正在等待加载更多完成。 #1395

Closed lozn00 closed 2 years ago

lozn00 commented 2 years ago

Coord view里面使用不正常发现超多bug,横屏的情况下上拉加载更多的view不出来但是会触发加载更多方法,然后调用finishmore无效果,调用finishmorenotdata死循环导致堆栈异常,finishmorenodata又会调用finishmore 另外 下拉重新加载会看到view提示正在等待加载更多完成。 也就是导致整个无法刷新了。

lozn00 commented 2 years ago
    implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3'      //核心必须依赖
    implementation 'com.scwang.smart:refresh-header-classics:2.0.3'    //经典刷新头
<?xml version="1.0" encoding="utf-8"?>

<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent">

    <com.google.android.material.appbar.AppBarLayout

        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/transparent">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbarLayout"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            app:layout_collapseMode="none"
            app:layout_scrollFlags="scroll">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    android:background="@color/themeColorSecond"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

                    <TextView
                        android:id="@+id/tv_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginHorizontal="@dimen/spacing_smlarge"
                        android:layout_marginLeft="@dimen/spacing_smlarge"
                        android:layout_marginRight="@dimen/spacing_smlarge"
                        android:text="Filter result"
                        android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
                        android:textColor="@android:color/white" />

                    <View
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_weight="1" />

                    <ImageView
                        android:id="@+id/action_cancel"
                        android:layout_width="?attr/actionBarSize"
                        android:layout_height="?attr/actionBarSize"
                        android:padding="@dimen/spacing_large"
                        android:src="@drawable/ic_close"
                        android:visibility="gone"
                        app:tint="@android:color/white" />

                    <ImageView
                        android:id="@+id/action_menu"
                        android:layout_width="?attr/actionBarSize"
                        android:layout_height="?attr/actionBarSize"
                        android:padding="@dimen/spacing_large"
                        android:src="@drawable/ic_tune"
                        app:tint="@android:color/white" />

            </LinearLayout>

        </com.google.android.material.appbar.CollapsingToolbarLayout>

    </com.google.android.material.appbar.AppBarLayout>

    <androidx.cardview.widget.CardView
        android:id="@+id/root"

        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="2dp"
        android:visibility="visible"
        app:cardBackgroundColor="@android:color/transparent"
        app:cardCornerRadius="0dp"
        app:cardElevation="0dp">

    <com.scwang.smart.refresh.layout.SmartRefreshLayout

        android:id="@+id/refreshlayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"

        android:visibility="visible">

        <com.scwang.smart.refresh.header.ClassicsHeader
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
        <com.sotrun.app.ui.thrid.MySmartTable
            android:id="@+id/tableview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollingCache="true"
            />

    </com.scwang.smart.refresh.layout.SmartRefreshLayout>
    </androidx.cardview.widget.CardView>
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:layout_height="match_parent">

        <androidx.core.widget.NestedScrollView
            android:id="@+id/backdrop_view"
            android:layout_width="0dp"

            android:layout_height="wrap_content"
            android:background="@color/themeColorSecond"
            app:layout_constraintRight_toRightOf="parent"

            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_percent="0.39">

            <LinearLayout
                android:id="@+id/layout_form"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="50dp"
                android:orientation="vertical">

            </LinearLayout>

        </androidx.core.widget.NestedScrollView>

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
lozn00 commented 2 years ago

CardView 是有behavior的,我修改behavior效果依然不理想,依然不会显示更多的view.依然有bug,刚开始以为是behavior导致的。

lozn00 commented 2 years ago

。竟然刷新头的位置也会影响。。