https://github.com/dinuscxj/ShootRefreshView
It's an refresh animation that opens the shutter
https://github.com/dinuscxj/ShootRefreshView
Last synced: about 2 months ago
JSON representation
It's an refresh animation that opens the shutter
- Host: GitHub
- URL: https://github.com/dinuscxj/ShootRefreshView
- Owner: dinuscxj
- Created: 2017-04-04T15:46:17.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-23T05:31:52.000Z (over 6 years ago)
- Last Synced: 2024-08-03T01:22:49.041Z (11 months ago)
- Language: Java
- Size: 1.61 MB
- Stars: 359
- Watchers: 6
- Forks: 45
- Open Issues: 0
-
Metadata Files:
- Readme: README-ZH.md
Awesome Lists containing this project
- awesome-github-android-ui - ShootRefreshView - 快手Android客户端刷新动画 (下拉刷新)
README
## RecyclerRefreshLayout
[English](https://github.com/dinuscxj/ShootRefreshView) | 中文版
[ShootRefreshView](https://github.com/dinuscxj/ShootRefreshView) 是Android的一个刷新动画。
事实上,就是一个打开快门的动画. 主要就是旋转和缩放快门的6跳线. 涉及的数学知识主要就是
直线和圆之间的公式。
## Analysis
**注意:** 下面用快线表示快门的6条线。
**第一步:** 旋转'快线',但是不打开快线
下图的红色弧度就是快线最初的旋转弧度。
**第二步:** 旋转'快线',并打开快线
核心思想就是如何计算下图两条线的交点。

下图是计算推导公式。
**第三部:** 以快线的中心为基准点, 缩放快线
核心思想就是如何计算下图中线和圆的交点。

下图是推导公式。
**第四步:** 执行刷新动画,旋转渐变圆环
最后一步很容易实现, 只要设置对应的SweepGradient到Paint, 并且绘制圆就可以啦。## Misc
***QQ 群:*** **342748245**
## LicenseCopyright 2015-2019 dinus
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 athttp://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.