| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
兼容NestedScroll的下拉刷新控件。可以使用ScrollView,ListView,WebView,RecyclerView,实现NestedScrollChild的View。
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
} dependencies {
implementation 'com.github.wangmingshuo:XPullToRefresh:1.0.3'
}<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);
可以嵌套在CoodinatorLayout及NestedChildParent实现类容器内。
嵌套在CoodinatorLayout协调滑动:
| Back | FazBrowse Home | New Git URL |