improve custom emoji support (#687)

This commit is contained in:
Konrad Pozniak 2018-06-24 09:53:23 +02:00 committed by GitHub
commit e8d1b16b39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 102 additions and 121 deletions

View file

@ -46,7 +46,7 @@ public class CustomEmojiHelper {
* @param textView a reference to the textView the emojis will be shown in
* @return the text with the shortcodes replaced by EmojiSpans
*/
public static Spanned emojifyText(Spanned text, List<Emoji> emojis, final TextView textView) {
public static Spanned emojifyText(@NonNull Spanned text, @NonNull List<Emoji> emojis, @NonNull final TextView textView) {
if (!emojis.isEmpty()) {
@ -71,7 +71,7 @@ public class CustomEmojiHelper {
return text;
}
public static Spanned emojifyString(String string, List<Emoji> emojis, final TextView textView) {
public static Spanned emojifyString(@NonNull String string, @NonNull List<Emoji> emojis, @NonNull final TextView textView) {
return emojifyText(new SpannedString(string), emojis, textView);
}

View file

@ -56,7 +56,8 @@ public final class ViewDataUtils {
.setSenderId(visibleStatus.getAccount().getId())
.setRebloggingEnabled(visibleStatus.rebloggingAllowed())
.setApplication(visibleStatus.getApplication())
.setEmojis(visibleStatus.getEmojis())
.setStatusEmojis(visibleStatus.getEmojis())
.setAccountEmojis(visibleStatus.getAccount().getEmojis())
.createStatusViewData();
}