Commit 1386b39b by YKai

feat:m-consultant组件升级

parent 99494151
...@@ -6,7 +6,7 @@ ext { ...@@ -6,7 +6,7 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.09", "m-confide" : "0.0.49.09",
"m-consultant" : "0.0.59.86", "m-consultant" : "0.0.59.87",
"m-fm" : "0.0.30.03", "m-fm" : "0.0.30.03",
"m-user" : "0.0.61.36", "m-user" : "0.0.61.36",
"m-home" : "0.0.22.66", "m-home" : "0.0.22.66",
...@@ -89,7 +89,7 @@ ext { ...@@ -89,7 +89,7 @@ ext {
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.09", "m-confide" : "0.0.49.09",
"m-consultant" : "0.0.59.86", "m-consultant" : "0.0.59.87",
"m-fm" : "0.0.30.01", "m-fm" : "0.0.30.01",
"m-user" : "0.0.61.36", "m-user" : "0.0.61.36",
"m-home" : "0.0.22.66", "m-home" : "0.0.22.66",
......
...@@ -599,7 +599,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -599,7 +599,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
} }
} }
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) { if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
...@@ -619,7 +619,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -619,7 +619,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
} }
} }
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) { if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
...@@ -639,7 +639,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -639,7 +639,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
} }
} }
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) { if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
...@@ -659,7 +659,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -659,7 +659,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
} }
} }
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) { if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
...@@ -975,7 +975,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -975,7 +975,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
filterPopupWindow.setOnDismissListener { filterPopupWindow.setOnDismissListener {
viewDim.visibility = View.INVISIBLE viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0 || !TextUtils.isEmpty( if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0 || !TextUtils.isEmpty(
allFilter.priceRanges?.minPrice allFilter.priceRanges?.minPrice
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice) ) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice)
) { ) {
...@@ -1134,18 +1134,25 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1134,18 +1134,25 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private fun filterLabelSet() { private fun filterLabelSet() {
if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) { if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
var text: String? = "" var text: String? = ""
if (allFilter.others.size == 1) { when {
text = allFilter.others[0].value allFilter.others.size == 1 -> {
} else if (allFilter.ages.size == 1) { text = allFilter.others[0].value
text = allFilter.ages[0].value }
} else if (allFilter.enquiries.size == 1) { allFilter.ages.size == 1 -> {
text = allFilter.enquiries[0].value text = allFilter.ages[0].value
} else if (allFilter.title.size == 1) { }
text = allFilter.title[0].value allFilter.enquiries.size == 1 -> {
}else if (allFilter.specialityCrowd.size==1){ text = allFilter.enquiries[0].value
text = allFilter.specialityCrowd[0].value }
} else { allFilter.title.size == 1 -> {
text = "筛选" text = allFilter.title[0].value
}
allFilter.specialityCrowd.size==1 -> {
text = allFilter.specialityCrowd[0].value
}
else -> {
text = "筛选"
}
} }
if (text?.length ?: 0 > 4) { if (text?.length ?: 0 > 4) {
tvFilter.text = text?.substring(0, 3) + "..." tvFilter.text = text?.substring(0, 3) + "..."
......
...@@ -4,9 +4,12 @@ import com.google.gson.annotations.SerializedName ...@@ -4,9 +4,12 @@ import com.google.gson.annotations.SerializedName
data class EnquiryItem( data class EnquiryItem(
@field:SerializedName("value") @field:SerializedName("value")
val value: String? = null, val value: String? = null,
@field:SerializedName("key") @field:SerializedName("key")
val key: Int? = null val key: Int? = null,
val checkRrl: String?,
val unCheckUrl: String?
) )
\ No newline at end of file
...@@ -13,6 +13,7 @@ import android.view.* ...@@ -13,6 +13,7 @@ import android.view.*
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.* import android.widget.*
import com.bumptech.glide.Glide
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
...@@ -57,7 +58,7 @@ class FilterPopupWindow( ...@@ -57,7 +58,7 @@ class FilterPopupWindow(
var onFilterConfirmListener: OnFilterConfirmListener? = null var onFilterConfirmListener: OnFilterConfirmListener? = null
/**筛选咨询方式一行数量*/ /**筛选咨询方式一行数量*/
private val enquirySize = 4; private val enquirySize = 4
private var dp5 = 0 private var dp5 = 0
private var dp10 = 0 private var dp10 = 0
...@@ -496,7 +497,9 @@ class FilterPopupWindow( ...@@ -496,7 +497,9 @@ class FilterPopupWindow(
private fun initEnquiryViews(view: View) { private fun initEnquiryViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, enquiry) in filterData.enquiry.withIndex()) { for ((index, enquiry) in filterData.enquiry.withIndex()) {
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView val llLayout = View.inflate(context, R.layout.consultant_method_item_filter, null)
val textView:TextView = llLayout.findViewById(R.id.tvFilterName)
val ivIcon:ImageView = llLayout.findViewById(R.id.iv_consultant_method)
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f)) val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f))
val marginNum = RxImageTool.dp2px(5f) val marginNum = RxImageTool.dp2px(5f)
params.setMargins( params.setMargins(
...@@ -505,28 +508,39 @@ class FilterPopupWindow( ...@@ -505,28 +508,39 @@ class FilterPopupWindow(
marginNum, marginNum,
0 0
) )
textView.layoutParams = params llLayout.layoutParams = params
textView.text = enquiry.value textView.text = enquiry.value
Glide.with(context)
.load(enquiry.unCheckUrl)
.into(ivIcon)
enquiryViews.add(textView) enquiryViews.add(view)
if (tempFilter.enquiries.contains(enquiry)) { if (tempFilter.enquiries.contains(enquiry)) {
textView.isSelected = true llLayout.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
Glide.with(context)
.load(enquiry.checkRrl)
.into(ivIcon)
} }
textView.setOnClickListener { llLayout.setOnClickListener {
if (llLayout.isSelected) {
if (textView.isSelected) {
tempFilter.enquiries.remove(enquiry) tempFilter.enquiries.remove(enquiry)
textView.isSelected = false llLayout.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
Glide.with(context)
.load(enquiry.unCheckUrl)
.into(ivIcon)
} else { } else {
tempFilter.enquiries.add(enquiry) tempFilter.enquiries.add(enquiry)
textView.isSelected = true llLayout.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
Glide.with(context)
.load(enquiry.checkRrl)
.into(ivIcon)
} }
updateCount(ConsultBIConstants.POSITION_CONSULT_TYPE_CLICK) updateCount(ConsultBIConstants.POSITION_CONSULT_TYPE_CLICK)
} }
view.flEnquiryType.addView(textView) view.flEnquiryType.addView(llLayout)
} }
} }
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:paddingBottom="10dp"></LinearLayout> android:paddingBottom="10dp"/>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginBottom="4dp"
android:background="@drawable/consultant_bg_search_filter_selector"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_consultant_method"
android:layout_width="@dimen/platform_dp_18"
android:layout_height="@dimen/platform_dp_18" />
<TextView
android:id="@+id/tvFilterName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:orientation="vertical"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/consultant_color_search_filter_selector"
android:textSize="13sp"
tools:text="当面" />
</LinearLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment