@@ -851,6 +851,11 @@ protected int getContentViewAttr(int fullscreenMode) {
851851 return R .layout .reviewer ;
852852 }
853853
854+ protected boolean isFullscreen () {
855+ isInFullscreen = !getSupportActionBar ().isShowing ();
856+ return isInFullscreen ;
857+ }
858+
854859 @ Override
855860 public void onConfigurationChanged (Configuration config ) {
856861 // called when screen rotated, etc, since recreating the Webview is too expensive
@@ -3120,8 +3125,7 @@ private boolean filterUrl(String url) {
31203125 }
31213126 // Show options menu from WebView
31223127 if (url .startsWith ("signal:anki_show_options_menu" )) {
3123- isInFullscreen = !getSupportActionBar ().isShowing ();
3124- if (isInFullscreen ) {
3128+ if (isFullscreen ()) {
31253129 openOptionsMenu ();
31263130 } else {
31273131 UIUtils .showThemedToast (AbstractFlashcardViewer .this , getString (R .string .ankidroid_turn_on_fullscreen_options_menu ), true );
@@ -3131,8 +3135,7 @@ private boolean filterUrl(String url) {
31313135
31323136 // Show Navigation Drawer from WebView
31333137 if (url .startsWith ("signal:anki_show_navigation_drawer" )) {
3134- isInFullscreen = !getSupportActionBar ().isShowing ();
3135- if (isInFullscreen ) {
3138+ if (isFullscreen ()) {
31363139 AbstractFlashcardViewer .this .onNavigationPressed ();
31373140 } else {
31383141 UIUtils .showThemedToast (AbstractFlashcardViewer .this , getString (R .string .ankidroid_turn_on_fullscreen_nav_drawer ), true );
@@ -3500,8 +3503,7 @@ public long ankiGetCardDue() {
35003503
35013504 @ JavascriptInterface
35023505 public boolean ankiIsInFullscreen () {
3503- isInFullscreen = !getSupportActionBar ().isShowing ();
3504- return isInFullscreen ;
3506+ return isFullscreen ();
35053507 }
35063508 }
35073509}
0 commit comments