From bc78c61009d4a2eadf74ca077933fa56a027017a Mon Sep 17 00:00:00 2001 From: Grishka Date: Mon, 6 May 2024 12:56:56 +0300 Subject: [PATCH] Fix #835 --- .../settings/SettingsServerAboutFragment.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsServerAboutFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsServerAboutFragment.java index cd464289b..307dfd837 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsServerAboutFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsServerAboutFragment.java @@ -100,15 +100,19 @@ public class SettingsServerAboutFragment extends LoaderFragment{ scroller.setClipToPadding(false); scroller.addView(scrollingLayout); - FixedAspectRatioImageView banner=new FixedAspectRatioImageView(getActivity()); - banner.setAspectRatio(1.914893617f); - banner.setScaleType(ImageView.ScaleType.CENTER_CROP); - banner.setOutlineProvider(OutlineProviders.bottomRoundedRect(16)); - banner.setClipToOutline(true); - ViewImageLoader.loadWithoutAnimation(banner, getResources().getDrawable(R.drawable.image_placeholder, getActivity().getTheme()), new UrlImageLoaderRequest(instance.thumbnail)); - LinearLayout.LayoutParams blp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); - blp.bottomMargin=V.dp(24); - scrollingLayout.addView(banner, blp); + if(!TextUtils.isEmpty(instance.thumbnail)){ + FixedAspectRatioImageView banner=new FixedAspectRatioImageView(getActivity()); + banner.setAspectRatio(1.914893617f); + banner.setScaleType(ImageView.ScaleType.CENTER_CROP); + banner.setOutlineProvider(OutlineProviders.bottomRoundedRect(16)); + banner.setClipToOutline(true); + ViewImageLoader.loadWithoutAnimation(banner, getResources().getDrawable(R.drawable.image_placeholder, getActivity().getTheme()), new UrlImageLoaderRequest(instance.thumbnail)); + LinearLayout.LayoutParams blp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + blp.bottomMargin=V.dp(24); + scrollingLayout.addView(banner, blp); + }else{ + scrollingLayout.setPadding(0, V.dp(24), 0, 0); + } boolean needDivider=false; if(instance.contactAccount!=null){