SwipeNest scroll view (supports various common View recycleView scrollView listView and other mixed arrangements) Handling scrolling conflicts With pull-down refresh and pull-up loading
Add Gradle dependency:
dependencies {
compile 'com.github.powyin:scroll:3.2.5'
compile 'com.android.support:recyclerview-v7:24.0.0'
}
Refresh (customizable) | Launch load to get new data (customizable) | Upload and load data are all available (customizable) |
---|---|---|
![]() |
![]() |
![]() |
Refresh (customizable) | Smooth scrolling conflicts between various Views | Custom refresh example |
---|---|---|
![]() |
![]() |
![]() |
<com.powyin.scroll.widget.SwipeRefresh>
<!--ListView-->
<android.support.v7.widget.RecyclerView/>
</com.powyin.scroll.widget.SwipeRefresh>
<com.powyin.scroll.widget.SwipeNest>
<FrameLayout>
<ImageView />
</FrameLayout>
<android.support.v7.widget.RecyclerView/>
<ImageView />
</com.powyin.scroll.widget.SwipeNest>
ISwipe
ISwipe.setOnRefreshListener(new SwipeRefresh.OnRefreshListener() {
@Override
public void onRefresh() {
// Start pull-down refresh
}
@Override
public void onLoading(boolen isLoadViewShow) {
// Start loading more
}
});
ISwipe.setFreshStatue(ISwip.RreshStatus.SUCCESS); //Pulldown refresh complete
ISwipe.setFreshStatue(ISwipe.RreshStatus.ERROR); //Pulldown refresh failed
ISwipe.setSwipeModel(SwipeControl.SwipeModel model)
(BOTH = SwipeModel.SWIPE_BOTH) Support for pull-down refresh and pull-up loading
(ONLY_REFRESH == SwipeModel.SWIPE_ONLY_REFRESH)) Only pull-down refresh
(ONLY_REFRESH == SwipeModel.SWIPE_ONLY_LOADINN) Only pull-up loading is supported
(SWIPE_NONE == SwipeModel.SWIPE_NONE) Not supported
PowViewHolder<T> This class abstracts the necessary conditions for getting ListAdapter.Item and Recycle.Adapter.Item and PagerAdapter.Item;
The generic type must be determined when using it;
AdapterDelegate<T> This interface defines the ListAdapter and RecycleView.Adatper and PagerAdapter public data operations;