From 7a3f4e18549c15718f037c143c30cc6226318a4a Mon Sep 17 00:00:00 2001 From: Ruben Gomez Date: Tue, 4 May 2021 11:33:14 +0200 Subject: [PATCH] Do not add less link if already added --- .idea/compiler.xml | 6 ++++++ .idea/gradle.xml | 3 +++ .idea/misc.xml | 2 +- README.md | 8 ++++---- .../com/skyhope/showmoretextview/ShowMoreTextView.java | 6 +++++- 5 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 .idea/compiler.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 6153c14..ff3531d 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -1,8 +1,10 @@ + diff --git a/.idea/misc.xml b/.idea/misc.xml index af0bbdd..3378229 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,7 +5,7 @@ - + diff --git a/README.md b/README.md index f2e4ab8..2f8cfcd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![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 @@ -6,8 +6,8 @@ This is simple library for creating textview expandable. Like **Continue or Less Sample

- - + +

@@ -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**. diff --git a/showmoretextview/src/main/java/com/skyhope/showmoretextview/ShowMoreTextView.java b/showmoretextview/src/main/java/com/skyhope/showmoretextview/ShowMoreTextView.java index 218e87a..22930f9 100644 --- a/showmoretextview/src/main/java/com/skyhope/showmoretextview/ShowMoreTextView.java +++ b/showmoretextview/src/main/java/com/skyhope/showmoretextview/ShowMoreTextView.java @@ -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() {