Example usage for android.view View SYSTEM_UI_FLAG_FULLSCREEN

List of usage examples for android.view View SYSTEM_UI_FLAG_FULLSCREEN

Introduction

In this page you can find the example usage for android.view View SYSTEM_UI_FLAG_FULLSCREEN.

Prototype

int SYSTEM_UI_FLAG_FULLSCREEN

To view the source code for android.view View SYSTEM_UI_FLAG_FULLSCREEN.

Click Source Link

Document

Flag for #setSystemUiVisibility(int) : View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application.

Usage

From source file:com.pimp.instincts.activities.SplashActivity.java

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    int mUIFlag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LOW_PROFILE
            | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

    getWindow().getDecorView().setSystemUiVisibility(mUIFlag);

    setContentView(R.layout.activity_splash);
    ButterKnife.bind(this);

    DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics();
    spinArrow.setTranslationX(-2000);//from  www  .  j  ava 2s.c  o  m
    wheelView.setTranslationX(2000);
    wheelView.setWheelRadius(displayMetrics.widthPixels / 2);
    wheelView.setWheelItemRadius(displayMetrics.widthPixels / 6);

    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            startSecondActivity();
        }
    }, 1000);
}

From source file:de.gobro.andreas.pa.pa_cleint_java.SendTouch.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_send_touch);
    View v = findViewById(R.id.main_view);
    v.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);

    maxPoints = 10;/*from   ww  w . j a  va  2  s .c o m*/

    size = new Point();

    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);

    size.x = metrics.widthPixels;
    size.y = metrics.heightPixels;

    serializer = Xml.newSerializer();

    new Thread() {
        public void run() {
            try {
                Intent intent = getIntent();
                //clientSocket = new Socket("192.168.43.245",15000);
                clientSocket = new Socket(intent.getStringExtra(MainActivity.IP_FIELD), 15000);
                //TODO checkt, if connection is etabished

                out = clientSocket.getOutputStream();
                //            xml with
                //            http://www.ibm.com/developerworks/opensource/library/x-android/index.html#N102B3

                serializer.setOutput(out, "UTF-8");

                serializer.startTag("", "pa_smart_gui");
                serializer.startTag("", "init");
                serializer.startTag("", "maxTouch");
                serializer.text(maxPoints.toString());
                serializer.endTag("", "maxTouch");
                serializer.endTag("", "init");
                serializer.flush();

            } catch (IllegalArgumentException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IllegalStateException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (UnknownHostException e) {
                // TODO Auto-generated catch block
                Log.d("net", "some error !!!!2");
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                Log.d("net", "some conection error");
                e.printStackTrace();
                finish();

            }

        }
    }.start();
}

From source file:support.plus.reportit.splashscreen.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splashscreen);

    View decorView = getWindow().getDecorView();
    // Hide the status bar.
    int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
    decorView.setSystemUiVisibility(uiOptions);

    // intro// www .j  av a2  s .c o m
    TextView by = (TextView) findViewById(R.id.by);
    TextView appname = (TextView) findViewById(R.id.appname);
    ImageView logo = (ImageView) findViewById(R.id.logo);
    ImageView supportlogo = (ImageView) findViewById(R.id.supportlogo);

    SharedPreferences pref = getSharedPreferences("IntroStat", Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = pref.edit();
    int countMe = pref.getInt("startCount", 0);
    countMe++;
    editor.putInt("startCount", countMe);
    editor.commit();

    YoYo.with(Techniques.Tada).duration(2000).playOn(logo);
    YoYo.with(Techniques.Landing).duration(2500).playOn(supportlogo);
    YoYo.with(Techniques.Landing).duration(2500).playOn(appname);
    YoYo.with(Techniques.Landing).duration(3000).playOn(by);

    boolean hasPermission = (ContextCompat.checkSelfPermission(this,
            Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED);
    if (!hasPermission) {
        SharedPreferences pref2 = getSharedPreferences("IntroStat", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor2 = pref2.edit();
        editor2.putBoolean("intro_executed", false);
        editor2.commit();
    }
    // Splashscreen Options
    myHandler = new Handler();

    myHandler.postDelayed(new Runnable() {
        @Override
        public void run() {
            SharedPreferences pref = getSharedPreferences("Fingerprint", Context.MODE_PRIVATE);
            boolean fingerprint_True = pref.getBoolean("fingerprintSet", false);
            if (fingerprint_True == true) {
                FingerprintDialog dialog = new FingerprintDialog();
                dialog.setStyle(DialogFragment.STYLE_NORMAL, R.style.DialogTheme);
                dialog.setCancelable(false);
                dialog.show(splashscreen.this, getString(R.string.app_name), 69);

            } else {
                Intent intent = new Intent(splashscreen.this, IntroActivity.class);
                startActivity(intent);
                finishAffinity();
            }
        }
    }, SPLASH_DURATION);
}

From source file:com.rn.full.screen.FullScreen.java

@ReactMethod
public void onFullScreen() {
    UiThreadUtil.runOnUiThread(new Runnable() {
        @Override//  w  w  w  .  j a v a  2 s .  c om
        public void run() {
            getCurrentActivity().getWindow().getDecorView()
                    .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);
        }
    });

}

From source file:net.grayswander.rotationmanager.FullscreenWatcher.java

@Override
public void onSystemUiVisibilityChange(int visibility) {
    Log.d("FullscreenWatcher", "Received event " + visibility);
    if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
        Log.d("FullscreenWatcher", "Went full screen");

        previous_setting = this.getAutoOrientationEnabled();
        if (!previous_setting) {
            this.setAutoOrientationEnabled(true);
        }/* ww  w  . j  a  v  a  2  s.co  m*/
        this.sendFullscreenStarted();
    } else {
        Log.d("FullscreenWatcher", "Exited full screen");
        if (previous_setting != this.getAutoOrientationEnabled()) {
            this.setAutoOrientationEnabled(previous_setting);
        }
        this.sendFullscreenStopped();
    }

}

From source file:com.poussiere_violette.poussieremagique.MainActivity2.java

@Override
public void onResume() {

    grandConteneur.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

    super.onResume();

}

From source file:com.thiagorosa.robotita.ActivityMain.java

@Override
@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity);//from   ww w .jav  a 2 s.  c o  m

    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(mToolbar);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);

    if ((getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_SMALL) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
        } else {
            View decorView = getWindow().getDecorView();
            int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
            decorView.setSystemUiVisibility(uiOptions);
        }
    }

    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        window.setStatusBarColor(getResources().getColor(R.color.theme_secondary));
    }

    if (savedInstanceState == null) {
        if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
            FragmentManager.BackStackEntry first = getSupportFragmentManager().getBackStackEntryAt(0);
            getSupportFragmentManager().popBackStack(first.getId(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
        }

        Fragment fragment = new FragmentMain();
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left, R.anim.slide_in_right,
                R.anim.slide_out_right);
        transaction.replace(R.id.fragment, fragment, "fragment");
        transaction.addToBackStack("main");
        transaction.commitAllowingStateLoss();

        if (!TextUtils.isEmpty(PreferencesManager.getDeviceMAC(getApplicationContext()))) {
            Bundle args = new Bundle();
            args.putString(FragmentDeviceList.EXTRA_MAC,
                    PreferencesManager.getDeviceMAC(getApplicationContext()));

            Fragment fragmentDevice = new FragmentDeviceList();
            fragmentDevice.setArguments(args);
            FragmentTransaction transactionDevice = getSupportFragmentManager().beginTransaction();
            transactionDevice.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left,
                    R.anim.slide_in_right, R.anim.slide_out_right);
            transactionDevice.replace(R.id.fragment, fragmentDevice, "fragment");
            transactionDevice.addToBackStack("device");
            transactionDevice.commitAllowingStateLoss();
        }
    }

}

From source file:com.achep.acdisplay.ui.activities.AcDisplayActivity.java

@SuppressLint("NewApi")
private void populateFlags(boolean windowHasFocus) {
    final View decorView = getWindow().getDecorView();

    if (windowHasFocus) {
        int visibilityUi = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_LOW_PROFILE;

        if (getConfig().isFullScreen()) {
            // Hide status bar if fullscreen mode is enabled.
            visibilityUi = visibilityUi | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_FULLSCREEN;

            if (Device.hasKitKatApi()) {
                // Hide navigation bar and flag sticky.
                visibilityUi = visibilityUi | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
            }/* ww  w  .  j ava  2s . c o m*/
        }

        decorView.setSystemUiVisibility(visibilityUi);
    }
}

From source file:com.bullmobi.message.ui.activities.EasyNotificationActivity.java

@SuppressLint("NewApi")
private void populateFlags(boolean windowHasFocus) {
    final View decorView = getWindow().getDecorView();

    if (windowHasFocus) {
        int visibilityUi = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_LOW_PROFILE;

        if (mConfig.isFullScreen()) {
            // Hide status bar if fullscreen mode is enabled.
            visibilityUi = visibilityUi | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_FULLSCREEN;

            if (Device.hasKitKatApi()) {
                // Hide navigation bar and flag sticky.
                visibilityUi = visibilityUi | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
            }// w  w  w. jav a 2s .c o  m
        }

        decorView.setSystemUiVisibility(visibilityUi);
    }
}

From source file:com.pimp.instincts.activities.GalleryActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    ActivityCompat.setExitSharedElementCallback(this, exitTransitionCallback);
    super.onCreate(savedInstanceState);

    int mUIFlag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LOW_PROFILE
            | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

    getWindow().getDecorView().setSystemUiVisibility(mUIFlag);

    setContentView(R.layout.activity_gallery);
    ButterKnife.bind(this);

    setSupportActionBar(toolbar);//w w w  .  j a  va2 s  .  co  m
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);

    ArrayList<String> imagesList = new ArrayList<>();
    for (int i = 1; i <= 23; i++)
        imagesList.add("http://ssninstincts.org.in/img/gallery/big/" + i + ".jpg");

    galleryAdapter = new GalleryAdapter(this, imagesList);
    StaggeredGridLayoutManager gridLayoutManager = new StaggeredGridLayoutManager(2,
            StaggeredGridLayoutManager.VERTICAL);
    gridLayoutManager.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS);
    galleryRecyclerView.setHasFixedSize(true);
    galleryRecyclerView.setLayoutManager(gridLayoutManager);
    galleryRecyclerView.setAdapter(galleryAdapter);
}