Merge pull request #7098 from Ebola16/ElfDolMessage

Android: Add AlertDialog for files without Game IDs in Game Settings
This commit is contained in:
Léo Lam 2018-06-10 14:36:46 +02:00 committed by GitHub
commit 69f079b371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 @Override
public boolean onLongClick(View view) public boolean onLongClick(View view)
{ {
FragmentActivity activity = (FragmentActivity) view.getContext();
GameViewHolder holder = (GameViewHolder) view.getTag(); GameViewHolder holder = (GameViewHolder) view.getTag();
String gameId = holder.gameFile.getGameId(); String gameId = holder.gameFile.getGameId();
if (gameId.isEmpty()) 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; return true;
} }
FragmentActivity activity = (FragmentActivity) view.getContext();
AlertDialog.Builder builder = new AlertDialog.Builder(activity); AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Game Settings") builder.setTitle("Game Settings")
.setItems(R.array.gameSettingsMenus, new DialogInterface.OnClickListener() { .setItems(R.array.gameSettingsMenus, new DialogInterface.OnClickListener() {

View File

@ -89,7 +89,11 @@ public final class GameRowPresenter extends Presenter
if (gameId.isEmpty()) 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; return true;
} }