Skip to content

Commit 430597f

Browse files
Update README.md
1 parent 1d40358 commit 430597f

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

README.md

+28-23
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ allprojects {
2727
Add the dependency
2828
```groovy
2929
dependencies {
30-
implementation 'androidx.cardview:cardview:1.0.0'
31-
implementation 'com.github.alibardide5124:CardViewPlus:1.0.5'
30+
implementation 'androidx.cardview:cardview:1.0.0'
31+
implementation 'com.github.alibardide5124:CardViewPlus:1.0.6'
3232
}
3333
```
3434

@@ -48,30 +48,34 @@ You can use CardViewPlus just like a normal CardView
4848

4949
But it gives you some more attributes
5050

51-
| Properties | Type | Default |
52-
| ------------------------------- | ------------------------------------------------------------ | --------------- |
53-
| `app:normalElevation` | Dimension - Float (in code) | 2dp |
54-
| `app:pressedElevation` | Dimension - Float (in code) | 5dp |
55-
| `app:pressedColor` | Color | #e0e0e0 |
56-
| `app:animationEnabled` | Boolean | true |
57-
| `app:clickDelay` | Int (milli second) | 150 |
51+
| Properties | Type | Default |
52+
| ------------------------------- | ---------------------------------------------- | ----------------------- |
53+
| `normalCardElevation` | Dimension - Float (in code) | 2dp |
54+
| `pressedCardElevation` | Dimension - Float (in code) | 5dp |
55+
| `cardPressedColor` | Color | `cardBackgroundColor` |
56+
| `animationEnabled` | Boolean | true |
57+
| `clickDelay` | Int (milli second) | 150 |
5858

59-
`app:normalElevation` : set CardViewPlus elevation in noraml state. Default: 2dp.
59+
`normalCardElevation` : set CardViewPlus elevation in noraml state. Default: 2dp.
6060

61-
`app:maxElevation`: set CardViewPlus elevation in pressed state. Default: 5dp.
61+
`pressedCardElevation`: set CardViewPlus elevation in pressed state. Default: 5dp.
6262

6363
If you want to disable elevation animation, set the same value for normalElevation and maxElevation.
6464

65-
`app:pressedColor`: set color for onTouch color animation. Default: #e0e0e0.
65+
`cardPressedColor`: set color for onTouch color animation. Default: #e0e0e0.
6666

6767
If you want to disable color animation, set the same value for pressedColor and cardBackgroundColor.
6868

69-
`app:animationEnabled`: enable or Disable CardViewPlus shadow and color animations. Default: true.
69+
`animationEnabled`: enable or Disable CardViewPlus shadow and color animations. Default: true.
7070

71-
`app:clickDelay`: set a delay for click after release the CardViewPlus. Default: 150ms.
71+
`clickDelay`: set a delay for click after release the CardViewPlus. Default: 150ms.
7272

7373
Suggest setting click delay more than 150ms.
7474

75+
<br/>
76+
77+
Please use `normalCardElevation` and `pressedCardElevation` instead of `cardElevation` and `maxCardElevation`.
78+
7579
<br/>
7680

7781
XML
@@ -80,22 +84,23 @@ XML
8084
<com.alibardide5124.cardviewplus.CardViewPlus
8185
android:layout_width="wrap_content"
8286
android:layout_height="wrap_content"
83-
app:normalElevation="2dp"
84-
app:maxElevation="5dp"
85-
app:pressedColor="#ffe0e0e0"
87+
app:normalCardElevation="2dp"
88+
app:pressedCardElevation="5dp"
89+
app:cardPressedColor="#ffe0e0e0"
8690
app:animationEnabled="true"
8791
app:clickDelay="150">
8892

93+
8994
</com.alibardide5124.cardviewplus.CardViewPlus>
9095
```
9196

9297
Kotlin
9398
----
9499
```kotlin
95100
cardViewPlus.apply {
96-
normalElevation = 4
97-
pessedElevation = 10
98-
pressedColor = Color.parseColor("#e0e0e0")
101+
normalCardElevation = 4
102+
pessedCardElevation = 10
103+
cardPressedColor = Color.parseColor("#e0e0e0")
99104
isAnimationEnabled = true
100105
clickDelay = 150
101106
}
@@ -105,9 +110,9 @@ Java
105110
-----
106111
```java
107112
CardViewPlus cardViewPlus = findViewById(R.id.cardViewPlus);
108-
cardViewPlus.setNormalElevation(4);
109-
cardViewPlus.setPressedElevation(10);
110-
cardViewPlus.setPressedColor(Color.parseColor("#e0e0e0"));
113+
cardViewPlus.setNormalCardElevation(4);
114+
cardViewPlus.setPressedCardElevation(10);
115+
cardViewPlus.setCardPressedColor(Color.parseColor("#e0e0e0"));
111116
cardViewPlus.setAnimationEnabled(true);
112117
cardViewPlus.setClickDelay(150);
113118
```

readme.files/app-debug.apk

-26 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)