XSession: move some status vars to session data

This commit is contained in:
zt515 2017-11-29 23:46:19 +08:00
parent 61da79720a
commit aa31446121
2 changed files with 14 additions and 14 deletions

View File

@ -25,7 +25,6 @@ class XSession private constructor(val mActivity: Activity, val sessionData: XSe
} }
var mSessionName = ""; var mSessionName = "";
var keyboardWithoutTextInputShown = false;
init { init {
if (Globals.InhibitSuspend) { if (Globals.InhibitSuspend) {
@ -40,7 +39,17 @@ class XSession private constructor(val mActivity: Activity, val sessionData: XSe
override fun getContext() = mActivity 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) { override fun showScreenKeyboardWithoutTextInputField(flags: Int) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates. 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. 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() { override fun updateScreenOrientation() {
var rotation: Int = windowManager.defaultDisplay.rotation var rotation: Int = windowManager.defaultDisplay.rotation
NeoAccelerometerReader.setGyroInvertedOrientation( 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 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) { override fun setSystemMousePointerVisible(visible: Int) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
glView?.pointerIcon = android.view.PointerIcon.getSystemIcon(mActivity, 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) else android.view.PointerIcon.TYPE_DEFAULT)
} }
} }
override fun isPaused(): Boolean {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
} }

View File

@ -11,4 +11,7 @@ class XSessionData {
var audioThread: NeoAudioThread? = null var audioThread: NeoAudioThread? = null
var glView: NeoGLView? = null var glView: NeoGLView? = null
var client: NeoXorgViewClient? = null var client: NeoXorgViewClient? = null
var keyboardWithoutTextInputShown = false
var isPaused = false
} }