Преглед изворни кода

优化焦点导致的操作问题

Frankensteinly пре 1 година
родитељ
комит
2465a069fc

+ 6 - 6
app/src/main/java/com/grkj/iscs/widget/SelectableInput.kt

@@ -64,10 +64,14 @@ class SelectableInput(private val ctx: Context, attrs: AttributeSet) : LinearLay
                     showDropdown()
                 }
             }
+
+            mBinding.et.setOnTouchListener { view, _ ->
+                view.requestFocus()
+                return@setOnTouchListener false
+            }
         } else {
 
             mBinding.et.background = AppCompatResources.getDrawable(ctx, R.drawable.selectable_input_text_bg)
-            mBinding.et.isEnabled = true
 
 //            btnDropdown.visibility = View.GONE
 //            btnDropdown.setOnClickListener(null)
@@ -120,11 +124,7 @@ class SelectableInput(private val ctx: Context, attrs: AttributeSet) : LinearLay
             }
         }
 
-        if (mPopWindow?.isShowing == false) {
-            mPopWindow?.showAsDropDown(mBinding.et)
-        } else {
-            mPopWindow?.dismiss()
-        }
+        mPopWindow?.showAsDropDown(mBinding.et)
     }
 
     fun setOnSpinnerSelectListener(onSpinnerSelectListener: OnSpinnerSelectListener) {

+ 1 - 0
app/src/main/res/layout/activity_presentation.xml

@@ -9,6 +9,7 @@
     android:paddingHorizontal="100px"
     android:paddingTop="100px"
     android:scrollbars="none"
+    android:overScrollMode="never"
     tools:context=".presentation.PresentationActivity">
 
     <LinearLayout