Skip to content

Commit 2fbd393

Browse files
authored
Merge pull request #1 from DipanshKhandelwal/patch-1
Update README.md
2 parents fb734e8 + b2c553e commit 2fbd393

File tree

1 file changed

+43
-36
lines changed

1 file changed

+43
-36
lines changed

README.md

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Koloda-Android
22

3-
<img src="swipe.jpg" width="300" height="500">
4-
<img src="swipe_down.jpg" width="300" height="500">
5-
<img src="swipe_top.jpg" width="300" height="500">
3+
<p align="center">
4+
<img src="swipe.jpg" height = "480" width="270">
5+
<img src="swipe_down.jpg" height = "480" width="270">
6+
<img src="swipe_top.jpg" height = "480" width="270">
7+
</p>
68

79
## Requirements
810
- Android SDK 15+
@@ -12,18 +14,18 @@
1214
Add to your root build.gradle:
1315
```Groovy
1416
allprojects {
15-
repositories {
16-
...
17-
maven { url 'https://jitpack.io' }
18-
}
17+
repositories {
18+
...
19+
maven { url 'https://jitpack.io' }
1920
}
21+
}
2022
```
2123

2224
Add the dependency:
2325
```Groovy
2426
dependencies {
25-
compile 'com.github.Yalantis:Koloda-Android:v0.0.1-alpha'
26-
}
27+
compile 'com.github.Yalantis:Koloda-Android:v0.0.1-alpha'
28+
}
2729
```
2830

2931
## How to use this library in your project?
@@ -32,11 +34,11 @@ First of all, add `Koloda` to the xml layout of your activity, so it looks like
3234

3335
```xml
3436
<?xml version="1.0" encoding="utf-8"?>
35-
<com.yalantis.library.Koloda
36-
android:id="@+id/koloda"
37-
android:layout_width="match_parent"
38-
android:layout_height="match_parent"
39-
app:koloda_card_layout="@layout/item_koloda" />
37+
<com.yalantis.library.Koloda
38+
android:id="@+id/koloda"
39+
android:layout_width="match_parent"
40+
android:layout_height="match_parent"
41+
app:koloda_card_layout="@layout/item_koloda" />
4042
```
4143

4244
Create your adapter and set it to Koloda adapter
@@ -51,33 +53,37 @@ For customization ui Koloda you can use such attributes value :
5153

5254
To control the card position by scale lower cards set koloda_card_scale_diff attributes float value in layout. The range of ScaleDiff is 0.01 - 0.1. The default value for ScaleDiff is 0.04f
5355
```xml
54-
<com.yalantis.library.Koloda
55-
...
56+
<com.yalantis.library.Koloda
57+
...
5658
app:koloda_card_scale_diff="0.04"
57-
.../>
59+
...
60+
/>
5861
```
5962

6063
To control distance between cards set value to koloda_card_offsetY in dp. The default value for CardOffsetY is 16dp.
6164
```xml
6265
<com.yalantis.library.Koloda
63-
...
66+
...
6467
app:koloda_card_offsetY="16dp"
65-
.../>
68+
...
69+
/>
6670
```
6771
Change angle for card when swipe it you can set value to koloda_card_rotate_angle. The default value for CardRotateAngle is 30
6872
```xml
69-
<com.yalantis.library.Koloda
70-
...
73+
<com.yalantis.library.Koloda
74+
...
7175
app:koloda_card_rotate_angle="30"
72-
.../>
76+
...
77+
/>
7378
```
7479

7580
Also you can change visible cards count in desk with koloda_max_visible_cards attributes. The default value for CardsVisible is 3
7681
```xml
77-
<com.yalantis.library.Koloda
78-
...
82+
<com.yalantis.library.Koloda
83+
...
7984
app:koloda_max_visible_cards="3"
80-
.../>
85+
...
86+
/>
8187
```
8288

8389
Kolod has reloadPreviousCard() method which reload previous card
@@ -97,17 +103,18 @@ koloda.onButtonClick(true) - swipe to right
97103
```
98104

99105
Also you can create `KolodaListener` and use all the methods of the `KolodaListener`. This interface provides empty implementations of the methods. For any custom animation callback handle you can create any custom listener that cares only about a subset of the methods of this listener can simply implement the interface directly:
100-
<br>onNewTopCard(position: Int)<br />
101-
onCardDrag(position: Int, cardView: View, progress: Float)<br />
102-
onCardSwipedLeft(position: Int)<br />
103-
onCardSwipedRight(position: Int)<br />
104-
onClickRight(position: Int)<br />
105-
onClickLeft(position: Int)<br />
106-
onCardSingleTap(position: Int)<br />
107-
onCardDoubleTap(position: Int)<br />
108-
onCardLongPress(position: Int)<br />
109-
onEmptyDeck()<br />
110-
106+
```
107+
onNewTopCard(position: Int)
108+
onCardDrag(position: Int, cardView: View, progress: Float)
109+
onCardSwipedLeft(position: Int)
110+
onCardSwipedRight(position: Int)
111+
onClickRight(position: Int)
112+
onClickLeft(position: Int)
113+
onCardSingleTap(position: Int)
114+
onCardDoubleTap(position: Int)
115+
onCardLongPress(position: Int)
116+
onEmptyDeck()
117+
```
111118

112119
## Let us know!
113120

0 commit comments

Comments
 (0)