Created
May 12, 2015 18:37
-
-
Save objectiveSee/93325be98e637746956e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList<String> cardIds = new ArrayList<>(); | |
for (CardView.CardInfo c : cardsToDiscard) { | |
cardIds.add(c.getId()); | |
} | |
bindFragmentLifecycle(lifecycle(), | |
gameManager.discardCards(game.getGameId(), cardIds)).observeOn( | |
AndroidSchedulers.mainThread()).subscribe(new Action1<Long>() { | |
@Override public void call(JSON json, ERROR error) { | |
View view = getView(); | |
if (view == null) return; | |
exitDiscardMode(); | |
if ( error ) { | |
Timber.e(throwable, "Error while discarding cards"); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment