use of com.nolanlawson.keepscore.helper.PlayerColor.CustomPlayerColor in project KeepScore by nolanlawson.
the class DialogHelper method showCustomColorDialog.
private static void showCustomColorDialog(Context context, int initialColor, final Callback<PlayerColor> onColorChanged, final Runnable onColorSelected) {
AmbilWarnaDialog dialog = new AmbilWarnaDialog(context, initialColor, new OnAmbilWarnaListener() {
@Override
public void onOk(AmbilWarnaDialog dialog, int color) {
onColorChanged.onCallback(new CustomPlayerColor(color));
onColorSelected.run();
}
@Override
public void onCancel(AmbilWarnaDialog dialog) {
// do nothing
}
});
dialog.show();
}
use of com.nolanlawson.keepscore.helper.PlayerColor.CustomPlayerColor in project KeepScore by nolanlawson.
the class SerializationTest method testNullsAndEmpties.
public void testNullsAndEmpties() {
GamesBackup gamesBackup = createRandomGamesBackup();
gamesBackup.getGames().get(0).setName(null);
gamesBackup.getGames().get(1).setName("");
gamesBackup.getGames().get(0).getPlayerScores().get(0).setName(null);
gamesBackup.getGames().get(0).getPlayerScores().get(0).setPlayerColor(PlayerColor.BUILT_INS[7]);
gamesBackup.getGames().get(0).getPlayerScores().get(1).setName("");
gamesBackup.getGames().get(0).getPlayerScores().get(1).setPlayerColor(new CustomPlayerColor(Color.parseColor("#FF00FF00")));
gamesBackup.getGames().get(0).getPlayerScores().get(0).setHistory(Collections.<Delta>emptyList());
testGamesBackup(gamesBackup);
}
Aggregations