Commit c02301ce by 霍志良

feat:BUG修改

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