-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ac5e18
commit c762115
Showing
4 changed files
with
79 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,71 @@ | ||
# WLikeView | ||
# WLikeAnim - 简单的点赞动画 | ||
|
||
|
||
<p > | ||
<a><img src="https://img.shields.io/github/release/wanglu1209/WLikeAnim.svg"/></a> | ||
<a><img src="https://img.shields.io/github/last-commit/wanglu1209/WLikeAnim.svg"/></a> | ||
<a><img src="https://img.shields.io/github/issues/wanglu1209/WLikeAnim.svg"/></a> | ||
<a><img src="https://img.shields.io/github/issues-closed/wanglu1209/WLikeAnim.svg"/></a> | ||
<a><img src="https://img.shields.io/github/issues-pr/wanglu1209/WLikeAnim.svg"/></a> | ||
<a><img src="https://img.shields.io/github/issues-pr-closed/wanglu1209/WLikeAnim.svg"/></a> | ||
<a><img src="https://img.shields.io/github/forks/wanglu1209/WLikeAnim.svg"/></a> | ||
<a><img src="https://img.shields.io/github/stars/wanglu1209/WLikeAnim.svg"/></a> | ||
</p> | ||
|
||
<div> | ||
<img src="https://raw.githubusercontent.com/wanglu1209/WPopup/master/img/anim_gif.gif" width="200" height="350" /> | ||
| ||
<img src="https://raw.githubusercontent.com/wanglu1209/WLikeAnim/master/img/gif.gif" width="200" height="350" /> | ||
</div> | ||
## 依赖 | ||
|
||
```gradle | ||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
dependencies { | ||
implementation 'com.github.wanglu1209:WLikeAnim:lastRelease' | ||
} | ||
``` | ||
|
||
## 使用 | ||
|
||
### 普通的动画效果 | ||
效果看第一个图 或者[WPopup](https://github.com/wanglu1209/WPopup)(只是简单的缩放) | ||
|
||
```Kotlin | ||
WCommonAnim(iv).show() | ||
``` | ||
|
||
### 类似于掘金的动画效果 | ||
|
||
```Kotlin | ||
// 第一个参数为点赞的ImageView,第二个参数为想要替换的res | ||
WJueJinLikeAnim.Builder(ImageView, R.mipmap.xxx).create().show() | ||
``` | ||
|
||
## 解释 | ||
|
||
**该动画库只有动画,完全不参与逻辑** | ||
|
||
类似于下面,所有的逻辑都要自己写: | ||
|
||
```Kotlin | ||
var isLiked = false | ||
val likeAnim = WJueJinLikeAnim.Builder(iv, R.mipmap.fd_zan_press).create() | ||
iv.setOnClickListener { | ||
if(isLiked){ | ||
iv.setImageResource(R.mipmap.fd_zan) | ||
isLiked = false | ||
}else{ | ||
iv.setImageResource(R.mipmap.fd_zan_press) | ||
isLiked = true | ||
likeAnim.show() | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters