From aa314461217f690cdfdbd9012accf52ece2760ec Mon Sep 17 00:00:00 2001 From: zt515 Date: Wed, 29 Nov 2017 23:46:19 +0800 Subject: [PATCH] XSession: move some status vars to session data --- .../java/io/neoterm/frontend/xorg/XSession.kt | 25 ++++++++----------- .../io/neoterm/frontend/xorg/XSessionData.kt | 3 +++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/io/neoterm/frontend/xorg/XSession.kt b/app/src/main/java/io/neoterm/frontend/xorg/XSession.kt index 114807b..2b96859 100644 --- a/app/src/main/java/io/neoterm/frontend/xorg/XSession.kt +++ b/app/src/main/java/io/neoterm/frontend/xorg/XSession.kt @@ -25,7 +25,6 @@ class XSession private constructor(val mActivity: Activity, val sessionData: XSe } var mSessionName = ""; - var keyboardWithoutTextInputShown = false; init { if (Globals.InhibitSuspend) { @@ -40,7 +39,17 @@ class XSession private constructor(val mActivity: Activity, val sessionData: XSe override fun getContext() = mActivity - override fun isKeyboardWithoutTextInputShown() = keyboardWithoutTextInputShown + override fun isKeyboardWithoutTextInputShown() = sessionData.keyboardWithoutTextInputShown + + override fun isPaused() = sessionData.isPaused + + override fun runOnUiThread(runnable: Runnable?) = mActivity.runOnUiThread(runnable) + + override fun getGLView() = sessionData.glView + + override fun getWindow() = mActivity.window!! + + override fun getWindowManager() = mActivity.windowManager!! override fun showScreenKeyboardWithoutTextInputField(flags: Int) { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. @@ -62,8 +71,6 @@ class XSession private constructor(val mActivity: Activity, val sessionData: XSe TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } - override fun runOnUiThread(runnable: Runnable?) = mActivity.runOnUiThread(runnable) - override fun updateScreenOrientation() { var rotation: Int = windowManager.defaultDisplay.rotation NeoAccelerometerReader.setGyroInvertedOrientation( @@ -92,12 +99,6 @@ class XSession private constructor(val mActivity: Activity, val sessionData: XSe return uiModeManager?.currentModeType == Configuration.UI_MODE_TYPE_TELEVISION || Globals.OuyaEmulation } - override fun getGLView() = sessionData.glView - - override fun getWindow() = mActivity.window!! - - override fun getWindowManager() = mActivity.windowManager!! - override fun setSystemMousePointerVisible(visible: Int) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { glView?.pointerIcon = android.view.PointerIcon.getSystemIcon(mActivity, @@ -105,8 +106,4 @@ class XSession private constructor(val mActivity: Activity, val sessionData: XSe else android.view.PointerIcon.TYPE_DEFAULT) } } - - override fun isPaused(): Boolean { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } } diff --git a/app/src/main/java/io/neoterm/frontend/xorg/XSessionData.kt b/app/src/main/java/io/neoterm/frontend/xorg/XSessionData.kt index acc4c3d..7c766ef 100644 --- a/app/src/main/java/io/neoterm/frontend/xorg/XSessionData.kt +++ b/app/src/main/java/io/neoterm/frontend/xorg/XSessionData.kt @@ -11,4 +11,7 @@ class XSessionData { var audioThread: NeoAudioThread? = null var glView: NeoGLView? = null var client: NeoXorgViewClient? = null + + var keyboardWithoutTextInputShown = false + var isPaused = false } \ No newline at end of file