Fixed hiding nav bars in immersive mode with on-screen keyboard, updated Xserver.

This commit is contained in:
pelya
2014-01-05 21:34:47 +02:00
parent 5aef158ddb
commit 419c94d516
8 changed files with 62 additions and 60 deletions

View File

@@ -414,11 +414,24 @@ public class MainActivity extends Activity
System.exit(0);
}
static boolean keyboardWithoutTextInputShown = false;
public void showScreenKeyboardWithoutTextInputField()
{
_inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
_inputManager.showSoftInput(mGLView, InputMethodManager.SHOW_FORCED);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
if( !keyboardWithoutTextInputShown )
{
keyboardWithoutTextInputShown = true;
_inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
_inputManager.showSoftInput(mGLView, InputMethodManager.SHOW_FORCED);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
else
{
keyboardWithoutTextInputShown = false;
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
_inputManager.hideSoftInputFromWindow(mGLView.getWindowToken(), 0);
DimSystemStatusBar.get().dim(_videoLayout);
DimSystemStatusBar.get().dim(mGLView);
}
}
public void showScreenKeyboard(final String oldText, boolean sendBackspace)
@@ -1167,7 +1180,7 @@ abstract class DimSystemStatusBar
{
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT && Globals.ImmersiveMode)
// Immersive mode, I already hear curses when system bar reappears mid-game from the slightest swipe at the bottom of the screen
view.setSystemUiVisibility(android.view.View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
view.setSystemUiVisibility(android.view.View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | android.view.View.SYSTEM_UI_FLAG_FULLSCREEN);
else
view.setSystemUiVisibility(android.view.View.STATUS_BAR_HIDDEN);
}