Fixes the infinitely growing notification text and removes the "Example status here" text that was appearing erroneously.

main
Vavassor 8 years ago
parent 7ae66a4ddc
commit ba16a47fed
  1. 15
      app/src/main/java/com/keylesspalace/tusky/NotificationsAdapter.java

@ -17,7 +17,6 @@ package com.keylesspalace.tusky;
import android.content.Context; import android.content.Context;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.media.Image;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
@ -26,15 +25,12 @@ import android.text.Spanned;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.android.volley.toolbox.NetworkImageView;
import com.squareup.picasso.Picasso; import com.squareup.picasso.Picasso;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRemover { class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRemover {
@ -255,22 +251,25 @@ class NotificationsAdapter extends RecyclerView.Adapter implements AdapterItemRe
default: default:
case FAVOURITE: { case FAVOURITE: {
icon.setImageResource(R.drawable.ic_star_24dp); 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); format = context.getString(R.string.notification_favourite_format);
break; break;
} }
case REBLOG: { case REBLOG: {
icon.setImageResource(R.drawable.ic_repeat_24dp); 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); format = context.getString(R.string.notification_reblog_format);
break; break;
} }
} }
String wholeMessage = String.format(format, displayName); String wholeMessage = String.format(format, displayName);
final SpannableStringBuilder str = new SpannableStringBuilder(wholeMessage); 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); message.setText(str);
statusContent.append(status.getContent()); statusContent.setText(status.getContent());
} }
} }
} }

Loading…
Cancel
Save