-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
70 lines (56 loc) · 1.5 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
FlippableView
=============
Custom Android view that provides some simple methods to make easier a flip.
This view contains primarly:
* frontFace - Layout front face
* backFace - Layout back face
* avoidClickOnFlip - boolean to prevent click events with view is flipping
* duration - integer flip duration
You can use your own animations using (this overwrites default animations):
* inAnimation
* outAnimation
```xml
<com.jaimedediego.flippableview.FlippableView
android:id="@+id/flippable_view"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
app:backFace="@layout/<<your back face layout>>"
app:frontFace="@layout/<<your front face layout>>"
app:flipDuration="<<integer>>"/>
```
```java
class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
...
final FlippableView flippableView = findViewById(R.id.flippable_view);
flippableView.avoidClickOnFlip(true);
flippableView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
flippableView.flip();
}
});
...
}
}
```
Download
--------
In Module gradle
```groovy
dependencies {
...
implementation 'com.github.jdediegomrt:flippableview:0.7'
}
```
In Project gradle
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```