From 5102fa2699419f73f69b7a99dd85ff7ee42c3e55 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Sun, 7 May 2023 15:40:18 -0300 Subject: [PATCH] feat: hide changelog header when update changelog is empty --- .../joinmastodon/android/fragments/SettingsFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java index b884bf8b1..28d603589 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java @@ -1262,7 +1262,7 @@ public class SettingsFragment extends MastodonToolbarFragment{ private class UpdateViewHolder extends BindableViewHolder{ - private final TextView text, changelog; + private final TextView text, changelog, changelogHeader; private final Button button; private final ImageButton cancelBtn; private final ProgressBar progress; @@ -1274,6 +1274,7 @@ public class SettingsFragment extends MastodonToolbarFragment{ super(getActivity(), R.layout.item_settings_update, list); text=findViewById(R.id.text); changelog=findViewById(R.id.changelog); + changelogHeader=findViewById(R.id.changelog_header); button=findViewById(R.id.button); cancelBtn=findViewById(R.id.cancel_btn); progress=findViewById(R.id.progress); @@ -1318,6 +1319,10 @@ public class SettingsFragment extends MastodonToolbarFragment{ progress.removeCallbacks(progressUpdater); } changelog.setText(info.changelog); + if(info.changelog.isEmpty()){ + changelogHeader.setVisibility(View.GONE); + changelog.setVisibility(View.GONE); + } // changelog.setText(getString(R.string.sk_changelog, info.changelog)); }