<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.realm.RealmDemo"> <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:id="@+id/swipe_refresh_layout"> <androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent" android:id="@+id/recycle_view"/> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.constraintlayout.widget.ConstraintLayout>

使用比较简单 这里就模拟了一下加载效果 下拉触发加载显示动画此时isRefreshing=true   加载数据后需要修改为false 隐藏动画

swipe_refresh_layout.isRefreshing = false
swipe_refresh_layout.setOnRefreshListener {
Handler().postDelayed({
swipe_refresh_layout.isRefreshing = false
},2000)
}

最新文章

  1. Android Duplicate files copied in APK
  2. Service and controller in angularJs
  3. vs 2015 连接不上tfs 错误代码:TF31002
  4. centos编译安装apache
  5. .frame类库简单介绍与使用
  6. XML解析之DOM详解及与SAX解析方法的比较
  7. 从range和xrange的性能对比到yield关键字(中)
  8. [SAP ABAP开发技术总结]IDoc
  9. JQuery中操作Css样式
  10. Intellij IDEA 使用Spring-boot-devTools无效解决办法
  11. CODEVS 1001 舒适的路线
  12. java中关于json传图片的方法
  13. Python 基础篇:编码、变量、模块
  14. SWT的TableVierer的使用二(数据排序)
  15. [已解决]import pymssql ImportError: libsybdb.so.5
  16. loj#2353. 「NOI2007」 货币兑换 斜率优化
  17. 2018.07.07 BZOJ2212: Poi2011Tree Rotations(线段树合并)
  18. 【CF739E】Gosha is hunting(动态规划,凸优化)
  19. js入门介绍
  20. [GO]多任务的资源竞争问题

热门文章

  1. 2018CCPC吉林赛区 hdu6555~hdu6566
  2. JS-语句三
  3. vue select框change事件
  4. Java中Scanner类在nextInt()后无法输入nextLine()的问题
  5. 2018.11.16javascript课上随笔(DOM)
  6. 简单的Vue计算属性
  7. maven打包 invalid entry size Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.14.RELEASE:repackage (default) on project
  8. Ubuntu apt install 下载软件很慢的解决办法
  9. MyBatis学习——动态SQL
  10. R语言 批量下载财务报表