Search in sources :

Example 1 with CustomPlayerColor

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();
}
Also used : AmbilWarnaDialog(yuku.ambilwarna.AmbilWarnaDialog) CustomPlayerColor(com.nolanlawson.keepscore.helper.PlayerColor.CustomPlayerColor) OnAmbilWarnaListener(yuku.ambilwarna.AmbilWarnaDialog.OnAmbilWarnaListener)

Example 2 with CustomPlayerColor

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);
}
Also used : CustomPlayerColor(com.nolanlawson.keepscore.helper.PlayerColor.CustomPlayerColor) GamesBackup(com.nolanlawson.keepscore.serialization.GamesBackup)

Aggregations

CustomPlayerColor (com.nolanlawson.keepscore.helper.PlayerColor.CustomPlayerColor)2 GamesBackup (com.nolanlawson.keepscore.serialization.GamesBackup)1 AmbilWarnaDialog (yuku.ambilwarna.AmbilWarnaDialog)1 OnAmbilWarnaListener (yuku.ambilwarna.AmbilWarnaDialog.OnAmbilWarnaListener)1