feat: don't show changelog headers if changelog is empty

This commit is contained in:
LucasGGamerM 2023-05-27 09:16:58 -03:00
parent ec11a5e8e3
commit 45b97de615
1 changed files with 6 additions and 1 deletions

View File

@ -851,7 +851,7 @@ public abstract class SettingsBaseFragment extends MastodonToolbarFragment imple
private class UpdateViewHolder extends BindableViewHolder<UpdateItem>{ private class UpdateViewHolder extends BindableViewHolder<UpdateItem>{
private final TextView text, changelog; private final TextView text, changelog, changelogHeader;
private final Button button; private final Button button;
private final ImageButton cancelBtn; private final ImageButton cancelBtn;
private final ProgressBar progress; private final ProgressBar progress;
@ -863,6 +863,7 @@ public abstract class SettingsBaseFragment extends MastodonToolbarFragment imple
super(getActivity(), R.layout.item_settings_update, list); super(getActivity(), R.layout.item_settings_update, list);
text=findViewById(R.id.text); text=findViewById(R.id.text);
changelog=findViewById(R.id.changelog); changelog=findViewById(R.id.changelog);
changelogHeader=findViewById(R.id.changelog_header);
button=findViewById(R.id.button); button=findViewById(R.id.button);
cancelBtn=findViewById(R.id.cancel_btn); cancelBtn=findViewById(R.id.cancel_btn);
progress=findViewById(R.id.progress); progress=findViewById(R.id.progress);
@ -907,6 +908,10 @@ public abstract class SettingsBaseFragment extends MastodonToolbarFragment imple
progress.removeCallbacks(progressUpdater); progress.removeCallbacks(progressUpdater);
} }
changelog.setText(info.changelog); 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)); // changelog.setText(getString(R.string.sk_changelog, info.changelog));
} }