fix wrong time/username reference when replying

This commit is contained in:
sk 2023-08-27 14:46:33 +02:00
parent 2fafdcc4f8
commit c3d9147705
2 changed files with 6 additions and 5 deletions

View File

@ -673,10 +673,11 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
? UiUtils.formatRelativeTimestamp(getContext(), status.createdAt) ? UiUtils.formatRelativeTimestamp(getContext(), status.createdAt)
: getString(R.string.edited_timestamp, UiUtils.formatRelativeTimestamp(getContext(), status.editedAt)); : getString(R.string.edited_timestamp, UiUtils.formatRelativeTimestamp(getContext(), status.editedAt));
String sepp = getString(R.string.sk_separator); ((TextView) view.findViewById(R.id.username)).setText(status.account.getDisplayUsername());
String username = status.account.getDisplayUsername(); view.findViewById(R.id.separator).setVisibility(time==null ? View.GONE : View.VISIBLE);
((TextView) view.findViewById(R.id.time_and_username)).setText(time == null ? username : view.findViewById(R.id.time).setVisibility(time==null ? View.GONE : View.VISIBLE);
username + " " + sepp + " " + time); if(time!=null) ((TextView) view.findViewById(R.id.time)).setText(time);
if (status.spoilerText != null && !status.spoilerText.isBlank()) { if (status.spoilerText != null && !status.spoilerText.isBlank()) {
TextView replyToSpoiler = view.findViewById(R.id.reply_to_spoiler); TextView replyToSpoiler = view.findViewById(R.id.reply_to_spoiler);
replyToSpoiler.setVisibility(View.VISIBLE); replyToSpoiler.setVisibility(View.VISIBLE);

View File

@ -317,7 +317,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
else if (item.status != null && item.status.editedAt != null) else if (item.status != null && item.status.editedAt != null)
time=item.parentFragment.getString(R.string.edited_timestamp, UiUtils.formatRelativeTimestamp(itemView.getContext(), item.status.editedAt)); time=item.parentFragment.getString(R.string.edited_timestamp, UiUtils.formatRelativeTimestamp(itemView.getContext(), item.status.editedAt));
this.username.setText("@" + item.user.acct); this.username.setText(item.user.getDisplayUsername());
this.timeUsernameSeparator.setVisibility(time==null ? View.GONE : View.VISIBLE); this.timeUsernameSeparator.setVisibility(time==null ? View.GONE : View.VISIBLE);
this.time.setVisibility(time==null ? View.GONE : View.VISIBLE); this.time.setVisibility(time==null ? View.GONE : View.VISIBLE);
if(time!=null) this.time.setText(time); if(time!=null) this.time.setText(time);