mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-14 10:46:51 -07:00
Fix Dialog after Background on Android
This commit is contained in:
parent
69f7c385c7
commit
08456d56b5
3 changed files with 14 additions and 1 deletions
|
@ -99,6 +99,11 @@ JNIEXPORT jstring JNICALL Java_com_metallic_chiaki_lib_ChiakiNative_quitReasonTo
|
|||
return E->NewStringUTF(env, chiaki_quit_reason_string((ChiakiQuitReason)value));
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_com_metallic_chiaki_lib_ChiakiNative_quitReasonIsStopped(JNIEnv *env, jobject obj, jint value)
|
||||
{
|
||||
return value == CHIAKI_QUIT_REASON_STOPPED;
|
||||
}
|
||||
|
||||
typedef struct android_chiaki_session_t
|
||||
{
|
||||
ChiakiSession session;
|
||||
|
|
|
@ -33,6 +33,7 @@ class ChiakiNative
|
|||
}
|
||||
@JvmStatic external fun errorCodeToString(value: Int): String
|
||||
@JvmStatic external fun quitReasonToString(value: Int): String
|
||||
@JvmStatic external fun quitReasonIsStopped(value: Int): Boolean
|
||||
@JvmStatic external fun sessionCreate(result: SessionCreateResult, connectInfo: ConnectInfo, javaSession: Session)
|
||||
@JvmStatic external fun sessionFree(ptr: Long)
|
||||
@JvmStatic external fun sessionStart(ptr: Long): Int
|
||||
|
@ -96,6 +97,11 @@ data class ControllerState constructor(
|
|||
class QuitReason(val value: Int)
|
||||
{
|
||||
override fun toString() = ChiakiNative.quitReasonToString(value)
|
||||
|
||||
/**
|
||||
* whether the reason is CHIAKI_QUIT_REASON_STOPPED
|
||||
*/
|
||||
val isStopped = ChiakiNative.quitReasonIsStopped(value)
|
||||
}
|
||||
|
||||
sealed class Event
|
||||
|
|
|
@ -22,6 +22,7 @@ import android.app.Dialog
|
|||
import android.content.DialogInterface
|
||||
import android.graphics.Matrix
|
||||
import android.os.Bundle
|
||||
import android.speech.tts.TextToSpeech
|
||||
import android.util.Log
|
||||
import android.view.KeyEvent
|
||||
import android.view.View
|
||||
|
@ -33,6 +34,7 @@ import com.metallic.chiaki.*
|
|||
import com.metallic.chiaki.R
|
||||
import com.metallic.chiaki.lib.ConnectInfo
|
||||
import com.metallic.chiaki.lib.LoginPinRequestEvent
|
||||
import com.metallic.chiaki.lib.QuitReason
|
||||
import com.metallic.chiaki.touchcontrols.TouchControlsFragment
|
||||
import kotlinx.android.synthetic.main.activity_stream.*
|
||||
|
||||
|
@ -138,7 +140,7 @@ class StreamActivity : AppCompatActivity()
|
|||
{
|
||||
is StreamStateQuit ->
|
||||
{
|
||||
if(dialogContents != StreamQuitDialog)
|
||||
if(!state.reason.isStopped && dialogContents != StreamQuitDialog)
|
||||
{
|
||||
dialog?.dismiss()
|
||||
val reasonStr = state.reasonString
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue