Fix editing
This commit is contained in:
parent
367057421b
commit
212e8893b9
|
@ -9,7 +9,7 @@ android {
|
||||||
applicationId "org.joinmastodon.android"
|
applicationId "org.joinmastodon.android"
|
||||||
minSdk 23
|
minSdk 23
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 41
|
versionCode 42
|
||||||
versionName "1.1.3"
|
versionName "1.1.3"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -880,13 +880,17 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
||||||
private View createMediaAttachmentView(DraftMediaAttachment draft){
|
private View createMediaAttachmentView(DraftMediaAttachment draft){
|
||||||
View thumb=getActivity().getLayoutInflater().inflate(R.layout.compose_media_thumb, attachmentsView, false);
|
View thumb=getActivity().getLayoutInflater().inflate(R.layout.compose_media_thumb, attachmentsView, false);
|
||||||
ImageView img=thumb.findViewById(R.id.thumb);
|
ImageView img=thumb.findViewById(R.id.thumb);
|
||||||
if(draft.mimeType.startsWith("image/")){
|
if(draft.serverAttachment!=null){
|
||||||
ViewImageLoader.load(img, null, new UrlImageLoaderRequest(draft.uri, V.dp(250), V.dp(250)));
|
ViewImageLoader.load(img, draft.serverAttachment.blurhashPlaceholder, new UrlImageLoaderRequest(draft.serverAttachment.previewUrl, V.dp(250), V.dp(250)));
|
||||||
}else if(draft.mimeType.startsWith("video/")){
|
}else{
|
||||||
loadVideoThumbIntoView(img, draft.uri);
|
if(draft.mimeType.startsWith("image/")){
|
||||||
|
ViewImageLoader.load(img, null, new UrlImageLoaderRequest(draft.uri, V.dp(250), V.dp(250)));
|
||||||
|
}else if(draft.mimeType.startsWith("video/")){
|
||||||
|
loadVideoThumbIntoView(img, draft.uri);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TextView fileName=thumb.findViewById(R.id.file_name);
|
TextView fileName=thumb.findViewById(R.id.file_name);
|
||||||
fileName.setText(UiUtils.getFileName(draft.uri));
|
fileName.setText(UiUtils.getFileName(draft.serverAttachment!=null ? Uri.parse(draft.serverAttachment.url) : draft.uri));
|
||||||
|
|
||||||
draft.view=thumb;
|
draft.view=thumb;
|
||||||
draft.imageView=img;
|
draft.imageView=img;
|
||||||
|
|
Loading…
Reference in New Issue