qTbot
0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
Toggle main menu visibility
MainActivity.java
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2021-2024 QuasarApp.
3
* Distributed under the lgplv3 software license, see the accompanying
4
* Everyone is permitted to copy and distribute verbatim copies
5
* of this license document, but changing it is not allowed.
6
*/
7
8
package
com.quasarapp.androidtools;
9
10
import
org.qtproject.qt.android.bindings.QtActivity;
11
import
android.view.View;
12
13
public
class
MainActivity
extends
QtActivity
14
{
15
@Override
16
public
void
onWindowFocusChanged
(
boolean
hasFocus) {
17
super.onWindowFocusChanged(hasFocus);
18
if
(hasFocus) {
19
hideSystemUI();
20
}
21
}
22
23
private
void
hideSystemUI() {
24
// Enables regular immersive mode.
25
// For "lean back" mode, remove SYSTEM_UI_FLAG_IMMERSIVE.
26
// Or for "sticky immersive," replace it with SYSTEM_UI_FLAG_IMMERSIVE_STICKY
27
View decorView = getWindow().getDecorView();
28
decorView.setSystemUiVisibility(
29
View.SYSTEM_UI_FLAG_IMMERSIVE
30
// Set the content to appear under the system bars so that the
31
// content doesn't resize when the system bars hide and show.
32
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
33
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
34
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
35
// Hide the nav bar and status bar
36
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
37
| View.SYSTEM_UI_FLAG_FULLSCREEN);
38
}
39
40
// Shows the system bars by removing all the flags
41
// except for the ones that make the content appear under the system bars.
42
private
void
showSystemUI() {
43
View decorView = getWindow().getDecorView();
44
decorView.setSystemUiVisibility(
45
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
46
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
47
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
48
}
49
50
}
com.quasarapp.androidtools.MainActivity
Definition
MainActivity.java:14
com.quasarapp.androidtools.MainActivity.onWindowFocusChanged
void onWindowFocusChanged(boolean hasFocus)
Definition
MainActivity.java:16
src
example
android
src
com
quasarapp
androidtools
MainActivity.java
Generated by
1.18.0