fix:修复反馈-bug

This commit is contained in:
max
2024-07-03 19:40:59 +08:00
parent 2af7cec8dd
commit 495bae0d00
6 changed files with 24 additions and 43 deletions

View File

@@ -1,21 +1,34 @@
package com.chwl.app.ui.feedback
import android.annotation.SuppressLint
import android.view.Gravity
import android.view.ViewGroup
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chwl.app.R
import com.example.lib_utils.AppUtils
import com.example.lib_utils.UiUtils
class CustomerServiceItemAdapter :
BaseQuickAdapter<Map.Entry<String, String?>, BaseViewHolder>(R.layout.feedback_customer_service_item) {
private var isRTL = UiUtils.isRtl(AppUtils.getApp())
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
return super.onCreateViewHolder(parent, viewType).apply {
this.addOnClickListener(R.id.layout_copy)
val textView = getView<TextView>(R.id.tv_content)
if (isRTL) {
textView.gravity = Gravity.RIGHT
}
}
}
@SuppressLint("SetTextI18n")
override fun convert(helper: BaseViewHolder, item: Map.Entry<String, String?>) {
helper.setText(R.id.tv_content, "${item.key}: ${item.value ?: ""}")
val textView = helper.getView<TextView>(R.id.tv_content)
textView.text = "${item.key}: ${item.value ?: ""}"
}
}

View File

@@ -90,6 +90,10 @@ class FeedbackActivity : BaseViewBindingActivity<FeedbackActivityBinding>(),
refreshSubmitState()
true
}
binding.etContact.setOnInputChangedListener {
refreshSubmitState()
true
}
}
private fun initObserve() {
@@ -181,6 +185,9 @@ class FeedbackActivity : BaseViewBindingActivity<FeedbackActivityBinding>(),
if (binding.etContent.text.isNullOrEmpty()) {
return false
}
if (binding.etContact.text.isNullOrEmpty()) {
return false
}
if (adapter.getSelectItem() == null) {
return false
}

View File

@@ -132,41 +132,17 @@
app:layout_constraintBottom_toBottomOf="@id/et_content"
app:layout_constraintEnd_toEndOf="@id/et_content" />
<TextView
android:id="@+id/tv_image_title_prefix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_23"
android:text="*"
android:textColor="#EB5C2C"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_type_title_prefix"
app:layout_constraintTop_toBottomOf="@id/et_content" />
<TextView
android:id="@+id/tv_image_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_23"
android:text="@string/feedback_image_title"
android:textColor="#000000"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_image_title_prefix"
app:layout_constraintStart_toEndOf="@id/tv_image_title_prefix"
app:layout_constraintTop_toTopOf="@id/tv_image_title_prefix" />
<TextView
android:id="@+id/tv_image_title_optional"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/feedback_optional"
android:textColor="#A7ACB3"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_image_title_prefix"
app:layout_constraintStart_toEndOf="@id/tv_image_title"
app:layout_constraintTop_toTopOf="@id/tv_image_title_prefix" />
app:layout_constraintStart_toStartOf="@id/tv_type_title_prefix"
app:layout_constraintTop_toBottomOf="@id/et_content" />
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_image"
@@ -205,18 +181,6 @@
app:layout_constraintStart_toEndOf="@id/tv_contact_title_prefix"
app:layout_constraintTop_toTopOf="@id/tv_contact_title_prefix" />
<TextView
android:id="@+id/tv_contact_title_optional"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/feedback_optional"
android:textColor="#A7ACB3"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_contact_title_prefix"
app:layout_constraintStart_toEndOf="@id/tv_contact_title"
app:layout_constraintTop_toTopOf="@id/tv_contact_title_prefix" />
<EditText
android:id="@+id/et_contact"
android:layout_width="match_parent"

View File

@@ -5320,7 +5320,6 @@
<string name="feedback_content_title">صف المشكلة</string>
<string name="feedback_image_title">تحميل لقطة شاشة</string>
<string name="feedback_contact_title">وسيلة تواصل</string>
<string name="feedback_optional">&#160;(اختياري)</string>
<string name="feedback_content_hint">من فضلك ادخل</string>
<string name="feedback_contact_hint"> رقم الهاتف او البريد الالكتروني</string>

View File

@@ -5260,7 +5260,6 @@
<string name="feedback_content_title">問題描述</string>
<string name="feedback_image_title">上傳截圖</string>
<string name="feedback_contact_title">聯係方式</string>
<string name="feedback_optional">(可選)</string>
<string name="feedback_content_hint">請輸入…</string>
<string name="feedback_contact_hint">手機號或郵箱</string>
</resources>

View File

@@ -5300,7 +5300,6 @@ You cannot join again within 24 hours after leaving</string>
<string name="feedback_content_title">Describe the problem</string>
<string name="feedback_image_title">Upload screenshot</string>
<string name="feedback_contact_title">Contact information</string>
<string name="feedback_optional">&#160;(Optional)</string>
<string name="feedback_content_hint">Please enter...</string>
<string name="feedback_contact_hint">Mobile phone number or email</string>