changeset 2676:a43cf048ff17

Android: Fix what I thought was a MLE layout issue... but it turns out the method I had been using to disable editing on an MLE, caused it to layout the text differently. So instead of changing the inputType... we set the isFocusable property instead. If the MLE can't be focused, it can't be edited. Word wrapping is still broken though, committing a few scrollbar settings changes in an attempt to fix that, but it is still broken.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 21 Oct 2021 18:53:35 +0000
parents a7868380098f
children c90b2d7057c8
files android/DWindows.kt
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/android/DWindows.kt	Tue Oct 19 11:01:16 2021 +0000
+++ b/android/DWindows.kt	Thu Oct 21 18:53:35 2021 +0000
@@ -1952,11 +1952,13 @@
             mle!!.tag = dataArrayMap
             mle!!.id = cid
             mle!!.isSingleLine = false
+            mle!!.maxLines = Integer.MAX_VALUE
             mle!!.imeOptions = EditorInfo.IME_FLAG_NO_ENTER_ACTION
             mle!!.inputType = (InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE)
             mle!!.isVerticalScrollBarEnabled = true
             mle!!.scrollBarStyle = View.SCROLLBARS_INSIDE_INSET
             mle!!.setHorizontallyScrolling(true)
+            mle!!.isHorizontalScrollBarEnabled = true
             mle!!.gravity = Gravity.TOP or Gravity.LEFT
         }
         return mle
@@ -1967,8 +1969,10 @@
         waitOnUiThread {
             if (state != 0) {
                 mle.setHorizontallyScrolling(false)
+                mle.isHorizontalScrollBarEnabled = false
             } else {
                 mle.setHorizontallyScrolling(true)
+                mle.isHorizontalScrollBarEnabled = true
             }
         }
     }
@@ -1976,11 +1980,7 @@
     fun mleSetEditable(mle: EditText, state: Int)
     {
         waitOnUiThread {
-            if (state != 0) {
-                mle.inputType = (InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE)
-            } else {
-                mle.inputType = InputType.TYPE_NULL
-            }
+            mle.isFocusable = state != 0
         }
     }