Fix display name
This commit is contained in:
parent
5e6f992782
commit
7171360785
|
@ -1,8 +1,9 @@
|
||||||
Changed:
|
Changed:
|
||||||
- One logout entry in the menu (it will remove the account from the app)
|
|
||||||
- Improve memory management
|
- Improve memory management
|
||||||
- Improve scroll
|
- Improve scroll
|
||||||
|
- One logout entry in the menu (it will remove the account from the app)
|
||||||
- Clear push notifications when visiting notifications tab
|
- Clear push notifications when visiting notifications tab
|
||||||
|
|
||||||
Fixed:
|
Fixed:
|
||||||
- Long press to store media download the preview image
|
- Long press to store media download the preview image
|
||||||
|
- Fix pagination with Nitter timelines
|
|
@ -2067,7 +2067,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
@Override
|
@Override
|
||||||
public void onRetrieveEmojiAccount(Account account) {
|
public void onRetrieveEmojiAccount(Account account) {
|
||||||
TextView displayedName = headerLayout.findViewById(R.id.displayedName);
|
TextView displayedName = headerLayout.findViewById(R.id.displayedName);
|
||||||
displayedName.setText(account.getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
displayedName.setText(account.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -951,7 +951,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
@Override
|
@Override
|
||||||
public void onRetrieveEmojiAccount(Account account) {
|
public void onRetrieveEmojiAccount(Account account) {
|
||||||
account_note.setText(account.getNoteSpan(), TextView.BufferType.SPANNABLE);
|
account_note.setText(account.getNoteSpan(), TextView.BufferType.SPANNABLE);
|
||||||
account_dn.setText(account.getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
account_dn.setText(account.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
LinkedHashMap<String, Boolean> fieldsVerified = account.getFieldsVerified();
|
LinkedHashMap<String, Boolean> fieldsVerified = account.getFieldsVerified();
|
||||||
if (account.getFieldsSpan() != null && account.getFieldsSpan().size() > 0) {
|
if (account.getFieldsSpan() != null && account.getFieldsSpan().size() > 0) {
|
||||||
HashMap<SpannableString, SpannableString> fieldsSpan = account.getFieldsSpan();
|
HashMap<SpannableString, SpannableString> fieldsSpan = account.getFieldsSpan();
|
||||||
|
|
|
@ -18,7 +18,6 @@ import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -68,7 +67,6 @@ import app.fedilab.android.interfaces.OnRetrieveEmojiAccountInterface;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
|
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
|
||||||
import static app.fedilab.android.helper.Helper.drawableToBitmap;
|
|
||||||
import static app.fedilab.android.helper.Helper.hashtagPattern;
|
import static app.fedilab.android.helper.Helper.hashtagPattern;
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,8 +203,8 @@ public class Account implements Parcelable {
|
||||||
if (((Activity) context).isFinishing())
|
if (((Activity) context).isFinishing())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
account.setdisplayNameSpan(new SpannableString(account.getDisplay_name()));
|
account.setDisplayNameSpan(new SpannableString(account.getDisplay_name()));
|
||||||
SpannableString displayNameSpan = account.getdisplayNameSpan();
|
SpannableString displayNameSpan = account.getDisplayNameSpan();
|
||||||
if (displayNameSpan == null)
|
if (displayNameSpan == null)
|
||||||
return;
|
return;
|
||||||
final List<Emojis> emojis = account.getEmojis();
|
final List<Emojis> emojis = account.getEmojis();
|
||||||
|
@ -218,7 +216,7 @@ public class Account implements Parcelable {
|
||||||
try {
|
try {
|
||||||
Glide.with(context)
|
Glide.with(context)
|
||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(emoji.getUrl())
|
.load(disableAnimatedEmoji ? emoji.getStatic_url() : emoji.getUrl())
|
||||||
.into(new SimpleTarget<Drawable>() {
|
.into(new SimpleTarget<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||||
|
@ -228,17 +226,9 @@ public class Account implements Parcelable {
|
||||||
for (int startPosition = -1; (startPosition = displayNameSpan.toString().indexOf(targetedEmoji, startPosition + 1)) != -1; startPosition++) {
|
for (int startPosition = -1; (startPosition = displayNameSpan.toString().indexOf(targetedEmoji, startPosition + 1)) != -1; startPosition++) {
|
||||||
final int endPosition = startPosition + targetedEmoji.length();
|
final int endPosition = startPosition + targetedEmoji.length();
|
||||||
if (endPosition <= displayNameSpan.toString().length() && endPosition >= startPosition) {
|
if (endPosition <= displayNameSpan.toString().length() && endPosition >= startPosition) {
|
||||||
ImageSpan imageSpan;
|
resource.setBounds(0, 0, (int) Helper.convertDpToPixel(20, context), (int) Helper.convertDpToPixel(20, context));
|
||||||
if (!disableAnimatedEmoji) {
|
resource.setVisible(true, true);
|
||||||
resource.setBounds(0, 0, (int) Helper.convertDpToPixel(20, context), (int) Helper.convertDpToPixel(20, context));
|
ImageSpan imageSpan = new ImageSpan(resource);
|
||||||
resource.setVisible(true, true);
|
|
||||||
imageSpan = new ImageSpan(resource);
|
|
||||||
} else {
|
|
||||||
Bitmap bitmap = drawableToBitmap(resource.getCurrent());
|
|
||||||
imageSpan = new ImageSpan(context,
|
|
||||||
Bitmap.createScaledBitmap(bitmap, (int) Helper.convertDpToPixel(20, context),
|
|
||||||
(int) Helper.convertDpToPixel(20, context), false));
|
|
||||||
}
|
|
||||||
displayNameSpan.setSpan(
|
displayNameSpan.setSpan(
|
||||||
imageSpan, startPosition,
|
imageSpan, startPosition,
|
||||||
endPosition, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
endPosition, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
|
@ -531,11 +521,11 @@ public class Account implements Parcelable {
|
||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpannableString getdisplayNameSpan() {
|
public SpannableString getDisplayNameSpan() {
|
||||||
return displayNameSpan;
|
return displayNameSpan;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setdisplayNameSpan(SpannableString displayNameSpan) {
|
public void setDisplayNameSpan(SpannableString displayNameSpan) {
|
||||||
this.displayNameSpan = displayNameSpan;
|
this.displayNameSpan = displayNameSpan;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class Status implements Parcelable {
|
||||||
private boolean isVisible = true;
|
private boolean isVisible = true;
|
||||||
private boolean fetchMore = false;
|
private boolean fetchMore = false;
|
||||||
private String content, contentCW, contentTranslated;
|
private String content, contentCW, contentTranslated;
|
||||||
private SpannableString contentSpan, displayNameSpan, contentSpanCW, contentSpanTranslated;
|
private SpannableString contentSpan, contentSpanCW, contentSpanTranslated;
|
||||||
private RetrieveFeedsAsyncTask.Type type;
|
private RetrieveFeedsAsyncTask.Type type;
|
||||||
private int itemViewType;
|
private int itemViewType;
|
||||||
private String conversationId;
|
private String conversationId;
|
||||||
|
@ -230,7 +230,6 @@ public class Status implements Parcelable {
|
||||||
this.contentCW = in.readString();
|
this.contentCW = in.readString();
|
||||||
this.contentTranslated = in.readString();
|
this.contentTranslated = in.readString();
|
||||||
this.contentSpan = (SpannableString) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
this.contentSpan = (SpannableString) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
||||||
this.displayNameSpan = (SpannableString) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
|
||||||
this.contentSpanCW = (SpannableString) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
this.contentSpanCW = (SpannableString) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
||||||
this.contentSpanTranslated = (SpannableString) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
this.contentSpanTranslated = (SpannableString) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
||||||
int tmpType = in.readInt();
|
int tmpType = in.readInt();
|
||||||
|
@ -366,9 +365,6 @@ public class Status implements Parcelable {
|
||||||
status.setContentSpan(treatment(context, spannableStringContent, status));
|
status.setContentSpan(treatment(context, spannableStringContent, status));
|
||||||
if (spannableStringCW.length() > 0)
|
if (spannableStringCW.length() > 0)
|
||||||
status.setContentSpanCW(spannableStringCW);
|
status.setContentSpanCW(spannableStringCW);
|
||||||
SpannableString displayNameSpan = new SpannableString(status.reblog != null ? status.getReblog().getAccount().getDisplay_name() : status.getAccount().getDisplay_name());
|
|
||||||
if (displayNameSpan.length() > 0)
|
|
||||||
status.setDisplayNameSpan(displayNameSpan);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -822,12 +818,7 @@ public class Status implements Parcelable {
|
||||||
spannableStringTranslated = new SpannableString(Html.fromHtml(status.getContentTranslated()));
|
spannableStringTranslated = new SpannableString(Html.fromHtml(status.getContentTranslated()));
|
||||||
|
|
||||||
status.setContentSpanTranslated(treatment(context, spannableStringTranslated, status));
|
status.setContentSpanTranslated(treatment(context, spannableStringTranslated, status));
|
||||||
String displayName;
|
|
||||||
if (status.getReblog() != null) {
|
|
||||||
displayName = status.getReblog().getAccount().getDisplay_name();
|
|
||||||
} else {
|
|
||||||
displayName = status.getAccount().getDisplay_name();
|
|
||||||
}
|
|
||||||
SpannableString contentSpanTranslated = status.getContentSpanTranslated();
|
SpannableString contentSpanTranslated = status.getContentSpanTranslated();
|
||||||
Matcher matcherALink = Patterns.WEB_URL.matcher(contentSpanTranslated.toString());
|
Matcher matcherALink = Patterns.WEB_URL.matcher(contentSpanTranslated.toString());
|
||||||
while (matcherALink.find()) {
|
while (matcherALink.find()) {
|
||||||
|
@ -856,8 +847,6 @@ public class Status implements Parcelable {
|
||||||
|
|
||||||
}
|
}
|
||||||
status.setContentSpanTranslated(contentSpanTranslated);
|
status.setContentSpanTranslated(contentSpanTranslated);
|
||||||
SpannableString displayNameSpan = new SpannableString(displayName);
|
|
||||||
status.setDisplayNameSpan(displayNameSpan);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void makeEmojis(final Context context, Status status) {
|
private static void makeEmojis(final Context context, Status status) {
|
||||||
|
@ -871,7 +860,6 @@ public class Status implements Parcelable {
|
||||||
final List<Emojis> emojis = status.getReblog() != null ? status.getReblog().getEmojis() : status.getEmojis();
|
final List<Emojis> emojis = status.getReblog() != null ? status.getReblog().getEmojis() : status.getEmojis();
|
||||||
|
|
||||||
|
|
||||||
SpannableString displayNameSpan = status.getDisplayNameSpan();
|
|
||||||
SpannableString contentSpan = status.getContentSpan();
|
SpannableString contentSpan = status.getContentSpan();
|
||||||
SpannableString contentSpanCW = status.getContentSpanCW();
|
SpannableString contentSpanCW = status.getContentSpanCW();
|
||||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||||
|
@ -1176,7 +1164,6 @@ public class Status implements Parcelable {
|
||||||
dest.writeString(this.contentCW);
|
dest.writeString(this.contentCW);
|
||||||
dest.writeString(this.contentTranslated);
|
dest.writeString(this.contentTranslated);
|
||||||
TextUtils.writeToParcel(this.contentSpan, dest, flags);
|
TextUtils.writeToParcel(this.contentSpan, dest, flags);
|
||||||
TextUtils.writeToParcel(this.displayNameSpan, dest, flags);
|
|
||||||
TextUtils.writeToParcel(this.contentSpanCW, dest, flags);
|
TextUtils.writeToParcel(this.contentSpanCW, dest, flags);
|
||||||
TextUtils.writeToParcel(this.contentSpanTranslated, dest, flags);
|
TextUtils.writeToParcel(this.contentSpanTranslated, dest, flags);
|
||||||
dest.writeInt(this.type == null ? -1 : this.type.ordinal());
|
dest.writeInt(this.type == null ? -1 : this.type.ordinal());
|
||||||
|
@ -1306,13 +1293,6 @@ public class Status implements Parcelable {
|
||||||
this.favourites_count = favourites_count;
|
this.favourites_count = favourites_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpannableString getDisplayNameSpan() {
|
|
||||||
return this.displayNameSpan;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDisplayNameSpan(SpannableString displayNameSpan) {
|
|
||||||
this.displayNameSpan = displayNameSpan;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isReblogged() {
|
public boolean isReblogged() {
|
||||||
return reblogged;
|
return reblogged;
|
||||||
|
|
|
@ -68,23 +68,23 @@ public class AccountsAdminListAdapter extends RecyclerView.Adapter implements On
|
||||||
Account account = accountAdmin.getAccount();
|
Account account = accountAdmin.getAccount();
|
||||||
|
|
||||||
|
|
||||||
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (account.getDisplayNameSpan() == null || account.getDisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn.setText(account.getDisplay_name());
|
holder.account_dn.setText(account.getDisplay_name());
|
||||||
else if (account.getDisplay_name() != null) {
|
else if (account.getDisplay_name() != null) {
|
||||||
holder.account_dn.setText(account.getDisplay_name().replace("@", ""));
|
holder.account_dn.setText(account.getDisplay_name().replace("@", ""));
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
holder.account_dn.setText(account.getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.account_dn.setText(account.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
|
|
||||||
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (account.getDisplayNameSpan() == null || account.getDisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn.setText(account.getDisplay_name());
|
holder.account_dn.setText(account.getDisplay_name());
|
||||||
else if (account.getDisplay_name() != null) {
|
else if (account.getDisplay_name() != null) {
|
||||||
holder.account_dn.setText(account.getDisplay_name().replace("@", ""));
|
holder.account_dn.setText(account.getDisplay_name().replace("@", ""));
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
holder.account_dn.setText(account.getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.account_dn.setText(account.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
holder.account_un.setText(String.format("@%s", account.getUsername()));
|
holder.account_un.setText(String.format("@%s", account.getUsername()));
|
||||||
holder.account_ac.setText(account.getAcct());
|
holder.account_ac.setText(account.getAcct());
|
||||||
if (account.getDisplay_name().equals(account.getAcct()))
|
if (account.getDisplay_name().equals(account.getAcct()))
|
||||||
|
|
|
@ -167,13 +167,13 @@ public class AccountsListAdapter extends RecyclerView.Adapter implements OnPostA
|
||||||
holder.account_follow.hide();
|
holder.account_follow.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (account.getDisplayNameSpan() == null || account.getDisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn.setText(account.getDisplay_name());
|
holder.account_dn.setText(account.getDisplay_name());
|
||||||
else
|
else
|
||||||
holder.account_dn.setText(account.getUsername().replace("@", ""));
|
holder.account_dn.setText(account.getUsername().replace("@", ""));
|
||||||
} else
|
} else
|
||||||
holder.account_dn.setText(account.getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.account_dn.setText(account.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
holder.account_un.setText(String.format("@%s", account.getUsername()));
|
holder.account_un.setText(String.format("@%s", account.getUsername()));
|
||||||
holder.account_ac.setText(account.getAcct());
|
holder.account_ac.setText(account.getAcct());
|
||||||
if (account.getUsername().equals(account.getAcct()))
|
if (account.getUsername().equals(account.getAcct()))
|
||||||
|
|
|
@ -185,8 +185,8 @@ public class ArtListAdapter extends RecyclerView.Adapter implements OnPostAction
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (status.getDisplayNameSpan() != null && status.getDisplayNameSpan().toString().trim().length() > 0)
|
if (status.getAccount().getDisplayNameSpan() != null && status.getAccount().getDisplayNameSpan().toString().trim().length() > 0)
|
||||||
holder.art_username.setText(status.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.art_username.setText(status.getAccount().getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
else
|
else
|
||||||
holder.art_username.setText(status.getAccount().getUsername());
|
holder.art_username.setText(status.getAccount().getUsername());
|
||||||
|
|
||||||
|
|
|
@ -327,11 +327,11 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (notification.getAccount().getdisplayNameSpan() == null) {
|
if (notification.getAccount().getDisplayNameSpan() == null) {
|
||||||
holder.notification_type.setText(typeString);
|
holder.notification_type.setText(typeString);
|
||||||
notification.getAccount().setStored_displayname(notification.getAccount().getDisplay_name());
|
notification.getAccount().setStored_displayname(notification.getAccount().getDisplay_name());
|
||||||
} else
|
} else
|
||||||
holder.notification_type.setText(notification.getAccount().getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.notification_type.setText(notification.getAccount().getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
|
|
||||||
if (imgH != null) {
|
if (imgH != null) {
|
||||||
DrawableCompat.setTint(imgH, ContextCompat.getColor(context, R.color.cyanea_accent));
|
DrawableCompat.setTint(imgH, ContextCompat.getColor(context, R.color.cyanea_accent));
|
||||||
|
|
|
@ -944,8 +944,8 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (status.getDisplayNameSpan() != null && status.getDisplayNameSpan().toString().trim().length() > 0)
|
if (status.getAccount().getDisplayNameSpan() != null && status.getAccount().getDisplayNameSpan().toString().trim().length() > 0)
|
||||||
holder.pf_username.setText(status.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.pf_username.setText(status.getAccount().getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
else
|
else
|
||||||
holder.pf_username.setText(status.getAccount().getUsername());
|
holder.pf_username.setText(status.getAccount().getUsername());
|
||||||
|
|
||||||
|
|
|
@ -67,15 +67,15 @@ public class ReportsListAdapter extends RecyclerView.Adapter implements OnRetrie
|
||||||
Report report = reports.get(position);
|
Report report = reports.get(position);
|
||||||
Account account = report.getAccount().getAccount();
|
Account account = report.getAccount().getAccount();
|
||||||
Account target_account = report.getTarget_account().getAccount();
|
Account target_account = report.getTarget_account().getAccount();
|
||||||
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (account.getDisplayNameSpan() == null || account.getDisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn_reporter.setText(account.getDisplay_name());
|
holder.account_dn_reporter.setText(account.getDisplay_name());
|
||||||
else
|
else
|
||||||
holder.account_dn_reporter.setText(account.getUsername().replace("@", ""));
|
holder.account_dn_reporter.setText(account.getUsername().replace("@", ""));
|
||||||
} else
|
} else
|
||||||
holder.account_dn_reporter.setText(account.getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.account_dn_reporter.setText(account.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
|
|
||||||
if (target_account.getdisplayNameSpan() == null || target_account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (target_account.getDisplayNameSpan() == null || target_account.getDisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (target_account.getDisplay_name() != null && !target_account.getDisplay_name().trim().equals(""))
|
if (target_account.getDisplay_name() != null && !target_account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn.setText(target_account.getDisplay_name());
|
holder.account_dn.setText(target_account.getDisplay_name());
|
||||||
else {
|
else {
|
||||||
|
@ -84,8 +84,8 @@ public class ReportsListAdapter extends RecyclerView.Adapter implements OnRetrie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (target_account.getdisplayNameSpan() != null) {
|
if (target_account.getDisplayNameSpan() != null) {
|
||||||
holder.account_dn.setText(target_account.getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.account_dn.setText(target_account.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1593,6 +1593,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
|
|
||||||
//Displays name & emoji in toot header
|
//Displays name & emoji in toot header
|
||||||
final Account accountForUrl;
|
final Account accountForUrl;
|
||||||
|
SpannableString displayNameSpan = status.getReblog() != null ? status.getReblog().getAccount().getDisplayNameSpan():status.getAccount().getDisplayNameSpan();
|
||||||
if (status.getReblog() != null) {
|
if (status.getReblog() != null) {
|
||||||
accountForUrl = status.getReblog().getAccount();
|
accountForUrl = status.getReblog().getAccount();
|
||||||
holder.status_account_displayname.setVisibility(View.VISIBLE);
|
holder.status_account_displayname.setVisibility(View.VISIBLE);
|
||||||
|
@ -1604,8 +1605,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
intent.putExtras(b);
|
intent.putExtras(b);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (status.getReblog().getAccount().getDisplay_name().length() > 0)
|
if (status.getReblog().getAccount().getDisplay_name().length() > 0)
|
||||||
holder.status_account_displayname_owner.setText(status.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.status_account_displayname_owner.setText(displayNameSpan, TextView.BufferType.SPANNABLE);
|
||||||
else
|
else
|
||||||
holder.status_account_displayname_owner.setText(status.getReblog().getAccount().getAcct().replace("@", ""));
|
holder.status_account_displayname_owner.setText(status.getReblog().getAccount().getAcct().replace("@", ""));
|
||||||
holder.status_account_displayname_owner.setVisibility(View.VISIBLE);
|
holder.status_account_displayname_owner.setVisibility(View.VISIBLE);
|
||||||
|
@ -1615,10 +1617,10 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
} else {
|
} else {
|
||||||
accountForUrl = status.getAccount();
|
accountForUrl = status.getAccount();
|
||||||
holder.status_account_displayname.setVisibility(View.GONE);
|
holder.status_account_displayname.setVisibility(View.GONE);
|
||||||
if (status.getDisplayNameSpan() == null || status.getDisplayNameSpan().toString().trim().length() == 0)
|
if (displayNameSpan == null || displayNameSpan.toString().trim().length() == 0)
|
||||||
holder.status_account_displayname_owner.setText(status.getAccount().getUsername().replace("@", ""), TextView.BufferType.SPANNABLE);
|
holder.status_account_displayname_owner.setText(status.getAccount().getUsername().replace("@", ""), TextView.BufferType.SPANNABLE);
|
||||||
else
|
else
|
||||||
holder.status_account_displayname_owner.setText(status.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
holder.status_account_displayname_owner.setText(displayNameSpan, TextView.BufferType.SPANNABLE);
|
||||||
}
|
}
|
||||||
//-------- END -> Displays name & emoji in toot header
|
//-------- END -> Displays name & emoji in toot header
|
||||||
|
|
||||||
|
|
|
@ -1884,7 +1884,7 @@ public class Helper {
|
||||||
} else {
|
} else {
|
||||||
Account.makeAccountNameEmoji(activity, account);
|
Account.makeAccountNameEmoji(activity, account);
|
||||||
username.setText(String.format("@%s", account.getUsername() + "@" + account.getInstance()));
|
username.setText(String.format("@%s", account.getUsername() + "@" + account.getInstance()));
|
||||||
displayedName.setText(account.getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
displayedName.setText(account.getDisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||||
loadGiF(activity, account, profilePicture);
|
loadGiF(activity, account, profilePicture);
|
||||||
String urlHeader = !disableGif ? account.getHeader() : account.getHeader_static();
|
String urlHeader = !disableGif ? account.getHeader() : account.getHeader_static();
|
||||||
if (urlHeader.startsWith("/")) {
|
if (urlHeader.startsWith("/")) {
|
||||||
|
|
Loading…
Reference in New Issue