allow entering minus and nothing (same as 0)

This commit is contained in:
Helium314 2025-01-05 18:36:47 +01:00
parent f7c694bfe0
commit 044f6dd81c
2 changed files with 3 additions and 3 deletions

View file

@ -262,14 +262,14 @@ private fun toolbarKeyCustomizer(context: Context, key: ToolbarKey) {
layout.findViewById<EditText>(R.id.toolbar_key_code)?.apply {
setText(getCodeForToolbarKey(key).toString())
doAfterTextChanged {
keyCode = it?.toString()
keyCode = it?.toString()?.ifEmpty { "0" }
checkOk()
}
}
layout.findViewById<EditText>(R.id.toolbar_key_longpress_code)?.apply {
setText(getCodeForToolbarKeyLongClick(key).toString())
doAfterTextChanged {
longpressCode = it?.toString()
longpressCode = it?.toString()?.ifEmpty { "0" }
checkOk()
}
}

View file

@ -18,7 +18,7 @@
android:id="@+id/toolbar_key_code"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:inputType="number"
android:inputType="numberSigned"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout