|
44 | 44 | import app.grapheneos.pdfviewer.fragment.DocumentPropertiesFragment;
|
45 | 45 | import app.grapheneos.pdfviewer.fragment.PasswordPromptFragment;
|
46 | 46 | import app.grapheneos.pdfviewer.fragment.JumpToPageFragment;
|
| 47 | +import app.grapheneos.pdfviewer.ktx.ViewKt; |
47 | 48 | import app.grapheneos.pdfviewer.loader.DocumentPropertiesLoader;
|
48 | 49 | import app.grapheneos.pdfviewer.viewModel.PasswordStatus;
|
49 | 50 |
|
@@ -331,8 +332,7 @@ public boolean onTapUp() {
|
331 | 332 | if (mUri != null) {
|
332 | 333 | binding.webview.evaluateJavascript("isTextSelected()", selection -> {
|
333 | 334 | if (!Boolean.parseBoolean(selection)) {
|
334 |
| - if ((getWindow().getDecorView().getSystemUiVisibility() & |
335 |
| - View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { |
| 335 | + if (getSupportActionBar().isShowing()) { |
336 | 336 | hideSystemUi();
|
337 | 337 | } else {
|
338 | 338 | showSystemUi();
|
@@ -569,21 +569,12 @@ public void onJumpToPageInDocument(final int selected_page) {
|
569 | 569 | }
|
570 | 570 |
|
571 | 571 | private void showSystemUi() {
|
572 |
| - getWindow().getDecorView().setSystemUiVisibility( |
573 |
| - View.SYSTEM_UI_FLAG_LAYOUT_STABLE | |
574 |
| - View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
575 |
| - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); |
| 572 | + ViewKt.showSystemUi(binding.getRoot()); |
576 | 573 | getSupportActionBar().show();
|
577 | 574 | }
|
578 | 575 |
|
579 | 576 | private void hideSystemUi() {
|
580 |
| - getWindow().getDecorView().setSystemUiVisibility( |
581 |
| - View.SYSTEM_UI_FLAG_LAYOUT_STABLE | |
582 |
| - View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
583 |
| - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | |
584 |
| - View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | |
585 |
| - View.SYSTEM_UI_FLAG_FULLSCREEN | |
586 |
| - View.SYSTEM_UI_FLAG_IMMERSIVE); |
| 577 | + ViewKt.hideSystemUi(binding.getRoot()); |
587 | 578 | getSupportActionBar().hide();
|
588 | 579 | }
|
589 | 580 |
|
|
0 commit comments