Commit a82638ea by 霍志良

feat:部分修改

parent 725a4ed9
......@@ -1086,6 +1086,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tempFilter.showType = allFilter.showType
tempFilter.ages.clear()
tempFilter.ages.addAll(allFilter.ages)
//排序
tempFilter.sorStyle.clear()
tempFilter.sorStyle.addAll(allFilter.sorStyle)
//学历
tempFilter.doctorEdu.clear()
tempFilter.doctorEdu.addAll(allFilter.doctorEdu)
......@@ -1105,13 +1108,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
filterPopupWindow.setOnDismissListener {
viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0 || !TextUtils.isEmpty(
if (allFilter.others.size + allFilter.enquiries.size + allFilter.sorStyle.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0 || !TextUtils.isEmpty(
allFilter.priceRanges?.min_price
) || !TextUtils.isEmpty(allFilter.priceRanges?.max_price)
) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
updateFilterRightTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
updateFilterRightTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
}
ConsultAssistantDialogUtils.INSTANCE.fitRequest(this, "doctor_list", true)
}
......@@ -1119,7 +1122,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
filterPopupWindow.showAsDropDown(viewSep2)
ConsultAssistantDialogUtils.INSTANCE.hideAssistantActivity()
filterPopupWindow.onFilterConfirmListener = this
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
updateFilterRightTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
viewDim.visibility = View.VISIBLE
} else {
ToastUtil.toastShort("数据初始化失败,请重试")
......@@ -1165,6 +1168,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter.enquiries.addAll(tempFilter.enquiries)
allFilter.ages.clear()
allFilter.ages.addAll(tempFilter.ages)
//排序
allFilter.sorStyle.clear()
allFilter.sorStyle.addAll(tempFilter.sorStyle)
//学历
allFilter.doctorEdu.clear()
allFilter.doctorEdu.addAll(tempFilter.doctorEdu)
......@@ -1417,7 +1424,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
updateFilterTextViewStatus(tvArea, FILTER_STATUS_OPEN)
regionPopupWindow.setOnDismissListener {
viewDim.visibility = View.INVISIBLE
if (tvArea.text != "地区") {
if (tvArea.text != "城市") {
updateFilterTextViewStatus(tvArea, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL)
......@@ -1430,7 +1437,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter.region = region
allFilter.sub = sub
if (TextUtils.isEmpty(region.code) && TextUtils.isEmpty(sub.code)) {
tvArea.text = "地区"
tvArea.text = "城市"
} else if (!TextUtils.isEmpty(region.code) && !TextUtils.isEmpty(sub.code)) {
if (region.value?.length ?: 0 > 4) {
tvArea.text = region.value?.substring(0, 3) + "..."
......@@ -1557,6 +1564,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter.sub = SubItem()
allFilter.enquiries.clear()
allFilter.ages.clear()
allFilter.sorStyle.clear()
allFilter.doctorEdu.clear()
allFilter.others.clear()
updateFilterTextViewStatus(tvSubject, FILTER_STATUS_NORMAL)
......@@ -1572,11 +1580,46 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
//设置筛选点击按钮状态
private fun updateFilterTextViewStatus(tv: TextView, status: Int) {
when (status) {
FILTER_STATUS_NORMAL -> {
tv.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp,
0
)
}
FILTER_STATUS_FILTERED -> {
tv.typeface = Typeface.DEFAULT_BOLD
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_main_theme))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp,
0
)
}
FILTER_STATUS_OPEN -> {
tv.typeface = Typeface.DEFAULT_BOLD
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_arrow_drop_down_en,
0
)
}
}
}
//设置筛选点击按钮状态
private fun updateFilterRightTextViewStatus(tv: TextView, status: Int) {
when (status) {
FILTER_STATUS_NORMAL -> {
tv.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
......@@ -1591,7 +1634,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.filter_up_grey,
R.drawable.filter_down_blue,
0
)
}
......
......@@ -566,7 +566,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
hasSelectedArea = true
} else {
allFilter.region = RegionItem()
tvArea.text = "地区"
tvArea.text = "城市"
updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL)
hasSelectedArea = false
......@@ -730,7 +730,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter.region = RegionItem()
allFilter.sub = SubItem("不限", null)
tvArea.text = "地区"
tvArea.text = "城市"
updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL)
hasSelectedArea = false
......@@ -991,6 +991,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tempFilter.showType = allFilter.showType
tempFilter.ages.clear()
tempFilter.ages.addAll(allFilter.ages)
//排序
tempFilter.sorStyle.clear()
tempFilter.sorStyle.addAll(allFilter.sorStyle)
//学历
tempFilter.doctorEdu.clear()
tempFilter.doctorEdu.addAll(allFilter.doctorEdu)
......@@ -1010,13 +1013,13 @@ 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.doctorEdu.size + allFilter.title.size + allFilter.specialityCrowd.size > 0 || !TextUtils.isEmpty(
if (allFilter.others.size + allFilter.enquiries.size + allFilter.sorStyle.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size + allFilter.specialityCrowd.size > 0 || !TextUtils.isEmpty(
allFilter.priceRanges?.min_price
) || !TextUtils.isEmpty(allFilter.priceRanges?.max_price)
) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
updateFilterRightTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
updateFilterRightTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
}
showConsultAssistantDialog()
}
......@@ -1024,7 +1027,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
filterPopupWindow.showAsDropDown(viewSep2)
hideConsultAssistantDialog()
filterPopupWindow.onFilterConfirmListener = this
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
updateFilterRightTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
viewDim.visibility = View.VISIBLE
} else {
ToastUtil.toastShort("数据初始化失败,请重试")
......@@ -1062,6 +1065,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter.showType = tempFilter.showType
allFilter.enquiries.clear()
allFilter.enquiries.addAll(tempFilter.enquiries)
//排序
allFilter.sorStyle.clear()
allFilter.sorStyle.addAll(tempFilter.sorStyle)
allFilter.ages.clear()
allFilter.ages.addAll(tempFilter.ages)
allFilter.doctorEdu.clear()
......@@ -1298,7 +1305,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
updateFilterTextViewStatus(tvArea, FILTER_STATUS_OPEN)
regionPopupWindow.setOnDismissListener {
viewDim.visibility = View.INVISIBLE
if (tvArea.text != "地区") {
if (tvArea.text != "城市") {
updateFilterTextViewStatus(tvArea, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL)
......@@ -1311,7 +1318,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter.region = region
allFilter.sub = sub
if (TextUtils.isEmpty(region.code) && TextUtils.isEmpty(sub.code)) {
tvArea.text = "地区"
tvArea.text = "城市"
} else if (!TextUtils.isEmpty(region.code) && !TextUtils.isEmpty(sub.code)) {
if (region.value?.length ?: 0 > 4) {
tvArea.text = region.value?.substring(0, 3) + "..."
......@@ -1455,7 +1462,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
rvExperts.scrollToPosition(0)
}
//设置筛选点击按钮状态
private fun updateFilterTextViewStatus(tv: TextView, status: Int) {
when (status) {
FILTER_STATUS_NORMAL -> {
......@@ -1464,6 +1470,42 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp,
0
)
}
FILTER_STATUS_FILTERED -> {
tv.typeface = Typeface.DEFAULT_BOLD
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_main_theme))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp,
0
)
}
FILTER_STATUS_OPEN -> {
tv.typeface = Typeface.DEFAULT_BOLD
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_arrow_drop_down_en,
0
)
}
}
}
//设置筛选点击按钮状态
private fun updateFilterRightTextViewStatus(tv: TextView, status: Int) {
when (status) {
FILTER_STATUS_NORMAL -> {
tv.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.filter_up_grey,
0
)
......
......@@ -20,6 +20,7 @@ data class AllFilter(
var priceRangesView: TextView? = null, //服务均价
var sortRangesView: TextView? = null, //排序均价
val ages: ArrayList<AgeItem> = ArrayList(), //年龄
val sorStyle: ArrayList<ReorderItem> = ArrayList(), //排序方式
val doctorEdu: ArrayList<DoctorEduItem> = ArrayList(), //学历
val others: ArrayList<OtherItem> = ArrayList(),//其他筛选
......@@ -29,7 +30,7 @@ data class AllFilter(
// 八大类标签集合
val childList: ArrayList<ChildrenBean> = ArrayList(), // 亲子教育
val stressList: ArrayList<ChildrenBean> = ArrayList(), // 情绪压力
val loveEmotionList:ArrayList<ChildrenBean> = ArrayList(), // 恋爱情感
val loveEmotionList: ArrayList<ChildrenBean> = ArrayList(), // 恋爱情感
val marriedFamilyList:ArrayList<ChildrenBean> = ArrayList(), // 婚姻家庭
val personalGrowthList:ArrayList<ChildrenBean> = ArrayList(), // 个人成长
val interpersonalRelationshipList:ArrayList<ChildrenBean> = ArrayList(), // 人际关系
......
......@@ -154,6 +154,7 @@ class FilterPopupWindow(
tempFilter.sortRangesView?.paint?.isFakeBoldText = false
}
if (llTextView.isSelected) {
tempFilter.sorStyle.remove(enquiry)
tempFilter.priceRanges = null
llTextView.isSelected = false
llTextView.background =
......@@ -161,6 +162,7 @@ class FilterPopupWindow(
llTextView.paint.isFakeBoldText = false
tempFilter.sortRangesView = null
} else {
tempFilter.sorStyle.add(enquiry)
llTextView.isSelected = true
llTextView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
......
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