pull to make soup
1.0.0
自定义动画拉动刷新,可以轻松添加到 RecyclerView
受到这个运球项目的启发
最低 SDK 版本 16
在您的项目级别 build.gradle 中
allprojects {
repositories {
.. .
maven { url ' https://jitpack.io ' }
}
}
在您的应用程序级别 build.gradle 中
compile ' com.github.Yalantis:pull-to-make-soup:1.0.2 '
将该库包含为本地库项目。
其次,将 PullToRefreshView 添加到您的布局中,并使用 app:type="soup"
< com .yalantis.pulltomakesoup.PullToRefreshView
android : id = " @+id/pull_to_refresh "
app : type = " soup "
android : layout_width = " match_parent "
android : layout_height = " match_parent " >
< android .support.v7.widget.RecyclerView
android : id = " @+id/recycler_view "
android : layout_width = " match_parent "
android : layout_height = " match_parent "
android : divider = " @null "
android : dividerHeight = " 0dp "
android : fadingEdge = " none " />
</ com .yalantis.pulltomakesoup.PullToRefreshView>
接下来在 onCreate 方法中引用 View 并设置 OnRefreshListener。
mPullToRefreshView = ( PullToRefreshView ) findViewById ( R . id . pull_to_refresh );
mPullToRefreshView . setOnRefreshListener ( new PullToRefreshView . OnRefreshListener () {
@ Override
public void onRefresh () {}
});
当您需要完成令人耳目一新的通话时
mPullToRefreshView . setRefreshing ( false );
如果您需要更改进度状态:
mPullToRefreshView . setRefreshing ( boolean isRefreshing )
如果您向我们发送使用我们组件的项目的链接,我们将非常高兴。只需发送电子邮件至 [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.