0

It is possible to hide the bar with the clock completely ? I mean complete full screen. I tried to use the IMMERSIVE_STICKY flag with the onWindowFocusChanged() method but the bar pulls down when I touch the edge of the screen.

Best regard

aminakoy
  • 413
  • 1
  • 5
  • 13

1 Answers1

0

You can set the style of the activity on the application tag of the manifest

<application
  ...
  android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" >
  ...
</application>

You can also do it programmatically by setting the WindowManager flags to your activity at runtime (as Anas Mehar answered)

class MainActivity : Activity() {

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    // If the Android version is lower than Jellybean, use this call to hide
    // the status bar.
    if (Build.VERSION.SDK_INT < 16) {
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN)
    }
    setContentView(R.layout.activity_main)
}
...
}

Source: https://developer.android.com/training/system-ui/status

Rander Gabriel
  • 637
  • 4
  • 14
  • yes but the status bar slides down when I touch the edge of the screen. I want to remove it permanently – aminakoy Sep 05 '19 at 15:21