fix: color for game count and file count is always black for <= 255

This commit is contained in:
lantzelot-swe 2023-08-15 08:30:50 +02:00
parent 6e130f98f1
commit 53ba3fe02c
1 changed files with 6 additions and 3 deletions

View File

@ -11,7 +11,8 @@ import se.lantz.util.DbConstants;
public class GameView implements Comparable
{
private static final String fontRedStart = "<FONT COLOR=\"#ff0000\">";
private static final String fontRedEnd = "</FONT COLOR>";
private static final String fontEnd = "</FONT COLOR>";
private static final String fontBlackStart = "<FONT COLOR=\"#000000\">";
public static final String FAV_GAMEVIEW_NAME_PREF_KEY = "GameViewFavoritesName_";
public static final int ALL_GAMES_ID = -1;
@ -70,8 +71,10 @@ public class GameView implements Comparable
{
if (gameViewId != -1)
{
String gameCountString = gameCount > 255 ? fontRedStart + gameCount + fontRedEnd : gameCount + "";
String fileCountString = fileCount > 255 ? fontRedStart + fileCount + fontRedEnd : fileCount + "";
String gameCountString =
gameCount > 255 ? fontRedStart + gameCount + fontEnd : fontBlackStart + gameCount + fontEnd;
String fileCountString =
fileCount > 255 ? fontRedStart + fileCount + fontEnd : fontBlackStart + fileCount + fontEnd;
if (gameCount < fileCount)
{
text = name + " (" + gameCountString + "/" + fileCountString + ")";