Commit c02301ce by 霍志良

feat:BUG修改

parent f150bf14
...@@ -14,7 +14,7 @@ buildscript { ...@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3' ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2' constrait_support_version = '1.0.2'
componentVersion = "0.3.0.17-SNAPSHOT" componentVersion = "0.3.0.20-SNAPSHOT"
} }
repositories { repositories {
mavenCentral() mavenCentral()
......
...@@ -21,7 +21,6 @@ import androidx.core.content.ContextCompat ...@@ -21,7 +21,6 @@ import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.google.android.material.appbar.AppBarLayout import com.google.android.material.appbar.AppBarLayout
...@@ -126,6 +125,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -126,6 +125,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private const val FILTER_STATUS_NORMAL = 0 //默认筛选状态 private const val FILTER_STATUS_NORMAL = 0 //默认筛选状态
private const val FILTER_STATUS_FILTERED = 1 //非默认筛选状态 private const val FILTER_STATUS_FILTERED = 1 //非默认筛选状态
private const val FILTER_STATUS_OPEN = 2 //筛选窗打开状态 private const val FILTER_STATUS_OPEN = 2 //筛选窗打开状态
private const val CONST_CITY = "城市"
const val FROM_ONLINE_EXPERT = 2 const val FROM_ONLINE_EXPERT = 2
fun newIntent( fun newIntent(
...@@ -397,11 +397,14 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -397,11 +397,14 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
initCategory = mIntent.getStringExtra(EXTRA_CATEGORY) ?: "" initCategory = mIntent.getStringExtra(EXTRA_CATEGORY) ?: ""
initShowType = mIntent.getIntExtra(EXTRA_SHOW_TYPE, 0) initShowType = mIntent.getIntExtra(EXTRA_SHOW_TYPE, 0)
//首页金刚位传递过来的动态Map参数 //首页金刚位传递过来的动态Map参数
mapFilter = mIntent.getSerializableExtra(GO_CRITERIA) as HashMap<String, Any> if (mIntent.getSerializableExtra(GO_CRITERIA) != null) {
initCategory = mIntent.getStringExtra("cateId") mapFilter = mIntent.getSerializableExtra(GO_CRITERIA) as HashMap<String, Any>
cateName = mIntent.getStringExtra("cateTitle") }
mSign2 = cateName!! initCategory = mIntent.getStringExtra("cateId") ?: ""
initShowType = mIntent.getStringExtra("showType").toInt() if (mIntent.getStringExtra("cateTitle") != null) {
cateName = mIntent.getStringExtra("cateTitle")
}
mSign2 = cateName.toString()
val relatedWord = mIntent.getStringExtra(EXTRA_RELATED_WORD) // 搜索内容的联想词 val relatedWord = mIntent.getStringExtra(EXTRA_RELATED_WORD) // 搜索内容的联想词
searchWord = mIntent.getStringExtra(EXTRA_SEARCH_WORD) searchWord = mIntent.getStringExtra(EXTRA_SEARCH_WORD)
val isRecommendWords = mIntent.getBooleanExtra(EXTRA_IS_RECCOMMEND_WORD, false) val isRecommendWords = mIntent.getBooleanExtra(EXTRA_IS_RECCOMMEND_WORD, false)
...@@ -1427,7 +1430,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1427,7 +1430,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
updateFilterTextViewStatus(tvArea, FILTER_STATUS_OPEN) updateFilterTextViewStatus(tvArea, FILTER_STATUS_OPEN)
regionPopupWindow.setOnDismissListener { regionPopupWindow.setOnDismissListener {
viewDim.visibility = View.INVISIBLE viewDim.visibility = View.INVISIBLE
if (tvArea.text != "城市") { if (tvArea.text != CONST_CITY) {
updateFilterTextViewStatus(tvArea, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvArea, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL)
...@@ -1440,7 +1443,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1440,7 +1443,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter.region = region allFilter.region = region
allFilter.sub = sub allFilter.sub = sub
if (TextUtils.isEmpty(region.code) && TextUtils.isEmpty(sub.code)) { if (TextUtils.isEmpty(region.code) && TextUtils.isEmpty(sub.code)) {
tvArea.text = "城市" tvArea.text = CONST_CITY
} else if (!TextUtils.isEmpty(region.code) && !TextUtils.isEmpty(sub.code)) { } else if (!TextUtils.isEmpty(region.code) && !TextUtils.isEmpty(sub.code)) {
if (region.value?.length ?: 0 > 4) { if (region.value?.length ?: 0 > 4) {
tvArea.text = region.value?.substring(0, 3) + "..." tvArea.text = region.value?.substring(0, 3) + "..."
...@@ -1601,7 +1604,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1601,7 +1604,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds( tv.setCompoundDrawablesWithIntrinsicBounds(
0, 0,
0, 0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, R.drawable.platform_arrow_drop_down_en,
0 0
) )
} }
...@@ -1678,7 +1681,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1678,7 +1681,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override fun onPriceItemSelected(priceRangesItem: PriceRangesItem) { override fun onPriceItemSelected(priceRangesItem: PriceRangesItem) {
//价格筛选回调 //价格筛选回调
updateFilterTextViewStatus(tvSort, FILTER_STATUS_FILTERED)
allFilter.priceRanges = priceRangesItem allFilter.priceRanges = priceRangesItem
getPresenter().fetchListData(allFilter, getPresenter().mExtras, mapFilter) refresh(false)
} }
} }
...@@ -1500,7 +1500,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1500,7 +1500,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds( tv.setCompoundDrawablesWithIntrinsicBounds(
0, 0,
0, 0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, R.drawable.platform_arrow_drop_down_en,
0 0
) )
} }
...@@ -1599,7 +1599,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1599,7 +1599,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun onPriceItemSelected(priceRange: PriceRangesItem) { override fun onPriceItemSelected(priceRange: PriceRangesItem) {
//价格筛选回调 //价格筛选回调
updateFilterTextViewStatus(tvSort, FILTER_STATUS_FILTERED)
allFilter.priceRanges = priceRange allFilter.priceRanges = priceRange
getPresenter().fetchListData(allFilter, getPresenter().mExtras, null) refresh(false)
} }
} }
...@@ -2,6 +2,7 @@ package com.yidianling.consultant.ui.view ...@@ -2,6 +2,7 @@ package com.yidianling.consultant.ui.view
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.graphics.Region
import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.BitmapDrawable
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import android.view.LayoutInflater import android.view.LayoutInflater
...@@ -46,6 +47,8 @@ class AreaPopupWindow( ...@@ -46,6 +47,8 @@ class AreaPopupWindow(
private var locationHistoryList: ArrayList<RegionItem>? = arrayListOf() private var locationHistoryList: ArrayList<RegionItem>? = arrayListOf()
private val locationCode = "-1" private val locationCode = "-1"
private val recentCityCode = "0" private val recentCityCode = "0"
private var locationRegionItem: RegionItem? = null
private var locationList: ArrayList<SubItem>? = arrayListOf()
init { init {
val view = val view =
...@@ -58,12 +61,11 @@ class AreaPopupWindow( ...@@ -58,12 +61,11 @@ class AreaPopupWindow(
this.height = this.height =
((RxDeviceTool.getScreenHeight(context) - RxImageTool.dp2px(90f)) * 0.618).toInt() //设置高度为屏幕的80% ((RxDeviceTool.getScreenHeight(context) - RxImageTool.dp2px(90f)) * 0.618).toInt() //设置高度为屏幕的80%
//根据IP获取当前城市 //根据IP获取当前城市
getRegionByIp(isAgree, false) getRegionByIp(isAgree, true)
recentCityBean = recentCityBean =
MMKV.defaultMMKV().decodeParcelable(RECENT_CITY, ConsultantRecentCity::class.java) MMKV.defaultMMKV().decodeParcelable(RECENT_CITY, ConsultantRecentCity::class.java)
if (recentCityBean == null) recentCityBean = ConsultantRecentCity(arrayListOf()) if (recentCityBean == null) recentCityBean = ConsultantRecentCity(arrayListOf())
var locationList: ArrayList<SubItem>? = arrayListOf()
locationHistoryList?.add( locationHistoryList?.add(
...@@ -74,17 +76,10 @@ class AreaPopupWindow( ...@@ -74,17 +76,10 @@ class AreaPopupWindow(
code = recentCityCode code = recentCityCode
) )
) )
subLocationItem?.let { locationList?.add(it) }
locationList?.let { RegionItem(it, value = "定位", key = locationCode, code = locationCode) }
?.let { locationHistoryList?.add(0, it) }
locationHistoryList?.addAll(regionList) locationHistoryList?.addAll(regionList)
regionAdapter.regionList = locationHistoryList!! regionAdapter.regionList = locationHistoryList!!
if (selectedRegion.sub.isNotEmpty()) {
subList.addAll(selectedRegion.sub)
} else {
subList.addAll(regionList[0].sub)
}
subAdapter = SubRecyclerViewAdapter(context, subList, selectedSub, locationCode) subAdapter = SubRecyclerViewAdapter(context, subList, selectedSub, locationCode)
subAdapter.setOnAuthClickLister(object : SubRecyclerViewAdapter.OnAuthClickLister { subAdapter.setOnAuthClickLister(object : SubRecyclerViewAdapter.OnAuthClickLister {
...@@ -119,10 +114,10 @@ class AreaPopupWindow( ...@@ -119,10 +114,10 @@ class AreaPopupWindow(
view.rvSub.scrollToPosition(0) view.rvSub.scrollToPosition(0)
} }
view.rvRegion.adapter = regionAdapter view.rvRegion.adapter = regionAdapter
val i = locationHistoryList!! // val i = locationHistoryList!!
.takeWhile { it.key != selectedRegion.key } // .takeWhile { it.key != selectedRegion.key }
.count() // .count()
view.rvRegion.scrollToPosition(i) // view.rvRegion.scrollToPosition(i)
view.rvSub.layoutManager = view.rvSub.layoutManager =
...@@ -168,9 +163,28 @@ class AreaPopupWindow( ...@@ -168,9 +163,28 @@ class AreaPopupWindow(
subLocationItem?.key = it.data.city_code subLocationItem?.key = it.data.city_code
subLocationItem?.value = it.data.city_name subLocationItem?.value = it.data.city_name
subLocationItem?.locationCode = locationCode subLocationItem?.locationCode = locationCode
if (refreshAdapter) { subLocationItem?.let { locationList?.add(it) }
subAdapter.notifyDataSetChanged() locationRegionItem =
locationList?.let {
RegionItem(
it,
value = "定位",
key = locationCode,
code = locationCode
)
}
locationRegionItem?.let { locationHistoryList?.add(0, it) }
if (locationRegionItem != null) {
selectedRegion = locationRegionItem!!
regionAdapter.selectedRegion = selectedRegion
} }
if (selectedRegion.sub.isNotEmpty()) {
subList.addAll(selectedRegion.sub)
}
subAdapter.notifyDataSetChanged()
regionAdapter.notifyDataSetChanged()
} }
}, {}) }, {})
} else { } else {
...@@ -178,6 +192,8 @@ class AreaPopupWindow( ...@@ -178,6 +192,8 @@ class AreaPopupWindow(
subLocationItem?.key = null subLocationItem?.key = null
subLocationItem?.value = "开启授权,获得定位城市" subLocationItem?.value = "开启授权,获得定位城市"
subLocationItem?.locationCode = "NotAuth" subLocationItem?.locationCode = "NotAuth"
subAdapter.notifyDataSetChanged()
regionAdapter.notifyDataSetChanged()
} }
} }
......
...@@ -11,6 +11,7 @@ import android.view.ViewGroup ...@@ -11,6 +11,7 @@ import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.PopupWindow import android.widget.PopupWindow
import android.widget.TextView import android.widget.TextView
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R import com.yidianling.consultant.R
...@@ -45,6 +46,7 @@ class PricePopupWindow( ...@@ -45,6 +46,7 @@ class PricePopupWindow(
private var SeekBarLeftValue = 0f private var SeekBarLeftValue = 0f
private var SeekBarRightValue = 0f private var SeekBarRightValue = 0f
private val maxPriceValue = 600 private val maxPriceValue = 600
private val infiniteText = "无限"
init { init {
val view = val view =
...@@ -56,8 +58,7 @@ class PricePopupWindow( ...@@ -56,8 +58,7 @@ class PricePopupWindow(
this.isOutsideTouchable = true this.isOutsideTouchable = true
initPriceTag() initPriceTag()
contentView.price_Confirm.setOnClickListener { contentView.price_Confirm.setOnClickListener {
// tempFilter.priceRanges?.min_price=min_Price if (max_Price == infiniteText) max_Price = ""
// tempFilter.priceRanges?.max_price=max_Price
var priceRangesItem = PriceRangesItem(min_Price, max_Price) var priceRangesItem = PriceRangesItem(min_Price, max_Price)
onPriceItemSelectedListener.onPriceItemSelected(priceRangesItem) onPriceItemSelectedListener.onPriceItemSelected(priceRangesItem)
dismiss() dismiss()
...@@ -71,7 +72,7 @@ class PricePopupWindow( ...@@ -71,7 +72,7 @@ class PricePopupWindow(
) { ) {
var maxPrice = ((rightValue / 100) * maxPriceValue).toInt().toString() var maxPrice = ((rightValue / 100) * maxPriceValue).toInt().toString()
if (rightValue > 93) { if (rightValue > 93) {
maxPrice = "无限" maxPrice = infiniteText
} }
contentView.tv_start_end_price.text = contentView.tv_start_end_price.text =
((leftValue / 100) * maxPriceValue).toInt().toString() + "-" + maxPrice ((leftValue / 100) * maxPriceValue).toInt().toString() + "-" + maxPrice
...@@ -91,7 +92,7 @@ class PricePopupWindow( ...@@ -91,7 +92,7 @@ class PricePopupWindow(
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, priceRangesItem) in filterData.priceRanges.withIndex()) { for ((index, priceRangesItem) in filterData.priceRanges.withIndex()) {
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(48f)) val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(50f))
val marginNum = RxImageTool.dp2px(2f) val marginNum = RxImageTool.dp2px(2f)
params.setMargins( params.setMargins(
marginNum + (RxImageTool.dp2px(10f) + mWidth) * (index % enquirySize), marginNum + (RxImageTool.dp2px(10f) + mWidth) * (index % enquirySize),
...@@ -140,7 +141,7 @@ class PricePopupWindow( ...@@ -140,7 +141,7 @@ class PricePopupWindow(
textView.isSelected = false textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
tempFilter.priceRangesView = null tempFilter.priceRangesView = null
contentView.tv_start_end_price.text = "0-无限" contentView.tv_start_end_price.text = "0-$infiniteText"
} else { } else {
textView.background = textView.background =
context.getDrawable(R.drawable.consult_price_expert_selected) context.getDrawable(R.drawable.consult_price_expert_selected)
...@@ -160,14 +161,14 @@ class PricePopupWindow( ...@@ -160,14 +161,14 @@ class PricePopupWindow(
(priceRangesItem.min_price.toString().toFloat() / maxPriceValue) * 100f (priceRangesItem.min_price.toString().toFloat() / maxPriceValue) * 100f
} }
if (priceRangesItem.max_price.isNullOrEmpty()) { if (priceRangesItem.max_price.isNullOrEmpty()) {
max_Price = "无限" max_Price = infiniteText
SeekBarRightValue = 100f SeekBarRightValue = 100f
} else { } else {
max_Price = priceRangesItem.max_price.toString() max_Price = priceRangesItem.max_price.toString()
SeekBarRightValue = SeekBarRightValue =
(priceRangesItem.max_price.toString().toFloat() / maxPriceValue) * 100f (priceRangesItem.max_price.toString().toFloat() / maxPriceValue) * 100f
} }
if (SeekBarRightValue > 100f) SeekBarRightValue = 100f
contentView.range_price_seekbar.setProgress(SeekBarLeftValue, SeekBarRightValue) contentView.range_price_seekbar.setProgress(SeekBarLeftValue, SeekBarRightValue)
contentView.tv_start_end_price.text = "$min_Price-$max_Price" contentView.tv_start_end_price.text = "$min_Price-$max_Price"
} }
......
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="wrap_content"
android:background="@color/white" android:background="@color/white"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingTop="@dimen/platform_dp_15"
android:paddingBottom="@dimen/platform_dp_15"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingRight="16dp"> android:paddingRight="16dp">
...@@ -23,6 +25,7 @@ ...@@ -23,6 +25,7 @@
android:layout_weight="1" android:layout_weight="1"
android:textColor="@color/platform_color_black_333333" android:textColor="@color/platform_color_black_333333"
android:textSize="14sp" android:textSize="14sp"
android:includeFontPadding="false"
tools:text="咨询方式" /> tools:text="咨询方式" />
<TextView <TextView
......
...@@ -14,5 +14,5 @@ ...@@ -14,5 +14,5 @@
android:paddingTop="6dp" android:paddingTop="6dp"
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:textColor="@color/consultant_color_search_filter_selector" android:textColor="@color/consultant_color_search_filter_selector"
android:textSize="13dp" android:textSize="14sp"
tools:text="按专家显示" /> tools:text="按专家显示" />
...@@ -16,7 +16,10 @@ ...@@ -16,7 +16,10 @@
<TextView <TextView
android:id="@+id/tvRegionName" android:id="@+id/tvRegionName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="wrap_content"
android:includeFontPadding="false"
android:paddingTop="@dimen/platform_dp_15"
android:paddingBottom="@dimen/platform_dp_15"
android:gravity="center" android:gravity="center"
android:text="地区" android:text="地区"
android:textColor="@color/platform_default_text_color" android:textColor="@color/platform_default_text_color"
......
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