From fd99879ffc37e0959c5f66d57b9b9082a4b55ea1 Mon Sep 17 00:00:00 2001 From: Jacocococo Date: Thu, 14 Sep 2023 17:16:03 +0200 Subject: [PATCH] Revert "Fix media layout with unknown sizes" This reverts commit a014fe944397a3271852fe09af9a01858d43498e. --- .../java/org/joinmastodon/android/model/Attachment.java | 8 ++++---- .../android/ui/drawables/BlurhashCrossfadeDrawable.java | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/Attachment.java b/mastodon/src/main/java/org/joinmastodon/android/model/Attachment.java index b198eb446..2e45cd1a1 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/Attachment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/Attachment.java @@ -46,26 +46,26 @@ public class Attachment extends BaseModel{ public int getWidth(){ if(meta==null) - return 0; + return 1920; if(meta.width>0) return meta.width; if(meta.original!=null && meta.original.width>0) return meta.original.width; if(meta.small!=null && meta.small.width>0) return meta.small.width; - return 0; + return 1920; } public int getHeight(){ if(meta==null) - return 0; + return 1080; if(meta.height>0) return meta.height; if(meta.original!=null && meta.original.height>0) return meta.original.height; if(meta.small!=null && meta.small.height>0) return meta.small.height; - return 0; + return 1080; } public double getDuration(){ diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/drawables/BlurhashCrossfadeDrawable.java b/mastodon/src/main/java/org/joinmastodon/android/ui/drawables/BlurhashCrossfadeDrawable.java index e0236a7a1..c909fcb8d 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/drawables/BlurhashCrossfadeDrawable.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/drawables/BlurhashCrossfadeDrawable.java @@ -99,15 +99,11 @@ public class BlurhashCrossfadeDrawable extends Drawable{ @Override public int getIntrinsicWidth(){ - if(width==0) - return imageDrawable==null ? 1920 : imageDrawable.getIntrinsicWidth(); return width; } @Override public int getIntrinsicHeight(){ - if(height==0) - return imageDrawable==null ? 1080 : imageDrawable.getIntrinsicHeight(); return height; }