1
0
mirror of https://github.com/accelforce/Yuito synced 2024-12-22 13:24:46 +01:00

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

This commit is contained in:
Vavassor 2017-03-07 22:11:03 -05:00
parent 7ae66a4ddc
commit ba16a47fed

View File

@ -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());
}
}
}