Android: Add AlertDialog for files without Game IDs in Game Settings

This commit is contained in:
Ryan Meredith 2018-06-09 11:30:20 -04:00
parent 48b7cfa75c
commit fb3ae94acb
2 changed files with 11 additions and 4 deletions

View File

@ -136,17 +136,20 @@ public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> impl
@Override
public boolean onLongClick(View view)
{
FragmentActivity activity = (FragmentActivity) view.getContext();
GameViewHolder holder = (GameViewHolder) view.getTag();
String gameId = holder.gameFile.getGameId();
if (gameId.isEmpty())
{
// We can't make a game-specific INI file if there is no game ID
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Game Settings");
builder.setMessage("Files without game IDs don't support game-specific settings.");
builder.show();
return true;
}
FragmentActivity activity = (FragmentActivity) view.getContext();
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Game Settings")
.setItems(R.array.gameSettingsMenus, new DialogInterface.OnClickListener() {

View File

@ -89,7 +89,11 @@ public final class GameRowPresenter extends Presenter
if (gameId.isEmpty())
{
// We can't make a game-specific INI file if there is no game ID
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Game Settings");
builder.setMessage("Files without game IDs don't support game-specific settings.");
builder.show();
return true;
}