Move SSD dropdown height clamp to typed Kotlin
ober
199e653f7915cb2f290bf29655395ad6b6c232a1
--- a/templates/ssd-review.ss +++ b/templates/ssd-review.ss @@ -3667,7 +3667,8 @@ formatActivityDuration groupDisplayLabel appendModeStatus selectedGroupStatus sessionCountsStatus rotatedPageStatus manualGroupLabel manualCellCount editedGroupCount - clampPageIndex shiftPageIndex displayGroupCanvasLabel) + clampPageIndex shiftPageIndex displayGroupCanvasLabel + dropdownHeight) (type Int32) (def (normalizeFiringArc (value : String)) : String (string-uppercase (string-trim value))) @@ -3796,6 +3797,11 @@ (if (> count (int32 400)) (int32 400) count))) + (def (dropdownHeight (screenHeight : Int32)) : Int32 + (let ((third (/ screenHeight (int32 3)))) + (if (> third (int32 620)) + (int32 620) + third))) (def (editedGroupCount (count : (Nullable Int32)) (fallback : Int32)) : Int32 (if (nullable-null? count) @@ -4922,7 +4928,7 @@ " }" "" " private fun focusBoxTypeDropdown(dialog: AlertDialog, boxType: AutoCompleteTextView) {" - " boxType.dropDownHeight = (resources.displayMetrics.heightPixels / 3).coerceAtMost(620)" + " boxType.dropDownHeight = dropdownHeight(resources.displayMetrics.heightPixels)" " dialog.window?.setSoftInputMode(" " android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE or" " android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE"