Skip to content

Instantly share code, notes, and snippets.

@mrhether
Created March 9, 2018 21:39
Show Gist options
  • Save mrhether/32f9669d1587d9a433ba27e67e3ca436 to your computer and use it in GitHub Desktop.
Save mrhether/32f9669d1587d9a433ba27e67e3ca436 to your computer and use it in GitHub Desktop.
private class GameInterface {
public void restartGame() {
this.webView.evaluateJavascript("restartGame()", null);
}
public void startGame() {
this.webView.evaluateJavascript("startGame()", null);
}
@JavascriptInterface
public void gameOver(final int score);
@JavascriptInterface
public void loadingCompleted();
@JavascriptInterface
public int getScoreToWin();
@JavascriptInterface
public String getMode();
@JavascriptInterface
public String getFriendImageUrl();
@JavascriptInterface
public void score(int score);
@JavascriptInterface
public void setScoreToWin(int score);
@JavascriptInterface
public void setNewScore(final int score);
@JavascriptInterface
public void won(int score);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment