feat: hide changelog header when update changelog is empty

This commit is contained in:
LucasGGamerM 2023-05-07 15:40:18 -03:00
parent 65907742a6
commit 5102fa2699
1 changed files with 6 additions and 1 deletions

View File

@ -1262,7 +1262,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
private class UpdateViewHolder extends BindableViewHolder<UpdateItem>{
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));
}