Crash fixes

fixes #854
This commit is contained in:
Grishka 2024-06-23 04:45:56 +03:00
parent 6d96ab5b7c
commit 501a2715be
4 changed files with 9 additions and 5 deletions

View File

@ -13,7 +13,7 @@ android {
applicationId "org.joinmastodon.android"
minSdk 23
targetSdk 33
versionCode 103
versionCode 104
versionName "2.5.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -766,6 +766,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements ComposeE
sendingOverlay=null;
removeBackCallback(sendingBackButtonBlocker);
removeBackCallback(discardConfirmationCallback);
removeBackCallback(emojiKeyboardHider);
if(editingStatus==null){
E.post(new StatusCreatedEvent(result, accountID));
if(replyTo!=null){

View File

@ -133,6 +133,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
more=findViewById(R.id.more);
extraText=findViewById(R.id.extra_text);
clickableThing=findViewById(R.id.clickable_thing);
if(clickableThing!=null)
clickableThing.setOnClickListener(this::onAvaClick);
avatar.setOutlineProvider(OutlineProviders.roundedRect(10));
avatar.setClipToOutline(true);
@ -272,9 +273,11 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
extraText.setText(item.extraText);
}
more.setVisibility(item.inset ? View.GONE : View.VISIBLE);
if(clickableThing!=null){
clickableThing.setClickable(!item.inset);
clickableThing.setContentDescription(item.parentFragment.getString(R.string.avatar_description, item.user.acct));
}
}
@Override
public void setImage(int index, Drawable drawable){

View File

@ -550,7 +550,7 @@ public class ComposeMediaViewController{
}
public List<String> getAttachmentIDs(){
return attachments.stream().map(a->a.serverAttachment.id).collect(Collectors.toList());
return attachments.stream().filter(a->a.serverAttachment!=null).map(a->a.serverAttachment.id).collect(Collectors.toList());
}
public List<CreateStatus.Request.MediaAttribute> getAttachmentAttributes(){