Taurus
1.0.0
该项目旨在提供简单且可定制的拉动刷新实现。
检查此 [Behance 上的项目] (https://www.behance.net/gallery/20411445/Mobile-Animations-Interactions)
检查这个[Dribbble 上的项目] (https://dribbble.com/shots/1623131-Pull-to-Refresh)
[示例 APK] (https://github.com/Yalantis/Taurus/blob/develop/sample-taurus.apk?raw=true)
#用法
对于有效的实现,请查看示例项目 - 示例
将该库包含为本地库项目。
在布局中包含 PullToRefreshView 小部件。
< com .yalantis.taurus.PullToRefreshView
android : id = " @+id/pull_to_refresh "
android : layout_width = " match_parent "
android : layout_height = " match_parent "
app : type = " sun " >
< ListView
android : id = " @+id/list_view "
android : divider = " @null "
android : dividerHeight = " 0dp "
android : layout_width = " match_parent "
android : layout_height = " match_parent " />
</ com .yalantis.taurus.PullToRefreshView>
在onCreate
方法中引用 View 并设置 OnRefreshListener。
mPullToRefreshView = ( PullToRefreshView ) findViewById ( R . id . pull_to_refresh );
mPullToRefreshView . setOnRefreshListener ( new PullToRefreshView . OnRefreshListener () {
@ Override
public void onRefresh () {
mPullToRefreshView . postDelayed ( new Runnable () {
@ Override
public void run () {
mPullToRefreshView . setRefreshing ( false );
}
}, REFRESH_DELAY );
}
});
如果您需要更改进度状态:
mPullToRefreshView . setRefreshing ( boolean isRefreshing )
##使用 Gradle 安装
compile ' com.github.yalantis:taurus:1.0.2 '
#兼容性
如果您向我们发送使用我们组件的项目的链接,我们将非常高兴。只需发送电子邮件至 [email protected] 如果您对动画有任何疑问或建议,请告诉我们。
PS 我们将发布更多包含在代码中的精彩内容以及关于如何使 Android (iOS) 的 UI 变得更好的教程。敬请关注!
Copyright 2017, Yalantis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.