Skip to content

Commit 6669194

Browse files
authored
Update README.md
1 parent d543f7e commit 6669194

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maven { url 'https://jitpack.io' }
99

1010
#### dependencies
1111
```kotlin
12-
implementation 'com.github.eriffanani:TextViewReadMore:1.5.2'
12+
implementation 'com.github.eriffanani:TextViewReadMore:2.0.0'
1313
```
1414

1515
## How To Use
@@ -18,7 +18,7 @@ implementation 'com.github.eriffanani:TextViewReadMore:1.5.2'
1818
<com.erif.readmoretextview.TextViewReadMore
1919
android:layout_width="wrap_content"
2020
android:layout_height="wrap_content"
21-
app:readMoreMaxLines="3"
21+
app:readMoreMaxLines="3" (Default 1)
2222
android:text="YOUR TEXT HERE"/>
2323
```
2424
![basic](https://user-images.githubusercontent.com/26743731/167334745-3915b937-a0b4-4524-a0b4-47b165143ec7.png)
@@ -27,46 +27,46 @@ implementation 'com.github.eriffanani:TextViewReadMore:1.5.2'
2727
* Expand
2828
```xml
2929
<com.erif.readmoretextview.TextViewReadMore
30-
android:layout_width="wrap_content"
31-
android:layout_height="wrap_content"
32-
app:readMoreMaxLines="3"
33-
app:expandText="Open Text"
34-
app:expandTextColor="@color/teal_200"
35-
app:expandTextStyle="bold|italic"
36-
app:expandTextUnderline="true"
30+
app:readMoreMaxLines="3" (Default 1)
31+
app:expandText="Open Text" (Default "Read More")
32+
app:expandTextColor="@color/teal_200" (Default Color.BLUE)
33+
app:expandTextStyle="bold|italic" (Default normal)
34+
app:expandTextUnderline="true" (Default false)
3735
android:text="YOUR TEXT HERE"/>
3836
```
37+
![styling](https://user-images.githubusercontent.com/26743731/167335646-86eb9860-b40e-4281-be49-644993cd49e1.png)
38+
3939
* Collapse
4040
```xml
4141
<com.erif.readmoretextview.TextViewReadMore
42-
app:collapseText="Close"
43-
app:collapseTextColor="@color/teal_200"
44-
app:collapseTextStyle="bold|italic"
45-
app:collapseTextUnderline="true"
46-
app:collapsed="false"/>
42+
app:collapseText="Close Text" (Default "Close")
43+
app:collapseTextColor="@color/teal_200" (Default Color.BLUE)
44+
app:collapseTextStyle="bold|italic" (Default normal)
45+
app:collapseTextUnderline="true" (Default false)
46+
app:collapsed="false" (Default true)/>
4747
```
48-
![styling](https://user-images.githubusercontent.com/26743731/167335646-86eb9860-b40e-4281-be49-644993cd49e1.png)
4948

5049
## Result
5150
<img src="https://user-images.githubusercontent.com/26743731/167337556-b46de2b5-9115-4d4e-ba48-7d48adbd018d.gif" width="400"/> <img src="https://user-images.githubusercontent.com/26743731/167338135-9d819401-aa26-4a20-ab83-9e9cc6b3886f.gif" width="400"/>
5251

5352
* Animation Duration
5453
```xml
5554
<com.erif.readmoretextview.TextViewReadMore
56-
android:animationDuration="1000"/>
55+
android:animationDuration="500" (Default 200)/>
5756
```
5857

5958
### Action
6059
```xml
6160
<com.erif.readmoretextview.TextViewReadMore
62-
app:actionClickColor="@color/colorRed"/>
61+
app:actionClickColor="@color/colorRed" (Default @color/text_view_read_more_button_hover_color)/>
6362
```
6463
```java
64+
TextViewReadMore txtReadMore = findViewById(R.id.txtReadMore);
6565
txtReadMore.onClickExpand(v -> txtReadMore.toggle());
6666
txtReadMore.onClickCollapse(v -> txtReadMore.toggle());
6767
```
6868

69-
### Callback
69+
### Listener
7070
* Java
7171
```Java
7272
txtReadMore.toggleListener(collapsed -> {
@@ -100,7 +100,7 @@ holder.text.onClickExpand(v -> {
100100
boolean status = !item.isCollapsed();
101101
holder.text.collapsed(status);
102102
item.setCollapsed(status);
103-
update(position);
103+
notifyItemChanged(position);
104104
});
105105
```
106106

0 commit comments

Comments
 (0)