File tree Expand file tree Collapse file tree
engine/src/java/com/runrev/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Fix incorrect stack size on Android for fullscreen mode ` showAll ` when the device has a soft button bar
Original file line number Diff line number Diff line change @@ -1484,10 +1484,24 @@ boolean keyboardIsVisible()
14841484 int t_screen_height = ((LiveCodeActivity )getContext ()).s_main_layout .getRootView ().getHeight ();
14851485
14861486 // keyboard height equals (screen height - (user app height + status))
1487- int t_keyboard_height = t_screen_height - (t_app_rect .height () + t_status_bar_height );
1487+ int t_keyboard_height = t_screen_height - (t_app_rect .height () + t_status_bar_height ) - getSoftbuttonsbarHeight () ;
14881488
14891489 return t_keyboard_height > 0 ;
14901490 }
1491+
1492+ private int getSoftbuttonsbarHeight () {
1493+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .JELLY_BEAN_MR1 ) {
1494+ return 0 ;
1495+ }
1496+
1497+ DisplayMetrics t_metrics = new DisplayMetrics ();
1498+ getWindowManager ().getDefaultDisplay ().getMetrics (t_metrics );
1499+ int t_usable_height = t_metrics .heightPixels ;
1500+ getWindowManager ().getDefaultDisplay ().getRealMetrics (t_metrics );
1501+ int t_real_height = t_metrics .heightPixels ;
1502+
1503+ return t_real_height > t_usable_height ? t_real_height - t_usable_height : 0 ;
1504+ }
14911505
14921506 void updateKeyboardVisible ()
14931507 {
You can’t perform that action at this time.
0 commit comments