GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - classops/XPullToRefresh: 一个下拉刷新库,支持 NestedScrollView、任何实现ScrollingView接口的View、ListView、SrollView等,支持拓展来支持其他布局View。

BranchesTags
Open more actions menu

Latest commit

 

History

32 Commits
32 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
library
library
 
 
screenshots
screenshots
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
TODO
TODO
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

XPullToRefresh

兼容NestedScroll的下拉刷新控件。可以使用ScrollView,ListView,WebView,RecyclerView,实现NestedScrollChild的View。

使用方法

添加依赖

  1. 添加仓库到根build.gradle文件
    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
  1. 添加库依赖
    dependencies {
        implementation 'com.github.wangmingshuo:XPullToRefresh:1.0.3'
    }
  • 使用下拉刷新,只需要把要刷新布局嵌套在 PullToRefreshLayout里。
<com.hanter.xpulltorefresh.PullToRefreshLayout
    android:id="@+id/refresh"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true" >

    <ScrollView
        android:id="@+id/slv_content"
        android:overScrollMode="never"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

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

        </LinearLayout>

    </ScrollView>

</com.hanter.xpulltorefresh.PullToRefreshLayout>
  • 设置刷新回调接口
PullToRefreshLayout refresh = (PullToRefreshLayout) findViewById(R.id.refresh);       
refresh.setOnRefreshListener(new PullToRefreshLayout.OnRefreshListener() {
    @Override
    public void onPullDownToRefresh(PullToRefreshLayout refreshView) {
		// 下拉刷新
    }

    @Override
    public void onPullUpToRefresh(PullToRefreshLayout refreshView) {
		// 上拉刷新
    }
});
  • 上下拉刷新使能方法
refresh.setPullDownRefreshEnabled(true);
refresh.setPullUpRefreshEnabled(false);

支持NestedScrollChild,实现嵌套滚动特性

可以嵌套在CoodinatorLayout及NestedChildParent实现类容器内。

嵌套在CoodinatorLayout协调滑动:

滑动

About

一个下拉刷新库,支持 NestedScrollView、任何实现ScrollingView接口的View、ListView、SrollView等,支持拓展来支持其他布局View。

Topics

androidlistviewnestedscrollpull-to-refreshpulltorefreshrecyclerview

Resources

Readme
Activity

Stars

4 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.