mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-22 23:29:10 +00:00
clarify error messages when layout can't be saved, see #887
This commit is contained in:
parent
0b9fb7334d
commit
5b7f4dae4c
1 changed files with 18 additions and 6 deletions
|
@ -114,16 +114,28 @@ private fun checkKeys(keys: List<List<Key.KeyParams>>): Boolean {
|
||||||
Log.w(TAG, "too many keys in one row")
|
Log.w(TAG, "too many keys in one row")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (keys.any { row -> row.any { ((it.mLabel?.length ?: 0) > 20) } }) {
|
if (keys.any { row -> row.any {
|
||||||
Log.w(TAG, "too long text on key")
|
if ((it.mLabel?.length ?: 0) > 20) {
|
||||||
|
Log.w(TAG, "too long text on key: ${it.mLabel}")
|
||||||
|
true
|
||||||
|
} else false
|
||||||
|
} }) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (keys.any { row -> row.any { (it.mPopupKeys?.size ?: 0) > 20 } }) {
|
if (keys.any { row -> row.any {
|
||||||
Log.w(TAG, "too many popup keys on a key")
|
if ((it.mPopupKeys?.size ?: 0) > 20) {
|
||||||
|
Log.w(TAG, "too many popup keys on key ${it.mLabel}")
|
||||||
|
true
|
||||||
|
} else false
|
||||||
|
} }) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (keys.any { row -> row.any { it.mPopupKeys?.any { popupKey -> (popupKey.mLabel?.length ?: 0) > 10 } == true } }) {
|
if (keys.any { row -> row.any { true == it.mPopupKeys?.any { popupKey ->
|
||||||
Log.w(TAG, "too long text on popup key")
|
if ((popupKey.mLabel?.length ?: 0) > 10) {
|
||||||
|
Log.w(TAG, "too long text on popup key: ${popupKey.mLabel}")
|
||||||
|
true
|
||||||
|
} else false
|
||||||
|
} } }) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Add table
Reference in a new issue