Search code examples
androidnotificationsgoogle-play-gamesachievements

Change the position of Google Play Game Services notification on Android


I'm using Google Play Game Services for my Android games. There is one game doesn't go along well with the achievements notification. It's an endless game and the user have to concentrate and stay focus to gain more score. The achievements notification cover the important portion of the screen which is very annoyed to the user.

I could see that it's possible to do so for iOS: https://developers.google.com/games/services/ios/achievements#changing_the_notification_location.

Is there anything similar in Android?


Solution

  • You can do it using setGravityForPopups method from the Games class

    Games.setGravityForPopups(GoogleApiClient apiClient, int gravity)
    

    For example,

    Games.setGravityForPopups(getApiClient(), Gravity.TOP | Gravity.CENTER_HORIZONTAL);