Java Code Examples for com.google.android.gms.games.GamesClient#setViewForPopups()

The following examples show how to use com.google.android.gms.games.GamesClient#setViewForPopups() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Request.java    From play_games with MIT License 5 votes vote down vote up
public void setPopupOptions(boolean show, int gravity) {
    GamesClient gamesClient = Games.getGamesClient(registrar.activity(), currentAccount);
    if (show) {
        gamesClient.setViewForPopups(registrar.view());
        gamesClient.setGravityForPopups(gravity);
    } else {
        gamesClient.setViewForPopups(null);
    }
    result(true);
}
 
Example 2
Source File: GPGamesHelper.java    From PretendYoureXyzzyAndroid with GNU General Public License v3.0 5 votes vote down vote up
public static void setPopupView(@NonNull Context context, @NonNull View view, @MagicConstant(flagsFromClass = Gravity.class) int gravity) {
    GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(context);
    if (account == null) return;

    GamesClient client = Games.getGamesClient(context, account);
    client.setViewForPopups(view);
    client.setGravityForPopups(gravity);
}