Android Open Source - android_game_engine Screen Utils






From Project

Back to project page android_game_engine.

License

The source code is released under:

GNU General Public License

If you think the Android project android_game_engine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.google.example.games.basegameutils;
//ww w.ja  v a 2  s.c  o m
import android.annotation.TargetApi;
import android.os.Build;
import android.view.View;

/**
 * @author Cyril Leroux
 *         Created 12/10/2014.
 */
public class ScreenUtils {

    // This snippet hides the system bars.
    @TargetApi(Build.VERSION_CODES.KITKAT)
    public static void hideSystemUI(View decorView) {

        // Set the IMMERSIVE flag.
        // Set the content to appear under the system bars so that the content
        // doesn't resize when the system bars hide and show.
        decorView.setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
                        | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
                        | View.SYSTEM_UI_FLAG_IMMERSIVE);
    }

    // This snippet shows the system bars. It does this by removing all the flags
// except for the ones that make the content appear under the system bars.
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    public static void showSystemUI(View decorView) {

        decorView.setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
    }
}




Java Source Code List

com.google.example.games.basegameutils.BaseGameActivity.java
com.google.example.games.basegameutils.GameHelperUtils.java
com.google.example.games.basegameutils.GameHelper.java
com.google.example.games.basegameutils.ScreenUtils.java
org.es.engine.audio.Sound.java
org.es.engine.game_mechanic.DrawingThread.java
org.es.engine.game_mechanic.DrawingView.java
org.es.engine.graphics.animation.AnimationCallback.java
org.es.engine.graphics.animation.Animation.java
org.es.engine.graphics.animation.BitmapAnimation.java
org.es.engine.graphics.animation.SpriteSheetAnimation.java
org.es.engine.graphics.drawable.DrawableElement.java
org.es.engine.graphics.sprite.GenericSprite.java
org.es.engine.graphics.sprite.SpriteSheet.java
org.es.engine.graphics.sprite.Sprite.java
org.es.engine.graphics.utils.DrawTextUtils.java
org.es.engine.graphics.utils.DrawingParam.java
org.es.engine.hud.Button.java
org.es.engine.hud.Control.java
org.es.engine.hud.HUD.java
org.es.engine.hud.Text.java
org.es.engine.hud.ToggleButton.java
org.es.engine.toolbox.pathfinding.Node.java
org.es.engine.toolbox.pathfinding.ShortestPath.java