Skip to content

Commit 81147aa

Browse files
committed
Fixes issue 1224
1 parent 0a86131 commit 81147aa

File tree

5 files changed

+13
-100
lines changed

5 files changed

+13
-100
lines changed

app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ dependencies {
9494
implementation "com.google.dagger:dagger-android-support:$DAGGER_VERSION"
9595
kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
9696
kapt "com.google.dagger:dagger-android-processor:$DAGGER_VERSION"
97+
98+
compile 'com.borjabravo:readmoretextview:2.1.0'
9799
}
98100

99101
android {

app/src/main/java/fr/free/nrw/commons/notification/ExpandableTextView.java

Lines changed: 0 additions & 87 deletions
This file was deleted.

app/src/main/java/fr/free/nrw/commons/notification/NotificationRenderer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.widget.ImageView;
77
import android.widget.TextView;
88

9+
import com.borjabravo.readmoretextview.ReadMoreTextView;
910
import com.pedrogomez.renderers.Renderer;
1011

1112
import butterknife.BindView;
@@ -17,8 +18,8 @@
1718
*/
1819

1920
public class NotificationRenderer extends Renderer<Notification> {
20-
@BindView(R.id.title) ExpandableTextView title;
21-
@BindView(R.id.description) ExpandableTextView description;
21+
@BindView(R.id.title) ReadMoreTextView title;
22+
@BindView(R.id.description) ReadMoreTextView description;
2223
@BindView(R.id.time) TextView time;
2324
@BindView(R.id.icon) ImageView icon;
2425
private NotificationClicked listener;

app/src/main/res/layout/item_notification.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
32
xmlns:tools="http://schemas.android.com/tools"
43
android:layout_width="match_parent"
54
android:layout_height="wrap_content"
5+
xmlns:app="http://schemas.android.com/apk/res-auto"
66
android:foreground="?selectableItemBackground"
7-
android:minHeight="72dp"
8-
>
7+
android:minHeight="72dp">
98

109
<ImageView
1110
android:id="@+id/icon"
@@ -34,7 +33,7 @@
3433
tools:text="@string/placeholder_place_distance"
3534
/>
3635

37-
<fr.free.nrw.commons.notification.ExpandableTextView
36+
<com.borjabravo.readmoretextview.ReadMoreTextView
3837
android:id="@+id/title"
3938
android:layout_width="match_parent"
4039
android:layout_height="wrap_content"
@@ -46,12 +45,13 @@
4645
android:layout_toRightOf="@id/icon"
4746
android:layout_toStartOf="@id/time"
4847
android:ellipsize="end"
49-
48+
app:trimLines="2"
49+
app:colorClickableText="#969494"
5050
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
5151
tools:text="@string/placeholder_place_name"
5252
/>
5353

54-
<fr.free.nrw.commons.notification.ExpandableTextView
54+
<com.borjabravo.readmoretextview.ReadMoreTextView
5555
android:id="@+id/description"
5656
android:layout_width="match_parent"
5757
android:layout_height="wrap_content"
@@ -62,7 +62,8 @@
6262
android:layout_below="@id/title"
6363
android:layout_marginBottom="16dp"
6464
android:ellipsize="end"
65-
65+
app:trimLines="2"
66+
app:colorClickableText="#969494"
6667
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
6768
tools:text="@string/placeholder_place_description"
6869
/>

app/src/main/res/values/attrs.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,4 @@
1616
<attr name="drawableEnd" format="reference"/>
1717
<attr name="drawableBottom" format="reference"/>
1818
</declare-styleable>
19-
20-
<declare-styleable name="ExpandableTextView">
21-
<attr name="trimLength" format="integer"/>
22-
</declare-styleable>
2319
</resources>

0 commit comments

Comments
 (0)