Forráskód Böngészése

feat: 一些ui fix

DoggyZhang 2 hete
szülő
commit
ab751fa98f

+ 2 - 2
app/dependencies/releaseRuntimeClasspath.txt

@@ -233,7 +233,7 @@ com.wenext.android:frame-aab:6.0.3
 com.wenext.android:frame-apm:6.0.1
 com.wenext.android:frame-audio:6.0.0
 com.wenext.android:frame-base:6.0.4
-com.wenext.android:frame-bom:6.2.18
+com.wenext.android:frame-bom:6.2.19
 com.wenext.android:frame-coroutine:6.0.0
 com.wenext.android:frame-crash:6.0.1
 com.wenext.android:frame-data:6.0.0
@@ -261,7 +261,7 @@ com.wenext.android:frame-spi:6.0.0
 com.wenext.android:frame-startup:6.0.2
 com.wenext.android:frame-statistics:6.1.4
 com.wenext.android:frame-storage:6.0.7
-com.wenext.android:frame-util:6.0.10
+com.wenext.android:frame-util:6.0.11
 com.wenext.android:frame-zero:6.0.0
 com.wenext.android:retrofit:6.0.0
 com.wenext.android:zxing:6.1.0

+ 2 - 14
module/im/src/main/java/com/adealink/weparty/im/session/comp/SessionBottomInputComp.kt

@@ -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)
                 }
             }

+ 5 - 1
module/im/src/main/java/com/adealink/weparty/im/session/comp/input/SessionInputMachine.kt

@@ -30,7 +30,11 @@ enum class InputState(val priority: Int) {
     STATE_SOFT_INPUT(1),
     STATE_EMOJI_INPUT(1),
     STATE_AUDIO_INPUT(1),
-    STATE_IMAGE_INPUT(2),
+    STATE_IMAGE_INPUT(2);
+
+    fun isInTextEditMode(): Boolean {
+        return this == STATE_SOFT_INPUT || this == STATE_EMOJI_INPUT
+    }
 }
 
 class SessionInputMachine(

+ 1 - 0
module/playmate/src/main/java/com/adealink/weparty/playmate/saywelcome/fragment/WelcomeAddTextFragment.kt

@@ -83,6 +83,7 @@ class WelcomeAddTextFragment : BaseFragment(R.layout.fragment_playmate_welcome_a
                 updateSubmitButton()
             }
         })
+        binding.tvInputLength.text = "${(binding.tvInputLength.text?.length ?: 0)}/${PLAYMATE_WELCOME_TEXT_MAX_LENGTH}"
         binding.btnSubmit.isEnabled = false
         binding.btnSubmit.onClick {
             submit()