@@ -27,8 +27,8 @@ allprojects {
27
27
Add the dependency
28
28
``` groovy
29
29
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 '
32
32
}
33
33
```
34
34
@@ -48,30 +48,34 @@ You can use CardViewPlus just like a normal CardView
48
48
49
49
But it gives you some more attributes
50
50
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 |
58
58
59
- ` app:normalElevation ` : set CardViewPlus elevation in noraml state. Default: 2dp.
59
+ ` normalCardElevation ` : set CardViewPlus elevation in noraml state. Default: 2dp.
60
60
61
- ` app:maxElevation ` : set CardViewPlus elevation in pressed state. Default: 5dp.
61
+ ` pressedCardElevation ` : set CardViewPlus elevation in pressed state. Default: 5dp.
62
62
63
63
If you want to disable elevation animation, set the same value for normalElevation and maxElevation.
64
64
65
- ` app:pressedColor ` : set color for onTouch color animation. Default: #e0e0e0.
65
+ ` cardPressedColor ` : set color for onTouch color animation. Default: #e0e0e0.
66
66
67
67
If you want to disable color animation, set the same value for pressedColor and cardBackgroundColor.
68
68
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.
70
70
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.
72
72
73
73
Suggest setting click delay more than 150ms.
74
74
75
+ <br />
76
+
77
+ Please use `normalCardElevation` and `pressedCardElevation` instead of `cardElevation` and `maxCardElevation`.
78
+
75
79
<br />
76
80
77
81
XML
80
84
<com .alibardide5124.cardviewplus.CardViewPlus
81
85
android:layout_width=" wrap_content"
82
86
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"
86
90
app:animationEnabled=" true"
87
91
app:clickDelay=" 150" >
88
92
93
+
89
94
</com .alibardide5124.cardviewplus.CardViewPlus>
90
95
```
91
96
92
97
Kotlin
93
98
----
94
99
``` kotlin
95
100
cardViewPlus.apply {
96
- normalElevation = 4
97
- pessedElevation = 10
98
- pressedColor = Color .parseColor(" #e0e0e0" )
101
+ normalCardElevation = 4
102
+ pessedCardElevation = 10
103
+ cardPressedColor = Color .parseColor(" #e0e0e0" )
99
104
isAnimationEnabled = true
100
105
clickDelay = 150
101
106
}
105
110
-----
106
111
``` java
107
112
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" ));
111
116
cardViewPlus. setAnimationEnabled(true );
112
117
cardViewPlus. setClickDelay(150 );
113
118
```
0 commit comments