Remove 'all' as a Platform enum.

This will remove the 'all games' row on the TV view.
This commit is contained in:
Mike Harris 2017-09-27 11:16:48 -07:00
parent cc77a4963f
commit 3c3d0fa6f5
3 changed files with 5 additions and 13 deletions

View File

@ -70,9 +70,10 @@ public final class GameRowPresenter extends Presenter
backgroundId = R.drawable.tv_card_background_wii;
break;
case WIIWARE:
default: // This shouldn't happen, but set the default to WiiWare colors.
backgroundId = R.drawable.tv_card_background_wiiware;
break;
default:
throw new AssertionError("Not reachable.");
}
Context context = holder.cardParent.getContext();
Drawable background = ContextCompat.getDrawable(context, backgroundId);

View File

@ -262,21 +262,13 @@ public final class GameDatabase extends SQLiteOpenHelper
{
Log.info("[GameDatabase] Reading games list...");
// Only add a WHERE clause if we have a specific platform
String whereClause = null;
String[] whereArgs = null;
if (platform != Platform.ALL)
{
whereClause = KEY_GAME_PLATFORM + " = ?";
whereArgs = new String[]{Integer.toString(platform.toInt())};
}
String[] whereArgs = new String[]{Integer.toString(platform.toInt())};
SQLiteDatabase database = getReadableDatabase();
Cursor resultCursor = database.query(
TABLE_NAME_GAMES,
null,
whereClause,
KEY_GAME_PLATFORM + " = ?",
whereArgs,
null,
null,

View File

@ -5,8 +5,7 @@ public enum Platform
{
GAMECUBE(0, "GameCube Games"),
WII(1, "Wii Games"),
WIIWARE(2, "WiiWare Games"),
ALL(3, "All Games");
WIIWARE(2, "WiiWare Games");
private final int value;
private final String headerName;