Commit 1386b39b by YKai

feat:m-consultant组件升级

parent 99494151
......@@ -6,7 +6,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"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-user" : "0.0.61.36",
"m-home" : "0.0.22.66",
......@@ -89,7 +89,7 @@ ext {
//第三步 若干
"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-user" : "0.0.61.36",
"m-home" : "0.0.22.66",
......
......@@ -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)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -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)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -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)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -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)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -975,7 +975,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
filterPopupWindow.setOnDismissListener {
viewDim.visibility = View.INVISIBLE
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
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice)
) {
......@@ -1134,18 +1134,25 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private fun filterLabelSet() {
if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
var text: String? = ""
if (allFilter.others.size == 1) {
text = allFilter.others[0].value
} else if (allFilter.ages.size == 1) {
text = allFilter.ages[0].value
} else if (allFilter.enquiries.size == 1) {
text = allFilter.enquiries[0].value
} else if (allFilter.title.size == 1) {
text = allFilter.title[0].value
}else if (allFilter.specialityCrowd.size==1){
text = allFilter.specialityCrowd[0].value
} else {
text = "筛选"
when {
allFilter.others.size == 1 -> {
text = allFilter.others[0].value
}
allFilter.ages.size == 1 -> {
text = allFilter.ages[0].value
}
allFilter.enquiries.size == 1 -> {
text = allFilter.enquiries[0].value
}
allFilter.title.size == 1 -> {
text = allFilter.title[0].value
}
allFilter.specialityCrowd.size==1 -> {
text = allFilter.specialityCrowd[0].value
}
else -> {
text = "筛选"
}
}
if (text?.length ?: 0 > 4) {
tvFilter.text = text?.substring(0, 3) + "..."
......
......@@ -4,9 +4,12 @@ import com.google.gson.annotations.SerializedName
data class EnquiryItem(
@field:SerializedName("value")
val value: String? = null,
@field:SerializedName("value")
val value: String? = null,
@field:SerializedName("key")
val key: Int? = null
@field:SerializedName("key")
val key: Int? = null,
val checkRrl: String?,
val unCheckUrl: String?
)
\ No newline at end of file
......@@ -13,6 +13,7 @@ import android.view.*
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.*
import com.bumptech.glide.Glide
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
......@@ -57,7 +58,7 @@ class FilterPopupWindow(
var onFilterConfirmListener: OnFilterConfirmListener? = null
/**筛选咨询方式一行数量*/
private val enquirySize = 4;
private val enquirySize = 4
private var dp5 = 0
private var dp10 = 0
......@@ -496,7 +497,9 @@ class FilterPopupWindow(
private fun initEnquiryViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
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 marginNum = RxImageTool.dp2px(5f)
params.setMargins(
......@@ -505,28 +508,39 @@ class FilterPopupWindow(
marginNum,
0
)
textView.layoutParams = params
llLayout.layoutParams = params
textView.text = enquiry.value
Glide.with(context)
.load(enquiry.unCheckUrl)
.into(ivIcon)
enquiryViews.add(textView)
enquiryViews.add(view)
if (tempFilter.enquiries.contains(enquiry)) {
textView.isSelected = true
llLayout.isSelected = true
textView.paint.isFakeBoldText = true
Glide.with(context)
.load(enquiry.checkRrl)
.into(ivIcon)
}
textView.setOnClickListener {
if (textView.isSelected) {
llLayout.setOnClickListener {
if (llLayout.isSelected) {
tempFilter.enquiries.remove(enquiry)
textView.isSelected = false
llLayout.isSelected = false
textView.paint.isFakeBoldText = false
Glide.with(context)
.load(enquiry.unCheckUrl)
.into(ivIcon)
} else {
tempFilter.enquiries.add(enquiry)
textView.isSelected = true
llLayout.isSelected = true
textView.paint.isFakeBoldText = true
Glide.with(context)
.load(enquiry.checkRrl)
.into(ivIcon)
}
updateCount(ConsultBIConstants.POSITION_CONSULT_TYPE_CLICK)
}
view.flEnquiryType.addView(textView)
view.flEnquiryType.addView(llLayout)
}
}
......
......@@ -75,7 +75,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingBottom="10dp"></LinearLayout>
android:paddingBottom="10dp"/>
<View
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