12
12
import android .view .MenuItem ;
13
13
import android .view .View ;
14
14
import android .view .ViewGroup ;
15
+ import android .view .WindowInsets ;
15
16
import android .widget .Toast ;
16
17
18
+ import androidx .annotation .NonNull ;
17
19
import androidx .annotation .Nullable ;
18
20
import androidx .appcompat .app .AlertDialog ;
19
21
import androidx .core .app .ActivityCompat ;
22
+ import androidx .core .view .WindowCompat ;
23
+ import androidx .core .view .WindowInsetsCompat ;
24
+ import androidx .core .view .WindowInsetsControllerCompat ;
20
25
import androidx .fragment .app .Fragment ;
21
26
import androidx .lifecycle .Observer ;
22
27
import androidx .lifecycle .ViewModelProvider ;
@@ -70,6 +75,10 @@ public void onStart() {
70
75
//init audio player
71
76
audioPlayer = new AudioPlayer (albumVM );
72
77
pageListRecyclerView .setOnScrollChangeListener (audioPlayer );
78
+ //hide status bar
79
+ WindowInsetsControllerCompat windowInsetsController =
80
+ WindowCompat .getInsetsController (getActivity ().getWindow (), getActivity ().getWindow ().getDecorView ());
81
+ windowInsetsController .hide (WindowInsetsCompat .Type .statusBars ());
73
82
}
74
83
75
84
@ Override
@@ -80,6 +89,10 @@ public void onStop() {
80
89
if (getActivity ().getClass ().equals (AlbumListActivity .class )) {
81
90
((AlbumListActivity )getActivity ()).transparentAppbar (false );
82
91
}
92
+ //restore status bar
93
+ WindowInsetsControllerCompat windowInsetsController =
94
+ WindowCompat .getInsetsController (getActivity ().getWindow (), getActivity ().getWindow ().getDecorView ());
95
+ windowInsetsController .show (WindowInsetsCompat .Type .statusBars ());
83
96
super .onStop ();
84
97
}
85
98
@@ -157,7 +170,7 @@ public void onClick(DialogInterface dialog, int which) {
157
170
}
158
171
159
172
@ Override
160
- public void onCreateOptionsMenu (Menu menu , MenuInflater inflater ) {
173
+ public void onCreateOptionsMenu (@ NonNull Menu menu , MenuInflater inflater ) {
161
174
inflater .inflate (R .menu .menu_show_album , menu );
162
175
if (!albumVM .hasNCAlbum ()) {
163
176
MenuItem shareMenu = menu .findItem (R .id .share_via_nextcloud );
0 commit comments