Skip to content

Commit

Permalink
Do not add less link if already added
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenKid committed May 4, 2021
1 parent 8057e62 commit 7a3f4e1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[![Release](https://jitpack.io/v/mahimrocky/ShowMoreText.svg)](https://github.com/mahimrocky/ShowMoreText/releases/tag/1.0.2)
[![Release](https://jitpack.io/v/EmployeeNetwork/ShowMoreText.svg)](https://github.com/EmployeeNetwork/ShowMoreText/releases/tag/1.0.2)

# ShowMoreText

This is simple library for creating textview expandable. Like **Continue or Less**. This library extended versiion **TextView**. Easy to use.

Sample
<p align="center">
<img src="https://github.com/mahimrocky/ShowMoreText/blob/master/screenshot1.png" width="200" height="400" />
<img src="https://github.com/mahimrocky/ShowMoreText/blob/master/screenshot2.png" width="200" height="400" />
<img src="https://github.com/EmployeeNetwork/ShowMoreText/blob/master/screenshot1.png" width="200" height="400" />
<img src="https://github.com/EmployeeNetwork/ShowMoreText/blob/master/screenshot2.png" width="200" height="400" />
</p>


Expand All @@ -25,7 +25,7 @@ Sample
```sh
dependencies {
implementation 'com.github.mahimrocky:ShowMoreText:1.0.2'
implementation 'com.github.EmployeeNetwork:ShowMoreText:1.0.2'
}
```
You have to use just this xml. You can modify or set color your own textView. **But don`t need to use maxLength or maxLine in text view. It may be confilict with library**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ public void onClick(@Nullable View view) {

private void showLessButton() {

String text = getText() + dotdot + showLess;
String text = getText().toString();
if (!getText().toString().endsWith(dotdot + showLess)) {
text = getText() + dotdot + showLess;
}

SpannableString spannableString = new SpannableString(text);

spannableString.setSpan(new ClickableSpan() {
Expand Down

0 comments on commit 7a3f4e1

Please sign in to comment.