Android 实现上下弹簧效果刷新 布局组合记录

185 阅读1分钟

image.png

<com.scwang.smart.refresh.layout.SmartRefreshLayout  
    android:layout_width="match_parent"  
    android:layout_height="0dp"  
    android:layout_weight="1"  
    android:background="@color/transparent"  
    app:srlDragRate="0.65"  
    app:srlEnablePureScrollMode="true">  
        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout  
            android:id="@+id/orderSwipeRefresh"  
            android:layout_width="match_parent"  
            android:layout_height="match_parent">  
                <androidx.core.widget.NestedScrollView  
                    android:layout_width="match_parent"  
                    android:layout_height="match_parent"  
                    android:orientation="vertical">  

                    <LinearLayout  
                        android:layout_width="match_parent"  
                        android:layout_height="match_parent"  
                        android:orientation="vertical">  

  
                    </LinearLayout>  
  
                </androidx.core.widget.NestedScrollView>  
        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>  
  
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
//SmartRefreshLayout  
implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' //核心必须依赖  
implementation 'io.github.scwang90:refresh-header-material:2.0.6' //谷歌刷新头  
implementation 'io.github.scwang90:refresh-footer-classics:2.0.6' //经典加载

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"