Introduction
PullToRefresh is a very good pull-down refresh library, it supports: ListView, ExpandableListView, GridView, WebView, ScrollView, HorizontalScrollView, ViewPager and other commonly used View types that need to be refreshed, and it is also very convenient to use.
use
- Download and official case address: https://github.com/chrisbanes/Android-PullToRefresh
- Import the associated library
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':library')
compile project(':pullToRefreshListFragment')
compile project(':pullToRefreshViewPager')
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
}
- When using it, you can refer to the official case. I personally think that the beginners of the open source framework will refer to the case to achieve the required functions. If the work requires further study of the framework source code.
Case study
Reference address: https://github.com/hzulwy/private-project/blob/master/app.rar