1
1
# ElasticViews
2
- ![ license] ( https://img.shields.io/badge/license-MIT%20License-blue.svg )
3
- [ ![ API] ( https://img.shields.io/badge/API-15%2B-brightgreen.svg?style=flat )] ( https://android-arsenal.com/api?level=15 )
4
- [ ![ Build Status] ( https://travis-ci.org/skydoves/ElasticViews.svg?branch=master )] ( https://travis-ci.org/skydoves/ElasticViews )
5
- [ ![ Android Weekly] ( https://img.shields.io/badge/Android%20Weekly-%23336-orange.svg )] ( https://androidweekly.net/issues/issue-336 )
6
- [ ![ Javadoc] ( https://img.shields.io/badge/Javadoc-ElasticViews-yellow )] ( https://skydoves.github.io/libraries/elasticviews/javadoc/elasticviews/com.skydoves.elasticviews/index.html )
7
- <br >
8
2
9
- An easy way to implement the elastic touch effect for Android.
3
+ <p align =" center " >
4
+ <a href =" https://opensource.org/licenses/MIT " ><img alt =" License " src =" https://img.shields.io/badge/license-MIT%20License-blue.svg " /></a >
5
+ <a href =" https://android-arsenal.com/api?level=15 " ><img alt =" API " src =" https://img.shields.io/badge/API-15%2B-brightgreen.svg?style=flat " /></a >
6
+ <a href =" https://travis-ci.org/skydoves/ElasticViews " ><img alt =" Build Status " src =" https://travis-ci.org/skydoves/ElasticViews.svg?branch=master " /></a >
7
+ <a href =" https://androidweekly.net/issues/issue-336 " ><img alt =" Android Weekly " src =" https://img.shields.io/badge/Android%20Weekly-%23336-orange.svg " /></a >
8
+ <a href =" https://skydoves.github.io/libraries/elasticviews/javadoc/elasticviews/com.skydoves.elasticviews/index.html " ><img alt =" Javadoc " src =" https://img.shields.io/badge/Javadoc-ElasticViews-yellow " /></a >
9
+ </p >
10
+
11
+ <p align =" center " >
12
+ ✨ An easy way to implement an elastic touch effect for Android.
13
+ </p >
14
+
15
+ <p align =" center " >
16
+ <img src =" https://user-images.githubusercontent.com/24237865/72123075-73943500-33a3-11ea-883f-9009de998788.gif " width =" 32% " />
17
+ <img src =" https://user-images.githubusercontent.com/24237865/72123076-73943500-33a3-11ea-92ef-0924cd0b902e.gif " width =" 32% " />
18
+ </p >
19
+
10
20
11
- ![ gif0] ( https://user-images.githubusercontent.com/24237865/48674497-53e2f180-eb90-11e8-86fb-476f841b3e32.gif )
12
- ![ gif1] ( https://user-images.githubusercontent.com/24237865/48674498-53e2f180-eb90-11e8-8313-aa94b34a40d2.gif )
13
21
14
22
## Including in your project
15
23
[ ![ Download] ( https://api.bintray.com/packages/devmagician/maven/elasticviews/images/download.svg )] ( https://bintray.com/devmagician/maven/elasticviews/_latestVersion )
@@ -23,7 +31,7 @@ repositories {
23
31
}
24
32
25
33
dependencies {
26
- implementation "com.github.skydoves:elasticviews:2.0.6 "
34
+ implementation "com.github.skydoves:elasticviews:2.0.7 "
27
35
}
28
36
```
29
37
@@ -38,7 +46,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"
38
46
```
39
47
40
48
#### OnClick Method
41
- All of ElasticViews should be set OnClickListener or OnClick Method, etc . If not, nothing happens.
49
+ All of ElasticViews should be set ` OnClickListener ` or OnClick method . If not, nothing happens.
42
50
``` java
43
51
ElasticButton elasticButton = (ElasticButton )findViewById(R . id. elasticbutton);
44
52
elasticButton. setOnClickListener(new View .OnClickListener () {
@@ -49,14 +57,6 @@ elasticButton.setOnClickListener(new View.OnClickListener() {
49
57
});
50
58
```
51
59
52
- or use butterknife
53
- ``` java
54
- @OnClick (R . id. elasticbutton)
55
- public void onClick(View v) {
56
- // do something
57
- }
58
- ```
59
-
60
60
### ElasticButton
61
61
``` gradle
62
62
<com.skydoves.elasticviews.ElasticButton
@@ -80,6 +80,7 @@ public void onClick(View v) {
80
80
android:textColor="@android:color/white"
81
81
android:textStyle="bold"
82
82
app:checkButton_cornerRadius="4dp"
83
+ app:checkButton_alpha="0.7"
83
84
app:checkButton_duration="400"
84
85
app:checkButton_scale="0.9" />
85
86
```
@@ -108,6 +109,22 @@ public void onClick(View v) {
108
109
app:fabutton_scale="0.85" />
109
110
```
110
111
112
+ ### ElasticCardView
113
+ ``` gradle
114
+ <com.skydoves.elasticviews.ElasticCardView
115
+ android:layout_width="match_parent"
116
+ android:layout_height="120dp"
117
+ app:cardCornerRadius="8dp"
118
+ app:cardElevation="12dp"
119
+ app:cardBackgroundColor="@color/background"
120
+ app:cardView_duration="250"
121
+ app:cardView_scale="0.8" >
122
+
123
+ ...
124
+
125
+ </com.skydoves.elasticviews.ElasticCardView>
126
+ ```
127
+
111
128
### ElasticLayout
112
129
ElasticLayout gives elastic animation to all child views.
113
130
@@ -146,6 +163,8 @@ new ElasticAnimation(clickedView).setScaleX(0.9f).setScaleY(0.9f).setDuration(40
146
163
.setOnFinishListener(onFinishListener). doAction();
147
164
```
148
165
166
+ <img src =" https://user-images.githubusercontent.com/24237865/72123077-742ccb80-33a3-11ea-9262-c4977983247e.gif " align =" right " width =" 30% " >
167
+
149
168
#### ViewPropertyAnimatorListener
150
169
we can set ` ViewPropertyAnimatorListener ` using ` setListener ` method and detect animation's status.
151
170
``` java
@@ -227,15 +246,13 @@ private class ListViewItemClickListener implements AdapterView.OnItemClickListen
227
246
};
228
247
```
229
248
230
- #### ElasticAnimation Preview
231
- ![ gif2] ( https://cloud.githubusercontent.com/assets/24237865/22189011/14bc94aa-e15d-11e6-9078-2dfc9d97ef87.gif )
232
-
233
249
## Find this library useful? :heart :
234
250
Support it by joining __ [ stargazers] ( https://github.com/skydoves/ElasticViews/stargazers ) __ for this repository. :star :
235
251
236
- ## Supports :coffee :
237
- If you feel like support me a coffee for my efforts, I would greatly appreciate it. <br ><br >
238
- <a href =" https://www.buymeacoffee.com/skydoves " target =" _blank " ><img src =" https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png " alt =" Buy Me A Coffee " style =" height : auto !important ;width : auto !important ;" ></a >
252
+ ## Sponsor :coffee :
253
+ If you feel like to sponsor me a coffee for my efforts, I would greatly appreciate it. <br ><br >
254
+
255
+ <a href =" https://www.buymeacoffee.com/skydoves " target =" _blank " ><img src =" https://skydoves.github.io/sponsor.png " alt =" Buy Me A Coffee " style =" height : 51px !important ;width : 217px !important ;" ></a >
239
256
240
257
# License
241
258
``` xml
0 commit comments