mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-25 06:44:59 +00:00
Android: Show message when trying to map disconnected device
Having the MotionAlertDialog immediately close is confusing for users. Let's show a message to tell them what went wrong.
This commit is contained in:
parent
516c1314d2
commit
9e9faf3be1
2 changed files with 10 additions and 1 deletions
|
@ -9,6 +9,8 @@ import android.view.InputDevice
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
|
import org.dolphinemu.dolphinemu.R
|
||||||
import org.dolphinemu.dolphinemu.features.input.model.ControllerInterface
|
import org.dolphinemu.dolphinemu.features.input.model.ControllerInterface
|
||||||
import org.dolphinemu.dolphinemu.features.input.model.InputDetector
|
import org.dolphinemu.dolphinemu.features.input.model.InputDetector
|
||||||
import org.dolphinemu.dolphinemu.features.input.model.view.InputMappingControlSetting
|
import org.dolphinemu.dolphinemu.features.input.model.view.InputMappingControlSetting
|
||||||
|
@ -35,6 +37,12 @@ class MotionAlertDialog(
|
||||||
running = true
|
running = true
|
||||||
inputDetector.start(setting.controller.getDefaultDevice(), allDevices)
|
inputDetector.start(setting.controller.getDefaultDevice(), allDevices)
|
||||||
periodicUpdate()
|
periodicUpdate()
|
||||||
|
if (running == false) {
|
||||||
|
MaterialAlertDialogBuilder(activity)
|
||||||
|
.setMessage(R.string.input_binding_disconnected_device)
|
||||||
|
.setPositiveButton(R.string.ok, null)
|
||||||
|
.show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
|
|
|
@ -54,7 +54,8 @@
|
||||||
|
|
||||||
<string name="input_binding">Input Binding</string>
|
<string name="input_binding">Input Binding</string>
|
||||||
<string name="input_binding_description">Press or move an input to bind it to %1$s.</string>
|
<string name="input_binding_description">Press or move an input to bind it to %1$s.</string>
|
||||||
<string name="input_binding_no_device">You need to select a device first!</string>
|
<string name="input_binding_no_device">You need to select a device first.</string>
|
||||||
|
<string name="input_binding_disconnected_device">The selected device is disconnected.\n\nPlease reconnect the device or select a different device.</string>
|
||||||
<string name="input_configure_input">Configure Input</string>
|
<string name="input_configure_input">Configure Input</string>
|
||||||
<string name="input_configure_output">Configure Output</string>
|
<string name="input_configure_output">Configure Output</string>
|
||||||
<string name="input_expression">Expression</string>
|
<string name="input_expression">Expression</string>
|
||||||
|
|
Loading…
Add table
Reference in a new issue