<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)
}

SwipeRefreshLayout 下拉刷新的更多相关文章

  1. google推出的SwipeRefreshLayout下拉刷新用法

    使用如下: 1.先下载android-support-v4.jar最新版本,之前的版本是没有SwipeRefreshLayout下拉刷新控件的,如果已经更新,此步骤可省略. 2.在xml文件中引用an ...

  2. 【转】google推出的SwipeRefreshLayout下拉刷新用法

    SwipeRefreshLayout是Google在support v4 19.1版本的library更新的一个下拉刷新组件,实现刷新效果更方便. 使用如下: 1.先下载android-support ...

  3. Android之SwipeRefreshLayout下拉刷新组件

    SwipeRefreshLayout概述 SwipeRefrshLayout是Google官方更新的一个Widget,可以实现下拉刷新的效果.该控件集成自ViewGroup在support-v4兼容包 ...

  4. Android零基础入门第72节:SwipeRefreshLayout下拉刷新

    在实际开发中,经常都会遇到下拉刷新.上拉加载更多的情形,这一期就一起来学习Android系统的SwipeRefreshLayout下拉刷新组件. 一.SwipeRefreshLayout简介 Swip ...

  5. Android SwipeRefreshLayout 下拉刷新——Hi_博客 Android App 开发笔记

    以前写下拉刷新 感觉好费劲,要判断ListView是否滚到顶部,还要加载头布局,还要控制 头布局的状态,等等一大堆.感觉麻烦死了.今天学习了SwipeRefreshLayout 的用法,来分享一下,有 ...

  6. SwipeRefreshLayout下拉刷新简单用例

    自己的下拉刷新组件 下拉刷新并自动添加数据 MainActivity package com.shaoxin.myswiperefreshlayout; import android.graphics ...

  7. SwipeRefreshLayout下拉刷新

    1.SwipeRefreshLayout是Google在support v4 19.1版本的library更新的一个下拉刷新组件,实现刷新效果更方便. 弊端:只有下拉 //设置刷新控件圈圈的颜色 sw ...

  8. Android --SwipeRefreshLayout 下拉刷新

    1.Layout <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/id_swipe_ly" an ...

  9. 谷歌官方SwipeRefreshLayout下拉刷新的用法。

    <Android SwipeRefreshLayout:谷歌官方SDK包中的下拉刷新> 下拉刷新在如今移动开发中应用如此广泛和普遍,以至于谷歌干脆在SDK中给予支持.在android-su ...

  10. [Android实例] Android 6.0RecyclerView SwipeRefreshLayout 下拉刷新 上拉加载

    这是Android 6.0的 SwipeRefreshLayout 实现下拉刷新和RecyclerView的上拉加载更多,以及添加分割线等 Android <ignore_js_op> r ...

随机推荐

  1. Tensorflow学习教程------softmax简单介绍

    做机器学习的同志们应该对这个都不陌生,这里简单举个例子.一般来说,使用softmax函数来将神经元输出的数值映射到0到1之间,这样神经元输出的值就变为了一个概率值. 公式和例子如下图 公式和例子如下图

  2. Java 过滤器Filter,Java Filter 不拦截某些请求 Java 过滤器支持Ajax请求

    ================================ ©Copyright 蕃薯耀 2020-01-10 https://www.cnblogs.com/fanshuyao/ 一.Java ...

  3. 【十日冲刺计划】第一日 星遇Sprint1计划会议成果

    ——小组成员 赵剑峰 张傲 周龙海 Sprint 计划会议1:定出 Sprint 目标和既定产品Backlog. 会议进程(1小时) • 首先对sprint目标进行总体介绍,概括星遇的backlog, ...

  4. h5-自定义视屏播放器

    1.html代码 <h3 class="playerTitle">视屏播放器</h3> <div class="player"&g ...

  5. 吴裕雄--天生自然GPU配置:查看本机显卡是否支持GPU

    NVIDIA的GF8级别以上的显卡才能支持physx物理加速(即GPU加速),ATI的显卡不支持. 打开:设备管理器,点击:显示适配器

  6. 吴裕雄--天生自然 JAVA开发学习:变量类型

    public class Variable{ static int allClicks=0; // 类变量 String str="hello world"; // 实例变量 pu ...

  7. [原]排错实战——通过对比分析sysinternals事件修复程序功能异常

    原调试debug排错troubleshootprocess monitorsysinternals 缘起 最近,我们程序的某个功能在一台机器上不正常,但是在另外一台机器上却是正常的.代码是同一份,vs ...

  8. ZJNU 1699 - Bits

    可得应当优先寻找最大的2^n-1这个数 如果l的位数不等于r的位数,那么这个数 2^n-1 就是最优解(每一位全为1) 如果l和r的位数相同,先看r是否符合 2^n-1,符合直接返回,不符合的话拆除最 ...

  9. GetCharWidth32

    #include <windows.h> #include<stdio.h> // 窗口函数的函数原形 LRESULT CALLBACK MainWndProc(HWND, U ...

  10. 常用的模型集成方法介绍:bagging、boosting 、stacking

    本文介绍了集成学习的各种概念,并给出了一些必要的关键信息,以便读者能很好地理解和使用相关方法,并且能够在有需要的时候设计出合适的解决方案. 本文将讨论一些众所周知的概念,如自助法.自助聚合(baggi ...