|
|
@@ -6,7 +6,6 @@ import android.text.Editable
|
|
|
import android.text.TextWatcher
|
|
|
import android.view.KeyEvent
|
|
|
import android.view.MotionEvent
|
|
|
-import android.view.View
|
|
|
import android.view.inputmethod.EditorInfo
|
|
|
import android.widget.TextView
|
|
|
import android.widget.TextView.OnEditorActionListener
|
|
|
@@ -158,17 +157,6 @@ class SessionBottomInputComp(
|
|
|
return true
|
|
|
}
|
|
|
})
|
|
|
- inputBar.etInputMessage.onFocusChangeListener = object : View.OnFocusChangeListener {
|
|
|
- override fun onFocusChange(v: View?, hasFocus: Boolean) {
|
|
|
- //多窗口模式
|
|
|
- if (activity.isMultiWindowMode()) {
|
|
|
- if (hasFocus) {
|
|
|
- //获取焦点
|
|
|
- sessionInputViewModel.execute(InputAction.CLICK_INPUT)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
inputBar.etInputMessage.addTextChangedListener(object : TextWatcher {
|
|
|
override fun beforeTextChanged(
|
|
|
s: CharSequence?,
|
|
|
@@ -176,7 +164,6 @@ class SessionBottomInputComp(
|
|
|
count: Int,
|
|
|
after: Int
|
|
|
) {
|
|
|
- inputContent = s?.toString()
|
|
|
}
|
|
|
|
|
|
override fun onTextChanged(
|
|
|
@@ -335,7 +322,8 @@ class SessionBottomInputComp(
|
|
|
//处理非全屏窗口底部输入栏
|
|
|
sessionInputViewModel.bottomImeVisibleLD.observe(viewLifecycleOwner) { visible ->
|
|
|
if (!activity.isMultiWindowMode() && !visible) {
|
|
|
- if (sessionInputViewModel.inputStateLD.value?.currentState != InputState.STATE_NONE) {
|
|
|
+ val currentState = sessionInputViewModel.inputStateLD.value?.currentState
|
|
|
+ if (currentState != null && !currentState.isInTextEditMode() && currentState != InputState.STATE_NONE) {
|
|
|
sessionInputViewModel.execute(InputAction.EMPTY_CLICKED)
|
|
|
}
|
|
|
}
|