Android开源框架之Android-PullToRefresh

简介

PullToRefresh是一套实现非常好的下拉刷新库,它支持:ListView、ExpandableListView、GridView、WebView、ScrollView、HorizontalScrollView、ViewPager等多种常用的需要刷新的View类型,而且使用起来也十分方便。

使用

  • 下载及官方案例地址:https://github.com/chrisbanes/Android-PullToRefresh
  • 导入关联库
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'
}

在这里插入图片描述

  • 使用时可参考官方案例,个人觉得初学开源框架会参考案例实现需要的功能就行,若工作需要再深入研究框架源码即可。

案例

参考地址:https://github.com/hzulwy/private-project/blob/master/app.rar

猜你喜欢

转载自blog.csdn.net/qq_36828822/article/details/104148745