From ba16a47fed9ae2b4f0ae1c2362a0d6113db8e8a3 Mon Sep 17 00:00:00 2001 From: Vavassor Date: Tue, 7 Mar 2017 22:11:03 -0500 Subject: [PATCH] Fixes the infinitely growing notification text and removes the "Example status here" text that was appearing erroneously. --- .../keylesspalace/tusky/NotificationsAdapter.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/NotificationsAdapter.java b/app/src/main/java/com/keylesspalace/tusky/NotificationsAdapter.java index aa33b4c1..8425805d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/NotificationsAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/NotificationsAdapter.java @@ -17,7 +17,6 @@ package com.keylesspalace.tusky; import android.content.Context; import android.graphics.Typeface; -import android.media.Image; import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; @@ -26,15 +25,12 @@ import android.text.Spanned; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; -import com.android.volley.toolbox.NetworkImageView; import com.squareup.picasso.Picasso; import java.util.ArrayList; -import java.util.Date; import java.util.List; class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRemover { @@ -255,22 +251,25 @@ class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRe default: case FAVOURITE: { icon.setImageResource(R.drawable.ic_star_24dp); - icon.setColorFilter(ContextCompat.getColor(context, R.color.status_favourite_button_marked_dark)); + icon.setColorFilter(ContextCompat.getColor(context, + R.color.status_favourite_button_marked_dark)); format = context.getString(R.string.notification_favourite_format); break; } case REBLOG: { icon.setImageResource(R.drawable.ic_repeat_24dp); - icon.setColorFilter(ContextCompat.getColor(context, R.color.color_accent_dark)); + icon.setColorFilter(ContextCompat.getColor(context, + R.color.color_accent_dark)); format = context.getString(R.string.notification_reblog_format); break; } } String wholeMessage = String.format(format, displayName); final SpannableStringBuilder str = new SpannableStringBuilder(wholeMessage); - str.setSpan(new android.text.style.StyleSpan(Typeface.BOLD), 0, displayName.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + str.setSpan(new android.text.style.StyleSpan(Typeface.BOLD), 0, displayName.length(), + Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); message.setText(str); - statusContent.append(status.getContent()); + statusContent.setText(status.getContent()); } } }