This commit is contained in:
Grishka 2022-02-08 13:25:17 +03:00
parent 1f4611bc4e
commit d9cd15eb2d
22 changed files with 110 additions and 22 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
.externalNativeBuild .externalNativeBuild
.cxx .cxx
local.properties local.properties
*.jks

4
mastodon/.gitignore vendored
View File

@ -1 +1,3 @@
/build /build
/release
/debug

View File

@ -4,13 +4,14 @@ import org.joinmastodon.android.model.Status;
public class StatusCountersUpdatedEvent{ public class StatusCountersUpdatedEvent{
public String id; public String id;
public int favorites, reblogs; public int favorites, reblogs, replies;
public boolean favorited, reblogged; public boolean favorited, reblogged;
public StatusCountersUpdatedEvent(Status s){ public StatusCountersUpdatedEvent(Status s){
id=s.id; id=s.id;
favorites=s.favouritesCount; favorites=s.favouritesCount;
reblogs=s.reblogsCount; reblogs=s.reblogsCount;
replies=s.repliesCount;
favorited=s.favourited; favorited=s.favourited;
reblogged=s.reblogged; reblogged=s.reblogged;
} }

View File

@ -12,6 +12,7 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.util.Log; import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
@ -42,16 +43,19 @@ import org.joinmastodon.android.api.requests.statuses.CreateStatus;
import org.joinmastodon.android.api.requests.statuses.UploadAttachment; import org.joinmastodon.android.api.requests.statuses.UploadAttachment;
import org.joinmastodon.android.api.session.AccountSession; import org.joinmastodon.android.api.session.AccountSession;
import org.joinmastodon.android.api.session.AccountSessionManager; import org.joinmastodon.android.api.session.AccountSessionManager;
import org.joinmastodon.android.events.StatusCountersUpdatedEvent;
import org.joinmastodon.android.events.StatusCreatedEvent; import org.joinmastodon.android.events.StatusCreatedEvent;
import org.joinmastodon.android.model.Account; import org.joinmastodon.android.model.Account;
import org.joinmastodon.android.model.Attachment; import org.joinmastodon.android.model.Attachment;
import org.joinmastodon.android.model.Emoji; import org.joinmastodon.android.model.Emoji;
import org.joinmastodon.android.model.EmojiCategory; import org.joinmastodon.android.model.EmojiCategory;
import org.joinmastodon.android.model.Mention;
import org.joinmastodon.android.model.Status; import org.joinmastodon.android.model.Status;
import org.joinmastodon.android.ui.CustomEmojiPopupKeyboard; import org.joinmastodon.android.ui.CustomEmojiPopupKeyboard;
import org.joinmastodon.android.ui.M3AlertDialogBuilder; import org.joinmastodon.android.ui.M3AlertDialogBuilder;
import org.joinmastodon.android.ui.PopupKeyboard; import org.joinmastodon.android.ui.PopupKeyboard;
import org.joinmastodon.android.ui.views.SizeListenerLinearLayout; import org.joinmastodon.android.ui.views.SizeListenerLinearLayout;
import org.parceler.Parcels;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -106,12 +110,15 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
private Button publishButton; private Button publishButton;
private ImageButton mediaBtn, pollBtn, emojiBtn, spoilerBtn, visibilityBtn; private ImageButton mediaBtn, pollBtn, emojiBtn, spoilerBtn, visibilityBtn;
private LinearLayout attachmentsView; private LinearLayout attachmentsView;
private TextView replyText;
private ArrayList<DraftMediaAttachment> queuedAttachments=new ArrayList<>(), failedAttachments=new ArrayList<>(), attachments=new ArrayList<>(); private ArrayList<DraftMediaAttachment> queuedAttachments=new ArrayList<>(), failedAttachments=new ArrayList<>(), attachments=new ArrayList<>();
private DraftMediaAttachment uploadingAttachment; private DraftMediaAttachment uploadingAttachment;
private List<EmojiCategory> customEmojis; private List<EmojiCategory> customEmojis;
private CustomEmojiPopupKeyboard emojiKeyboard; private CustomEmojiPopupKeyboard emojiKeyboard;
private Status replyTo;
private String initialReplyMentions;
@Override @Override
public void onAttach(Activity activity){ public void onAttach(Activity activity){
@ -127,6 +134,9 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
customEmojis=AccountSessionManager.getInstance().getCustomEmojis(instanceDomain); customEmojis=AccountSessionManager.getInstance().getCustomEmojis(instanceDomain);
emojiKeyboard=new CustomEmojiPopupKeyboard(activity, customEmojis, instanceDomain); emojiKeyboard=new CustomEmojiPopupKeyboard(activity, customEmojis, instanceDomain);
emojiKeyboard.setListener(this::onCustomEmojiClick); emojiKeyboard.setListener(this::onCustomEmojiClick);
if(getArguments().containsKey("replyTo"))
replyTo=Parcels.unwrap(getArguments().getParcelable("replyTo"));
} }
@Override @Override
@ -156,6 +166,7 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
emojiBtn=view.findViewById(R.id.btn_emoji); emojiBtn=view.findViewById(R.id.btn_emoji);
spoilerBtn=view.findViewById(R.id.btn_spoiler); spoilerBtn=view.findViewById(R.id.btn_spoiler);
visibilityBtn=view.findViewById(R.id.btn_visibility); visibilityBtn=view.findViewById(R.id.btn_visibility);
replyText=view.findViewById(R.id.reply_text);
mediaBtn.setOnClickListener(v->openFilePicker()); mediaBtn.setOnClickListener(v->openFilePicker());
emojiBtn.setOnClickListener(v->emojiKeyboard.toggleKeyboardPopup(mainEditText)); emojiBtn.setOnClickListener(v->emojiKeyboard.toggleKeyboardPopup(mainEditText));
@ -207,6 +218,23 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
} }
}); });
updateToolbar(); updateToolbar();
if(replyTo!=null){
replyText.setText(getString(R.string.in_reply_to, replyTo.account.displayName));
ArrayList<String> mentions=new ArrayList<>();
mentions.add('@'+replyTo.account.acct);
for(Mention mention : replyTo.mentions){
String m='@'+mention.acct;
if(!mentions.contains(m))
mentions.add(m);
}
initialReplyMentions=TextUtils.join(" ", mentions)+" ";
if(savedInstanceState==null){
mainEditText.setText(initialReplyMentions);
mainEditText.setSelection(mainEditText.length());
}
}else{
replyText.setVisibility(View.GONE);
}
} }
@Override @Override
@ -277,6 +305,9 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
if(!attachments.isEmpty()){ if(!attachments.isEmpty()){
req.mediaIds=attachments.stream().map(a->a.serverAttachment.id).collect(Collectors.toList()); req.mediaIds=attachments.stream().map(a->a.serverAttachment.id).collect(Collectors.toList());
} }
if(replyTo!=null){
req.inReplyToId=replyTo.id;
}
String uuid=UUID.randomUUID().toString(); String uuid=UUID.randomUUID().toString();
ProgressDialog progress=new ProgressDialog(getActivity()); ProgressDialog progress=new ProgressDialog(getActivity());
progress.setMessage(getString(R.string.publishing)); progress.setMessage(getString(R.string.publishing));
@ -289,6 +320,8 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
progress.dismiss(); progress.dismiss();
Nav.finish(ComposeFragment.this); Nav.finish(ComposeFragment.this);
E.post(new StatusCreatedEvent(result)); E.post(new StatusCreatedEvent(result));
replyTo.repliesCount++;
E.post(new StatusCountersUpdatedEvent(replyTo));
} }
@Override @Override
@ -301,7 +334,8 @@ public class ComposeFragment extends ToolbarFragment implements OnBackPressedLis
} }
private boolean hasDraft(){ private boolean hasDraft(){
return mainEditText.length()>0; return (mainEditText.length()>0 && !mainEditText.getText().toString().equals(initialReplyMentions)) || !attachments.isEmpty()
|| uploadingAttachment!=null || !queuedAttachments.isEmpty() || !failedAttachments.isEmpty();
} }
@Override @Override

View File

@ -23,7 +23,7 @@ public class NotificationsFragment extends BaseStatusListFragment<Notification>{
@Override @Override
protected List<StatusDisplayItem> buildDisplayItems(Notification n){ protected List<StatusDisplayItem> buildDisplayItems(Notification n){
ReblogOrReplyLineStatusDisplayItem titleItem=new ReblogOrReplyLineStatusDisplayItem(n.id, switch(n.type){ ReblogOrReplyLineStatusDisplayItem titleItem=new ReblogOrReplyLineStatusDisplayItem(n.id, this, switch(n.type){
case FOLLOW -> getString(R.string.user_followed_you, n.account.displayName); case FOLLOW -> getString(R.string.user_followed_you, n.account.displayName);
case FOLLOW_REQUEST -> getString(R.string.user_sent_follow_request, n.account.displayName); case FOLLOW_REQUEST -> getString(R.string.user_sent_follow_request, n.account.displayName);
case MENTION -> getString(R.string.user_mentioned_you, n.account.displayName); case MENTION -> getString(R.string.user_mentioned_you, n.account.displayName);

View File

@ -1,7 +1,9 @@
package org.joinmastodon.android.model; package org.joinmastodon.android.model;
import org.joinmastodon.android.api.RequiredField; import org.joinmastodon.android.api.RequiredField;
import org.parceler.Parcel;
@Parcel
public class Application extends BaseModel{ public class Application extends BaseModel{
@RequiredField @RequiredField
public String name; public String name;

View File

@ -10,7 +10,9 @@ import org.joinmastodon.android.api.ObjectValidationException;
import org.joinmastodon.android.api.RequiredField; import org.joinmastodon.android.api.RequiredField;
import org.joinmastodon.android.ui.utils.BlurHashDecoder; import org.joinmastodon.android.ui.utils.BlurHashDecoder;
import org.joinmastodon.android.ui.utils.BlurHashDrawable; import org.joinmastodon.android.ui.utils.BlurHashDrawable;
import org.parceler.Parcel;
@Parcel
public class Attachment extends BaseModel{ public class Attachment extends BaseModel{
@RequiredField @RequiredField
public String id; public String id;
@ -88,6 +90,7 @@ public class Attachment extends BaseModel{
UNKNOWN UNKNOWN
} }
@Parcel
public static class Metadata{ public static class Metadata{
public double duration; public double duration;
public int width; public int width;
@ -111,6 +114,7 @@ public class Attachment extends BaseModel{
} }
} }
@Parcel
public static class SizeMetadata{ public static class SizeMetadata{
public int width; public int width;
public int height; public int height;

View File

@ -9,7 +9,9 @@ import org.joinmastodon.android.api.ObjectValidationException;
import org.joinmastodon.android.api.RequiredField; import org.joinmastodon.android.api.RequiredField;
import org.joinmastodon.android.ui.utils.BlurHashDecoder; import org.joinmastodon.android.ui.utils.BlurHashDecoder;
import org.joinmastodon.android.ui.utils.BlurHashDrawable; import org.joinmastodon.android.ui.utils.BlurHashDrawable;
import org.parceler.Parcel;
@Parcel
public class Card extends BaseModel{ public class Card extends BaseModel{
@RequiredField @RequiredField
public String url; public String url;

View File

@ -1,9 +1,11 @@
package org.joinmastodon.android.model; package org.joinmastodon.android.model;
import org.joinmastodon.android.api.RequiredField; import org.joinmastodon.android.api.RequiredField;
import org.parceler.Parcel;
import java.util.List; import java.util.List;
@Parcel
public class Hashtag extends BaseModel{ public class Hashtag extends BaseModel{
@RequiredField @RequiredField
public String name; public String name;

View File

@ -1,8 +1,10 @@
package org.joinmastodon.android.model; package org.joinmastodon.android.model;
import org.joinmastodon.android.api.AllFieldsAreRequired; import org.joinmastodon.android.api.AllFieldsAreRequired;
import org.parceler.Parcel;
@AllFieldsAreRequired @AllFieldsAreRequired
@Parcel
public class History extends BaseModel{ public class History extends BaseModel{
public long day; // unixtime public long day; // unixtime
public int uses; public int uses;

View File

@ -1,8 +1,10 @@
package org.joinmastodon.android.model; package org.joinmastodon.android.model;
import org.joinmastodon.android.api.AllFieldsAreRequired; import org.joinmastodon.android.api.AllFieldsAreRequired;
import org.parceler.Parcel;
@AllFieldsAreRequired @AllFieldsAreRequired
@Parcel
public class Mention extends BaseModel{ public class Mention extends BaseModel{
public String id; public String id;
public String username; public String username;

View File

@ -2,12 +2,14 @@ package org.joinmastodon.android.model;
import org.joinmastodon.android.api.AllFieldsAreRequired; import org.joinmastodon.android.api.AllFieldsAreRequired;
import org.joinmastodon.android.api.ObjectValidationException; import org.joinmastodon.android.api.ObjectValidationException;
import org.parceler.Parcel;
import java.time.Instant; import java.time.Instant;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@AllFieldsAreRequired @AllFieldsAreRequired
@Parcel
public class Poll extends BaseModel{ public class Poll extends BaseModel{
public String id; public String id;
public Instant expiresAt; public Instant expiresAt;
@ -41,6 +43,7 @@ public class Poll extends BaseModel{
'}'; '}';
} }
@Parcel
public static class Option{ public static class Option{
public String title; public String title;
public Integer votesCount; public Integer votesCount;

View File

@ -3,10 +3,12 @@ package org.joinmastodon.android.model;
import org.joinmastodon.android.api.ObjectValidationException; import org.joinmastodon.android.api.ObjectValidationException;
import org.joinmastodon.android.api.RequiredField; import org.joinmastodon.android.api.RequiredField;
import org.joinmastodon.android.events.StatusCountersUpdatedEvent; import org.joinmastodon.android.events.StatusCountersUpdatedEvent;
import org.parceler.Parcel;
import java.time.Instant; import java.time.Instant;
import java.util.List; import java.util.List;
@Parcel
public class Status extends BaseModel implements DisplayItemsParent{ public class Status extends BaseModel implements DisplayItemsParent{
@RequiredField @RequiredField
public String id; public String id;
@ -116,6 +118,7 @@ public class Status extends BaseModel implements DisplayItemsParent{
public void update(StatusCountersUpdatedEvent ev){ public void update(StatusCountersUpdatedEvent ev){
favouritesCount=ev.favorites; favouritesCount=ev.favorites;
reblogsCount=ev.reblogs; reblogsCount=ev.reblogs;
repliesCount=ev.replies;
favourited=ev.favorited; favourited=ev.favorited;
reblogged=ev.reblogged; reblogged=ev.reblogged;
} }

View File

@ -2,8 +2,8 @@ package org.joinmastodon.android.ui.displayitems;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.res.ColorStateList;
import android.os.Build; import android.os.Build;
import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
@ -11,12 +11,16 @@ import android.widget.TextView;
import org.joinmastodon.android.R; import org.joinmastodon.android.R;
import org.joinmastodon.android.api.session.AccountSessionManager; import org.joinmastodon.android.api.session.AccountSessionManager;
import org.joinmastodon.android.fragments.BaseStatusListFragment;
import org.joinmastodon.android.fragments.ComposeFragment;
import org.joinmastodon.android.model.Status; import org.joinmastodon.android.model.Status;
import org.joinmastodon.android.model.StatusPrivacy; import org.joinmastodon.android.model.StatusPrivacy;
import org.joinmastodon.android.ui.utils.UiUtils; import org.joinmastodon.android.ui.utils.UiUtils;
import org.parceler.Parcels;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import me.grishka.appkit.Nav;
import me.grishka.appkit.utils.BindableViewHolder; import me.grishka.appkit.utils.BindableViewHolder;
import me.grishka.appkit.utils.V; import me.grishka.appkit.utils.V;
@ -24,8 +28,8 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
public final Status status; public final Status status;
private final String accountID; private final String accountID;
public FooterStatusDisplayItem(String parentID, Status status, String accountID){ public FooterStatusDisplayItem(String parentID, BaseStatusListFragment parentFragment, Status status, String accountID){
super(parentID); super(parentID, parentFragment);
this.status=status; this.status=status;
this.accountID=accountID; this.accountID=accountID;
} }
@ -78,7 +82,10 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
} }
private void onReplyClick(View v){ private void onReplyClick(View v){
Bundle args=new Bundle();
args.putString("account", item.accountID);
args.putParcelable("replyTo", Parcels.wrap(item.status));
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
} }
private void onBoostClick(View v){ private void onBoostClick(View v){

View File

@ -13,6 +13,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import org.joinmastodon.android.R; import org.joinmastodon.android.R;
import org.joinmastodon.android.fragments.BaseStatusListFragment;
import org.joinmastodon.android.fragments.ProfileFragment; import org.joinmastodon.android.fragments.ProfileFragment;
import org.joinmastodon.android.model.Account; import org.joinmastodon.android.model.Account;
import org.joinmastodon.android.ui.utils.UiUtils; import org.joinmastodon.android.ui.utils.UiUtils;
@ -34,8 +35,8 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
private Fragment parentFragment; private Fragment parentFragment;
private String accountID; private String accountID;
public HeaderStatusDisplayItem(String parentID, Account user, Instant createdAt, Fragment parentFragment, String accountID){ public HeaderStatusDisplayItem(String parentID, Account user, Instant createdAt, BaseStatusListFragment parentFragment, String accountID){
super(parentID); super(parentID, parentFragment);
this.user=user; this.user=user;
this.createdAt=createdAt; this.createdAt=createdAt;
avaRequest=new UrlImageLoaderRequest(user.avatar); avaRequest=new UrlImageLoaderRequest(user.avatar);

View File

@ -8,6 +8,7 @@ import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import org.joinmastodon.android.R; import org.joinmastodon.android.R;
import org.joinmastodon.android.fragments.BaseStatusListFragment;
import org.joinmastodon.android.model.Attachment; import org.joinmastodon.android.model.Attachment;
import org.joinmastodon.android.model.Status; import org.joinmastodon.android.model.Status;
import org.joinmastodon.android.ui.photoviewer.PhotoViewerHost; import org.joinmastodon.android.ui.photoviewer.PhotoViewerHost;
@ -23,8 +24,8 @@ public class PhotoStatusDisplayItem extends StatusDisplayItem{
private Fragment parentFragment; private Fragment parentFragment;
private Status status; private Status status;
public final int index, totalPhotos; public final int index, totalPhotos;
public PhotoStatusDisplayItem(String parentID, Status status, Attachment photo, Fragment parentFragment, int index, int totalPhotos){ public PhotoStatusDisplayItem(String parentID, Status status, Attachment photo, BaseStatusListFragment parentFragment, int index, int totalPhotos){
super(parentID); super(parentID, parentFragment);
this.status=status; this.status=status;
this.attachment=photo; this.attachment=photo;
request=new UrlImageLoaderRequest(photo.url, 1000, 1000); request=new UrlImageLoaderRequest(photo.url, 1000, 1000);

View File

@ -6,6 +6,7 @@ import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;
import org.joinmastodon.android.R; import org.joinmastodon.android.R;
import org.joinmastodon.android.fragments.BaseStatusListFragment;
import org.joinmastodon.android.ui.utils.UiUtils; import org.joinmastodon.android.ui.utils.UiUtils;
import me.grishka.appkit.utils.BindableViewHolder; import me.grishka.appkit.utils.BindableViewHolder;
@ -13,8 +14,8 @@ import me.grishka.appkit.utils.BindableViewHolder;
public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{
private CharSequence text; private CharSequence text;
public ReblogOrReplyLineStatusDisplayItem(String parentID, CharSequence text){ public ReblogOrReplyLineStatusDisplayItem(String parentID, BaseStatusListFragment parentFragment, CharSequence text){
super(parentID); super(parentID, parentFragment);
this.text=text; this.text=text;
} }

View File

@ -6,6 +6,7 @@ import android.text.TextUtils;
import android.view.ViewGroup; import android.view.ViewGroup;
import org.joinmastodon.android.R; import org.joinmastodon.android.R;
import org.joinmastodon.android.fragments.BaseStatusListFragment;
import org.joinmastodon.android.model.Attachment; import org.joinmastodon.android.model.Attachment;
import org.joinmastodon.android.model.DisplayItemsParent; import org.joinmastodon.android.model.DisplayItemsParent;
import org.joinmastodon.android.model.Status; import org.joinmastodon.android.model.Status;
@ -18,9 +19,11 @@ import me.grishka.appkit.utils.BindableViewHolder;
public abstract class StatusDisplayItem{ public abstract class StatusDisplayItem{
public final String parentID; public final String parentID;
public final BaseStatusListFragment parentFragment;
public StatusDisplayItem(String parentID){ public StatusDisplayItem(String parentID, BaseStatusListFragment parentFragment){
this.parentID=parentID; this.parentID=parentID;
this.parentFragment=parentFragment;
} }
public abstract Type getType(); public abstract Type getType();
@ -44,12 +47,12 @@ public abstract class StatusDisplayItem{
}; };
} }
public static ArrayList<StatusDisplayItem> buildItems(Fragment fragment, Status status, String accountID, DisplayItemsParent parentObject){ public static ArrayList<StatusDisplayItem> buildItems(BaseStatusListFragment fragment, Status status, String accountID, DisplayItemsParent parentObject){
String parentID=parentObject.getID(); String parentID=parentObject.getID();
ArrayList<StatusDisplayItem> items=new ArrayList<>(); ArrayList<StatusDisplayItem> items=new ArrayList<>();
Status statusForContent=status.getContentStatus(); Status statusForContent=status.getContentStatus();
if(status.reblog!=null){ if(status.reblog!=null){
items.add(new ReblogOrReplyLineStatusDisplayItem(parentID, fragment.getString(R.string.user_boosted, status.account.displayName))); items.add(new ReblogOrReplyLineStatusDisplayItem(parentID, fragment, fragment.getString(R.string.user_boosted, status.account.displayName)));
} }
items.add(new HeaderStatusDisplayItem(parentID, statusForContent.account, statusForContent.createdAt, fragment, accountID)); items.add(new HeaderStatusDisplayItem(parentID, statusForContent.account, statusForContent.createdAt, fragment, accountID));
if(!TextUtils.isEmpty(statusForContent.content)) if(!TextUtils.isEmpty(statusForContent.content))
@ -67,7 +70,7 @@ public abstract class StatusDisplayItem{
photoIndex++; photoIndex++;
} }
} }
items.add(new FooterStatusDisplayItem(parentID, statusForContent, accountID)); items.add(new FooterStatusDisplayItem(parentID, fragment, statusForContent, accountID));
return items; return items;
} }

View File

@ -9,7 +9,7 @@ import android.view.ViewGroup;
import android.widget.Toast; import android.widget.Toast;
import org.joinmastodon.android.R; import org.joinmastodon.android.R;
import org.joinmastodon.android.model.Status; import org.joinmastodon.android.fragments.BaseStatusListFragment;
import org.joinmastodon.android.ui.text.CustomEmojiSpan; import org.joinmastodon.android.ui.text.CustomEmojiSpan;
import org.joinmastodon.android.ui.text.LinkSpan; import org.joinmastodon.android.ui.text.LinkSpan;
import org.joinmastodon.android.ui.utils.UiUtils; import org.joinmastodon.android.ui.utils.UiUtils;
@ -26,8 +26,8 @@ public class TextStatusDisplayItem extends StatusDisplayItem implements LinkSpan
private CharSequence text; private CharSequence text;
private ImageLoaderRequest[] emojiRequests; private ImageLoaderRequest[] emojiRequests;
private Fragment parentFragment; private Fragment parentFragment;
public TextStatusDisplayItem(String parentID, CharSequence text, Fragment parentFragment){ public TextStatusDisplayItem(String parentID, CharSequence text, BaseStatusListFragment parentFragment){
super(parentID); super(parentID, parentFragment);
this.text=text; this.text=text;
this.parentFragment=parentFragment; this.parentFragment=parentFragment;
if(text instanceof Spanned){ if(text instanceof Spanned){

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20">
<path android:pathData="M4.31 9.5l2.963 2.963c0.293 0.293 0.293 0.768 0 1.06-0.266 0.267-0.683 0.29-0.977 0.073l-0.084-0.073L1.97 9.281C1.703 9.014 1.68 8.598 1.897 8.304L1.97 8.22l4.242-4.243c0.293-0.292 0.768-0.292 1.061 0 0.266 0.267 0.29 0.683 0.073 0.977L7.273 5.038 4.31 8H10c4.198 0 7.616 3.338 7.746 7.504l0.004 0.247c0 0.414-0.336 0.75-0.75 0.75s-0.75-0.336-0.75-0.75c0-3.376-2.675-6.126-6.02-6.246L10 9.5H4.31l2.963 2.963L4.31 9.5z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

@ -16,6 +16,20 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView
android:id="@+id/reply_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:textAppearance="@style/m3_title_small"
android:drawableStart="@drawable/ic_fluent_arrow_reply_20_filled"
android:drawableTint="@color/gray_500"
android:drawablePadding="6dp"
android:singleLine="true"
android:ellipsize="end"/>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -11,7 +11,7 @@
<string name="preparing_auth">Preparing for authentication…</string> <string name="preparing_auth">Preparing for authentication…</string>
<string name="finishing_auth">Finishing authentication…</string> <string name="finishing_auth">Finishing authentication…</string>
<string name="user_boosted">%s boosted</string> <string name="user_boosted">%s boosted</string>
<string name="replied_to">Replied to %s</string> <string name="in_reply_to">In reply to %s</string>
<string name="notifications">Notifications</string> <string name="notifications">Notifications</string>
<string name="user_followed_you">%s followed you</string> <string name="user_followed_you">%s followed you</string>