Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
84b8fa54
Commit
84b8fa54
authored
Jul 27, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:对接接口,保存历史数据
parent
a6d4fc8c
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
261 additions
and
66 deletions
+261
-66
ExpertSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
+2
-1
ExpertSearchFragment.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
+23
-2
ConsultantRecentCity.kt
m-consultant/src/main/java/com/yidianling/consultant/bean/ConsultantRecentCity.kt
+11
-0
ConsultantRegionBean.kt
m-consultant/src/main/java/com/yidianling/consultant/bean/ConsultantRegionBean.kt
+11
-0
ConsultBIConstants.kt
m-consultant/src/main/java/com/yidianling/consultant/constants/ConsultBIConstants.kt
+8
-0
SearchApi.kt
m-consultant/src/main/java/com/yidianling/consultant/model/SearchApi.kt
+7
-1
AllFilter.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/AllFilter.kt
+38
-36
SubItem.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/SubItem.kt
+6
-3
AreaPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/AreaPopupWindow.kt
+55
-11
FilterPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
+49
-2
PricePopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/PricePopupWindow.kt
+19
-9
consult_price_expert_selected.png
m-consultant/src/main/res/drawable-xxhdpi/consult_price_expert_selected.png
+0
-0
consult_price_expert_unseleted.xml
m-consultant/src/main/res/drawable/consult_price_expert_unseleted.xml
+6
-0
consultant_selected_expert.xml
m-consultant/src/main/res/drawable/consultant_selected_expert.xml
+10
-0
consultant_layout_search_content.xml
m-consultant/src/main/res/layout/consultant_layout_search_content.xml
+1
-1
consultant_ui_filter_popup.xml
m-consultant/src/main/res/layout/consultant_ui_filter_popup.xml
+15
-0
No files found.
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
View file @
84b8fa54
...
@@ -1086,7 +1086,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1086,7 +1086,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tempFilter
.
priceRangesView
=
allFilter
.
priceRangesView
tempFilter
.
priceRangesView
=
allFilter
.
priceRangesView
if
(
headData
?.
filters
!=
null
)
{
if
(
headData
?.
filters
!=
null
)
{
val
filterPopupWindow
=
FilterPopupWindow
(
this
,
headData
?.
filters
!!
,
tempFilter
)
val
filterPopupWindow
=
FilterPopupWindow
(
this
,
headData
?.
filters
!!
,
tempFilter
,
headData
?.
reorder
!!
)
filterPopupWindow
.
setOnDismissListener
{
filterPopupWindow
.
setOnDismissListener
{
viewDim
.
visibility
=
View
.
INVISIBLE
viewDim
.
visibility
=
View
.
INVISIBLE
viewDim_filter
.
visibility
=
View
.
GONE
viewDim_filter
.
visibility
=
View
.
GONE
...
...
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
View file @
84b8fa54
...
@@ -6,7 +6,9 @@ import android.animation.ObjectAnimator
...
@@ -6,7 +6,9 @@ import android.animation.ObjectAnimator
import
android.animation.PropertyValuesHolder
import
android.animation.PropertyValuesHolder
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.graphics.Typeface
import
android.graphics.Typeface
import
android.net.Uri
import
android.os.Handler
import
android.os.Handler
import
android.text.TextUtils
import
android.text.TextUtils
import
android.view.View
import
android.view.View
...
@@ -22,6 +24,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
...
@@ -22,6 +24,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
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
import
com.tencent.mmkv.MMKV
import
com.ydl.webview.H5Params
import
com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
import
com.ydl.webview.NewH5Activity
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
...
@@ -37,6 +40,7 @@ import com.ydl.ydlcommon.utils.DisplayUtils
...
@@ -37,6 +40,7 @@ import com.ydl.ydlcommon.utils.DisplayUtils
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.remind.ToastHelper
import
com.ydl.ydlcommon.utils.remind.ToastHelper
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import
com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.RxImageTool
...
@@ -44,6 +48,7 @@ import com.yidianling.common.tools.ToastUtil
...
@@ -44,6 +48,7 @@ import com.yidianling.common.tools.ToastUtil
import
com.yidianling.consultant.adapter.ExpertSearchAdapter
import
com.yidianling.consultant.adapter.ExpertSearchAdapter
import
com.yidianling.consultant.bean.FunctionWordConsultBean
import
com.yidianling.consultant.bean.FunctionWordConsultBean
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.constants.ConsultBIConstants.ConsultantLocationAuth.Companion.WHETHER_LOCATION_AUTH
import
com.yidianling.consultant.listener.*
import
com.yidianling.consultant.listener.*
import
com.yidianling.consultant.model.bean.*
import
com.yidianling.consultant.model.bean.*
import
com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import
com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
...
@@ -883,8 +888,23 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -883,8 +888,23 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
props1
.
put
(
"filtrate_first"
,
"地区"
)
props1
.
put
(
"filtrate_first"
,
"地区"
)
hideSoftInput
()
hideSoftInput
()
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
postDelayed
({
appbar_layout
.
postDelayed
({
showAreaPopupWindow
()
if
(
MMKV
.
defaultMMKV
().
decodeBool
(
WHETHER_LOCATION_AUTH
))
{
//同意定位授权
showAreaPopupWindow
()
}
else
{
val
dialog
=
CommonDialog
(
mContext
)
.
setTitle
(
"温馨提示"
)
.
setMessage
(
"建议您授权定位权限,就能轻松获取周边优秀咨询师和其他服务"
)
.
setLeftOnclick
(
"暂不"
)
{
v1
->
showAreaPopupWindow
()
}.
setRightClick
(
"授权"
)
{
v12
->
MMKV
.
defaultMMKV
().
encode
(
WHETHER_LOCATION_AUTH
,
true
)
showAreaPopupWindow
()
}
dialog
.
show
()
}
},
300
)
},
300
)
}
}
...
@@ -982,7 +1002,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -982,7 +1002,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tempFilter
.
priceRangesView
=
allFilter
.
priceRangesView
tempFilter
.
priceRangesView
=
allFilter
.
priceRangesView
if
(
headData
?.
filters
!=
null
)
{
if
(
headData
?.
filters
!=
null
)
{
val
filterPopupWindow
=
FilterPopupWindow
(
mContext
,
headData
?.
filters
!!
,
tempFilter
)
val
filterPopupWindow
=
FilterPopupWindow
(
mContext
,
headData
?.
filters
!!
,
tempFilter
,
headData
?.
reorder
!!
)
filterPopupWindow
.
setOnDismissListener
{
filterPopupWindow
.
setOnDismissListener
{
viewDim
.
visibility
=
View
.
INVISIBLE
viewDim
.
visibility
=
View
.
INVISIBLE
viewDim_filter
.
visibility
=
View
.
GONE
viewDim_filter
.
visibility
=
View
.
GONE
...
...
m-consultant/src/main/java/com/yidianling/consultant/bean/ConsultantRecentCity.kt
0 → 100644
View file @
84b8fa54
package
com.yidianling.consultant.bean
import
android.os.Parcelable
import
com.yidianling.consultant.model.bean.SubItem
import
kotlinx.android.parcel.Parcelize
@Parcelize
data class
ConsultantRecentCity
(
var
recentCity
:
MutableList
<
SubItem
>
=
arrayListOf
()
)
:
Parcelable
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/bean/ConsultantRegionBean.kt
0 → 100644
View file @
84b8fa54
package
com.yidianling.consultant.bean
data class
ConsultantRegionBean
(
val
country_code
:
String
?,
val
country_name
:
String
?,
val
province_code
:
String
?,
val
province_name
:
String
?,
val
city_code
:
String
?,
val
city_name
:
String
?
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/constants/ConsultBIConstants.kt
View file @
84b8fa54
...
@@ -94,4 +94,11 @@ class ConsultBIConstants {
...
@@ -94,4 +94,11 @@ class ConsultBIConstants {
YDL_USER_MAIN_PAGE
+
"private_chat_click"
// 点击私聊按钮
YDL_USER_MAIN_PAGE
+
"private_chat_click"
// 点击私聊按钮
}
}
}
}
class
ConsultantLocationAuth
{
companion
object
{
const
val
WHETHER_LOCATION_AUTH
=
"whether_location_auth"
const
val
RECENT_CITY
=
"recent_city"
}
}
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/SearchApi.kt
View file @
84b8fa54
...
@@ -105,11 +105,16 @@ interface SearchApi {
...
@@ -105,11 +105,16 @@ interface SearchApi {
* 100 有配置接口
* 100 有配置接口
* */
* */
@GET
(
"consult/assistant/chat-route-config"
)
@GET
(
"consult/assistant/chat-route-config"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
,
"Content-Type:application/json"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
,
"Content-Type:application/json"
)
fun
getChatRouteConfig
(
fun
getChatRouteConfig
(
@Query
(
"location"
)
location
:
Int
,
@Query
(
"location"
)
location
:
Int
,
@Query
(
"naviType"
)
naviType
:
String
=
"1"
@Query
(
"naviType"
)
naviType
:
String
=
"1"
):
Observable
<
BaseAPIResponse
<
Long
>>
):
Observable
<
BaseAPIResponse
<
Long
>>
//根据IP地址获取城市
@GET
(
"region/ip-region"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
,
"Content-Type:application/json"
)
fun
getCityByIp
():
Observable
<
BaseAPIResponse
<
ConsultantRegionBean
>>
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/AllFilter.kt
View file @
84b8fa54
...
@@ -8,45 +8,46 @@ import android.widget.TextView
...
@@ -8,45 +8,46 @@ import android.widget.TextView
* Created by zqk on 17-9-20.
* Created by zqk on 17-9-20.
*/
*/
data class
AllFilter
(
data class
AllFilter
(
var
searchWord
:
String
?
=
null
,
var
searchWord
:
String
?
=
null
,
val
categories
:
ArrayList
<
CateItem
>
=
ArrayList
(),
//主题
val
categories
:
ArrayList
<
CateItem
>
=
ArrayList
(),
//主题
var
reorder
:
ReorderItem
=
ReorderItem
(),
//排序
var
reorder
:
ReorderItem
=
ReorderItem
(),
//排序
var
region
:
RegionItem
=
RegionItem
(),
//省
var
region
:
RegionItem
=
RegionItem
(),
//省
var
sub
:
SubItem
=
SubItem
(),
//市
var
sub
:
SubItem
=
SubItem
(),
//市
var
showType
:
ShowTypeItem
=
ShowTypeItem
(),
//显示方式
var
showType
:
ShowTypeItem
=
ShowTypeItem
(),
//显示方式
val
enquiries
:
ArrayList
<
EnquiryItem
>
=
ArrayList
(),
//咨询方式
val
enquiries
:
ArrayList
<
EnquiryItem
>
=
ArrayList
(),
//咨询方式
var
priceRanges
:
PriceRangesItem
?=
null
,
//服务均价
var
priceRanges
:
PriceRangesItem
?
=
null
,
//服务均价
var
priceRangesView
:
TextView
?=
null
,
//服务均价
var
priceRangesView
:
TextView
?
=
null
,
//服务均价
val
ages
:
ArrayList
<
AgeItem
>
=
ArrayList
(),
//年龄
var
sortRangesView
:
TextView
?
=
null
,
//排序均价
val
doctorEdu
:
ArrayList
<
DoctorEduItem
>
=
ArrayList
(),
//学历
val
ages
:
ArrayList
<
AgeItem
>
=
ArrayList
(),
//年龄
val
others
:
ArrayList
<
OtherItem
>
=
ArrayList
(),
//其他筛选
val
doctorEdu
:
ArrayList
<
DoctorEduItem
>
=
ArrayList
(),
//学历
val
others
:
ArrayList
<
OtherItem
>
=
ArrayList
(),
//其他筛选
val
title
:
ArrayList
<
ReorderItem
>
=
ArrayList
(),
//资质
val
specialityCrowd
:
ArrayList
<
SpecialityCrowdBean
>
=
ArrayList
(),
// 擅长人群
val
title
:
ArrayList
<
ReorderItem
>
=
ArrayList
(),
//资质
val
specialityCrowd
:
ArrayList
<
SpecialityCrowdBean
>
=
ArrayList
(),
// 擅长人群
// 八大类标签集合
val
childList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 亲子教育
// 八大类标签集合
val
stressList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 情绪压力
val
childList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 亲子教育
val
loveEmotionList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 恋爱情感
val
stressList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 情绪压力
val
marriedFamilyList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 婚姻家庭
val
loveEmotionList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 恋爱情感
val
personalGrowthList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 个人成长
val
marriedFamilyList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 婚姻家庭
val
interpersonalRelationshipList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 人际关系
val
personalGrowthList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 个人成长
val
careerDevelopmentList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 职场发展
val
interpersonalRelationshipList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 人际关系
val
mentalHealthList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 心理健康
val
careerDevelopmentList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 职场发展
val
mentalHealthList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 心理健康
// 八大类已选中标签id集合
// 八大类已选中标签id集合
val
categoryId2List
:
ArrayList
<
String
>
=
ArrayList
(),
// 一级类目id集合
val
categoryId2List
:
ArrayList
<
String
>
=
ArrayList
(),
// 一级类目id集合
val
categoryId3List
:
ArrayList
<
String
>
=
ArrayList
(),
// 二级类目id集合
val
categoryId3List
:
ArrayList
<
String
>
=
ArrayList
(),
// 二级类目id集合
// 八大类选中下标集合,重置的时候可以减少循坏,提升性能
// 八大类选中下标集合,重置的时候可以减少循坏,提升性能
val
chooseChildIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseChildIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseStressIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseStressIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseLoveEmotionIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseLoveEmotionIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseMarriedFamilyIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseMarriedFamilyIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
choosePersonalGrowthIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
choosePersonalGrowthIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseInterpersonalRelationshipIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseInterpersonalRelationshipIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseCareerDevelopmentIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseCareerDevelopmentIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseMentalHealthIndexList
:
ArrayList
<
Int
>
=
ArrayList
()
val
chooseMentalHealthIndexList
:
ArrayList
<
Int
>
=
ArrayList
()
)
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/SubItem.kt
View file @
84b8fa54
package
com.yidianling.consultant.model.bean
package
com.yidianling.consultant.model.bean
import
android.os.Parcelable
import
com.google.gson.annotations.SerializedName
import
com.google.gson.annotations.SerializedName
import
kotlinx.android.parcel.Parcelize
@Parcelize
data class
SubItem
(
data class
SubItem
(
@field
:
SerializedName
(
"value"
)
@field
:
SerializedName
(
"value"
)
...
@@ -11,5 +14,5 @@ data class SubItem(
...
@@ -11,5 +14,5 @@ data class SubItem(
var
key
:
String
?
=
null
,
var
key
:
String
?
=
null
,
@field
:
SerializedName
(
"code"
)
@field
:
SerializedName
(
"code"
)
var
code
:
String
?=
null
var
code
:
String
?
=
null
)
)
:
Parcelable
\ No newline at end of file
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/ui/view/AreaPopupWindow.kt
View file @
84b8fa54
package
com.yidianling.consultant.ui.view
package
com.yidianling.consultant.ui.view
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.graphics.drawable.BitmapDrawable
import
android.graphics.drawable.BitmapDrawable
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearSnapHelper
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.PopupWindow
import
android.widget.PopupWindow
import
androidx.collection.arraySetOf
import
com.tencent.mmkv.MMKV
import
com.ydl.ydlcommon.adapter.MyBaseAdapter
import
com.ydl.ydlcommon.adapter.MyBaseAdapter
import
com.ydl.ydlcommon.utils.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
import
com.yidianling.consultant.adapter.RegionRecyclerViewAdapter
import
com.yidianling.consultant.adapter.RegionRecyclerViewAdapter
import
com.yidianling.consultant.adapter.SubRecyclerViewAdapter
import
com.yidianling.consultant.adapter.SubRecyclerViewAdapter
import
com.yidianling.consultant.bean.ConsultantRecentCity
import
com.yidianling.consultant.constants.ConsultBIConstants.ConsultantLocationAuth.Companion.RECENT_CITY
import
com.yidianling.consultant.model.SearchApi
import
com.yidianling.consultant.model.bean.RegionItem
import
com.yidianling.consultant.model.bean.RegionItem
import
com.yidianling.consultant.model.bean.SubItem
import
com.yidianling.consultant.model.bean.SubItem
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
kotlinx.android.synthetic.main.consultant_ui_region_popup_window.view.*
import
kotlinx.android.synthetic.main.consultant_ui_region_popup_window.view.*
/**
/**
* 地区选择弹窗
* 地区选择弹窗
*/
*/
class
AreaPopupWindow
(
val
context
:
Context
,
regionList
:
ArrayList
<
RegionItem
>,
private
var
selectedRegion
:
RegionItem
,
private
var
selectedSub
:
SubItem
)
class
AreaPopupWindow
(
:
PopupWindow
(
null
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
RxImageTool
.
dp2px
(
369f
))
{
val
context
:
Context
,
regionList
:
ArrayList
<
RegionItem
>,
private
var
selectedRegion
:
RegionItem
,
private
var
selectedSub
:
SubItem
)
:
PopupWindow
(
null
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
RxImageTool
.
dp2px
(
369f
))
{
private
val
subList
=
ArrayList
<
SubItem
>()
private
val
subList
=
ArrayList
<
SubItem
>()
private
val
regionAdapter
=
RegionRecyclerViewAdapter
(
context
,
regionList
,
selectedRegion
)
private
val
regionAdapter
=
RegionRecyclerViewAdapter
(
context
,
regionList
,
selectedRegion
)
private
var
subAdapter
:
SubRecyclerViewAdapter
private
var
subAdapter
:
SubRecyclerViewAdapter
private
var
recentCityBean
:
ConsultantRecentCity
?
=
ConsultantRecentCity
(
arrayListOf
())
var
onRegionSelectedListener
:
OnRegionSelectedListener
?
=
null
var
onRegionSelectedListener
:
OnRegionSelectedListener
?
=
null
init
{
init
{
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
consultant_ui_region_popup_window
,
null
)
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
consultant_ui_region_popup_window
,
null
)
this
.
contentView
=
view
this
.
contentView
=
view
this
.
isFocusable
=
true
this
.
isFocusable
=
true
@Suppress
(
"DEPRECATION"
)
@Suppress
(
"DEPRECATION"
)
this
.
setBackgroundDrawable
(
BitmapDrawable
())
this
.
setBackgroundDrawable
(
BitmapDrawable
())
this
.
isOutsideTouchable
=
true
this
.
isOutsideTouchable
=
true
this
.
height
=
((
RxDeviceTool
.
getScreenHeight
(
context
)
-
RxImageTool
.
dp2px
(
90f
))
*
0.618
).
toInt
()
//设置高度为屏幕的80%
this
.
height
=
((
RxDeviceTool
.
getScreenHeight
(
context
)
-
RxImageTool
.
dp2px
(
90f
))
*
0.618
).
toInt
()
//设置高度为屏幕的80%
if
(
selectedRegion
.
sub
.
isNotEmpty
()){
if
(
selectedRegion
.
sub
.
isNotEmpty
())
{
subList
.
addAll
(
selectedRegion
.
sub
)
subList
.
addAll
(
selectedRegion
.
sub
)
}
else
{
}
else
{
subList
.
addAll
(
regionList
[
0
].
sub
)
subList
.
addAll
(
regionList
[
0
].
sub
)
}
}
subAdapter
=
SubRecyclerViewAdapter
(
context
,
subList
,
selectedSub
)
subAdapter
=
SubRecyclerViewAdapter
(
context
,
subList
,
selectedSub
)
view
.
rvRegion
.
layoutManager
=
view
.
rvRegion
.
layoutManager
=
LinearLayoutManager
(
LinearLayoutManager
(
...
@@ -60,8 +75,8 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p
...
@@ -60,8 +75,8 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p
}
}
view
.
rvRegion
.
adapter
=
regionAdapter
view
.
rvRegion
.
adapter
=
regionAdapter
val
i
=
regionList
val
i
=
regionList
.
takeWhile
{
it
.
key
!=
selectedRegion
.
key
}
.
takeWhile
{
it
.
key
!=
selectedRegion
.
key
}
.
count
()
.
count
()
view
.
rvRegion
.
scrollToPosition
(
i
)
view
.
rvRegion
.
scrollToPosition
(
i
)
...
@@ -72,11 +87,40 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p
...
@@ -72,11 +87,40 @@ class AreaPopupWindow(val context: Context, regionList: ArrayList<RegionItem>, p
false
false
)
)
subAdapter
.
onItemClickListener
=
MyBaseAdapter
.
OnItemClickListener
{
_
,
_
,
data
->
subAdapter
.
onItemClickListener
=
MyBaseAdapter
.
OnItemClickListener
{
_
,
_
,
data
->
//保留最近五次的搜索历史记录
recentCityBean
=
MMKV
.
defaultMMKV
().
decodeParcelable
(
RECENT_CITY
,
ConsultantRecentCity
::
class
.
java
)
if
(
recentCityBean
==
null
)
recentCityBean
=
ConsultantRecentCity
(
arrayListOf
())
recentCityBean
?.
let
{
if
(
it
.
recentCity
.
size
<
5
)
{
it
.
recentCity
.
add
(
0
,
data
)
it
.
recentCity
=
it
.
recentCity
.
toMutableSet
().
toMutableList
()
MMKV
.
defaultMMKV
().
encode
(
RECENT_CITY
,
recentCityBean
)
}
else
{
it
.
recentCity
.
removeAt
(
it
.
recentCity
.
size
-
1
)
it
.
recentCity
.
add
(
0
,
data
)
it
.
recentCity
=
it
.
recentCity
.
toMutableSet
().
toMutableList
()
MMKV
.
defaultMMKV
().
encode
(
RECENT_CITY
,
recentCityBean
)
}
}
selectedSub
=
data
selectedSub
=
data
onRegionSelectedListener
?.
onRegionSelected
(
selectedRegion
,
selectedSub
)
onRegionSelectedListener
?.
onRegionSelected
(
selectedRegion
,
selectedSub
)
}
}
view
.
rvSub
.
adapter
=
subAdapter
view
.
rvSub
.
adapter
=
subAdapter
view
.
rvSub
.
scrollToPosition
(
subList
.
indexOf
(
selectedSub
)
+
1
)
view
.
rvSub
.
scrollToPosition
(
subList
.
indexOf
(
selectedSub
)
+
1
)
getRegionByIp
()
}
@SuppressLint
(
"CheckResult"
)
fun
getRegionByIp
()
{
SearchApi
.
getSearchApi
().
getCityByIp
()
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
if
(
it
.
code
==
"200"
)
{
}
},
{})
}
}
interface
OnRegionSelectedListener
{
interface
OnRegionSelectedListener
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
View file @
84b8fa54
...
@@ -28,6 +28,7 @@ import com.yidianling.consultant.listener.OnFilterConfirmListener
...
@@ -28,6 +28,7 @@ import com.yidianling.consultant.listener.OnFilterConfirmListener
import
com.yidianling.consultant.model.bean.AllFilter
import
com.yidianling.consultant.model.bean.AllFilter
import
com.yidianling.consultant.model.bean.Filters
import
com.yidianling.consultant.model.bean.Filters
import
com.yidianling.consultant.model.bean.PriceRangesItem
import
com.yidianling.consultant.model.bean.PriceRangesItem
import
com.yidianling.consultant.model.bean.ReorderItem
import
com.yidianling.consultant.ui.view.rangeseekbar.OnRangeChangedListener
import
com.yidianling.consultant.ui.view.rangeseekbar.OnRangeChangedListener
import
com.yidianling.consultant.ui.view.rangeseekbar.RangeSeekBar
import
com.yidianling.consultant.ui.view.rangeseekbar.RangeSeekBar
import
kotlinx.android.synthetic.main.consultant_item_filter.view.*
import
kotlinx.android.synthetic.main.consultant_item_filter.view.*
...
@@ -43,7 +44,8 @@ import kotlin.math.roundToInt
...
@@ -43,7 +44,8 @@ import kotlin.math.roundToInt
class
FilterPopupWindow
(
class
FilterPopupWindow
(
private
val
context
:
Context
,
private
val
context
:
Context
,
private
val
filterData
:
Filters
,
private
val
filterData
:
Filters
,
private
val
tempFilter
:
AllFilter
private
val
tempFilter
:
AllFilter
,
private
val
sortItems
:
ArrayList
<
ReorderItem
>
)
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
)
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
...
@@ -54,6 +56,7 @@ class FilterPopupWindow(
...
@@ -54,6 +56,7 @@ class FilterPopupWindow(
private
val
otherViews
:
ArrayList
<
View
>
=
ArrayList
()
private
val
otherViews
:
ArrayList
<
View
>
=
ArrayList
()
private
val
ziZhiViews
:
ArrayList
<
View
>
=
ArrayList
()
private
val
ziZhiViews
:
ArrayList
<
View
>
=
ArrayList
()
private
val
goodAtViews
:
ArrayList
<
TextView
>
=
ArrayList
()
private
val
goodAtViews
:
ArrayList
<
TextView
>
=
ArrayList
()
private
val
sortRangeViews
:
ArrayList
<
View
>
=
ArrayList
()
//排序list
var
onFilterConfirmListener
:
OnFilterConfirmListener
?
=
null
var
onFilterConfirmListener
:
OnFilterConfirmListener
?
=
null
/**筛选咨询方式一行数量*/
/**筛选咨询方式一行数量*/
...
@@ -87,7 +90,7 @@ class FilterPopupWindow(
...
@@ -87,7 +90,7 @@ class FilterPopupWindow(
this
.
isOutsideTouchable
=
true
this
.
isOutsideTouchable
=
true
// this.animationStyle = R.style.consultant_expert_service_popupwindow_filter_anim_style
// this.animationStyle = R.style.consultant_expert_service_popupwindow_filter_anim_style
initShowSortViews
(
view
)
initShowTypeViews
(
view
)
initShowTypeViews
(
view
)
//咨询方式
//咨询方式
initEnquiryViews
(
view
)
initEnquiryViews
(
view
)
...
@@ -120,6 +123,50 @@ class FilterPopupWindow(
...
@@ -120,6 +123,50 @@ class FilterPopupWindow(
}
}
}
}
private
fun
initShowSortViews
(
view
:
View
)
{
val
mWidth
=
(
popWidth
-
RxImageTool
.
dp2px
(
52f
))
/
enquirySize
for
((
index
,
enquiry
)
in
sortItems
.
withIndex
())
{
val
llTextView
=
View
.
inflate
(
context
,
R
.
layout
.
consultant_item_filter
,
null
)
as
TextView
val
params
=
FrameLayout
.
LayoutParams
(
mWidth
,
RxImageTool
.
dp2px
(
36f
))
val
marginNum
=
RxImageTool
.
dp2px
(
5f
)
params
.
setMargins
(
marginNum
+
(
RxImageTool
.
dp2px
(
10f
)
+
mWidth
)
*
(
index
%
enquirySize
),
RxImageTool
.
dp2px
(
46f
)
*
(
index
/
enquirySize
),
marginNum
,
0
)
llTextView
.
layoutParams
=
params
llTextView
.
text
=
enquiry
.
value
sortRangeViews
.
add
(
llTextView
)
if
(
enquiry
==
tempFilter
.
reorder
)
{
llTextView
.
isSelected
=
true
llTextView
.
paint
.
isFakeBoldText
=
true
tempFilter
.
priceRangesView
=
llTextView
}
llTextView
.
setOnClickListener
{
if
(
llTextView
!=
tempFilter
.
sortRangesView
)
{
tempFilter
.
sortRangesView
?.
isSelected
=
false
tempFilter
.
sortRangesView
?.
paint
?.
isFakeBoldText
=
false
}
if
(
llTextView
.
isSelected
)
{
tempFilter
.
priceRanges
=
null
llTextView
.
isSelected
=
false
llTextView
.
paint
.
isFakeBoldText
=
false
tempFilter
.
sortRangesView
=
null
}
else
{
llTextView
.
isSelected
=
true
llTextView
.
paint
.
isFakeBoldText
=
true
tempFilter
.
sortRangesView
=
llTextView
}
updateCount
(
ConsultBIConstants
.
POSITION_CONSULT_TYPE_CLICK
)
}
view
.
flSortType
.
addView
(
llTextView
)
}
}
@SuppressLint
(
"ClickableViewAccessibility"
)
@SuppressLint
(
"ClickableViewAccessibility"
)
private
fun
initKeyboardListener
(
view
:
View
)
{
private
fun
initKeyboardListener
(
view
:
View
)
{
val
svFilter
=
view
.
findViewById
<
ScrollView
>(
R
.
id
.
sv_filter
)
val
svFilter
=
view
.
findViewById
<
ScrollView
>(
R
.
id
.
sv_filter
)
...
...
m-consultant/src/main/java/com/yidianling/consultant/ui/view/PricePopupWindow.kt
View file @
84b8fa54
package
com.yidianling.consultant.ui.view
package
com.yidianling.consultant.ui.view
import
android.content.Context
import
android.content.Context
import
android.graphics.Bitmap
import
android.graphics.Canvas
import
android.graphics.drawable.BitmapDrawable
import
android.graphics.drawable.BitmapDrawable
import
android.graphics.drawable.Drawable
import
android.text.SpannableString
import
android.text.SpannableString
import
android.text.Spanned
import
android.text.Spanned
import
android.text.style.AbsoluteSizeSpan
import
android.text.style.AbsoluteSizeSpan
import
androidx.recyclerview.widget.LinearLayoutManager
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
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.ydl.ydlcommon.utils.ResUtil.getResources
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
import
com.yidianling.consultant.adapter.SortRecyclerViewAdapter
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.listener.OnPriceItemSelectedListener
import
com.yidianling.consultant.listener.OnPriceItemSelectedListener
import
com.yidianling.consultant.listener.OnSortItemSelectedListener
import
com.yidianling.consultant.model.bean.AllFilter
import
com.yidianling.consultant.model.bean.AllFilter
import
com.yidianling.consultant.model.bean.Filters
import
com.yidianling.consultant.model.bean.Filters
import
com.yidianling.consultant.model.bean.ReorderItem
import
com.yidianling.consultant.model.bean.ReorderItem
import
com.yidianling.consultant.ui.view.rangeseekbar.OnRangeChangedListener
import
com.yidianling.consultant.ui.view.rangeseekbar.OnRangeChangedListener
import
com.yidianling.consultant.ui.view.rangeseekbar.RangeSeekBar
import
com.yidianling.consultant.ui.view.rangeseekbar.RangeSeekBar
import
kotlinx.android.synthetic.main.consultant_item_price_range.view.*
import
kotlinx.android.synthetic.main.consultant_ui_filter_popup.view.*
import
kotlinx.android.synthetic.main.consultant_ui_filter_popup.view.flPriceRange
import
kotlinx.android.synthetic.main.consultant_ui_price_popup_window.view.*
import
kotlinx.android.synthetic.main.consultant_ui_price_popup_window.view.*
import
kotlinx.android.synthetic.main.consultant_ui_sort_popup_window.view.*
/**
/**
* 排序弹窗
* 排序弹窗
...
@@ -42,13 +39,16 @@ class PricePopupWindow(
...
@@ -42,13 +39,16 @@ class PricePopupWindow(
)
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
)
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
private
val
popWidth
=
(
RxDeviceTool
.
getScreenWidth
(
context
))
private
val
popWidth
=
(
RxDeviceTool
.
getScreenWidth
(
context
))
private
val
enquirySize
=
4
//价格筛选一行三个项
private
val
enquirySize
=
3
private
val
priceRangeViews
:
ArrayList
<
View
>
=
ArrayList
()
private
val
priceRangeViews
:
ArrayList
<
View
>
=
ArrayList
()
private
var
min_Price
=
""
private
var
min_Price
=
""
private
var
max_Price
=
""
private
var
max_Price
=
""
private
var
SeekBarLeftValue
=
0f
private
var
SeekBarLeftValue
=
0f
private
var
SeekBarRightValue
=
0f
private
var
SeekBarRightValue
=
0f
private
val
maxPriceValue
=
600
private
val
maxPriceValue
=
600
init
{
init
{
val
view
=
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
consultant_ui_price_popup_window
,
null
)
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
consultant_ui_price_popup_window
,
null
)
...
@@ -117,6 +117,7 @@ class PricePopupWindow(
...
@@ -117,6 +117,7 @@ class PricePopupWindow(
if
(
priceRangesItem
==
tempFilter
.
priceRanges
)
{
if
(
priceRangesItem
==
tempFilter
.
priceRanges
)
{
textView
.
isSelected
=
true
textView
.
isSelected
=
true
textView
.
background
=
context
.
getDrawable
(
R
.
drawable
.
consult_price_expert_selected
)
textView
.
paint
.
isFakeBoldText
=
true
textView
.
paint
.
isFakeBoldText
=
true
tempFilter
.
priceRangesView
=
textView
tempFilter
.
priceRangesView
=
textView
}
}
...
@@ -124,15 +125,21 @@ class PricePopupWindow(
...
@@ -124,15 +125,21 @@ class PricePopupWindow(
textView
.
setOnClickListener
{
textView
.
setOnClickListener
{
if
(
textView
!=
tempFilter
.
priceRangesView
)
{
if
(
textView
!=
tempFilter
.
priceRangesView
)
{
tempFilter
.
priceRangesView
?.
isSelected
=
false
tempFilter
.
priceRangesView
?.
isSelected
=
false
tempFilter
.
priceRangesView
?.
background
=
context
.
getDrawable
(
R
.
drawable
.
consult_price_expert_unseleted
)
tempFilter
.
priceRangesView
?.
paint
?.
isFakeBoldText
=
false
tempFilter
.
priceRangesView
?.
paint
?.
isFakeBoldText
=
false
}
}
if
(
textView
.
isSelected
)
{
if
(
textView
.
isSelected
)
{
textView
.
background
=
context
.
getDrawable
(
R
.
drawable
.
consult_price_expert_unseleted
)
tempFilter
.
priceRanges
=
null
tempFilter
.
priceRanges
=
null
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-无限"
}
else
{
}
else
{
textView
.
background
=
context
.
getDrawable
(
R
.
drawable
.
consult_price_expert_selected
)
tempFilter
.
priceRanges
=
priceRangesItem
.
copy
(
tempFilter
.
priceRanges
=
priceRangesItem
.
copy
(
min_price
=
priceRangesItem
.
min_price
,
min_price
=
priceRangesItem
.
min_price
,
max_price
=
priceRangesItem
.
max_price
max_price
=
priceRangesItem
.
max_price
...
@@ -165,4 +172,6 @@ class PricePopupWindow(
...
@@ -165,4 +172,6 @@ class PricePopupWindow(
contentView
.
flPriceRangeView
.
addView
(
textView
)
contentView
.
flPriceRangeView
.
addView
(
textView
)
}
}
}
}
}
}
\ No newline at end of file
m-consultant/src/main/res/drawable-xxhdpi/consult_price_expert_selected.png
0 → 100644
View file @
84b8fa54
1.67 KB
m-consultant/src/main/res/drawable/consult_price_expert_unseleted.xml
0 → 100644
View file @
84b8fa54
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@color/platform_color_F7F7F7"
/>
<corners
android:radius=
"4dp"
/>
</shape>
\ No newline at end of file
m-consultant/src/main/res/drawable/consultant_selected_expert.xml
0 → 100644
View file @
84b8fa54
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"@dimen/dp_4"
/>
<solid
android:color=
"@color/platform_main_theme_bright"
/>
<stroke
android:width=
"0.5dp"
android:color=
"@color/platform_main_theme"
/>
</shape>
\ No newline at end of file
m-consultant/src/main/res/layout/consultant_layout_search_content.xml
View file @
84b8fa54
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
android:width=
"0dp"
android:width=
"0dp"
android:drawableEnd=
"@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableEnd=
"@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight=
"@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight=
"@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text=
"
@string/platform_area
"
android:text=
"
城市
"
android:textColor=
"@color/platform_color_242424"
/>
android:textColor=
"@color/platform_color_242424"
/>
<com.ydl.ydlcommon.view.DrawableRightTextView
<com.ydl.ydlcommon.view.DrawableRightTextView
...
...
m-consultant/src/main/res/layout/consultant_ui_filter_popup.xml
View file @
84b8fa54
...
@@ -44,6 +44,21 @@
...
@@ -44,6 +44,21 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_28"
android:layout_marginTop=
"@dimen/platform_dp_28"
android:text=
"排序"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"@dimen/platform_dp_16"
android:textStyle=
"bold"
/>
<FrameLayout
android:id=
"@+id/flSortType"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"12dp"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_28"
android:text=
"咨询方式"
android:text=
"咨询方式"
android:textColor=
"@color/platform_color_242424"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"@dimen/platform_dp_16"
android:textSize=
"@dimen/platform_dp_16"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment