kopia lustrzana https://github.com/ge0rg/aprsdroid
Helper: implement keyboard navigation help popup
rodzic
00cd675550
commit
7d63e7967e
|
@ -356,6 +356,15 @@
|
||||||
<string name="p_themefile_choose">Choose theme file</string>
|
<string name="p_themefile_choose">Choose theme file</string>
|
||||||
<string name="themefile_error">Error loading theme file %s!</string>
|
<string name="themefile_error">Error loading theme file %s!</string>
|
||||||
|
|
||||||
|
<string name="kbdnav_title">Keyboard Navigation</string>
|
||||||
|
<!-- keyboard navigation info -->
|
||||||
|
<string-array name="kbdnav_lines">
|
||||||
|
<item>move map</item>
|
||||||
|
<item>zoom</item>
|
||||||
|
<item>menu</item>
|
||||||
|
<item>select</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<string name="translator_credits">translator-credits</string>
|
<string name="translator_credits">translator-credits</string>
|
||||||
|
|
||||||
<!-- Bluetooth TNC settings -->
|
<!-- Bluetooth TNC settings -->
|
||||||
|
|
|
@ -137,6 +137,23 @@ trait UIHelper extends Activity
|
||||||
passcodeDialog.show()
|
passcodeDialog.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def keyboardNavDialog() {
|
||||||
|
if (getPackageManager().hasSystemFeature("android.hardware.touchscreen"))
|
||||||
|
return
|
||||||
|
if (prefs.getBoolean("kbdnav_shown", false))
|
||||||
|
return
|
||||||
|
prefs.prefs.edit().putBoolean("kbdnav_shown", true).commit()
|
||||||
|
|
||||||
|
val keys = Array("⬅➡⬆⬇", "⏪⏩", "⏯️", "⏎🆗")
|
||||||
|
val titles = getResources().getStringArray(R.array.kbdnav_lines)
|
||||||
|
val text = keys zip titles map { case (k, v) => "%s\t%s".format(k, v) } mkString("\n")
|
||||||
|
new AlertDialog.Builder(this).setTitle(R.string.kbdnav_title)
|
||||||
|
.setMessage(text)
|
||||||
|
.setIcon(android.R.drawable.ic_dialog_info)
|
||||||
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
|
.create.show
|
||||||
|
}
|
||||||
|
|
||||||
def setTitleStatus() {
|
def setTitleStatus() {
|
||||||
if (AprsService.link_error != 0) {
|
if (AprsService.link_error != 0) {
|
||||||
setTitle(getString(R.string.status_linkoff, getString(AprsService.link_error)))
|
setTitle(getString(R.string.status_linkoff, getString(AprsService.link_error)))
|
||||||
|
|
Ładowanie…
Reference in New Issue