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.