android 自定义 刷新/加载更多 Google官方级高性能控件 ,可自定义UI图片

android中 常会用到各种列表控件,像古老的ListView  , GridView,常用的RecyclerView,或者自定义的ViewGroup,

实现下拉刷新的控件库也是各种各样,花样百出,但有一个简约可自定义的不算多,于是手撸一个控件

Google官方性能级别的控件,可自定义刷新图(在drawable-hdpi>refresh_icon)

纯手工打造。体验竟然如此般丝滑。

先上效果图

加载更多

刷新

优点:性能最优,可自定义UI,简约,持续更新

使用方式:

 app:refresh_icon  自定义下拉刷新的图片,最好大一些,不写默认是八卦样式。

//代码里的刷新逻辑  判断头部和底部

引入方式:

主工程的gradle:

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
maven { url 'https://jitpack.io' }

然后在项目中:

dependencies {
	        implementation 'com.github.ChenXi1995.SmartAndroid:smartrefreshview:1.0.4'
	}
implementation 'com.github.ChenXi1995.SmartAndroid:smartrefreshview:1.0.4'

github地址:https://github.com/ChenXi1995/SmartAndroid 欢迎star

发布了42 篇原创文章 · 获赞 7 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_29769851/article/details/93976064
今日推荐