Commit 99e39eac by 霍志良

feat:UI修改

parent 2cc79821
...@@ -121,6 +121,7 @@ class FilterPopupWindow( ...@@ -121,6 +121,7 @@ class FilterPopupWindow(
} }
} }
@SuppressLint("UseCompatLoadingForDrawables")
private fun initShowSortViews(view: View) { private fun initShowSortViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, enquiry) in sortItems.withIndex()) { for ((index, enquiry) in sortItems.withIndex()) {
...@@ -140,21 +141,29 @@ class FilterPopupWindow( ...@@ -140,21 +141,29 @@ class FilterPopupWindow(
sortRangeViews.add(llTextView) sortRangeViews.add(llTextView)
if (enquiry == tempFilter.reorder) { if (enquiry == tempFilter.reorder) {
llTextView.isSelected = true llTextView.isSelected = true
llTextView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
llTextView.paint.isFakeBoldText = true llTextView.paint.isFakeBoldText = true
tempFilter.priceRangesView = llTextView tempFilter.priceRangesView = llTextView
} }
llTextView.setOnClickListener { llTextView.setOnClickListener {
if (llTextView != tempFilter.sortRangesView) { if (llTextView != tempFilter.sortRangesView) {
tempFilter.sortRangesView?.isSelected = false tempFilter.sortRangesView?.isSelected = false
tempFilter.sortRangesView?.background =
context.resources.getDrawable(R.drawable.consult_price_expert_unseleted)
tempFilter.sortRangesView?.paint?.isFakeBoldText = false tempFilter.sortRangesView?.paint?.isFakeBoldText = false
} }
if (llTextView.isSelected) { if (llTextView.isSelected) {
tempFilter.priceRanges = null tempFilter.priceRanges = null
llTextView.isSelected = false llTextView.isSelected = false
llTextView.background =
context.resources.getDrawable(R.drawable.consult_price_expert_unseleted)
llTextView.paint.isFakeBoldText = false llTextView.paint.isFakeBoldText = false
tempFilter.sortRangesView = null tempFilter.sortRangesView = null
} else { } else {
llTextView.isSelected = true llTextView.isSelected = true
llTextView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
llTextView.paint.isFakeBoldText = true llTextView.paint.isFakeBoldText = true
tempFilter.sortRangesView = llTextView tempFilter.sortRangesView = llTextView
tempFilter.reorder = sortItems[index] tempFilter.reorder = sortItems[index]
...@@ -406,6 +415,8 @@ class FilterPopupWindow( ...@@ -406,6 +415,8 @@ class FilterPopupWindow(
if (tempFilter.others.contains(other)) { if (tempFilter.others.contains(other)) {
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
textView.tvFilterName.text = " " + other.value + " " textView.tvFilterName.text = " " + other.value + " "
textView.setOnClickListener { textView.setOnClickListener {
...@@ -414,10 +425,14 @@ class FilterPopupWindow( ...@@ -414,10 +425,14 @@ class FilterPopupWindow(
tempFilter.others.remove(other) tempFilter.others.remove(other)
textView.isSelected = false textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
textView.background =
context.resources.getDrawable(R.drawable.consult_price_expert_unseleted)
} else { } else {
tempFilter.others.add(other) tempFilter.others.add(other)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
updateCount(ConsultBIConstants.POSITION_OTHER_CHOICE_CLICK) updateCount(ConsultBIConstants.POSITION_OTHER_CHOICE_CLICK)
} }
...@@ -441,6 +456,8 @@ class FilterPopupWindow( ...@@ -441,6 +456,8 @@ class FilterPopupWindow(
if (tempFilter.title.contains(other)) { if (tempFilter.title.contains(other)) {
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consultant_filter_expert_two_selected)
} }
textView.tvFilterName.text = " " + other.value + " " textView.tvFilterName.text = " " + other.value + " "
textView.setOnClickListener { textView.setOnClickListener {
...@@ -449,10 +466,14 @@ class FilterPopupWindow( ...@@ -449,10 +466,14 @@ class FilterPopupWindow(
tempFilter.title.remove(other) tempFilter.title.remove(other)
textView.isSelected = false textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
textView.background =
context.resources.getDrawable(R.drawable.consult_price_expert_unseleted)
} else { } else {
tempFilter.title.add(other) tempFilter.title.add(other)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consultant_filter_expert_two_selected)
} }
updateCount(ConsultBIConstants.POSITION_QUALIFICATION_CHOICE_CLICK) updateCount(ConsultBIConstants.POSITION_QUALIFICATION_CHOICE_CLICK)
} }
...@@ -496,6 +517,8 @@ class FilterPopupWindow( ...@@ -496,6 +517,8 @@ class FilterPopupWindow(
if (tempFilter.specialityCrowd.contains(item)) { if (tempFilter.specialityCrowd.contains(item)) {
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
textView.tvFilterName.text = " " + item.value + " " textView.tvFilterName.text = " " + item.value + " "
textView.setOnClickListener { textView.setOnClickListener {
...@@ -504,10 +527,14 @@ class FilterPopupWindow( ...@@ -504,10 +527,14 @@ class FilterPopupWindow(
tempFilter.specialityCrowd.remove(item) tempFilter.specialityCrowd.remove(item)
textView.isSelected = false textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
textView.background =
context.resources.getDrawable(R.drawable.consult_price_expert_unseleted)
} else { } else {
tempFilter.specialityCrowd.add(item) tempFilter.specialityCrowd.add(item)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
} }
...@@ -542,6 +569,8 @@ class FilterPopupWindow( ...@@ -542,6 +569,8 @@ class FilterPopupWindow(
if (tempFilter.ages.contains(age)) { if (tempFilter.ages.contains(age)) {
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
textView.text = " " + age.value + " " textView.text = " " + age.value + " "
textView.setOnClickListener { textView.setOnClickListener {
...@@ -550,10 +579,14 @@ class FilterPopupWindow( ...@@ -550,10 +579,14 @@ class FilterPopupWindow(
tempFilter.ages.remove(age) tempFilter.ages.remove(age)
textView.isSelected = false textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
textView.background =
context.resources.getDrawable(R.drawable.consult_price_expert_unseleted)
} else { } else {
tempFilter.ages.add(age) tempFilter.ages.add(age)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
updateCount(ConsultBIConstants.POSITION_AGE_CHOICE_CLICK) updateCount(ConsultBIConstants.POSITION_AGE_CHOICE_CLICK)
} }
...@@ -583,6 +616,8 @@ class FilterPopupWindow( ...@@ -583,6 +616,8 @@ class FilterPopupWindow(
if (tempFilter.doctorEdu.contains(edu)) { if (tempFilter.doctorEdu.contains(edu)) {
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
textView.text = " " + edu.value + " " textView.text = " " + edu.value + " "
textView.setOnClickListener { textView.setOnClickListener {
...@@ -591,10 +626,14 @@ class FilterPopupWindow( ...@@ -591,10 +626,14 @@ class FilterPopupWindow(
tempFilter.doctorEdu.remove(edu) tempFilter.doctorEdu.remove(edu)
textView.isSelected = false textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
textView.background =
context.resources.getDrawable(R.drawable.consult_price_expert_unseleted)
} else { } else {
tempFilter.doctorEdu.add(edu) tempFilter.doctorEdu.add(edu)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
textView.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
updateCount(ConsultBIConstants.POSITION_EDU_CHOICE_CLICK) updateCount(ConsultBIConstants.POSITION_EDU_CHOICE_CLICK)
} }
...@@ -629,6 +668,8 @@ class FilterPopupWindow( ...@@ -629,6 +668,8 @@ class FilterPopupWindow(
Glide.with(context) Glide.with(context)
.load(enquiry.check_url) .load(enquiry.check_url)
.into(ivIcon) .into(ivIcon)
llLayout.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
llLayout.setOnClickListener { llLayout.setOnClickListener {
if (llLayout.isSelected) { if (llLayout.isSelected) {
...@@ -638,6 +679,8 @@ class FilterPopupWindow( ...@@ -638,6 +679,8 @@ class FilterPopupWindow(
Glide.with(context) Glide.with(context)
.load(enquiry.un_check_url) .load(enquiry.un_check_url)
.into(ivIcon) .into(ivIcon)
llLayout.background =
context.resources.getDrawable(R.drawable.consult_price_expert_unseleted)
} else { } else {
tempFilter.enquiries.add(enquiry) tempFilter.enquiries.add(enquiry)
llLayout.isSelected = true llLayout.isSelected = true
...@@ -645,6 +688,8 @@ class FilterPopupWindow( ...@@ -645,6 +688,8 @@ class FilterPopupWindow(
Glide.with(context) Glide.with(context)
.load(enquiry.check_url) .load(enquiry.check_url)
.into(ivIcon) .into(ivIcon)
llLayout.background =
context.resources.getDrawable(R.drawable.consult_filter_four_selected)
} }
updateCount(ConsultBIConstants.POSITION_CONSULT_TYPE_CLICK) updateCount(ConsultBIConstants.POSITION_CONSULT_TYPE_CLICK)
} }
......
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