Skip to content

Commit

Permalink
GameDetailsDialog: Hide description if empty
Browse files Browse the repository at this point in the history
In particular, Wii games don't have descriptions.
  • Loading branch information
JosJuice committed Nov 23, 2019
1 parent 100f032 commit 100e7e2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
Expand Down Expand Up @@ -53,9 +54,14 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
FloatingActionButton buttonLaunch = contents.findViewById(R.id.button_launch);

String country = getResources().getStringArray(R.array.countryNames)[gameFile.getCountry()];
String description = gameFile.getDescription();

textTitle.setText(gameFile.getTitle());
textDescription.setText(gameFile.getDescription());
if (description.isEmpty())
{
textDescription.setVisibility(View.GONE);
}
textCountry.setText(country);
textCompany.setText(gameFile.getCompany());

Expand Down

0 comments on commit 100e7e2

Please sign in to comment.