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
a58adebe
Commit
a58adebe
authored
Jun 08, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/yk_sort' into 'd/v_sort'
Feature/yk sort See merge request app_android_lib/YDL-Component!138
parents
a5d2d185
342290e2
Hide whitespace changes
Inline
Side-by-side
Showing
66 changed files
with
3359 additions
and
1605 deletions
+3359
-1605
build.gradle
app/build.gradle
+26
-55
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+2
-2
config.gradle
config.gradle
+8
-8
build.gradle
m-consultant/build.gradle
+1
-1
ExpertSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
+334
-353
ExpertSearchFragment.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
+239
-354
ExpertSearchPresenter.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchPresenter.kt
+187
-117
HotSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/HotSearchActivity.kt
+122
-52
IExpertSearchView.kt
m-consultant/src/main/java/com/yidianling/consultant/IExpertSearchView.kt
+3
-6
CategoryRecyclerViewAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/CategoryRecyclerViewAdapter.kt
+1
-1
ExpertSearchAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
+221
-79
SearchWordsAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/SearchWordsAdapter.kt
+41
-0
SortAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/SortAdapter.kt
+71
-0
SortRecyclerViewAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/SortRecyclerViewAdapter.kt
+1
-1
ExpertSearchProductsBean.kt
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchProductsBean.kt
+3
-3
ExpertSearchTagsIconBean.kt
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchTagsIconBean.kt
+5
-5
SearchWordsBean.kt
m-consultant/src/main/java/com/yidianling/consultant/bean/SearchWordsBean.kt
+19
-0
ConsultBIConstants.kt
m-consultant/src/main/java/com/yidianling/consultant/constants/ConsultBIConstants.kt
+11
-3
IHotSearchContract.kt
m-consultant/src/main/java/com/yidianling/consultant/contract/IHotSearchContract.kt
+17
-0
ExpertSearchHttpImpl.kt
m-consultant/src/main/java/com/yidianling/consultant/http/ExpertSearchHttpImpl.kt
+7
-4
IExpertSearchHttp.kt
m-consultant/src/main/java/com/yidianling/consultant/http/IExpertSearchHttp.kt
+13
-3
HotSearchHttpImpl.kt
m-consultant/src/main/java/com/yidianling/consultant/http/hotsearch/HotSearchHttpImpl.kt
+6
-0
IHotSearchHttp.kt
m-consultant/src/main/java/com/yidianling/consultant/http/hotsearch/IHotSearchHttp.kt
+8
-1
FlowLayoutManager.java
m-consultant/src/main/java/com/yidianling/consultant/layoutmanager/FlowLayoutManager.java
+287
-0
OnCategoriesSelectedListener.kt
m-consultant/src/main/java/com/yidianling/consultant/listener/OnCategoriesSelectedListener.kt
+2
-3
HotSearchModelImpl.kt
m-consultant/src/main/java/com/yidianling/consultant/model/HotSearchModelImpl.kt
+6
-0
SearchApi.kt
m-consultant/src/main/java/com/yidianling/consultant/model/SearchApi.kt
+18
-6
AgeItem.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/AgeItem.kt
+2
-1
AllFilter.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/AllFilter.kt
+27
-1
CateItem.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/CateItem.kt
+16
-23
EnquiryItem.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/EnquiryItem.kt
+1
-1
ExpertBean.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ExpertBean.kt
+22
-0
ExpertSearchBean.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ExpertSearchBean.kt
+0
-37
ExpertServiceItem.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ExpertServiceItem.kt
+65
-40
Filters.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/Filters.kt
+0
-6
OtherItem.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/OtherItem.kt
+8
-1
ReorderItem.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ReorderItem.kt
+8
-1
ServiceItem.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ServiceItem.kt
+0
-47
ConsultAssistantDialogUtils.kt
m-consultant/src/main/java/com/yidianling/consultant/modular/singlton/ConsultAssistantDialogUtils.kt
+3
-3
TempH5RouteUtils.kt
m-consultant/src/main/java/com/yidianling/consultant/modular/utils/TempH5RouteUtils.kt
+1
-1
HotSearchPresenterImpl.kt
m-consultant/src/main/java/com/yidianling/consultant/presenter/HotSearchPresenterImpl.kt
+23
-2
CategoryPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/CategoryPopupWindow.kt
+666
-20
FilterPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
+44
-60
SortPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/SortPopupWindow.kt
+2
-7
consultant_ic_sort_close.png
m-consultant/src/main/res/drawable-xhdpi/consultant_ic_sort_close.png
+0
-0
consultant_ic_sort_open.png
m-consultant/src/main/res/drawable-xhdpi/consultant_ic_sort_open.png
+0
-0
consultant_solid_main_theme_color_r_8.xml
m-consultant/src/main/res/drawable/consultant_solid_main_theme_color_r_8.xml
+8
-0
consultant_stroke_ebebeb_r_8.xml
m-consultant/src/main/res/drawable/consultant_stroke_ebebeb_r_8.xml
+10
-0
consultant_stroke_ebebeb_solid_f9f9f9_r_4.xml
m-consultant/src/main/res/drawable/consultant_stroke_ebebeb_solid_f9f9f9_r_4.xml
+11
-0
consultant_activity_hot_search.xml
m-consultant/src/main/res/layout/consultant_activity_hot_search.xml
+216
-194
consultant_expert_search_header_view.xml
m-consultant/src/main/res/layout/consultant_expert_search_header_view.xml
+65
-0
consultant_item_search_words.xml
m-consultant/src/main/res/layout/consultant_item_search_words.xml
+33
-0
consultant_item_sort1.xml
m-consultant/src/main/res/layout/consultant_item_sort1.xml
+25
-0
consultant_item_sort2.xml
m-consultant/src/main/res/layout/consultant_item_sort2.xml
+26
-0
consultant_item_subject.xml
m-consultant/src/main/res/layout/consultant_item_subject.xml
+13
-13
consultant_item_tag.xml
m-consultant/src/main/res/layout/consultant_item_tag.xml
+1
-1
consultant_layout_search_content.xml
m-consultant/src/main/res/layout/consultant_layout_search_content.xml
+1
-0
consultant_ui_filter_popup.xml
m-consultant/src/main/res/layout/consultant_ui_filter_popup.xml
+3
-4
consultant_ui_subject_popup_window.xml
m-consultant/src/main/res/layout/consultant_ui_subject_popup_window.xml
+346
-33
HomeBaseImpl.kt
m-home/src/main/java/com/yidianling/home/event/HomeBaseImpl.kt
+2
-7
IHomeBaseEvent.kt
m-home/src/main/java/com/yidianling/home/event/IHomeBaseEvent.kt
+1
-1
HomeModuleTabEvent.java
m-home/src/main/modular_api/com/yidianling/home/api/event/HomeModuleTabEvent.java
+6
-0
YdlHomeAdapter.kt
m-home/src/ydl/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
+3
-3
YdlHomeFragment.kt
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
+13
-15
HomeButtonBannerView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeButtonBannerView.kt
+3
-3
DefaultFormatPrinter.java
ydl-net/src/main/java/com/ydl/ydlnet/builder/interceptor/log/DefaultFormatPrinter.java
+26
-23
No files found.
app/build.gradle
View file @
a58adebe
...
@@ -188,63 +188,34 @@ dependencies {
...
@@ -188,63 +188,34 @@ dependencies {
implementation
(
rootProject
.
ext
.
dependencies
[
"espresso-core"
])
implementation
(
rootProject
.
ext
.
dependencies
[
"espresso-core"
])
implementation
(
rootProject
.
ext
.
dependencies
[
"okhttp3"
])
implementation
(
rootProject
.
ext
.
dependencies
[
"okhttp3"
])
// TPNS SDK 主工程依赖包
// implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release'
implementation
fileTree
(
dir:
'aars'
,
include:
[
'*.aar'
])
if
(
true
)
{
implementation
project
(
':m-user'
)
//开发模式
implementation
modularPublication
(
'com.ydl:m-user-api'
)
implementation
fileTree
(
dir:
'aars'
,
include:
[
'*.aar'
])
implementation
project
(
':m-confide'
)
implementation
project
(
':m-user'
)
implementation
modularPublication
(
'com.ydl:m-confide-api'
)
implementation
modularPublication
(
'com.ydl:m-user-api'
)
api
project
(
':m-consultant'
)
implementation
project
(
':m-confide'
)
implementation
modularPublication
(
'com.ydl:m-consultant-api'
)
implementation
modularPublication
(
'com.ydl:m-confide-api'
)
api
project
(
':m-tests'
)
api
project
(
':m-consultant'
)
api
project
(
':m-home'
)
implementation
modularPublication
(
'com.ydl:m-consultant-api'
)
api
project
(
':m-confide'
)
api
project
(
':m-tests'
)
implementation
project
(
':ydl-flutter-base'
)
api
(
project
(
':ydl-platform'
))
{
transitive
=
true
api
project
(
':m-home'
)
api
project
(
':m-confide'
)
implementation
project
(
':ydl-flutter-base'
)
api
(
project
(
':ydl-platform'
))
{
transitive
=
true
}
implementation
project
(
':ydl-webview'
)
implementation
project
(
':ydl-media'
)
implementation
project
(
':m-muse'
)
implementation
project
(
':m-im'
)
implementation
modularPublication
(
'com.ydl:m-im-api'
)
implementation
project
(
':m-dynamic'
)
implementation
project
(
':m-course'
)
//文章模块
implementation
project
(
':m-article'
)
implementation
project
(
':m-audioim'
)
implementation
modularPublication
(
'com.ydl:m-audioim-api'
)
implementation
project
(
':m-fm'
)
implementation
modularPublication
(
'com.ydl:m-fm-api'
)
implementation
project
(
':ydl-tuicore'
)
}
else
{
//发布模式
api
'com.ydl:m-user-module-ydl:0.0.6'
api
rootProject
.
ext
.
dependencies
[
"ydl-webview"
]
api
rootProject
.
ext
.
dependencies
[
"ydl-m-user-api"
]
api
rootProject
.
ext
.
dependencies
[
"ydl-m-fm-api"
]
api
rootProject
.
ext
.
dependencies
[
"m-article"
]
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
transitive
=
true
}
api
(
rootProject
.
ext
.
dependencies
[
"ydl-tuicalling"
])
{
transitive
=
true
}
}
}
implementation
project
(
':ydl-webview'
)
implementation
project
(
':ydl-media'
)
implementation
project
(
':m-muse'
)
implementation
project
(
':m-im'
)
implementation
modularPublication
(
'com.ydl:m-im-api'
)
implementation
project
(
':m-dynamic'
)
implementation
project
(
':m-course'
)
implementation
project
(
':m-article'
)
implementation
project
(
':m-audioim'
)
implementation
modularPublication
(
'com.ydl:m-audioim-api'
)
implementation
project
(
':m-fm'
)
implementation
modularPublication
(
'com.ydl:m-fm-api'
)
implementation
project
(
':ydl-tuicore'
)
implementation
rootProject
.
ext
.
dependencies
[
"retrofit-url-manager"
]
implementation
rootProject
.
ext
.
dependencies
[
"retrofit-url-manager"
]
...
...
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
a58adebe
...
@@ -21,9 +21,9 @@ import java.util.List;
...
@@ -21,9 +21,9 @@ import java.util.List;
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
String
APP_DOMAIN
=
"https://api.github.com/"
;
String
APP_DOMAIN
=
"https://api.github.com/"
;
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
//
public static String appEnv = YDLConstants.ENV_TEST;
public
static
String
appEnv
=
YDLConstants
.
ENV_TEST
;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
public
static
String
appEnv
=
YDLConstants
.
ENV_PROD
;
//
public static String appEnv = YDLConstants.ENV_PROD;
@Override
@Override
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
lifecycles
.
add
(
new
DemoAppLifecycles
());
lifecycles
.
add
(
new
DemoAppLifecycles
());
...
...
config.gradle
View file @
a58adebe
...
@@ -6,10 +6,10 @@ ext {
...
@@ -6,10 +6,10 @@ ext {
// -------------- 业务模块 --------------
// -------------- 业务模块 --------------
//第三步 若干
//第三步 若干
"m-confide"
:
"0.0.49.72"
,
"m-confide"
:
"0.0.49.72"
,
"m-consultant"
:
"0.0.60.
2
1"
,
"m-consultant"
:
"0.0.60.
6
1"
,
"m-fm"
:
"0.0.30.08"
,
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.04"
,
"m-user"
:
"0.0.62.04"
,
"m-home"
:
"0.0.23.
44
"
,
"m-home"
:
"0.0.23.
80
"
,
"m-im"
:
"0.0.21.33"
,
"m-im"
:
"0.0.21.33"
,
"m-dynamic"
:
"0.0.7.37"
,
"m-dynamic"
:
"0.0.7.37"
,
"m-article"
:
"0.0.0.10"
,
"m-article"
:
"0.0.0.10"
,
...
@@ -27,7 +27,7 @@ ext {
...
@@ -27,7 +27,7 @@ ext {
"m-muse-api"
:
"0.0.1"
,
"m-muse-api"
:
"0.0.1"
,
"m-tests-api"
:
"0.0.2"
,
"m-tests-api"
:
"0.0.2"
,
"m-user-api"
:
"0.0.10.19"
,
"m-user-api"
:
"0.0.10.19"
,
"m-home-api"
:
"0.0.4.
2
"
,
"m-home-api"
:
"0.0.4.
4
"
,
"m-im-api"
:
"0.0.12.24"
,
"m-im-api"
:
"0.0.12.24"
,
"m-dynamic-api"
:
"0.0.3.71"
,
"m-dynamic-api"
:
"0.0.3.71"
,
//-------------- 功能组件 --------------
//-------------- 功能组件 --------------
...
@@ -35,7 +35,7 @@ ext {
...
@@ -35,7 +35,7 @@ ext {
//mdt 组件
//mdt 组件
"ydl-tuicore"
:
"0.0.22"
,
"ydl-tuicore"
:
"0.0.22"
,
//第一步
//第一步
"ydl-platform"
:
"0.0.4
0.97
"
,
"ydl-platform"
:
"0.0.4
1.25
"
,
//第二步 若干
//第二步 若干
"ydl-webview"
:
"0.0.38.62"
,
"ydl-webview"
:
"0.0.38.62"
,
...
@@ -46,7 +46,7 @@ ext {
...
@@ -46,7 +46,7 @@ ext {
//以下 几乎不会动
//以下 几乎不会动
"router"
:
"0.0.1"
,
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.3.9
3
"
,
"ydl-net"
:
"0.0.3.9
4
"
,
"ydl-utils"
:
"0.0.3.3"
,
"ydl-utils"
:
"0.0.3.3"
,
]
]
ydl_app
=
[
ydl_app
=
[
...
@@ -92,7 +92,7 @@ ext {
...
@@ -92,7 +92,7 @@ ext {
//第三步 若干
//第三步 若干
"m-confide"
:
"0.0.49.72"
,
"m-confide"
:
"0.0.49.72"
,
"m-consultant"
:
"0.0.60.
2
1"
,
"m-consultant"
:
"0.0.60.
6
1"
,
"m-fm"
:
"0.0.30.08"
,
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.04"
,
"m-user"
:
"0.0.62.04"
,
"m-home"
:
"0.0.23.41"
,
"m-home"
:
"0.0.23.41"
,
...
@@ -112,7 +112,7 @@ ext {
...
@@ -112,7 +112,7 @@ ext {
"m-muse-api"
:
"0.0.1"
,
"m-muse-api"
:
"0.0.1"
,
"m-tests-api"
:
"0.0.2"
,
"m-tests-api"
:
"0.0.2"
,
"m-user-api"
:
"0.0.10.19"
,
"m-user-api"
:
"0.0.10.19"
,
"m-home-api"
:
"0.0.4.
2
"
,
"m-home-api"
:
"0.0.4.
4
"
,
"m-im-api"
:
"0.0.12.24"
,
"m-im-api"
:
"0.0.12.24"
,
"m-dynamic-api"
:
"0.0.3.71"
,
"m-dynamic-api"
:
"0.0.3.71"
,
//-------------- 功能组件 --------------
//-------------- 功能组件 --------------
...
@@ -130,7 +130,7 @@ ext {
...
@@ -130,7 +130,7 @@ ext {
//以下 几乎不会动
//以下 几乎不会动
"router"
:
"0.0.1"
,
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.3.9
3
"
,
"ydl-net"
:
"0.0.3.9
4
"
,
"ydl-utils"
:
"0.0.3.3"
,
"ydl-utils"
:
"0.0.3.3"
,
]
]
...
...
m-consultant/build.gradle
View file @
a58adebe
...
@@ -68,7 +68,7 @@ dependencies {
...
@@ -68,7 +68,7 @@ dependencies {
androidTestImplementation
'androidx.test.ext:junit:1.1.1'
androidTestImplementation
'androidx.test.ext:junit:1.1.1'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.1.0'
kapt
'com.alibaba:arouter-compiler:1.2.2'
kapt
'com.alibaba:arouter-compiler:1.2.2'
implementation
rootProject
.
ext
.
dependencies
[
"BaseRecyclerViewAdapterHelper"
]
api
rootProject
.
ext
.
dependencies
[
"ydl-user-router"
]
api
rootProject
.
ext
.
dependencies
[
"ydl-user-router"
]
if
(
rootProject
.
ext
.
dev_mode
){
if
(
rootProject
.
ext
.
dev_mode
){
//开发时使用
//开发时使用
...
...
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
View file @
a58adebe
...
@@ -8,9 +8,8 @@ import android.app.Activity
...
@@ -8,9 +8,8 @@ import android.app.Activity
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.graphics.Typeface
import
android.graphics.Typeface
import
android.os.
Build
import
android.os.
Handler
import
android.text.TextUtils
import
android.text.TextUtils
import
android.view.Gravity
import
android.view.View
import
android.view.View
import
android.view.WindowManager
import
android.view.WindowManager
import
android.view.inputmethod.InputMethodManager
import
android.view.inputmethod.InputMethodManager
...
@@ -34,12 +33,10 @@ import com.ydl.ydlcommon.base.config.HttpConfig
...
@@ -34,12 +33,10 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.ui.LogoLoadingView
import
com.ydl.ydlcommon.ui.LogoLoadingView
import
com.ydl.ydlcommon.utils.BuryPointUtils
import
com.ydl.ydlcommon.utils.BuryPointUtils
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.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.RxDeviceTool
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.consultant.adapter.ExpertSearchAdapter
import
com.yidianling.consultant.adapter.ExpertSearchAdapter
...
@@ -94,7 +91,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -94,7 +91,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override
fun
initDataAndEvent
()
{
override
fun
initDataAndEvent
()
{
window
.
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_ADJUST_RESIZE
or
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_HIDDEN
)
window
.
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_ADJUST_RESIZE
or
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_HIDDEN
)
initViews
()
initViews
()
initData
(
intent
)
initData
(
intent
,
false
)
rl_hot_fix_for_huawei
.
visibility
=
View
.
VISIBLE
rl_hot_fix_for_huawei
.
visibility
=
View
.
VISIBLE
}
}
...
@@ -111,6 +108,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -111,6 +108,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
const
val
HOT_SEARCH_DOCTOR_NAME
=
"hot_search_doctor_name"
const
val
HOT_SEARCH_DOCTOR_NAME
=
"hot_search_doctor_name"
private
const
val
EXTRA_IS_SHOW_HOT
=
"isInitShowHot"
private
const
val
EXTRA_IS_SHOW_HOT
=
"isInitShowHot"
private
const
val
EXTRA_SEARCH_WORD
=
"searchWord"
private
const
val
EXTRA_SEARCH_WORD
=
"searchWord"
private
const
val
EXTRA_RELATED_WORD
=
"related_word"
private
const
val
EXTRA_IS_RECCOMMEND_WORD
=
"is_reccommend_word"
private
const
val
EXTRA_IS_FROM_SPLASH
=
"isFromSplash"
private
const
val
EXTRA_IS_FROM_SPLASH
=
"isFromSplash"
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
//非默认筛选状态
...
@@ -147,9 +146,24 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -147,9 +146,24 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
context
.
startActivity
(
intent
)
context
.
startActivity
(
intent
)
}
}
fun
startSearch
(
context
:
Context
,
searchWord
:
String
?)
{
/**
* 搜索页面过来的
* @param sign2为14 仅用于埋点
* @param relatedWord 搜索内容的关联词
* @param isRecommendWords 是否是推荐词
*/
fun
startSearch
(
context
:
Context
,
searchWord
:
String
?,
sign2
:
String
,
relatedWord
:
String
,
isRecommendWords
:
Boolean
)
{
val
intent
=
Intent
(
context
,
ExpertSearchActivity
::
class
.
java
)
val
intent
=
Intent
(
context
,
ExpertSearchActivity
::
class
.
java
)
intent
.
putExtra
(
EXTRA_SEARCH_WORD
,
searchWord
)
intent
.
putExtra
(
EXTRA_SEARCH_WORD
,
searchWord
)
intent
.
putExtra
(
EXTRA_RELATED_WORD
,
relatedWord
)
intent
.
putExtra
(
EXTRA_IS_RECCOMMEND_WORD
,
isRecommendWords
)
intent
.
putExtra
(
"sign2"
,
sign2
)
context
.
startActivity
(
intent
)
context
.
startActivity
(
intent
)
}
}
...
@@ -177,8 +191,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -177,8 +191,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private
val
allFilter
=
AllFilter
()
//当前筛选
private
val
allFilter
=
AllFilter
()
//当前筛选
private
val
tempFilter
=
AllFilter
()
//临时筛选,未确认状态
private
val
tempFilter
=
AllFilter
()
//临时筛选,未确认状态
private
var
curPage
=
1
private
var
curPage
=
1
private
val
doctorList
=
ArrayList
<
DoctorServiceItem
>()
private
val
doctorList
=
ArrayList
<
ExpertServiceItem
>()
private
val
serviceList
=
ArrayList
<
DoctorServiceItem
>()
private
var
hasMore
=
true
private
var
hasMore
=
true
private
var
initCategory
=
"0"
private
var
initCategory
=
"0"
private
var
initShowType
:
Int
=
1
private
var
initShowType
:
Int
=
1
...
@@ -188,11 +201,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -188,11 +201,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private
var
isFromSplash
=
false
private
var
isFromSplash
=
false
private
val
props1
=
JSONObject
()
//筛选标题埋点参数
private
val
props1
=
JSONObject
()
//筛选标题埋点参数
private
var
fromPageType
:
Int
=
1
//从哪个页面跳转过来的
private
var
fromPageType
:
Int
=
1
//从哪个页面跳转过来的
private
val
fromPages
=
arrayOf
(
"首页"
,
"搜索页面"
,
"在线专家"
)
private
var
isRecommend
=
false
//埋点数据
private
var
isRecommend
=
false
//埋点数据
private
var
keyWord
:
String
?
=
null
//埋点数据
private
var
cateName
:
String
?
=
null
private
var
mSign2
:
String
=
""
// 用于搜索页面进来的埋点参数
private
var
isDoSearch
:
Boolean
=
false
//埋点判断是否通过搜索进入埋点的
private
var
isDoSearch
:
Boolean
=
false
//埋点判断是否通过搜索进入埋点的
private
val
bannerList
=
ArrayList
<
String
>()
private
var
hasSelectedArea
=
false
//是否选择过地区
private
var
hasSelectedArea
=
false
//是否选择过地区
private
var
hasSelectedSort
=
false
//是否选择过排序
private
var
hasSelectedSort
=
false
//是否选择过排序
...
@@ -226,26 +238,21 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -226,26 +238,21 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
initNetLossView
()
initNetLossView
()
// etSearch.setOnEditorActionListener { _, actionId, _ ->
// if (actionId == EditorInfo.IME_ACTION_SEARCH) {
// doSearch()
// }
// true
// }
// etSearch.setOnClickListener { appbar_layout.setExpanded(false) }
// etSearch.setOnFocusChangeListener { view, b -> if (b) appbar_layout.setExpanded(false) }
btn_back
.
setOnClickListener
{
btn_back
.
setOnClickListener
{
onBackPressed
()
onBackPressed
()
}
}
doctorAdapter
=
ExpertSearchAdapter
(
this
,
this
,
doctorList
)
doctorAdapter
=
ExpertSearchAdapter
(
this
,
this
,
doctorList
)
val
layoutManager
=
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
)
rvExperts
.
adapter
=
doctorAdapter
val
layoutManager
=
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
)
rvExperts
.
layoutManager
=
layoutManager
rvExperts
.
layoutManager
=
layoutManager
rvExperts
.
adapter
=
doctorAdapter
doctorAdapter
.
setOnClickLister
(
object
:
ExpertSearchAdapter
.
OnClickLister
{
override
fun
onClick
(
searchWords
:
String
)
{
allFilter
.
searchWord
=
searchWords
refresh
(
false
)
}
})
onScrollListener
=
object
:
EndlessRecyclerViewScrollListener
(
layoutManager
)
{
onScrollListener
=
object
:
EndlessRecyclerViewScrollListener
(
layoutManager
)
{
private
var
isBtnShow
:
Boolean
=
false
private
var
isBtnShow
:
Boolean
=
false
private
var
sIsScrolling
=
false
private
var
sIsScrolling
=
false
...
@@ -276,10 +283,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -276,10 +283,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
override
fun
onScrollTop
()
{
override
fun
onScrollTop
()
{
va
r
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
l
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
r
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
l
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
r
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
l
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
r
animator
=
va
l
animator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
.
setDuration
(
200
)
.
setDuration
(
200
)
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
...
@@ -295,10 +302,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -295,10 +302,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
if
(
isBtnShow
)
{
if
(
isBtnShow
)
{
return
return
}
}
va
r
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
0f
,
1f
)
va
l
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
0f
,
1f
)
va
r
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
0f
,
1f
)
va
l
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
0f
,
1f
)
va
r
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
0f
,
1f
)
va
l
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
0f
,
1f
)
va
r
animator
=
va
l
animator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
.
setDuration
(
200
)
.
setDuration
(
200
)
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
...
@@ -314,10 +321,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -314,10 +321,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
if
(!
isBtnShow
)
{
if
(!
isBtnShow
)
{
return
return
}
}
va
r
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
l
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
r
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
l
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
r
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
l
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
r
animator
=
va
l
animator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
.
setDuration
(
200
)
.
setDuration
(
200
)
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
...
@@ -331,24 +338,12 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -331,24 +338,12 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override
fun
onLoadMore
(
page
:
Int
,
totalItemsCount
:
Int
,
view
:
RecyclerView
?)
{
override
fun
onLoadMore
(
page
:
Int
,
totalItemsCount
:
Int
,
view
:
RecyclerView
?)
{
if
(
hasMore
)
{
if
(
hasMore
)
{
curPage
++
getPresenter
().
fetchListData
(
allFilter
,
getPresenter
().
mExtras
)
getPresenter
().
fetchListData
(
allFilter
,
curPage
)
}
}
}
}
}
}
// rvExperts.addItemDecoration(ExpertItemDecoration(this))
rvExperts
.
addOnScrollListener
(
onScrollListener
)
rvExperts
.
addOnScrollListener
(
onScrollListener
)
rvExperts
.
addOnScrollListener
(
YDLImageRecyclerOnScrollListener
(
ExpertSearchActivity
@
this
))
rvExperts
.
addOnScrollListener
(
YDLImageRecyclerOnScrollListener
(
ExpertSearchActivity
@
this
))
// etSearch.addTextChangedListener(object : TextWatcher {
// override fun afterTextChanged(s: Editable?) {}
//
// override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
//
// override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
//
// }
//
// })
image_scroll_top
.
setOnClickListener
(
this
)
image_scroll_top
.
setOnClickListener
(
this
)
// initStatus()
// initStatus()
...
@@ -374,61 +369,78 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -374,61 +369,78 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override
fun
localData
()
{
override
fun
localData
()
{
}
}
override
fun
updateCache
(
showType
:
Int
,
searchBean
:
ExpertSearchBean
)
{
}
//路由传递过来的参数
//路由传递过来的参数
private
fun
getRouterParam
()
{
private
fun
getRouterParam
()
{
if
(
null
!=
intent
&&
intent
.
hasExtra
(
"routerParam"
))
{
if
(
null
!=
intent
&&
intent
.
hasExtra
(
"routerParam"
))
{
val
params
=
intent
.
getStringExtra
(
"routerParam"
)
val
params
=
intent
.
getStringExtra
(
"routerParam"
)
val
paramsJson
=
JSONObject
(
params
)
val
paramsJson
=
JSONObject
(
params
)
initCategory
=
paramsJson
.
getString
(
"cateId"
)
initCategory
=
paramsJson
.
getString
(
"cateId"
)
keyWord
=
paramsJson
.
getString
(
"cateTitle"
)
cateName
=
paramsJson
.
getString
(
"cateTitle"
)
mSign2
=
cateName
!!
initShowType
=
paramsJson
.
getString
(
"showType"
).
toInt
()
initShowType
=
paramsJson
.
getString
(
"showType"
).
toInt
()
}
}
}
}
private
fun
initData
(
mIntent
:
Intent
)
{
private
fun
initData
(
mIntent
:
Intent
,
isRefresh
:
Boolean
)
{
fromPageType
=
mIntent
.
getIntExtra
(
EXTRA_FROM_PAGE
,
-
1
)
fromPageType
=
mIntent
.
getIntExtra
(
EXTRA_FROM_PAGE
,
-
1
)
initCategory
=
mIntent
.
getStringExtra
(
EXTRA_CATEGORY
)
?:
""
initCategory
=
mIntent
.
getStringExtra
(
EXTRA_CATEGORY
)
?:
""
initShowType
=
mIntent
.
getIntExtra
(
EXTRA_SHOW_TYPE
,
0
)
initShowType
=
mIntent
.
getIntExtra
(
EXTRA_SHOW_TYPE
,
0
)
tv_search_content
.
text
=
mIntent
.
getStringExtra
(
EXTRA_SEARCH_WORD
)
val
relatedWord
=
mIntent
.
getStringExtra
(
EXTRA_RELATED_WORD
)
// 搜索内容的联想词
keyWord
=
mIntent
.
getStringExtra
(
EXTRA_CATEGORY_NAME
)
?:
""
val
searchWord
=
mIntent
.
getStringExtra
(
EXTRA_SEARCH_WORD
)
val
isRecommendWords
=
mIntent
.
getBooleanExtra
(
EXTRA_IS_RECCOMMEND_WORD
,
false
)
if
(!
TextUtils
.
isEmpty
(
relatedWord
))
{
// 判断搜索内容的联想词为空,则用搜索词进行搜索
allFilter
.
searchWord
=
relatedWord
}
else
{
allFilter
.
searchWord
=
searchWord
}
mSign2
=
mIntent
.
getStringExtra
(
"sign2"
)
?:
""
getRouterParam
()
getRouterParam
()
allFilter
.
showType
.
key
=
initShowType
allFilter
.
showType
.
key
=
initShowType
val
cat
=
CateItem
()
if
(!
TextUtils
.
isEmpty
(
initCategory
)&&
initCategory
!=
"0"
)
{
cat
.
cateId
=
initCategory
allFilter
.
categoryId2List
.
add
(
initCategory
)
allFilter
.
categories
.
clear
()
}
allFilter
.
categories
.
add
(
cat
)
if
(!
TextUtils
.
isEmpty
(
cateName
))
{
tvSubject
.
text
=
cateName
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
}
getPresenter
().
fetchListHead
()
getPresenter
().
fetchListHead
()
//加载本地缓存数据
if
(
isRefresh
)
{
getPresenter
().
localData
(
initShowType
)
refresh
(
false
)
refresh
(
false
)
}
tv_search_content
.
text
=
searchWord
// 判断搜索词和联想词不一样,则显示匹配结果
LogUtil
.
e
(
"searchWord:${searchWord}"
)
LogUtil
.
e
(
"relatedWord:${relatedWord}"
)
if
(!
TextUtils
.
isEmpty
(
searchWord
)
&&
!
TextUtils
.
isEmpty
(
relatedWord
)
&&
searchWord
!=
relatedWord
)
{
if
(
doctorList
.
size
>
0
&&
doctorList
[
0
].
is_head_view
)
{
doctorList
[
0
]
=
ExpertServiceItem
(
true
,
searchWord
,
relatedWord
)
}
else
if
(
doctorList
.
size
>
0
)
{
doctorList
.
add
(
0
,
ExpertServiceItem
(
true
,
searchWord
,
relatedWord
))
}
else
{
doctorList
.
add
(
ExpertServiceItem
(
true
,
searchWord
,
relatedWord
))
}
}
else
{
if
(
doctorList
.
size
>
0
&&
doctorList
[
0
].
is_head_view
)
{
doctorList
.
removeAt
(
0
)
}
}
v_loading
.
visibility
=
View
.
VISIBLE
v_loading
.
visibility
=
View
.
VISIBLE
v_loading
.
setViewType
(
LogoLoadingView
.
TYPE_LOADING
,
null
)
v_loading
.
setViewType
(
LogoLoadingView
.
TYPE_LOADING
,
null
)
doctorAdapter
.
clickCount
=
0
doctorAdapter
.
setIsRecommendWords
(
isRecommendWords
)
doctorAdapter
.
setEntrance
(
1
)
doctorAdapter
.
setEntrance
(
1
)
}
}
override
fun
onNewIntent
(
intent
:
Intent
?)
{
override
fun
onNewIntent
(
intent
:
Intent
?)
{
super
.
onNewIntent
(
intent
)
super
.
onNewIntent
(
intent
)
initData
(
intent
!!
)
initData
(
intent
!!
,
true
)
}
}
/**
* 初始化状态栏位置
*/
private
fun
initStatus
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//4.4以下不支持状态栏变色
StatusBarUtils
.
setTransparentForImageView
(
this
,
null
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
this
)
val
lp1
=
title_layout
.
layoutParams
as
LinearLayout
.
LayoutParams
lp1
.
height
=
(
RxImageTool
.
dp2px
(
48f
)
+
statusBarHeight
)
title_layout
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
}
}
//返回键处理,热门搜索如果可见,则隐藏,来自启动页,则打开主界面
//返回键处理,热门搜索如果可见,则隐藏,来自启动页,则打开主界面
override
fun
onBackPressed
()
{
override
fun
onBackPressed
()
{
...
@@ -443,34 +455,61 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -443,34 +455,61 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override
fun
onHeadFetched
(
headData
:
HeadData
?)
{
override
fun
onHeadFetched
(
headData
:
HeadData
?)
{
//头部数据获取到后初始化筛选数据
//头部数据获取到后初始化筛选数据
this
.
headData
=
headData
this
.
headData
=
headData
if
(
initCategory
!=
"0"
)
{
headData
?.
let
{
it
->
if
(
headData
?.
cates
!=
null
)
{
// allFilter.reorder = it.reorder[0]
for
(
cate
in
headData
.
cates
)
{
allFilter
.
showType
=
it
.
filters
.
showType
[
initShowType
]
if
(
cate
.
cateId
==
initCategory
)
{
if
(
it
.
highlighter
.
size
>
0
)
{
allFilter
.
categories
.
clear
()
//设置热门搜索
allFilter
.
categories
.
add
(
cate
)
initHotViews
(
lin_filter2
,
it
.
highlighter
)
if
(
allFilter
.
categories
.
size
==
1
&&
!
"全部"
.
equals
(
allFilter
.
categories
[
0
].
cateName
))
{
}
//显示选中标题
it
.
cates
[
0
].
children
?.
forEachIndexed
{
index
,
children
->
tvSubject
.
text
=
allFilter
.
categories
[
0
].
cateName
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
}
else
{
val
childrenBean
=
//显示主标题
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
tvSubject
.
text
=
"主题"
allFilter
.
childList
.
add
(
childrenBean
)
}
}
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
it
.
cates
[
1
].
children
?.
forEachIndexed
{
index
,
children
->
break
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
}
val
childrenBean
=
}
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
stressList
.
add
(
childrenBean
)
}
it
.
cates
[
2
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
loveEmotionList
.
add
(
childrenBean
)
}
it
.
cates
[
3
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
marriedFamilyList
.
add
(
childrenBean
)
}
it
.
cates
[
4
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
personalGrowthList
.
add
(
childrenBean
)
}
it
.
cates
[
5
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
interpersonalRelationshipList
.
add
(
childrenBean
)
}
it
.
cates
[
6
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
careerDevelopmentList
.
add
(
childrenBean
)
}
it
.
cates
[
7
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
mentalHealthList
.
add
(
childrenBean
)
}
}
initCategory
=
"0"
}
else
{
allFilter
.
categories
.
clear
()
allFilter
.
categories
.
add
(
headData
?.
cates
?.
get
(
0
)
?:
CateItem
())
}
allFilter
.
reorder
=
headData
?.
reorder
?.
get
(
0
)
?:
ReorderItem
()
allFilter
.
showType
=
headData
?.
filters
?.
showType
?.
get
(
initShowType
)
?:
ShowTypeItem
()
if
(
headData
?.
highlighter
?.
size
?:
0
>
0
)
{
//设置热门搜索
initHotViews
(
lin_filter2
,
headData
!!
.
highlighter
)
}
}
}
}
...
@@ -481,9 +520,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -481,9 +520,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
if
(
view
.
childCount
>
0
)
{
if
(
view
.
childCount
>
0
)
{
return
return
}
}
val
popWidth
=
RxDeviceTool
.
getScreenWidth
(
mContext
)
for
(
hot
in
hotData
)
{
val
mWidth
=
(
popWidth
-
RxImageTool
.
dp2px
(
10f
))
/
hotData
.
size
for
((
index
,
hot
)
in
hotData
!!
.
withIndex
())
{
val
tv
=
val
tv
=
View
.
inflate
(
mContext
,
R
.
layout
.
consultant_item_filter_online
,
null
)
as
TextView
View
.
inflate
(
mContext
,
R
.
layout
.
consultant_item_filter_online
,
null
)
as
TextView
val
textView
=
tv
.
tvFree
val
textView
=
tv
.
tvFree
...
@@ -502,6 +539,14 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -502,6 +539,14 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
dealHotSelect
(
hot
,
true
)
dealHotSelect
(
hot
,
true
)
textView
.
isSelected
=
true
textView
.
isSelected
=
true
textView
.
paint
.
isFakeBoldText
=
true
textView
.
paint
.
isFakeBoldText
=
true
// 埋点
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
ConsultEvent
.
POSITION_CHOICE_FILTER_CLICK
,
hot
.
value
!!
,
"app"
,
""
)
}
}
filterLabelSet
()
filterLabelSet
()
//开始筛选数据
//开始筛选数据
...
@@ -528,36 +573,37 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -528,36 +573,37 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private
fun
dealHotSelect
(
hotData
:
HighlighterItem
,
isAdd
:
Boolean
)
{
private
fun
dealHotSelect
(
hotData
:
HighlighterItem
,
isAdd
:
Boolean
)
{
when
(
hotData
.
type
)
{
when
(
hotData
.
type
)
{
"1"
->
{
"1"
->
{
if
(
headData
?.
cates
!!
.
size
>
0
)
{
// if (headData?.cates!!.size > 0) {
for
(
bean
in
headData
?.
cates
!!
)
{
// for (bean in headData?.cates!!) {
if
(
TextUtils
.
equals
(
hotData
.
id
,
bean
.
cateId
.
toString
()))
{
// if (TextUtils.equals(hotData.id, bean.cateId.toString())) {
if
(
isAdd
)
{
// if (isAdd) {
if
(
allFilter
.
categories
.
size
==
1
&&
allFilter
.
categories
[
0
].
cateId
==
"0"
)
{
// if (allFilter.categories.size == 1 && allFilter.categories[0].cateId == "0") {
allFilter
.
categories
.
clear
()
// allFilter.categories.clear()
}
// }
allFilter
.
categories
.
add
(
bean
)
// allFilter.categories.add(bean)
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
// updateFilterTextViewStatus(tvSubject, FILTER_STATUS_FILTERED)
}
else
{
// } else {
allFilter
.
categories
.
remove
(
bean
)
// allFilter.categories.remove(bean)
if
(
allFilter
.
categories
.
size
==
0
)
{
// if (allFilter.categories.size == 0) {
allFilter
.
categories
.
add
(
headData
?.
cates
?.
get
(
0
)
?:
CateItem
())
// allFilter.categories.add(headData?.cates?.get(0) ?: CateItem())
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_NORMAL
)
// updateFilterTextViewStatus(tvSubject, FILTER_STATUS_NORMAL)
}
// }
}
// }
}
// }
}
// }
if
(
allFilter
.
categories
.
size
==
1
&&
"全部"
!=
allFilter
.
categories
[
0
].
cateName
)
{
// if (allFilter.categories.size == 1 && "全部" != allFilter.categories[0].cateName) {
//显示选中标题
// //显示选中标题
tvSubject
.
text
=
allFilter
.
categories
[
0
].
cateName
// tvSubject.text = allFilter.categories[0].cateName
}
else
{
// } else {
//显示主标题
// //显示主标题
tvSubject
.
text
=
"主题"
// tvSubject.text = "主题"
}
// }
}
// }
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
}
}
"2"
->
{
//省
"2"
->
{
//省
if
(
headData
?.
region
!!
.
size
>
0
)
{
if
(
headData
?.
region
!!
.
size
>
0
)
{
va
r
bean
=
RegionItem
()
va
l
bean
=
RegionItem
()
if
(
isAdd
)
{
if
(
isAdd
)
{
//热门中如果选择过地区、要把其他已选中的置位未选中
//热门中如果选择过地区、要把其他已选中的置位未选中
if
(
hasSelectedArea
)
{
if
(
hasSelectedArea
)
{
...
@@ -764,7 +810,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -764,7 +810,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//用于侧滑筛选过来更新快捷筛选选中状态
//用于侧滑筛选过来更新快捷筛选选中状态
private
fun
updateOtherViews
(
other
d
ata
:
List
<
OtherItem
>)
{
private
fun
updateOtherViews
(
other
D
ata
:
List
<
OtherItem
>)
{
if
(
lin_filter2
.
childCount
>
0
)
{
if
(
lin_filter2
.
childCount
>
0
)
{
//清空选中
//清空选中
for
(
i
in
0
.
until
(
lin_filter2
.
childCount
))
{
for
(
i
in
0
.
until
(
lin_filter2
.
childCount
))
{
...
@@ -773,7 +819,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -773,7 +819,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
textView
.
paint
.
isFakeBoldText
=
false
textView
.
paint
.
isFakeBoldText
=
false
}
}
//重置选中状态
//重置选中状态
for
(
(
index
,
other
)
in
otherdata
.
withIndex
()
)
{
for
(
other
in
otherData
)
{
for
(
i
in
0
until
lin_filter2
.
childCount
)
{
for
(
i
in
0
until
lin_filter2
.
childCount
)
{
val
textView
=
lin_filter2
.
getChildAt
(
i
)
as
TextView
val
textView
=
lin_filter2
.
getChildAt
(
i
)
as
TextView
if
(
textView
.
text
==
other
.
value
)
{
if
(
textView
.
text
==
other
.
value
)
{
...
@@ -785,89 +831,62 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -785,89 +831,62 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
}
//服务列表数据获取到后的回调
/**
override
fun
onServiceListFetched
(
* 获取专家列表数据
data
:
MutableList
<
DoctorServiceItem
>,
*/
page
:
Int
,
totalPage
:
Int
)
{
LogUtil
.
d
(
"onServiceListFetched"
)
// if (rvExperts.adapter != serviceAdapter) {
// rvExperts.adapter = serviceAdapter
// }
if
(
page
==
1
)
{
if
(
fromPageType
!=
-
1
&&
isDoSearch
)
{
// LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType])
}
serviceList
.
clear
()
hasMore
=
true
// serviceAdapter.hasMore = true
}
if
(
fromPageType
==
-
1
)
{
bury
(
keyWord
?:
""
,
data
.
size
>
0
,
isRecommend
,
"首页分类"
)
}
else
{
bury
(
keyWord
?:
""
,
data
.
size
>
0
,
isRecommend
,
fromPages
[
fromPageType
])
}
if
(
page
>=
totalPage
)
{
hasMore
=
false
// serviceAdapter.hasMore = false
}
serviceList
.
addAll
(
data
)
// serviceAdapter.notifyDataSetChanged()
isRecommend
=
false
isDoSearch
=
false
v_loading
.
visibility
=
View
.
GONE
ll_network_error
.
visibility
=
View
.
GONE
rvExperts
.
visibility
=
View
.
VISIBLE
dismissProgressDialog
()
srlContainer
.
isRefreshing
=
false
}
//专家列表数据获取到后的回调
override
fun
onDoctorListFetched
(
override
fun
onDoctorListFetched
(
data
:
MutableList
<
Doctor
ServiceItem
>,
data
:
MutableList
<
Expert
ServiceItem
>,
page
:
Int
,
extras
:
Extras
?
,
total
Page
:
Int
cur
Page
:
Int
)
{
)
{
LogUtil
.
d
(
"onDoctorListFetched"
)
if
(
rvExperts
.
adapter
!=
doctorAdapter
)
{
if
(
rvExperts
.
adapter
!=
doctorAdapter
)
{
rvExperts
.
adapter
=
doctorAdapter
rvExperts
.
adapter
=
doctorAdapter
}
}
LogUtil
.
d
(
"data size "
+
data
.
size
)
if
(
page
==
1
)
{
// 如果是第一页
if
(
fromPageType
!=
-
1
&&
isDoSearch
)
{
if
(
curPage
==
1
)
{
// LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType])
if
(
data
.
size
>=
10
)
{
hasMore
=
true
doctorAdapter
.
hasMore
=
true
}
else
{
hasMore
=
false
doctorAdapter
.
hasMore
=
false
}
if
(
doctorList
.
size
>
0
&&
doctorList
[
0
].
is_head_view
)
{
val
expertServiceItem
=
doctorList
[
0
]
doctorList
.
clear
()
doctorList
.
add
(
expertServiceItem
)
}
else
{
doctorList
.
clear
()
}
}
doctorList
.
clear
()
doctorAdapter
.
hasMore
=
true
hasMore
=
true
}
if
(
fromPageType
==
-
1
)
{
bury
(
keyWord
?:
""
,
data
!=
null
&&
data
.
size
>
0
,
isRecommend
,
"首页分类"
)
}
else
{
bury
(
keyWord
?:
""
,
data
!=
null
&&
data
.
size
>
0
,
isRecommend
,
fromPages
[
fromPageType
])
}
}
if
(
page
>=
totalPage
)
{
if
(
data
.
size
==
0
)
{
// data的长度为0的时候为最后一页
hasMore
=
false
hasMore
=
false
doctorAdapter
.
hasMore
=
false
doctorAdapter
.
hasMore
=
false
}
else
{
doctorList
.
addAll
(
data
)
}
}
doctorList
.
addAll
(
data
)
doctorAdapter
.
notifyDataSetChanged
()
doctorAdapter
.
notifyDataSetChanged
()
isDoSearch
=
false
isDoSearch
=
false
isRecommend
=
false
isRecommend
=
false
v_loading
.
visibility
=
View
.
GONE
v_loading
.
visibility
=
View
.
GONE
ll_network_error
.
visibility
=
View
.
GONE
ll_network_error
.
visibility
=
View
.
GONE
rvExperts
.
visibility
=
View
.
VISIBLE
rvExperts
.
visibility
=
View
.
VISIBLE
dismissProgressDialog
()
srlContainer
.
isRefreshing
=
false
srlContainer
.
isRefreshing
=
false
// 埋点
val
sign1
=
data
.
joinToString
(
","
)
{
it
.
id
}
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT
,
sign1
,
mSign2
,
"app"
)
}
}
override
fun
fetchListFailed
(
msg
:
String
?)
{
override
fun
fetchListFailed
(
msg
:
String
?)
{
...
@@ -893,14 +912,27 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -893,14 +912,27 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
isDoSearch
=
false
isDoSearch
=
false
isRecommend
=
false
isRecommend
=
false
tv_reload
.
visibility
=
View
.
GONE
if
(
doctorList
.
size
>
0
&&
doctorList
[
0
].
is_head_view
)
{
tv_reload_hint
.
text
=
msg
val
expertServiceItem
=
doctorList
[
0
]
ll_network_error
.
visibility
=
View
.
VISIBLE
doctorList
.
clear
()
iv_exception
.
setImageResource
(
R
.
drawable
.
platform_ico_img_zixun_empty
)
doctorList
.
add
(
expertServiceItem
)
doctorAdapter
.
notifyDataSetChanged
()
v_loading
.
visibility
=
View
.
GONE
ll_network_error
.
visibility
=
View
.
GONE
rvExperts
.
visibility
=
View
.
VISIBLE
}
else
{
tv_reload
.
visibility
=
View
.
GONE
tv_reload_hint
.
text
=
msg
ll_network_error
.
visibility
=
View
.
VISIBLE
iv_exception
.
setImageResource
(
R
.
drawable
.
platform_ico_img_zixun_empty
)
rvExperts
.
visibility
=
View
.
GONE
dismissProgressDialog
()
srlContainer
.
isRefreshing
=
false
}
rvExperts
.
visibility
=
View
.
GONE
dismissProgressDialog
()
srlContainer
.
isRefreshing
=
false
}
}
override
fun
fetchFailed
(
msg
:
String
?)
{
override
fun
fetchFailed
(
msg
:
String
?)
{
...
@@ -938,7 +970,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -938,7 +970,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
postDelayed
({
appbar_layout
.
postDelayed
({
showSubjectPopupWindow
()
showSubjectPopupWindow
()
},
300
)
;
},
300
)
}
}
R
.
id
.
tvArea
->
{
R
.
id
.
tvArea
->
{
...
@@ -947,7 +979,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -947,7 +979,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
postDelayed
({
appbar_layout
.
postDelayed
({
showAreaPopupWindow
()
showAreaPopupWindow
()
},
300
)
;
},
300
)
}
}
R
.
id
.
tvSort
->
{
R
.
id
.
tvSort
->
{
...
@@ -956,7 +988,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -956,7 +988,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
postDelayed
({
appbar_layout
.
postDelayed
({
showSortPopupWindow
()
showSortPopupWindow
()
},
300
)
;
},
300
)
}
}
R
.
id
.
tvFilter
->
{
R
.
id
.
tvFilter
->
{
...
@@ -965,7 +997,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -965,7 +997,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
postDelayed
({
appbar_layout
.
postDelayed
({
showFilterPopupWindow
()
showFilterPopupWindow
()
},
300
)
;
},
300
)
}
}
R
.
id
.
tv_guide
->
{
R
.
id
.
tv_guide
->
{
...
@@ -1001,7 +1033,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1001,7 +1033,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//显示筛选弹窗
//显示筛选弹窗
private
fun
showFilterPopupWindow
()
{
private
fun
showFilterPopupWindow
()
{
// tempFilter.searchWord = etSearch.text.toString()
tempFilter
.
categories
.
clear
()
tempFilter
.
categories
.
clear
()
tempFilter
.
categories
.
addAll
(
allFilter
.
categories
)
tempFilter
.
categories
.
addAll
(
allFilter
.
categories
)
tempFilter
.
reorder
=
allFilter
.
reorder
tempFilter
.
reorder
=
allFilter
.
reorder
...
@@ -1027,7 +1058,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1027,7 +1058,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
if
(
headData
?.
filters
!=
null
)
{
if
(
headData
?.
filters
!=
null
)
{
val
filterPopupWindow
=
FilterPopupWindow
(
this
,
headData
?.
filters
!!
,
tempFilter
)
val
filterPopupWindow
=
FilterPopupWindow
(
this
,
headData
?.
filters
!!
,
tempFilter
)
filterPopupWindow
.
setOnDismissListener
{
filterPopupWindow
.
setOnDismissListener
{
//
viewDim.visibility = View.INVISIBLE
viewDim
.
visibility
=
View
.
INVISIBLE
viewDim_filter
.
visibility
=
View
.
GONE
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
.
ages
.
size
+
allFilter
.
doctorEdu
.
size
+
allFilter
.
title
.
size
>
0
||
!
TextUtils
.
isEmpty
(
allFilter
.
priceRanges
?.
minPrice
allFilter
.
priceRanges
?.
minPrice
...
@@ -1040,12 +1071,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1040,12 +1071,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
ConsultAssistantDialogUtils
.
INSTANCE
.
fitRequest
(
this
,
"doctor_list"
,
true
)
ConsultAssistantDialogUtils
.
INSTANCE
.
fitRequest
(
this
,
"doctor_list"
,
true
)
}
}
filterPopupWindow
.
isClippingEnabled
=
false
filterPopupWindow
.
isClippingEnabled
=
false
filterPopupWindow
.
showA
tLocation
(
viewSep2
.
rootView
,
Gravity
.
TOP
+
Gravity
.
RIGHT
,
0
,
0
)
filterPopupWindow
.
showA
sDropDown
(
viewSep2
)
ConsultAssistantDialogUtils
.
INSTANCE
.
hideAssistantActivity
()
ConsultAssistantDialogUtils
.
INSTANCE
.
hideAssistantActivity
()
filterPopupWindow
.
onFilterConfirmListener
=
this
filterPopupWindow
.
onFilterConfirmListener
=
this
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_OPEN
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_OPEN
)
// viewDim.visibility = View.VISIBLE
viewDim
.
visibility
=
View
.
VISIBLE
viewDim_filter
.
visibility
=
View
.
VISIBLE
}
else
{
}
else
{
ToastUtil
.
toastShort
(
"数据初始化失败,请重试"
)
ToastUtil
.
toastShort
(
"数据初始化失败,请重试"
)
getPresenter
().
fetchListHead
()
getPresenter
().
fetchListHead
()
...
@@ -1055,21 +1085,35 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1055,21 +1085,35 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//筛选确认回调
//筛选确认回调
override
fun
onFilterConfirmed
()
{
override
fun
onFilterConfirmed
()
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_OPEN
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_OPEN
)
LogUtil
.
d
(
"filter: "
+
tempFilter
.
showType
.
value
+
","
LogUtil
.
d
(
+
tempFilter
.
enquiries
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
"filter: "
+
tempFilter
.
showType
.
value
+
","
+
tempFilter
.
ages
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
enquiries
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
others
.
map
{
it
.
value
}.
joinToString
(
","
)+
","
+
tempFilter
.
ages
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
doctorEdu
.
map
{
it
.
value
}.
joinToString
(
","
))
+
tempFilter
.
others
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
doctorEdu
.
map
{
it
.
value
}.
joinToString
(
","
)
)
props1
.
put
(
props1
.
put
(
"filtrate_second"
,
"filtrate_second"
,
tempFilter
.
showType
.
value
+
","
tempFilter
.
showType
.
value
+
","
+
tempFilter
.
enquiries
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
enquiries
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
ages
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
ages
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
others
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
others
.
map
{
it
.
value
}.
joinToString
(
","
)
+
","
+
tempFilter
.
doctorEdu
.
map
{
it
.
value
}.
joinToString
(
","
)
+
tempFilter
.
doctorEdu
.
map
{
it
.
value
}.
joinToString
(
","
)
)
)
BuryPointUtils
.
buryPoint
(
"Filtrate"
,
props1
)
BuryPointUtils
.
buryPoint
(
"Filtrate"
,
props1
)
// 埋点
if
(
tempFilter
.
specialityCrowd
.
size
>
0
)
{
val
sign1
=
tempFilter
.
specialityCrowd
.
joinToString
(
","
)
{
it
.
value
!!
}
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_FILTER_PAGE
,
ConsultBIConstants
.
ConsultEvent
.
POSITION_GOODAT_CROWD_CLICK
,
sign1
,
"app"
,
""
)
}
allFilter
.
showType
=
tempFilter
.
showType
allFilter
.
showType
=
tempFilter
.
showType
allFilter
.
enquiries
.
clear
()
allFilter
.
enquiries
.
clear
()
...
@@ -1188,21 +1232,29 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1188,21 +1232,29 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private
fun
filterLabelSet
()
{
private
fun
filterLabelSet
()
{
if
((
allFilter
.
others
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
doctorEdu
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
)
==
1
)
{
if
((
allFilter
.
others
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
doctorEdu
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
)
==
1
)
{
var
text
:
String
?
=
""
var
text
:
String
?
=
""
if
(
allFilter
.
others
.
size
==
1
)
{
when
{
text
=
allFilter
.
others
[
0
].
value
allFilter
.
others
.
size
==
1
->
{
}
else
if
(
allFilter
.
ages
.
size
==
1
)
{
text
=
allFilter
.
others
[
0
].
value
text
=
allFilter
.
ages
[
0
].
value
}
}
else
if
(
allFilter
.
enquiries
.
size
==
1
)
{
allFilter
.
ages
.
size
==
1
->
{
text
=
allFilter
.
enquiries
[
0
].
value
text
=
allFilter
.
ages
[
0
].
value
}
else
if
(
allFilter
.
title
.
size
==
1
)
{
}
text
=
allFilter
.
title
[
0
].
value
allFilter
.
enquiries
.
size
==
1
->
{
}
else
if
(
allFilter
.
specialityCrowd
.
size
==
1
)
{
text
=
allFilter
.
enquiries
[
0
].
value
text
=
allFilter
.
specialityCrowd
[
0
].
value
}
}
else
if
(
allFilter
.
doctorEdu
.
size
==
1
){
allFilter
.
title
.
size
==
1
->
{
//学历
text
=
allFilter
.
title
[
0
].
value
text
=
allFilter
.
doctorEdu
[
0
].
value
}
}
else
{
allFilter
.
specialityCrowd
.
size
==
1
->
{
text
=
"筛选"
text
=
allFilter
.
specialityCrowd
[
0
].
value
}
allFilter
.
doctorEdu
.
size
==
1
->
{
//学历
text
=
allFilter
.
doctorEdu
[
0
].
value
}
else
->
{
text
=
"筛选"
}
}
}
if
(
text
?.
length
?:
0
>
4
)
{
if
(
text
?.
length
?:
0
>
4
)
{
tvFilter
.
text
=
text
?.
substring
(
0
,
3
)
+
"..."
tvFilter
.
text
=
text
?.
substring
(
0
,
3
)
+
"..."
...
@@ -1249,12 +1301,16 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1249,12 +1301,16 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
?:
""
?:
""
)
)
if
(
sortItem
.
value
.
equals
(
"综合排序"
))
{
when
{
tvSort
.
text
=
"排序"
sortItem
.
value
.
equals
(
"综合排序"
)
->
{
}
else
if
(
sortItem
.
value
?.
length
?:
0
>
4
)
{
tvSort
.
text
=
"排序"
tvSort
.
text
=
sortItem
.
value
?.
substring
(
0
,
3
)
+
"..."
}
}
else
{
sortItem
.
value
?.
length
?:
0
>
4
->
{
tvSort
.
text
=
sortItem
.
value
tvSort
.
text
=
sortItem
.
value
?.
substring
(
0
,
3
)
+
"..."
}
else
->
{
tvSort
.
text
=
sortItem
.
value
}
}
}
//判断排序选中,判断热门筛选中是否也有该排序
//判断排序选中,判断热门筛选中是否也有该排序
...
@@ -1366,31 +1422,26 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1366,31 +1422,26 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
}
private
var
categoryPopup
:
CategoryPopupWindow
?
=
null
private
var
mHandler
:
Handler
?
=
null
//显示主题弹窗
/**
* 显示主题弹窗
*/
private
fun
showSubjectPopupWindow
()
{
private
fun
showSubjectPopupWindow
()
{
tempFilter
.
categories
.
clear
()
val
categoryPopup
=
CategoryPopupWindow
(
this
,
allFilter
)
tempFilter
.
categories
.
addAll
(
allFilter
.
categories
)
mHandler
=
Handler
()
val
categories
=
headData
?.
cates
mHandler
!!
.
post
{
if
(
categories
!=
null
)
{
categoryPopup
.
updateData
()
categoryPopup
=
CategoryPopupWindow
(
this
,
categories
,
tempFilter
.
categories
)
}
categoryPopup
!!
.
setOnDismissListener
{
categoryPopup
.
setOnDismissListener
{
viewDim
.
visibility
=
View
.
INVISIBLE
viewDim
.
visibility
=
View
.
INVISIBLE
if
(
allFilter
.
categories
.
size
>
1
||
(
allFilter
.
categories
.
size
==
1
&&
allFilter
.
categories
[
0
]
!=
headData
!!
.
cates
[
0
]))
{
ConsultAssistantDialogUtils
.
INSTANCE
.
fitRequest
(
this
,
"doctor_list"
,
true
)
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
}
else
{
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_NORMAL
)
}
}
categoryPopup
!!
.
onSubjectsSelectedListener
=
this
categoryPopup
!!
.
showAsDropDown
(
viewSep2
)
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_OPEN
)
viewDim
.
visibility
=
View
.
VISIBLE
}
else
{
ToastUtil
.
toastShort
(
"数据初始化失败,请重试"
)
getPresenter
().
fetchListHead
()
}
}
ConsultAssistantDialogUtils
.
INSTANCE
.
hideAssistantActivity
()
categoryPopup
.
onSubjectsSelectedListener
=
this
categoryPopup
.
showAsDropDown
(
viewSep2
)
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_OPEN
)
viewDim
.
visibility
=
View
.
VISIBLE
}
}
/**
/**
...
@@ -1398,58 +1449,24 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1398,58 +1449,24 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
*
*
* 新增逻辑:当主题选择后,需要判断热门筛选中是否也有该主题,如果有,也需要同步更新选中状态
* 新增逻辑:当主题选择后,需要判断热门筛选中是否也有该主题,如果有,也需要同步更新选中状态
*/
*/
override
fun
onCategoriesSelected
(
categories
:
ArrayList
<
CateItem
>)
{
override
fun
onCategoriesSelected
(
signLit
:
ArrayList
<
String
>)
{
ActionCountUtils
.
count
(
if
(
signLit
.
isNotEmpty
())
{
ConsultBIConstants
.
ConsultEvent
.
APP_CONSULT_LIST_THEME_CLICK
,
val
sign1
=
signLit
.
joinToString
(
","
)
{
it
}
categories
.
map
{
it
.
cateName
}.
joinToString
(
"|"
)
ActionCountUtils
.
baiDuCountSign3
(
)
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
if
(
categories
.
size
==
1
&&
"全部"
!=
categories
[
0
].
cateName
)
{
ConsultBIConstants
.
ConsultEvent
.
POSITION_TWO_CATEGORY_CLICK
,
//显示选中标题
sign1
,
tvSubject
.
text
=
categories
[
0
].
cateName
"app"
,
}
else
{
""
//显示主标题
)
tvSubject
.
text
=
"主题"
}
//判断主题选中,判断热门筛选中是否也有该主题
Executors
.
newCachedThreadPool
().
execute
{
if
(
headData
!!
.
highlighter
.
size
>
0
)
{
for
(
index
in
0
.
until
(
headData
!!
.
highlighter
.
size
))
{
if
(
headData
!!
.
highlighter
[
index
].
type
==
"1"
)
{
var
textview
=
lin_filter2
.
getChildAt
(
index
)
as
TextView
this
@ExpertSearchActivity
.
runOnUiThread
{
textview
.
isSelected
=
false
textview
.
paint
.
isFakeBoldText
=
false
}
for
(
bean
in
categories
)
{
if
(
TextUtils
.
equals
(
bean
.
cateName
,
headData
!!
.
highlighter
[
index
].
value
)
)
{
this
@ExpertSearchActivity
.
runOnUiThread
{
textview
.
isSelected
=
true
textview
.
paint
.
isFakeBoldText
=
true
}
break
}
}
}
}
}
}
}
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_OPEN
)
if
(
allFilter
.
categoryId2List
.
size
>
0
||
allFilter
.
categoryId3List
.
size
>
0
)
{
// LogUtil.d("theme callback: " + categories.map { it.cateName }.joinToString(","))
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
// props1.put("filtrate_second", categories.map { it.cateName }.joinToString(","))
// BuryPointUtils.buryPoint("Filtrate", props1)
allFilter
.
categories
.
clear
()
allFilter
.
categories
.
addAll
(
categories
)
refresh
()
if
(
categories
.
size
==
1
)
{
doctorAdapter
?.
cateId
=
"${categories[0].cateId}"
}
else
{
}
else
{
doctorAdapter
?.
cateId
=
""
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_NORMAL
)
}
}
refresh
()
}
}
override
fun
onRefresh
()
{
override
fun
onRefresh
()
{
...
@@ -1460,38 +1477,12 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1460,38 +1477,12 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//刷新列表
//刷新列表
private
fun
refresh
(
isShowRefresh
:
Boolean
?
=
true
)
{
private
fun
refresh
(
isShowRefresh
:
Boolean
?
=
true
)
{
srlContainer
.
isRefreshing
=
isShowRefresh
!!
srlContainer
.
isRefreshing
=
isShowRefresh
!!
val
key
=
tv_search_content
.
text
.
toString
()
if
(!
TextUtils
.
isEmpty
(
key
.
trim
()))
{
allFilter
.
searchWord
=
key
.
trim
()
}
else
{
allFilter
.
searchWord
=
null
}
curPage
=
1
onScrollListener
.
resetState
()
onScrollListener
.
resetState
()
getPresenter
().
fetchListData
(
allFilter
,
curPage
)
getPresenter
().
mExtras
=
null
getPresenter
().
fetchListData
(
allFilter
,
getPresenter
().
mExtras
)
rvExperts
.
scrollToPosition
(
0
)
rvExperts
.
scrollToPosition
(
0
)
}
}
//执行搜索
private
fun
doSearch
()
{
image_scroll_top
.
visibility
=
View
.
GONE
hideSoftInput
();
// keyWord = etSearch.text.toString()
// if (TextUtils.isEmpty(keyWord?.trim())) {
// ToastUtil.toastShort(this, "请输入搜索内容")
// return
// }
ActionCountUtils
.
count
(
ConsultBIConstants
.
UserMainEvent
.
YDL_USER_SEARCH_CLICK
,
keyWord
?:
""
)
isDoSearch
=
true
resetFilter
()
refresh
()
}
//重置所有筛选
//重置所有筛选
private
fun
resetFilter
()
{
private
fun
resetFilter
()
{
allFilter
.
categories
.
clear
()
allFilter
.
categories
.
clear
()
...
@@ -1560,17 +1551,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1560,17 +1551,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
}
/**
* 事件埋点
*/
fun
bury
(
keyworks
:
String
,
isResult
:
Boolean
,
isRecommend
:
Boolean
,
location
:
String
)
{
BuryPointUtils
.
getInstance
().
createMap
()
.
put
(
"keyWord"
,
keyworks
)
.
put
(
"hasResult"
,
isResult
)
.
put
(
"isRecommend"
,
isRecommend
)
.
put
(
"location"
,
location
)
.
burryPoint
(
"search"
)
}
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
...
@@ -1580,6 +1560,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1580,6 +1560,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
super
.
onDestroy
()
super
.
onDestroy
()
mHandler
=
null
ConsultAssistantDialogUtils
.
INSTANCE
.
expertSearchResetStatus
()
ConsultAssistantDialogUtils
.
INSTANCE
.
expertSearchResetStatus
()
}
}
}
}
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
View file @
a58adebe
...
@@ -6,7 +6,7 @@ import android.animation.ObjectAnimator
...
@@ -6,7 +6,7 @@ import android.animation.ObjectAnimator
import
android.animation.PropertyValuesHolder
import
android.animation.PropertyValuesHolder
import
android.content.Context
import
android.content.Context
import
android.graphics.Typeface
import
android.graphics.Typeface
import
android.os.
Build
import
android.os.
Handler
import
android.text.TextUtils
import
android.text.TextUtils
import
android.view.View
import
android.view.View
import
android.view.inputmethod.InputMethodManager
import
android.view.inputmethod.InputMethodManager
...
@@ -37,7 +37,6 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
...
@@ -37,7 +37,6 @@ 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.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.RxDeviceTool
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.consultant.adapter.ExpertSearchAdapter
import
com.yidianling.consultant.adapter.ExpertSearchAdapter
...
@@ -53,6 +52,8 @@ import com.yidianling.consultant.ui.view.CategoryPopupWindow
...
@@ -53,6 +52,8 @@ import com.yidianling.consultant.ui.view.CategoryPopupWindow
import
com.yidianling.consultant.ui.view.FilterPopupWindow
import
com.yidianling.consultant.ui.view.FilterPopupWindow
import
com.yidianling.consultant.ui.view.SortPopupWindow
import
com.yidianling.consultant.ui.view.SortPopupWindow
import
com.yidianling.consultant.ui.view.topView.RecommendListView
import
com.yidianling.consultant.ui.view.topView.RecommendListView
import
com.yidianling.home.api.event.HomeModuleTabEvent
import
de.greenrobot.event.EventBus
import
kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import
kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import
kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import
kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import
kotlinx.android.synthetic.main.consultant_layout_search_content.*
import
kotlinx.android.synthetic.main.consultant_layout_search_content.*
...
@@ -67,14 +68,16 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -67,14 +68,16 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
SwipeRefreshLayout
.
OnRefreshListener
{
SwipeRefreshLayout
.
OnRefreshListener
{
private
lateinit
var
mContext
:
Context
private
lateinit
var
mContext
:
Context
private
lateinit
var
mActivity
:
FragmentActivity
private
lateinit
var
mActivity
:
FragmentActivity
var
startTime
=
0L
var
startTime
=
0L
var
endTime
=
0L
var
endTime
=
0L
private
var
mIdssign1
:
String
=
""
// 列表埋点咨询师列表id拼接参数
override
fun
layoutResId
():
Int
{
override
fun
layoutResId
():
Int
{
return
R
.
layout
.
consultant_activity_expert_search_list
return
R
.
layout
.
consultant_activity_expert_search_list
}
}
override
fun
initDataAndEvent
()
{
override
fun
initDataAndEvent
()
{
EventBus
.
getDefault
().
register
(
this
)
mContext
=
requireContext
()
mContext
=
requireContext
()
mActivity
=
requireActivity
()
mActivity
=
requireActivity
()
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
mContext
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
mContext
)
...
@@ -122,10 +125,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -122,10 +125,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
YDLImageCacheManager
.
showImage
(
activity
,
url
,
imgView
,
width
,
heigh
,
ops
)
YDLImageCacheManager
.
showImage
(
activity
,
url
,
imgView
,
width
,
heigh
,
ops
)
}
}
}
}
//
// override fun getStatusViewOptions(): StatusBarOptions {
// return StatusBarOptions(true,true)
// }
companion
object
{
companion
object
{
const
val
EXTRA_CATEGORY
=
"category"
const
val
EXTRA_CATEGORY
=
"category"
...
@@ -147,22 +146,15 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -147,22 +146,15 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private
val
allFilter
=
AllFilter
()
//当前筛选
private
val
allFilter
=
AllFilter
()
//当前筛选
private
val
tempFilter
=
AllFilter
()
//临时筛选,未确认状态
private
val
tempFilter
=
AllFilter
()
//临时筛选,未确认状态
private
var
curPage
=
1
private
val
doctorList
=
ArrayList
<
ExpertServiceItem
>()
private
val
doctorList
=
ArrayList
<
DoctorServiceItem
>()
private
val
serviceList
=
ArrayList
<
DoctorServiceItem
>()
private
var
hasMore
=
true
private
var
hasMore
=
true
private
var
initCategory
=
"0"
private
var
initShowType
:
Int
=
0
private
var
initShowType
:
Int
=
0
private
lateinit
var
doctorAdapter
:
ExpertSearchAdapter
private
lateinit
var
doctorAdapter
:
ExpertSearchAdapter
private
lateinit
var
onScrollListener
:
EndlessRecyclerViewScrollListener
private
lateinit
var
onScrollListener
:
EndlessRecyclerViewScrollListener
private
var
headData
:
HeadData
?
=
null
//筛选数据
private
var
headData
:
HeadData
?
=
null
//筛选数据
private
val
props1
=
JSONObject
()
//筛选标题埋点参数
private
val
props1
=
JSONObject
()
//筛选标题埋点参数
private
var
fromPageType
:
Int
=
0
//从哪个页面跳转过来的
private
val
fromPages
=
arrayOf
(
"首页"
,
"搜索页面"
,
"在线专家"
)
private
var
isRecommend
=
false
//埋点数据
private
var
isRecommend
=
false
//埋点数据
private
var
keyWord
:
String
?
=
null
//埋点数据
private
var
isDoSearch
:
Boolean
=
false
//埋点判断是否通过搜索进入埋点的
private
var
isDoSearch
:
Boolean
=
false
//埋点判断是否通过搜索进入埋点的
private
val
bannerList
=
ArrayList
<
String
>()
private
var
hasSelectedArea
=
false
//是否选择过地区
private
var
hasSelectedArea
=
false
//是否选择过地区
private
var
hasSelectedSort
=
false
//是否选择过排序
private
var
hasSelectedSort
=
false
//是否选择过排序
...
@@ -200,18 +192,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -200,18 +192,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
srlContainer
.
isEnabled
=
i
>=
0
srlContainer
.
isEnabled
=
i
>=
0
})
})
// etSearch.setOnEditorActionListener { _, actionId, _ ->
// if (actionId == EditorInfo.IME_ACTION_SEARCH) {
// doSearch()
// }
// true
// }
// etSearch.setOnClickListener { appbar_layout.setExpanded(false) }
// etSearch.setOnFocusChangeListener { view, b -> if (b) appbar_layout.setExpanded(false) }
// btn_back.setOnClickListener {
// onBackPressed()
// }
doctorAdapter
=
ExpertSearchAdapter
(
mContext
,
this
,
doctorList
)
doctorAdapter
=
ExpertSearchAdapter
(
mContext
,
this
,
doctorList
)
rvExperts
.
adapter
=
doctorAdapter
rvExperts
.
adapter
=
doctorAdapter
...
@@ -295,40 +275,30 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -295,40 +275,30 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override
fun
onLoadMore
(
page
:
Int
,
totalItemsCount
:
Int
,
view
:
RecyclerView
?)
{
override
fun
onLoadMore
(
page
:
Int
,
totalItemsCount
:
Int
,
view
:
RecyclerView
?)
{
if
(
hasMore
)
{
if
(
hasMore
)
{
curPage
++
getPresenter
().
fetchListData
(
allFilter
,
getPresenter
().
mExtras
)
getPresenter
().
fetchListData
(
allFilter
,
curPage
)
}
}
}
}
}
}
// rvExperts.addItemDecoration(ExpertItemDecoration(this))
rvExperts
.
addOnScrollListener
(
onScrollListener
)
rvExperts
.
addOnScrollListener
(
onScrollListener
)
rvExperts
.
addOnScrollListener
(
YDLImageRecyclerOnScrollListener
(
activity
))
rvExperts
.
addOnScrollListener
(
YDLImageRecyclerOnScrollListener
(
activity
))
// etSearch.addTextChangedListener(object : TextWatcher {
// override fun afterTextChanged(s: Editable?) {}
//
// override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
//
// override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
//
// }
//
// })
image_scroll_top
.
setOnClickListener
(
this
)
image_scroll_top
.
setOnClickListener
(
this
)
// initStatus()
}
}
override
fun
setUserVisibleHint
(
isVisibleToUser
:
Boolean
)
{
override
fun
setUserVisibleHint
(
isVisibleToUser
:
Boolean
)
{
super
.
setUserVisibleHint
(
isVisibleToUser
)
super
.
setUserVisibleHint
(
isVisibleToUser
)
if
(
isVisibleToUser
&&
isResumed
)
{
if
(
isVisibleToUser
&&
isResumed
)
{
startTime
=
System
.
currentTimeMillis
()
startTime
=
System
.
currentTimeMillis
()
showConsultAssistantDialog
()
showConsultAssistantDialog
()
}
else
{
}
else
{
hideConsultAssistantDialog
()
hideConsultAssistantDialog
()
if
(
startTime
!=
0L
){
if
(
startTime
!=
0L
)
{
endTime
=
System
.
currentTimeMillis
()
endTime
=
System
.
currentTimeMillis
()
ActionCountUtils
.
count
(
ConsultBIConstants
.
ConsultEvent
.
YDL_USER_CONSULT_PAGE_STAY_VISIT
,(
endTime
-
startTime
).
toString
())
ActionCountUtils
.
count
(
ConsultBIConstants
.
ConsultEvent
.
YDL_USER_CONSULT_PAGE_STAY_VISIT
,
(
endTime
-
startTime
).
toString
()
)
}
}
}
}
if
(
isVisibleToUser
&&
isResumed
)
{
if
(
isVisibleToUser
&&
isResumed
)
{
onResume
()
onResume
()
}
}
...
@@ -359,21 +329,13 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -359,21 +329,13 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
override
fun
localData
()
{
override
fun
localData
()
{
}
override
fun
updateCache
(
showType
:
Int
,
searchBean
:
ExpertSearchBean
)
{
}
}
private
fun
initData
()
{
private
fun
initData
()
{
allFilter
.
showType
.
key
=
initShowType
allFilter
.
showType
.
key
=
initShowType
val
cat
=
CateItem
()
cat
.
cateId
=
initCategory
allFilter
.
categories
.
clear
()
allFilter
.
categories
.
add
(
cat
)
getPresenter
().
fetchListHead
()
getPresenter
().
fetchListHead
()
//加载本地缓存数据
getPresenter
().
localData
(
initShowType
)
//refresh(false)
v_loading
.
visibility
=
View
.
VISIBLE
v_loading
.
visibility
=
View
.
VISIBLE
v_loading
.
setViewType
(
LogoLoadingView
.
TYPE_LOADING
,
null
)
v_loading
.
setViewType
(
LogoLoadingView
.
TYPE_LOADING
,
null
)
...
@@ -382,51 +344,66 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -382,51 +344,66 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
/**
/**
*
初始化状态栏位置
*
获取所有的筛选选项数据
*/
*/
private
fun
initStatus
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//4.4以下不支持状态栏变色
StatusBarUtils
.
setTransparentForImageView
(
mActivity
,
null
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
mContext
)
val
lp1
=
title_layout
.
layoutParams
as
LinearLayout
.
LayoutParams
lp1
.
height
=
(
RxImageTool
.
dp2px
(
48f
)
+
statusBarHeight
)
title_layout
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
}
}
//筛选数据获取后回调
override
fun
onHeadFetched
(
headData
:
HeadData
?)
{
override
fun
onHeadFetched
(
headData
:
HeadData
?)
{
//头部数据获取到后初始化筛选数据
//头部数据获取到后初始化筛选数据
this
.
headData
=
headData
this
.
headData
=
headData
if
(
initCategory
!=
"0"
)
{
headData
?.
let
{
it
->
if
(
headData
?.
cates
!=
null
)
{
// allFilter.reorder = it.reorder[0]
for
(
cate
in
headData
.
cates
)
{
allFilter
.
showType
=
it
.
filters
.
showType
[
initShowType
]
if
(
cate
.
cateId
==
initCategory
)
{
if
(
it
.
highlighter
.
size
>
0
)
{
allFilter
.
categories
.
clear
()
//设置热门搜索
allFilter
.
categories
.
add
(
cate
)
initHotViews
(
lin_filter2
,
it
.
highlighter
)
if
(
allFilter
.
categories
.
size
==
1
&&
!
"全部"
.
equals
(
allFilter
.
categories
[
0
].
cateName
))
{
}
//显示选中标题
it
.
cates
[
0
].
children
?.
forEachIndexed
{
index
,
children
->
tvSubject
.
text
=
allFilter
.
categories
[
0
].
cateName
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
}
else
{
val
childrenBean
=
//显示主标题
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
tvSubject
.
text
=
"主题"
allFilter
.
childList
.
add
(
childrenBean
)
}
}
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
it
.
cates
[
1
].
children
?.
forEachIndexed
{
index
,
children
->
break
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
}
val
childrenBean
=
}
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
stressList
.
add
(
childrenBean
)
}
it
.
cates
[
2
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
loveEmotionList
.
add
(
childrenBean
)
}
it
.
cates
[
3
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
marriedFamilyList
.
add
(
childrenBean
)
}
it
.
cates
[
4
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
personalGrowthList
.
add
(
childrenBean
)
}
it
.
cates
[
5
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
interpersonalRelationshipList
.
add
(
childrenBean
)
}
it
.
cates
[
6
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
careerDevelopmentList
.
add
(
childrenBean
)
}
it
.
cates
[
7
].
children
?.
forEachIndexed
{
index
,
children
->
val
type
=
if
(
children
.
cate_name
.
length
>
4
)
2
else
1
val
childrenBean
=
ChildrenBean
(
children
.
cate_name
,
children
.
cate_id
,
index
<=
12
,
type
)
allFilter
.
mentalHealthList
.
add
(
childrenBean
)
}
}
initCategory
=
"0"
}
else
{
allFilter
.
categories
.
clear
()
allFilter
.
categories
.
add
(
headData
?.
cates
?.
get
(
0
)
?:
CateItem
())
}
allFilter
.
reorder
=
headData
?.
reorder
?.
get
(
0
)
?:
ReorderItem
()
allFilter
.
showType
=
headData
?.
filters
?.
showType
?.
get
(
initShowType
)
?:
ShowTypeItem
()
if
(
headData
?.
highlighter
?.
size
?:
0
>
0
)
{
//设置热门搜索
initHotViews
(
lin_filter2
,
headData
!!
.
highlighter
)
}
}
}
}
...
@@ -437,9 +414,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -437,9 +414,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if
(
view
.
childCount
>
0
)
{
if
(
view
.
childCount
>
0
)
{
return
return
}
}
val
popWidth
=
RxDeviceTool
.
getScreenWidth
(
context
)
for
(
hot
in
hotData
)
{
val
mWidth
=
(
popWidth
-
RxImageTool
.
dp2px
(
10f
))
/
hotData
.
size
for
((
index
,
hot
)
in
hotData
!!
.
withIndex
())
{
val
tv
=
View
.
inflate
(
context
,
R
.
layout
.
consultant_item_filter_online
,
null
)
as
TextView
val
tv
=
View
.
inflate
(
context
,
R
.
layout
.
consultant_item_filter_online
,
null
)
as
TextView
val
textView
=
tv
.
tvFree
val
textView
=
tv
.
tvFree
val
params
=
LinearLayout
.
LayoutParams
(
0
,
RxImageTool
.
dp2px
(
22f
))
val
params
=
LinearLayout
.
LayoutParams
(
0
,
RxImageTool
.
dp2px
(
22f
))
...
@@ -457,6 +432,14 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -457,6 +432,14 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
dealHotSelect
(
hot
,
true
)
dealHotSelect
(
hot
,
true
)
textView
.
isSelected
=
true
textView
.
isSelected
=
true
textView
.
paint
.
isFakeBoldText
=
true
textView
.
paint
.
isFakeBoldText
=
true
// 埋点
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
ConsultEvent
.
POSITION_CHOICE_FILTER_CLICK
,
hot
.
value
!!
,
"app"
,
""
)
}
}
filterLabelSet
()
filterLabelSet
()
//开始筛选数据
//开始筛选数据
...
@@ -483,32 +466,31 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -483,32 +466,31 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private
fun
dealHotSelect
(
hotData
:
HighlighterItem
,
isAdd
:
Boolean
)
{
private
fun
dealHotSelect
(
hotData
:
HighlighterItem
,
isAdd
:
Boolean
)
{
when
(
hotData
.
type
)
{
when
(
hotData
.
type
)
{
"1"
->
{
"1"
->
{
if
(
headData
?.
cates
!!
.
size
>
0
)
{
// if (headData?.cates!!.size > 0) {
for
(
bean
in
headData
?.
cates
!!
)
{
// for (bean in headData?.cates!!) {
if
(
TextUtils
.
equals
(
hotData
.
id
,
bean
.
cateId
.
toString
()))
{
// if (TextUtils.equals(hotData.id, bean.cateId.toString())) {
if
(
isAdd
)
{
// if (isAdd) {
if
(
allFilter
.
categories
.
size
==
1
&&
allFilter
.
categories
[
0
].
cateId
==
"0"
)
{
// if (allFilter.categories.size == 1 && allFilter.categories[0].cateId == "0") {
allFilter
.
categories
.
clear
()
// allFilter.categories.clear()
}
// }
allFilter
.
categories
.
add
(
bean
)
// updateFilterTextViewStatus(tvSubject, FILTER_STATUS_FILTERED)
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
// } else {
}
else
{
// allFilter.categories.remove(bean)
allFilter
.
categories
.
remove
(
bean
)
// if (allFilter.categories.size == 0) {
if
(
allFilter
.
categories
.
size
==
0
)
{
// updateFilterTextViewStatus(tvSubject, FILTER_STATUS_NORMAL)
allFilter
.
categories
.
add
(
headData
?.
cates
?.
get
(
0
)
?:
CateItem
())
// }
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_NORMAL
)
// }
}
// }
}
// }
}
// if (allFilter.categories.size == 1 && "全部" != allFilter.categories[0].cateName) {
}
// //显示选中标题
if
(
allFilter
.
categories
.
size
==
1
&&
"全部"
!=
allFilter
.
categories
[
0
].
cateName
)
{
// tvSubject.text = allFilter.categories[0].cateName
//显示选中标题
// } else {
tvSubject
.
text
=
allFilter
.
categories
[
0
].
cateName
// //显示主标题
}
else
{
// tvSubject.text = "主题"
//显示主标题
// }
tvSubject
.
text
=
"主题"
// }
}
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
}
}
}
"2"
->
{
//省
"2"
->
{
//省
if
(
headData
?.
region
!!
.
size
>
0
)
{
if
(
headData
?.
region
!!
.
size
>
0
)
{
...
@@ -599,7 +581,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -599,7 +581,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
}
}
}
}
if
(
allFilter
.
others
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
doctorEdu
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
>
0
)
{
if
(
allFilter
.
others
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
doctorEdu
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
>
0
)
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_FILTERED
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_FILTERED
)
}
else
{
}
else
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_NORMAL
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_NORMAL
)
...
@@ -619,7 +601,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -619,7 +601,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
}
}
}
}
if
(
allFilter
.
others
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
>
0
)
{
if
(
allFilter
.
others
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
>
0
)
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_FILTERED
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_FILTERED
)
}
else
{
}
else
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_NORMAL
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_NORMAL
)
...
@@ -639,7 +621,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -639,7 +621,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
}
}
}
}
if
(
allFilter
.
others
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
>
0
)
{
if
(
allFilter
.
others
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
>
0
)
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_FILTERED
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_FILTERED
)
}
else
{
}
else
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_NORMAL
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_NORMAL
)
...
@@ -659,7 +641,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -659,7 +641,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
}
}
}
}
if
(
allFilter
.
others
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
>
0
)
{
if
(
allFilter
.
others
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
>
0
)
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_FILTERED
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_FILTERED
)
}
else
{
}
else
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_NORMAL
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_NORMAL
)
...
@@ -719,7 +701,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -719,7 +701,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//用于侧滑筛选过来更新快捷筛选选中状态
//用于侧滑筛选过来更新快捷筛选选中状态
private
fun
updateOtherViews
(
other
d
ata
:
List
<
OtherItem
>)
{
private
fun
updateOtherViews
(
other
D
ata
:
List
<
OtherItem
>)
{
if
(
lin_filter2
.
childCount
>
0
)
{
if
(
lin_filter2
.
childCount
>
0
)
{
//清空选中
//清空选中
for
(
i
in
0
.
until
(
lin_filter2
.
childCount
))
{
for
(
i
in
0
.
until
(
lin_filter2
.
childCount
))
{
...
@@ -728,7 +710,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -728,7 +710,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
textView
.
paint
.
isFakeBoldText
=
false
textView
.
paint
.
isFakeBoldText
=
false
}
}
//重置选中状态
//重置选中状态
for
(
(
index
,
other
)
in
otherdata
.
withIndex
()
)
{
for
(
other
in
otherData
)
{
for
(
i
in
0
until
lin_filter2
.
childCount
)
{
for
(
i
in
0
until
lin_filter2
.
childCount
)
{
val
textView
=
lin_filter2
.
getChildAt
(
i
)
as
TextView
val
textView
=
lin_filter2
.
getChildAt
(
i
)
as
TextView
if
(
textView
.
text
==
other
.
value
)
{
if
(
textView
.
text
==
other
.
value
)
{
...
@@ -740,98 +722,64 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -740,98 +722,64 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
}
}
//服务列表数据获取到后的回调
/**
override
fun
onServiceListFetched
(
* 获取专家列表数据
data
:
MutableList
<
DoctorServiceItem
>,
*/
page
:
Int
,
totalPage
:
Int
)
{
LogUtil
.
d
(
"onServiceListFetched"
)
// if (rvExperts.adapter != serviceAdapter) {
// rvExperts.adapter = serviceAdapter
// }
if
(
page
==
1
)
{
if
(
fromPageType
!=
-
1
&&
isDoSearch
)
{
// LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType])
}
serviceList
.
clear
()
hasMore
=
true
// serviceAdapter.hasMore = true
}
if
(
fromPageType
==
-
1
)
{
bury
(
keyWord
?:
""
,
data
.
size
>
0
,
isRecommend
,
"首页分类"
)
}
else
{
bury
(
keyWord
?:
""
,
data
.
size
>
0
,
isRecommend
,
fromPages
[
fromPageType
])
}
if
(
page
>=
totalPage
)
{
hasMore
=
false
// serviceAdapter.hasMore = false
}
serviceList
.
addAll
(
data
)
// serviceAdapter.notifyDataSetChanged()
isRecommend
=
false
isDoSearch
=
false
v_loading
.
visibility
=
View
.
GONE
ll_network_error
.
visibility
=
View
.
GONE
rvExperts
.
visibility
=
View
.
VISIBLE
srlContainer
.
isRefreshing
=
false
}
//专家列表数据获取到后的回调
override
fun
onDoctorListFetched
(
override
fun
onDoctorListFetched
(
data
:
MutableList
<
Doctor
ServiceItem
>,
data
:
MutableList
<
Expert
ServiceItem
>,
page
:
Int
,
extras
:
Extras
?
,
total
Page
:
Int
cur
Page
:
Int
)
{
)
{
LogUtil
.
d
(
"onDoctorListFetched"
)
if
(
rvExperts
.
adapter
!=
doctorAdapter
)
{
if
(
rvExperts
.
adapter
!=
doctorAdapter
)
{
rvExperts
.
adapter
=
doctorAdapter
rvExperts
.
adapter
=
doctorAdapter
}
}
LogUtil
.
d
(
"data size "
+
data
.
size
)
LogUtil
.
d
(
"data size "
+
data
.
size
)
if
(
page
==
1
)
{
// 如果是第一页
if
(
fromPageType
!=
-
1
&&
isDoSearch
)
{
if
(
curPage
==
1
)
{
// LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType])
if
(
data
.
size
>=
10
)
{
hasMore
=
true
doctorAdapter
.
hasMore
=
true
}
else
{
hasMore
=
false
doctorAdapter
.
hasMore
=
false
}
}
doctorList
.
clear
()
doctorList
.
clear
()
doctorAdapter
.
hasMore
=
true
hasMore
=
true
}
if
(
fromPageType
==
-
1
)
{
bury
(
keyWord
?:
""
,
data
!=
null
&&
data
.
size
>
0
,
isRecommend
,
"首页分类"
)
}
else
{
bury
(
keyWord
?:
""
,
data
!=
null
&&
data
.
size
>
0
,
isRecommend
,
fromPages
[
fromPageType
])
}
}
if
(
page
>=
totalPage
)
{
if
(
data
.
size
==
0
)
{
// data的长度为0的时候为最后一页
hasMore
=
false
hasMore
=
false
doctorAdapter
.
hasMore
=
false
doctorAdapter
.
hasMore
=
false
}
else
{
doctorList
.
addAll
(
data
)
}
}
doctorList
.
addAll
(
data
)
//咨询师列表去除重复数据start
var
linkedHashSet
=
LinkedHashSet
(
doctorList
)
doctorList
.
clear
()
doctorList
.
addAll
(
linkedHashSet
)
//咨询师列表去除重复数据end
doctorAdapter
.
notifyDataSetChanged
()
doctorAdapter
.
notifyDataSetChanged
()
isDoSearch
=
false
isDoSearch
=
false
isRecommend
=
false
isRecommend
=
false
v_loading
.
visibility
=
View
.
GONE
v_loading
.
visibility
=
View
.
GONE
ll_network_error
.
visibility
=
View
.
GONE
ll_network_error
.
visibility
=
View
.
GONE
rvExperts
.
visibility
=
View
.
VISIBLE
rvExperts
.
visibility
=
View
.
VISIBLE
srlContainer
.
isRefreshing
=
false
srlContainer
.
isRefreshing
=
false
// 埋点
mIdssign1
=
data
.
joinToString
(
","
)
{
it
.
id
}
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT
,
mIdssign1
,
sign2
,
"app"
)
}
}
override
fun
fetchListFailed
(
msg
:
String
?)
{
override
fun
fetchListFailed
(
msg
:
String
?)
{
isDoSearch
=
false
isDoSearch
=
false
isRecommend
=
false
isRecommend
=
false
if
(
curPage
==
1
)
{
if
(
getPresenter
().
mExtras
==
null
)
{
v_loading
.
setViewType
(
v_loading
.
setViewType
(
LogoLoadingView
.
TYPE_NET_LOSS
,
LogoLoadingView
.
TYPE_NET_LOSS
,
getString
(
R
.
string
.
consultant_reload_hint
)
getString
(
R
.
string
.
consultant_reload_hint
)
...
@@ -892,7 +840,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -892,7 +840,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
postDelayed
({
appbar_layout
.
postDelayed
({
showSubjectPopupWindow
()
showSubjectPopupWindow
()
},
300
)
;
},
300
)
}
}
R
.
id
.
tvArea
->
{
R
.
id
.
tvArea
->
{
...
@@ -901,7 +849,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -901,7 +849,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
postDelayed
({
appbar_layout
.
postDelayed
({
showAreaPopupWindow
()
showAreaPopupWindow
()
},
300
)
;
},
300
)
}
}
R
.
id
.
tvSort
->
{
R
.
id
.
tvSort
->
{
...
@@ -910,7 +858,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -910,7 +858,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
postDelayed
({
appbar_layout
.
postDelayed
({
showSortPopupWindow
()
showSortPopupWindow
()
},
300
)
;
},
300
)
}
}
R
.
id
.
tvFilter
->
{
R
.
id
.
tvFilter
->
{
...
@@ -919,7 +867,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -919,7 +867,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
setExpanded
(
false
)
appbar_layout
.
postDelayed
({
appbar_layout
.
postDelayed
({
showFilterPopupWindow
()
showFilterPopupWindow
()
},
300
)
;
},
300
)
}
}
R
.
id
.
tv_guide
->
{
R
.
id
.
tv_guide
->
{
...
@@ -954,7 +902,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -954,7 +902,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//显示筛选弹窗
//显示筛选弹窗
private
fun
showFilterPopupWindow
()
{
private
fun
showFilterPopupWindow
()
{
// tempFilter.searchWord = etSearch.text.toString()
tempFilter
.
categories
.
clear
()
tempFilter
.
categories
.
clear
()
tempFilter
.
categories
.
addAll
(
allFilter
.
categories
)
tempFilter
.
categories
.
addAll
(
allFilter
.
categories
)
tempFilter
.
reorder
=
allFilter
.
reorder
tempFilter
.
reorder
=
allFilter
.
reorder
...
@@ -982,7 +929,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -982,7 +929,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
filterPopupWindow
.
setOnDismissListener
{
filterPopupWindow
.
setOnDismissListener
{
viewDim
.
visibility
=
View
.
INVISIBLE
viewDim
.
visibility
=
View
.
INVISIBLE
viewDim_filter
.
visibility
=
View
.
GONE
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
.
ages
.
size
+
allFilter
.
doctorEdu
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
>
0
||
!
TextUtils
.
isEmpty
(
allFilter
.
priceRanges
?.
minPrice
allFilter
.
priceRanges
?.
minPrice
)
||
!
TextUtils
.
isEmpty
(
allFilter
.
priceRanges
?.
maxPrice
)
)
||
!
TextUtils
.
isEmpty
(
allFilter
.
priceRanges
?.
maxPrice
)
)
{
)
{
...
@@ -1007,15 +954,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1007,15 +954,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//筛选确认回调
//筛选确认回调
override
fun
onFilterConfirmed
()
{
override
fun
onFilterConfirmed
()
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_OPEN
)
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_OPEN
)
LogUtil
.
d
(
"filter: "
+
tempFilter
.
showType
.
value
+
","
+
tempFilter
.
enquiries
.
map
{
it
.
value
}
.
joinToString
(
","
)
+
","
+
tempFilter
.
ages
.
map
{
it
.
value
}
.
joinToString
(
","
)
+
","
+
tempFilter
.
others
.
map
{
it
.
value
}.
joinToString
(
","
)
)
props1
.
put
(
props1
.
put
(
"filtrate_second"
,
"filtrate_second"
,
tempFilter
.
showType
.
value
+
","
tempFilter
.
showType
.
value
+
","
...
@@ -1026,6 +965,18 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1026,6 +965,18 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
)
)
BuryPointUtils
.
buryPoint
(
"Filtrate"
,
props1
)
BuryPointUtils
.
buryPoint
(
"Filtrate"
,
props1
)
// 埋点
if
(
tempFilter
.
specialityCrowd
.
size
>
0
)
{
val
sign1
=
tempFilter
.
specialityCrowd
.
joinToString
(
","
)
{
it
.
value
!!
}
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_FILTER_PAGE
,
ConsultBIConstants
.
ConsultEvent
.
POSITION_GOODAT_CROWD_CLICK
,
sign1
,
"app"
,
""
)
}
allFilter
.
showType
=
tempFilter
.
showType
allFilter
.
showType
=
tempFilter
.
showType
allFilter
.
enquiries
.
clear
()
allFilter
.
enquiries
.
clear
()
...
@@ -1142,7 +1093,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1142,7 +1093,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//筛选标题显示处理
//筛选标题显示处理
private
fun
filterLabelSet
()
{
private
fun
filterLabelSet
()
{
if
((
allFilter
.
others
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
doctorEdu
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
)
==
1
)
{
if
((
allFilter
.
others
.
size
+
allFilter
.
ages
.
size
+
allFilter
.
doctorEdu
.
size
+
allFilter
.
enquiries
.
size
+
allFilter
.
title
.
size
+
allFilter
.
specialityCrowd
.
size
)
==
1
)
{
var
text
:
String
?
=
""
var
text
:
String
?
=
""
when
{
when
{
allFilter
.
others
.
size
==
1
->
{
allFilter
.
others
.
size
==
1
->
{
...
@@ -1157,10 +1108,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1157,10 +1108,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter
.
title
.
size
==
1
->
{
allFilter
.
title
.
size
==
1
->
{
text
=
allFilter
.
title
[
0
].
value
text
=
allFilter
.
title
[
0
].
value
}
}
allFilter
.
specialityCrowd
.
size
==
1
->
{
allFilter
.
specialityCrowd
.
size
==
1
->
{
text
=
allFilter
.
specialityCrowd
[
0
].
value
text
=
allFilter
.
specialityCrowd
[
0
].
value
}
}
allFilter
.
doctorEdu
.
size
==
1
->
{
allFilter
.
doctorEdu
.
size
==
1
->
{
text
=
allFilter
.
doctorEdu
[
0
].
value
text
=
allFilter
.
doctorEdu
[
0
].
value
}
}
else
->
{
else
->
{
...
@@ -1212,19 +1163,23 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1212,19 +1163,23 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
?:
""
?:
""
)
)
if
(
sortItem
.
value
.
equals
(
"综合排序"
))
{
when
{
tvSort
.
text
=
"排序"
sortItem
.
value
.
equals
(
"综合排序"
)
->
{
}
else
if
(
sortItem
.
value
?.
length
?:
0
>
4
)
{
tvSort
.
text
=
"排序"
tvSort
.
text
=
sortItem
.
value
?.
substring
(
0
,
3
)
+
"..."
}
}
else
{
sortItem
.
value
?.
length
?:
0
>
4
->
{
tvSort
.
text
=
sortItem
.
value
tvSort
.
text
=
sortItem
.
value
?.
substring
(
0
,
3
)
+
"..."
}
else
->
{
tvSort
.
text
=
sortItem
.
value
}
}
}
//判断排序选中,判断热门筛选中是否也有该排序
//判断排序选中,判断热门筛选中是否也有该排序
if
(
headData
!!
.
highlighter
.
size
>
0
)
{
if
(
headData
!!
.
highlighter
.
size
>
0
)
{
for
(
index
in
0
.
until
(
headData
!!
.
highlighter
.
size
))
{
for
(
index
in
0
.
until
(
headData
!!
.
highlighter
.
size
))
{
if
(
headData
!!
.
highlighter
[
index
].
type
==
"3"
)
{
if
(
headData
!!
.
highlighter
[
index
].
type
==
"3"
)
{
va
r
textview
=
lin_filter2
.
getChildAt
(
index
)
as
TextView
va
l
textview
=
lin_filter2
.
getChildAt
(
index
)
as
TextView
if
(
TextUtils
.
equals
(
sortItem
.
value
,
headData
!!
.
highlighter
[
index
].
value
))
{
if
(
TextUtils
.
equals
(
sortItem
.
value
,
headData
!!
.
highlighter
[
index
].
value
))
{
textview
.
isSelected
=
true
textview
.
isSelected
=
true
textview
.
paint
.
isFakeBoldText
=
true
textview
.
paint
.
isFakeBoldText
=
true
...
@@ -1250,7 +1205,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1250,7 +1205,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//显示地区弹窗
//显示地区弹窗
private
fun
showAreaPopupWindow
()
{
private
fun
showAreaPopupWindow
()
{
if
(
headData
?.
region
!=
null
)
{
if
(
headData
?.
region
!=
null
)
{
val
regionPopupWindow
=
AreaPopupWindow
(
mActivity
,
headData
?.
region
?:
ArrayList
(),
allFilter
.
region
,
allFilter
.
sub
)
val
regionPopupWindow
=
AreaPopupWindow
(
mActivity
,
headData
?.
region
?:
ArrayList
(),
allFilter
.
region
,
allFilter
.
sub
)
regionPopupWindow
.
showAsDropDown
(
viewSep2
)
regionPopupWindow
.
showAsDropDown
(
viewSep2
)
viewDim
.
visibility
=
View
.
VISIBLE
viewDim
.
visibility
=
View
.
VISIBLE
updateFilterTextViewStatus
(
tvArea
,
FILTER_STATUS_OPEN
)
updateFilterTextViewStatus
(
tvArea
,
FILTER_STATUS_OPEN
)
...
@@ -1268,7 +1228,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1268,7 +1228,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
updateFilterTextViewStatus
(
tvArea
,
FILTER_STATUS_OPEN
)
updateFilterTextViewStatus
(
tvArea
,
FILTER_STATUS_OPEN
)
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
=
"地区"
}
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
)
{
...
@@ -1326,93 +1286,50 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1326,93 +1286,50 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
}
}
private
var
categoryPopup
:
CategoryPopupWindow
?
=
null
private
var
mHandler
:
Handler
?
=
null
//显示主题弹窗
/**
* 显示八大类弹窗
*/
private
fun
showSubjectPopupWindow
()
{
private
fun
showSubjectPopupWindow
()
{
tempFilter
.
categories
.
clear
()
val
categoryPopup
=
CategoryPopupWindow
(
mActivity
,
allFilter
)
tempFilter
.
categories
.
addAll
(
allFilter
.
categories
)
mHandler
=
Handler
()
val
categories
=
headData
?.
cates
mHandler
!!
.
post
{
if
(
categories
!=
null
)
{
categoryPopup
.
updateData
()
categoryPopup
=
CategoryPopupWindow
(
mActivity
,
categories
,
tempFilter
.
categories
)
categoryPopup
!!
.
setOnDismissListener
{
viewDim
.
visibility
=
View
.
INVISIBLE
if
(
allFilter
.
categories
.
size
>
1
||
(
allFilter
.
categories
.
size
==
1
&&
allFilter
.
categories
[
0
]
!=
headData
!!
.
cates
[
0
]))
{
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
}
else
{
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_NORMAL
)
}
}
categoryPopup
!!
.
onSubjectsSelectedListener
=
this
categoryPopup
!!
.
showAsDropDown
(
viewSep2
)
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_OPEN
)
viewDim
.
visibility
=
View
.
VISIBLE
}
else
{
ToastUtil
.
toastShort
(
"数据初始化失败,请重试"
)
getPresenter
().
fetchListHead
()
}
}
categoryPopup
.
setOnDismissListener
{
viewDim
.
visibility
=
View
.
INVISIBLE
showConsultAssistantDialog
()
}
hideConsultAssistantDialog
()
categoryPopup
.
onSubjectsSelectedListener
=
this
categoryPopup
.
showAsDropDown
(
viewSep2
)
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_OPEN
)
viewDim
.
visibility
=
View
.
VISIBLE
}
}
/**
/**
* 主题选择确认回调
* 主题选择确认回调
*
*
* 新增逻辑:当主题选择后,需要判断热门筛选中是否也有该主题,如果有,也需要同步更新选中状态
*/
*/
override
fun
onCategoriesSelected
(
categories
:
ArrayList
<
CateItem
>)
{
override
fun
onCategoriesSelected
(
signLit
:
ArrayList
<
String
>)
{
ActionCountUtils
.
count
(
if
(
signLit
.
isNotEmpty
())
{
ConsultBIConstants
.
ConsultEvent
.
APP_CONSULT_LIST_THEME_CLICK
,
val
sign1
=
signLit
.
joinToString
(
","
)
{
it
}
categories
.
map
{
it
.
cateName
}.
joinToString
(
"|"
)
ActionCountUtils
.
baiDuCountSign3
(
)
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
if
(
categories
.
size
==
1
&&
"全部"
!=
categories
[
0
].
cateName
)
{
ConsultBIConstants
.
ConsultEvent
.
POSITION_TWO_CATEGORY_CLICK
,
//显示选中标题
sign1
,
tvSubject
.
text
=
categories
[
0
].
cateName
"app"
,
}
else
{
""
//显示主标题
)
tvSubject
.
text
=
"主题"
}
//如果是亲自教育类别----->点击咨询顾问---会跳转到一个只是亲自教育的导医队列中
//判断主题选中,判断热门筛选中是否也有该主题
Executors
.
newCachedThreadPool
().
execute
{
if
(
headData
!!
.
highlighter
.
size
>
0
)
{
for
(
index
in
0
.
until
(
headData
!!
.
highlighter
.
size
))
{
if
(
headData
!!
.
highlighter
[
index
].
type
==
"1"
)
{
val
textview
=
lin_filter2
.
getChildAt
(
index
)
as
TextView
mActivity
.
runOnUiThread
{
textview
.
isSelected
=
false
textview
.
paint
.
isFakeBoldText
=
false
}
for
(
bean
in
categories
)
{
if
(
TextUtils
.
equals
(
bean
.
cateName
,
headData
!!
.
highlighter
[
index
].
value
)
)
{
mActivity
.
runOnUiThread
{
textview
.
isSelected
=
true
textview
.
paint
.
isFakeBoldText
=
true
}
break
}
}
}
}
}
}
}
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_OPEN
)
if
(
allFilter
.
categoryId2List
.
size
>
0
||
allFilter
.
categoryId3List
.
size
>
0
)
{
// LogUtil.d("theme callback: " + categories.map { it.cateName }.joinToString(","))
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
// props1.put("filtrate_second", categories.map { it.cateName }.joinToString(","))
// BuryPointUtils.buryPoint("Filtrate", props1)
allFilter
.
categories
.
clear
()
allFilter
.
categories
.
addAll
(
categories
)
refresh
()
if
(
categories
.
size
==
1
)
{
doctorAdapter
.
cateId
=
"${categories[0].cateId}"
}
else
{
}
else
{
doctorAdapter
.
cateId
=
""
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_NORMAL
)
}
}
refresh
()
}
}
override
fun
onRefresh
()
{
override
fun
onRefresh
()
{
...
@@ -1421,6 +1338,27 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1421,6 +1338,27 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
/**
* EventBus从首页某个位置点击事件传递
* sign 仅用于埋点事件统计
*/
private
var
sign2
=
""
fun
onEvent
(
event
:
HomeModuleTabEvent
)
{
if
(!
TextUtils
.
isEmpty
(
event
.
sign
))
{
sign2
=
event
.
sign
// 埋点
if
(!
TextUtils
.
isEmpty
(
mIdssign1
))
{
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT
,
mIdssign1
,
sign2
,
"app"
)
}
}
}
//刷新列表
//刷新列表
private
fun
refresh
(
isShowRefresh
:
Boolean
?
=
true
)
{
private
fun
refresh
(
isShowRefresh
:
Boolean
?
=
true
)
{
srlContainer
.
isRefreshing
=
isShowRefresh
!!
srlContainer
.
isRefreshing
=
isShowRefresh
!!
...
@@ -1430,55 +1368,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1430,55 +1368,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
else
{
}
else
{
allFilter
.
searchWord
=
null
allFilter
.
searchWord
=
null
}
}
curPage
=
1
onScrollListener
.
resetState
()
onScrollListener
.
resetState
()
getPresenter
().
fetchListData
(
allFilter
,
curPage
)
getPresenter
().
mExtras
=
null
getPresenter
().
fetchListData
(
allFilter
,
getPresenter
().
mExtras
)
rvExperts
.
scrollToPosition
(
0
)
rvExperts
.
scrollToPosition
(
0
)
}
}
//执行搜索
private
fun
doSearch
()
{
image_scroll_top
.
visibility
=
View
.
GONE
hideSoftInput
();
// keyWord = etSearch.text.toString()
// if (TextUtils.isEmpty(keyWord?.trim())) {
// ToastUtil.toastShort(this, "请输入搜索内容")
// return
// }
ActionCountUtils
.
count
(
ConsultBIConstants
.
UserMainEvent
.
YDL_USER_SEARCH_CLICK
,
keyWord
?:
""
)
isDoSearch
=
true
resetFilter
()
refresh
()
}
//重置所有筛选
private
fun
resetFilter
()
{
allFilter
.
categories
.
clear
()
allFilter
.
categories
.
add
(
headData
?.
cates
?.
get
(
0
)
?:
CateItem
())
allFilter
.
reorder
=
headData
?.
reorder
?.
get
(
0
)
?:
ReorderItem
()
allFilter
.
region
=
RegionItem
()
allFilter
.
sub
=
SubItem
()
allFilter
.
enquiries
.
clear
()
allFilter
.
ages
.
clear
()
allFilter
.
others
.
clear
()
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_NORMAL
)
updateFilterTextViewStatus
(
tvArea
,
FILTER_STATUS_NORMAL
)
updateFilterTextViewStatus
(
tvSort
,
FILTER_STATUS_NORMAL
)
if
(
headData
!=
null
)
{
if
(
allFilter
.
showType
!=
headData
!!
.
filters
.
showType
[
1
])
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_FILTERED
)
}
else
{
updateFilterTextViewStatus
(
tvFilter
,
FILTER_STATUS_NORMAL
)
}
}
}
//设置筛选点击按钮状态
//设置筛选点击按钮状态
private
fun
updateFilterTextViewStatus
(
tv
:
TextView
,
status
:
Int
)
{
private
fun
updateFilterTextViewStatus
(
tv
:
TextView
,
status
:
Int
)
{
when
(
status
)
{
when
(
status
)
{
...
@@ -1523,27 +1418,17 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1523,27 +1418,17 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
}
}
/**
* 事件埋点
*/
fun
bury
(
keyworks
:
String
,
isResult
:
Boolean
,
isRecommend
:
Boolean
,
location
:
String
)
{
BuryPointUtils
.
getInstance
().
createMap
()
.
put
(
"keyWord"
,
keyworks
)
.
put
(
"hasResult"
,
isResult
)
.
put
(
"isRecommend"
,
isRecommend
)
.
put
(
"location"
,
location
)
.
burryPoint
(
"search"
)
}
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
refresh
(
false
)
refresh
(
false
)
ActionCountUtils
.
count
(
ConsultBIConstants
.
ConsultEvent
.
APP_CONSULT_LIST_PAGE_VISIT
)
ActionCountUtils
.
count
(
ConsultBIConstants
.
ConsultEvent
.
APP_CONSULT_LIST_PAGE_VISIT
)
ActionCountUtils
.
count
(
"daoyi_advertisement_page|daoyi_advertisement_visit"
,
"6"
)
ActionCountUtils
.
count
(
"daoyi_advertisement_page|daoyi_advertisement_visit"
,
"6"
)
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
super
.
onDestroy
()
super
.
onDestroy
()
EventBus
.
getDefault
().
unregister
(
this
)
mHandler
=
null
ConsultAssistantDialogUtils
.
INSTANCE
.
resetStatus
()
ConsultAssistantDialogUtils
.
INSTANCE
.
resetStatus
()
}
}
}
}
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchPresenter.kt
View file @
a58adebe
...
@@ -2,20 +2,21 @@ package com.yidianling.consultant
...
@@ -2,20 +2,21 @@ package com.yidianling.consultant
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.text.TextUtils
import
android.text.TextUtils
import
com.google.gson.Gson
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.mvp.base.SimplePresenter
import
com.ydl.ydlcommon.mvp.base.SimplePresenter
import
com.ydl.ydlcommon.utils.RxLifecycleUtils
import
com.ydl.ydlcommon.utils.RxLifecycleUtils
import
com.ydl.ydlcommon.utils.YDLAsyncUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import
com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.consultant.http.ExpertSearchDataManager
import
com.yidianling.consultant.http.ExpertSearchDataManager
import
com.yidianling.consultant.model.SearchApi
import
com.yidianling.consultant.model.SearchApi
import
com.yidianling.consultant.model.bean.AllFilter
import
com.yidianling.consultant.model.bean.AllFilter
import
com.yidianling.consultant.model.bean.Ex
pertSearchBean
import
com.yidianling.consultant.model.bean.Ex
tras
import
com.yidianling.
consultant.modular.singlton.ConsultAssistantDialogUtils
import
com.yidianling.
user.api.service.IUserService
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Consumer
import
io.reactivex.functions.Consumer
import
io.reactivex.schedulers.Schedulers
import
io.reactivex.schedulers.Schedulers
...
@@ -24,6 +25,7 @@ import io.reactivex.schedulers.Schedulers
...
@@ -24,6 +25,7 @@ import io.reactivex.schedulers.Schedulers
* 专家搜索页Presenter
* 专家搜索页Presenter
*/
*/
class
ExpertSearchPresenter
:
SimplePresenter
<
IExpertSearchView
>()
{
class
ExpertSearchPresenter
:
SimplePresenter
<
IExpertSearchView
>()
{
var
mExtras
:
Extras
?
=
null
// 用于分页
@SuppressLint
(
"CheckResult"
)
@SuppressLint
(
"CheckResult"
)
fun
fetchListHead
()
{
fun
fetchListHead
()
{
...
@@ -41,150 +43,218 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
...
@@ -41,150 +43,218 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
})
})
}
}
/**
* 加载缓存
*/
fun
localData
(
showType
:
Int
)
{
YDLAsyncUtils
.
asyncAsResult
(
object
:
YDLAsyncUtils
.
AsyncObjecyerResult
{
override
fun
doAsyncAction
():
Any
{
return
when
(
showType
)
{
0
->
{
//按专家
YDLCacheUtils
.
getDoctorListData
()
}
1
->
{
//按服务
YDLCacheUtils
.
getServerListData
()
}
else
->
{
YDLCacheUtils
.
getServerListData
()
}
}
}
override
fun
asyncResult
(
`object`
:
Any
?)
{
//如果没有缓存数据,显示加载框
if
(
`object`
!
is
String
||
TextUtils
.
isEmpty
(
`object`
))
{
mView
.
showRefreshLayout
()
}
if
(
`object`
is
String
)
{
val
gson
=
Gson
()
val
bean
=
gson
.
fromJson
<
ExpertSearchBean
>(
`object`
,
ExpertSearchBean
::
class
.
java
)
// val bean = gson.fromJson<ExpertSearchBean>(`object`, object : TypeToken<ExpertSearchBean>() {}.type)
if
(
bean
?.
list
!=
null
)
{
when
(
showType
)
{
0
->
{
mView
.
onDoctorListFetched
(
bean
.
list
,
1
,
1
)
}
1
->
{
mView
.
onServiceListFetched
(
bean
.
list
,
1
,
1
)
}
else
->
{
mView
.
onServiceListFetched
(
bean
.
list
,
1
,
1
)
}
}
}
}
}
})
}
fun
updateCache
(
showType
:
Int
,
searchBean
:
ExpertSearchBean
)
{
val
gson
=
Gson
()
val
json
=
gson
.
toJson
(
searchBean
)
when
(
showType
)
{
0
->
{
YDLCacheUtils
.
saveDoctorListData
(
json
)
}
1
->
{
YDLCacheUtils
.
saveServerListData
(
json
)
}
}
}
@SuppressLint
(
"CheckResult"
)
@SuppressLint
(
"CheckResult"
)
fun
fetchListData
(
allFilter
:
AllFilter
,
page
:
Int
)
{
fun
fetchListData
(
allFilter
:
AllFilter
,
extras
:
Extras
?
)
{
//是否亲子教育字段
//是否亲子教育字段
ConsultAssistantDialogUtils
.
REALATION_EDUCATION
=
// ConsultAssistantDialogUtils.REALATION_EDUCATION = allFilter.categories.size == 1 && allFilter.categories[0].cateId == "23"
allFilter
.
categories
.
size
==
1
&&
allFilter
.
categories
[
0
].
cateId
==
"23"
var
showType
=
0
val
sb
=
StringBuffer
()
val
map
=
HashMap
<
String
,
Any
>()
sb
.
append
(
"searchWord="
)
// filter
.
append
(
if
(
TextUtils
.
isEmpty
(
allFilter
.
searchWord
))
""
else
allFilter
.
searchWord
)
val
filterMap
=
HashMap
<
String
,
Any
?>()
if
(
allFilter
.
categories
.
isNotEmpty
())
{
// 搜索词
var
categorys
=
allFilter
.
categories
.
map
{
it
.
cateId
}.
joinToString
(
","
)
if
(!
TextUtils
.
isEmpty
(
allFilter
.
searchWord
)){
if
(
"0"
==
categorys
)
{
filterMap
[
"__keywords"
]
=
allFilter
.
searchWord
categorys
=
""
}
val
categoryList
=
ArrayList
<
Any
>()
// 八大类一级标签
if
(
allFilter
.
categoryId2List
.
size
>
0
){
val
categoryMap2
=
HashMap
<
String
,
Any
>()
val
categoryIdMap2
=
HashMap
<
String
,
Any
>()
categoryIdMap2
[
"in"
]
=
allFilter
.
categoryId2List
categoryMap2
[
"product_cates.category_id2"
]
=
categoryIdMap2
categoryList
.
add
(
categoryMap2
)
}
// 八大类二级标签
if
(
allFilter
.
categoryId3List
.
size
>
0
){
val
categoryMap3
=
HashMap
<
String
,
Any
>()
val
categoryIdMap3
=
HashMap
<
String
,
Any
>()
categoryIdMap3
[
"in"
]
=
allFilter
.
categoryId3List
categoryMap3
[
"product_cates.category_id3"
]
=
categoryIdMap3
categoryList
.
add
(
categoryMap3
)
}
if
(
categoryList
.
size
>
0
){
filterMap
[
"__or"
]
=
categoryList
}
// 主题
if
(
allFilter
.
categories
.
size
>
0
)
{
val
categories
=
ArrayList
<
String
?>()
allFilter
.
categories
.
forEach
{
categories
.
add
(
it
.
cateId
)
}
}
sb
.
append
(
"&directionTags="
).
append
(
categorys
)
val
categoriesMap
=
HashMap
<
String
,
Any
>()
categoriesMap
[
"in"
]
=
categories
filterMap
[
"tags.tag_id"
]
=
categoriesMap
}
}
if
(
allFilter
.
region
.
value
==
"海外"
||
allFilter
.
region
.
value
==
"全国"
)
{
// 地区
sb
.
append
(
"&country="
).
append
(
allFilter
.
sub
.
code
)
if
(
allFilter
.
region
.
value
==
"海外"
)
{
filterMap
[
"country_code"
]
=
allFilter
.
sub
.
code
}
else
{
}
else
{
if
(
allFilter
.
region
.
code
!=
null
)
{
if
(
allFilter
.
region
.
code
!=
null
)
{
sb
.
append
(
"&province="
).
append
(
allFilter
.
region
.
code
)
filterMap
[
"province_code"
]
=
allFilter
.
region
.
code
}
}
if
(
allFilter
.
sub
.
code
!=
null
)
{
if
(
allFilter
.
sub
.
code
!=
null
)
{
sb
.
append
(
"&city="
).
append
(
allFilter
.
sub
.
code
)
filterMap
[
"city_code"
]
=
allFilter
.
sub
.
code
}
}
}
}
if
(
allFilter
.
reorder
.
key
!=
null
)
{
// 咨询方式
sb
.
append
(
"&reorder="
).
append
(
allFilter
.
reorder
.
key
)
}
if
(
allFilter
.
enquiries
.
isNotEmpty
())
{
if
(
allFilter
.
enquiries
.
isNotEmpty
())
{
sb
.
append
(
"&enquirys="
).
append
(
allFilter
.
enquiries
.
map
{
it
.
key
}.
joinToString
(
","
))
val
way
=
ArrayList
<
Int
>()
allFilter
.
enquiries
.
forEach
{
way
.
add
(
it
.
key
)
}
val
wayMap
=
HashMap
<
String
,
Any
>()
wayMap
[
"in"
]
=
way
filterMap
[
"service_type_list.service_type"
]
=
wayMap
}
}
// 服务均价
if
(
allFilter
.
priceRanges
!=
null
)
{
val
avgPriceMap
=
HashMap
<
String
,
Any
?>()
avgPriceMap
[
"gte"
]
=
allFilter
.
priceRanges
?.
minPrice
avgPriceMap
[
"lte"
]
=
allFilter
.
priceRanges
?.
maxPrice
filterMap
[
"avg_price"
]
=
avgPriceMap
}
// 年龄
if
(
allFilter
.
ages
.
isNotEmpty
())
{
if
(
allFilter
.
ages
.
isNotEmpty
())
{
sb
.
append
(
"&ages="
).
append
(
allFilter
.
ages
.
map
{
it
.
key
}.
joinToString
(
","
))
val
age
=
ArrayList
<
Int
>()
allFilter
.
ages
.
forEach
{
age
.
add
(
it
.
key
)
}
val
ageMap
=
HashMap
<
String
,
Any
>()
ageMap
[
"in"
]
=
age
filterMap
[
"years"
]
=
ageMap
}
}
// 资质
if
(
allFilter
.
doctorEdu
.
isNotEmpty
())
{
if
(
allFilter
.
title
.
isNotEmpty
())
{
sb
.
append
(
"&edus="
).
append
(
allFilter
.
doctorEdu
.
map
{
it
.
key
}.
joinToString
(
","
))
val
title
=
ArrayList
<
String
?>()
allFilter
.
title
.
forEach
{
title
.
add
(
it
.
key
)
}
val
titleMap
=
HashMap
<
String
,
Any
>()
titleMap
[
"in"
]
=
title
filterMap
[
"titles.title"
]
=
titleMap
}
}
// 擅长人群
拼接
// 擅长人群
if
(
allFilter
.
specialityCrowd
.
isNotEmpty
())
{
if
(
allFilter
.
specialityCrowd
.
isNotEmpty
())
{
sb
.
append
(
"&crowdsTags="
)
val
specialityCrowd
=
ArrayList
<
String
?>()
.
append
(
allFilter
.
specialityCrowd
.
map
{
it
.
key
}.
joinToString
(
","
))
allFilter
.
specialityCrowd
.
forEach
{
specialityCrowd
.
add
(
it
.
key
)
}
val
specialityCrowdMap
=
HashMap
<
String
,
Any
>()
specialityCrowdMap
[
"in"
]
=
specialityCrowdMap
filterMap
[
"doctor_tag_list.list.tag_id"
]
=
specialityCrowdMap
}
}
// 学历
if
(
allFilter
.
doctorEdu
.
isNotEmpty
())
{
val
edu
=
ArrayList
<
Int
?>()
allFilter
.
doctorEdu
.
forEach
{
edu
.
add
(
it
.
key
)
}
val
eduMap
=
HashMap
<
String
,
Any
>()
eduMap
[
"in"
]
=
edu
filterMap
[
"edu"
]
=
eduMap
}
// 其它
if
(
allFilter
.
others
.
isNotEmpty
())
{
if
(
allFilter
.
others
.
isNotEmpty
())
{
sb
.
append
(
"&others="
).
append
(
allFilter
.
others
.
map
{
it
.
key
}.
joinToString
(
","
))
val
gender
=
ArrayList
<
String
?>()
// val bookIngStatusList = ArrayList<String>()
allFilter
.
others
.
forEach
{
when
(
it
.
key1
)
{
"gender"
->
{
gender
.
add
(
it
.
value1
)
}
// "booking_status" -> {
// bookIngStatusList.add("1")
// bookIngStatusList.add("2")
// }
else
->
{
filterMap
[
it
.
key1
]
=
it
.
value1
}
}
}
if
(
gender
.
size
>
0
){
val
genderMap
=
HashMap
<
String
,
Any
>()
genderMap
[
"in"
]
=
gender
filterMap
[
"gender"
]
=
genderMap
}
// if (bookIngStatusList.size>0){
// val bookStatusMap = HashMap<String, Any>()
// bookStatusMap["in"] = bookIngStatusList
// filterMap["booking_status"] = bookStatusMap
// }
}
}
// if (allFilter.showType.key != null) {
map
[
"filter"
]
=
filterMap
// showType = allFilter.showType.key!!
// sb.append("&showType=").append(allFilter.showType.key!!)
// sorts
// }
if
(
allFilter
.
reorder
.
key
!=
null
)
{
if
(
allFilter
.
title
.
isNotEmpty
())
{
val
sortsMap
=
HashMap
<
String
,
Any
>()
sb
.
append
(
"&title="
).
append
(
allFilter
.
title
.
map
{
it
.
key
}.
joinToString
(
","
))
sortsMap
[
allFilter
.
reorder
.
key1
]
=
allFilter
.
reorder
.
value1
map
[
"sorts"
]
=
sortsMap
}
}
if
(
allFilter
.
priceRanges
!=
null
)
{
// fields
sb
.
append
(
"&minPrice="
).
append
(
allFilter
.
priceRanges
?.
minPrice
)
val
fieldsMap
=
HashMap
<
String
,
Any
>()
sb
.
append
(
"&maxPrice="
).
append
(
allFilter
.
priceRanges
?.
maxPrice
)
fieldsMap
[
"doctor_id"
]
=
true
fieldsMap
[
"doctor_name"
]
=
true
fieldsMap
[
"uid"
]
=
true
fieldsMap
[
"chat_status"
]
=
true
// fieldsMap["consult_status"] = true
// fieldsMap["listen_status"] = true
// fieldsMap["booking_status"] = true
fieldsMap
[
"gender"
]
=
true
fieldsMap
[
"years"
]
=
true
fieldsMap
[
"head"
]
=
true
fieldsMap
[
"edu"
]
=
true
fieldsMap
[
"province"
]
=
true
fieldsMap
[
"city"
]
=
true
fieldsMap
[
"evaluation_average_score"
]
=
true
fieldsMap
[
"evaluate_num"
]
=
true
fieldsMap
[
"min_price"
]
=
true
fieldsMap
[
"title"
]
=
true
fieldsMap
[
"famous_remark"
]
=
true
fieldsMap
[
"help_num"
]
=
true
fieldsMap
[
"p30d_sold_hour"
]
=
true
fieldsMap
[
"sum_service_time"
]
=
true
fieldsMap
[
"has_servicefree_consult"
]
=
true
fieldsMap
[
"is_new_enter"
]
=
true
fieldsMap
[
"chat_num"
]
=
true
fieldsMap
[
"chat_btn_text"
]
=
true
fieldsMap
[
"feature_tags"
]
=
true
fieldsMap
[
"link_url"
]
=
true
fieldsMap
[
"open_chat_agency"
]
=
true
fieldsMap
[
"service_status"
]
=
true
fieldsMap
[
"is_free_today"
]
=
true
map
[
"fields"
]
=
fieldsMap
val
optionsMap
=
HashMap
<
String
,
Any
?>()
optionsMap
[
"search_scene_id"
]
=
"doctor_main_search"
optionsMap
[
"uid"
]
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
?.
uid
optionsMap
[
"ffrom"
]
=
PlatformDataManager
.
getRam
().
getChannelName
()
optionsMap
[
"version"
]=
RxAppTool
.
getAppVersionName
(
BaseApp
.
getApp
())
optionsMap
[
"os_type"
]=
2
if
(
extras
!=
null
){
optionsMap
[
"extras"
]
=
extras
}
}
sb
.
append
(
"&page="
).
append
(
page
)
map
[
"options"
]
=
optionsMap
ExpertSearchDataManager
.
getHttp
().
searchDoctor
(
sb
.
toString
())
ExpertSearchDataManager
.
getHttp
()
.
getExpertList
(
map
)
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mView
))
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mView
))
.
compose
(
RxUtils
.
resultJavaData
())
.
compose
(
RxUtils
.
resultJavaData
())
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
Consumer
{
.
subscribe
(
Consumer
{
if
(
null
!=
it
.
list
&&
it
.
list
.
isNotEmpty
())
{
// 当前页数
// if (showType == 0) {
val
curPage
=
(
it
.
skip
/
it
.
limit
)+
1
// mView.onDoctorListFetched(it.list!!, page, it.pages)
if
(
curPage
==
1
&&
it
.
objects
.
size
==
0
){
// } else {
// mView.onServiceListFetched(it.list!!, page, it.pages)
// }
mView
.
onDoctorListFetched
(
it
.
list
,
page
,
it
.
pages
)
//更新缓存 只更新第一页的缓存
if
(
page
==
1
)
{
updateCache
(
showType
,
it
)
}
}
else
{
mView
.
fetchListEmpty
(
"没有搜到相关信息,换个关键词看看吧"
)
mView
.
fetchListEmpty
(
"没有搜到相关信息,换个关键词看看吧"
)
}
else
{
mExtras
=
it
.
extras
mView
.
onDoctorListFetched
(
it
.
objects
,
mExtras
,
curPage
)
}
}
},
object
:
ThrowableConsumer
()
{
},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
override
fun
accept
(
msg
:
String
)
{
ToastUtil
.
toastShort
(
msg
)
mView
.
fetchListFailed
(
msg
)
mView
.
fetchListFailed
(
msg
)
}
}
})
})
...
...
m-consultant/src/main/java/com/yidianling/consultant/HotSearchActivity.kt
View file @
a58adebe
...
@@ -11,31 +11,24 @@ import android.view.WindowManager
...
@@ -11,31 +11,24 @@ import android.view.WindowManager
import
android.view.inputmethod.EditorInfo
import
android.view.inputmethod.EditorInfo
import
android.view.inputmethod.InputMethodManager
import
android.view.inputmethod.InputMethodManager
import
android.widget.TextView
import
android.widget.TextView
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.google.gson.Gson
import
com.google.gson.Gson
import
com.google.gson.reflect.TypeToken
import
com.google.gson.reflect.TypeToken
import
com.ydl.ydl_image.config.ISimpleImageOpConfig
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydl_image.manager.YDLImageCacheManager
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_router.manager.YDLRouterParams
import
com.ydl.ydl_router.manager.YDLRouterParams
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.ydl.ydlcommon.utils.FixSizeLinkedList
import
com.ydl.ydlcommon.utils.*
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.view.banner.GlideImageLoader
import
com.ydl.ydlcommon.view.banner.GlideImageLoader
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.adapter.SearchWordsAdapter
import
com.yidianling.consultant.api.IConsultantService
import
com.yidianling.consultant.api.IConsultantService
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.*
import
com.yidianling.consultant.bean.HotSearchFocusItemBean
import
com.yidianling.consultant.bean.HotSearchKeyWordDataBean
import
com.yidianling.consultant.bean.HotSearchPopularDoctorBean
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.contract.IHotSearchContract
import
com.yidianling.consultant.contract.IHotSearchContract
import
com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
import
com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
...
@@ -45,9 +38,10 @@ import kotlinx.android.synthetic.main.consultant_activity_hot_search.*
...
@@ -45,9 +38,10 @@ import kotlinx.android.synthetic.main.consultant_activity_hot_search.*
import
kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.*
import
kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.*
@Route
(
path
=
"/consult/hot_search"
)
@Route
(
path
=
"/consult/hot_search"
)
class
HotSearchActivity
:
BaseMvpActivity
<
IHotSearchContract
.
View
,
IHotSearchContract
.
Presenter
>(),
class
HotSearchActivity
:
BaseMvpActivity
<
IHotSearchContract
.
View
,
IHotSearchContract
.
Presenter
>(),
IHotSearchContract
.
View
{
IHotSearchContract
.
View
{
private
lateinit
var
searchWordsAdapter
:
SearchWordsAdapter
private
val
searchSuggestList
:
ArrayList
<
SearchSuggestListBean
>
=
ArrayList
()
private
var
mSearchContent
:
String
=
""
private
val
CACHE_CONSULT_SEARCH_HISTORY_DATA
=
"cache_consult_search_history_data"
private
val
CACHE_CONSULT_SEARCH_HISTORY_DATA
=
"cache_consult_search_history_data"
private
val
HOT_SEARCH_DOCTOR_NAME
=
"hot_search_doctor_name"
private
val
HOT_SEARCH_DOCTOR_NAME
=
"hot_search_doctor_name"
private
var
historyList
:
FixSizeLinkedList
<
String
>
=
FixSizeLinkedList
(
15
)
private
var
historyList
:
FixSizeLinkedList
<
String
>
=
FixSizeLinkedList
(
15
)
...
@@ -64,6 +58,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -64,6 +58,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
private
var
dp42
:
Int
=
0
private
var
dp42
:
Int
=
0
override
fun
layoutResId
():
Int
{
override
fun
layoutResId
():
Int
{
return
R
.
layout
.
consultant_activity_hot_search
return
R
.
layout
.
consultant_activity_hot_search
}
}
...
@@ -84,7 +79,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -84,7 +79,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
}
private
fun
getDataFromIntent
()
{
private
fun
getDataFromIntent
()
{
va
r
doctorName
=
intent
.
getStringExtra
(
HOT_SEARCH_DOCTOR_NAME
)
va
l
doctorName
=
intent
.
getStringExtra
(
HOT_SEARCH_DOCTOR_NAME
)
if
(!
TextUtils
.
isEmpty
(
doctorName
))
{
if
(!
TextUtils
.
isEmpty
(
doctorName
))
{
etSearch
.
setText
(
doctorName
)
etSearch
.
setText
(
doctorName
)
iv_delete_icon
.
visibility
=
View
.
VISIBLE
iv_delete_icon
.
visibility
=
View
.
VISIBLE
...
@@ -92,18 +87,35 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -92,18 +87,35 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
}
private
fun
initViews
()
{
private
fun
initViews
()
{
StatusBarUtils
.
statusBarLightMode
(
this
)
maxWidth
=
(
2
*
RxDeviceTool
.
getScreenWidth
(
this
@HotSearchActivity
))
-
RxImageTool
.
dip2px
(
60f
)
dp42
=
RxImageTool
.
dip2px
(
60f
)
iv_delete_icon
.
setOnClickListener
{
iv_delete_icon
.
setOnClickListener
{
etSearch
.
setText
(
""
)
etSearch
.
setText
(
""
)
}
}
etSearch
.
setOnEditorActionListener
{
_
,
actionId
,
_
->
etSearch
.
setOnEditorActionListener
{
_
,
actionId
,
_
->
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
doSearch
()
// 搜索的关联词
}
var
relatedWords
=
""
true
var
isRecommendWords
=
false
}
if
(
searchSuggestList
.
isNotEmpty
()&&
searchSuggestList
.
size
>
0
){
etSearch
.
setOnEditorActionListener
{
_
,
actionId
,
_
->
if
(
searchSuggestList
[
0
].
suggest_relations
.
size
>
0
){
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
relatedWords
=
searchSuggestList
[
0
].
suggest_relations
[
0
]
doSearch
()
isRecommendWords
=
true
}
if
(
TextUtils
.
isEmpty
(
relatedWords
)&&!
TextUtils
.
isEmpty
(
searchSuggestList
[
0
].
suggest_content
)){
relatedWords
=
searchSuggestList
[
0
].
suggest_content
}
doSearch
(
etSearch
.
text
.
toString
(),
relatedWords
,
isRecommendWords
)
}
else
{
val
searchWords
=
etSearch
.
text
.
toString
()
if
(
TextUtils
.
isEmpty
(
searchWords
)){
doSearch
(
searchWords
,
""
,
isRecommendWords
)
}
else
{
getSearchWords
(
etSearch
.
text
.
toString
(),
true
)
}
}
}
}
true
true
}
}
...
@@ -126,18 +138,42 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -126,18 +138,42 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
iv_daoyi_image
.
setOnClickListener
{
iv_daoyi_image
.
setOnClickListener
{
LogUtil
.
e
(
"跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}"
)
LogUtil
.
e
(
"跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}"
)
ConsultAssistantEntryUtils
.
jumpConsultAssistant
(
this
,
data
?.
get
(
0
)
!!
.
location
.
toInt
(),
"learning"
)
ConsultAssistantEntryUtils
.
jumpConsultAssistant
(
this
,
data
[
0
]
.
location
.
toInt
(),
"learning"
)
}
}
}
}
searchWordsAdapter
=
SearchWordsAdapter
(
searchSuggestList
)
rv_search_words
.
layoutManager
=
LinearLayoutManager
(
this
)
rv_search_words
.
adapter
=
searchWordsAdapter
searchWordsAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
// 搜索的关联词
var
relatedWords
=
""
var
isRecommendWords
=
false
if
(
searchSuggestList
.
isNotEmpty
()&&
searchSuggestList
.
size
>
0
){
if
(
searchSuggestList
[
position
].
suggest_relations
.
size
>
0
){
relatedWords
=
searchSuggestList
[
position
].
suggest_relations
[
0
]
isRecommendWords
=
true
}
if
(
TextUtils
.
isEmpty
(
relatedWords
)&&!
TextUtils
.
isEmpty
(
searchSuggestList
[
position
].
suggest_content
)){
relatedWords
=
searchSuggestList
[
position
].
suggest_content
}
}
doSearch
(
searchSuggestList
[
position
].
suggest_content
,
relatedWords
,
isRecommendWords
)
// 埋点
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_YDL_USER_MAIN_PAGE
,
ConsultBIConstants
.
POSITION_YDL_USER_ASSOCIATE_WORD_CLICK
,
etSearch
.
text
.
toString
(),
searchSuggestList
[
position
].
suggest_content
,
"app"
)
}
etSearch
.
addTextChangedListener
(
object
:
TextWatcher
{
etSearch
.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
afterTextChanged
(
s
:
Editable
?)
{
override
fun
afterTextChanged
(
s
:
Editable
?)
{
if
(
TextUtils
.
isEmpty
(
s
))
{
if
(
TextUtils
.
isEmpty
(
s
))
{
iv_delete_icon
.
visibility
=
View
.
INVISIBLE
iv_delete_icon
.
visibility
=
View
.
INVISIBLE
rv_search_words
.
visibility
=
View
.
GONE
getSearchWords
(
""
,
false
)
}
else
{
}
else
{
iv_delete_icon
.
visibility
=
View
.
VISIBLE
iv_delete_icon
.
visibility
=
View
.
VISIBLE
getSearchWords
(
s
.
toString
(),
false
)
}
}
}
}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
...
@@ -147,10 +183,53 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -147,10 +183,53 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
}
})
})
StatusBarUtils
.
statusBarLightMode
(
this
)
}
maxWidth
=
(
2
*
RxDeviceTool
.
getScreenWidth
(
this
@HotSearchActivity
))
-
RxImageTool
.
dip2px
(
60f
)
dp42
=
RxImageTool
.
dip2px
(
60f
)
/**
* 获取搜索联想词
* @param isClickWords 是否是点击历史搜索、热门搜索等进行搜索
*/
private
fun
getSearchWords
(
searchContent
:
String
,
isClickWords
:
Boolean
){
if
(!
TextUtils
.
isEmpty
(
searchContent
)){
mSearchContent
=
searchContent
val
map
=
HashMap
<
String
,
Any
>()
map
[
"content"
]
=
searchContent
mPresenter
.
getSearchWords
(
map
,
searchContent
,
isClickWords
)
}
else
{
rv_search_words
.
visibility
=
View
.
GONE
}
}
override
fun
getSearchWordsSuccess
(
searchWordsBean
:
SearchWordsBean
,
searchContent
:
String
,
isClickWords
:
Boolean
)
{
if
(
isClickWords
){
// 搜索的关联词
var
relatedWords
=
""
var
isRecommendWords
=
false
if
(!
searchWordsBean
.
search_suggests
.
isNullOrEmpty
()&&
searchWordsBean
.
search_suggests
.
size
>
0
){
if
(
searchWordsBean
.
search_suggests
[
0
].
suggest_relations
.
size
>
0
){
relatedWords
=
searchWordsBean
.
search_suggests
[
0
].
suggest_relations
[
0
]
isRecommendWords
=
true
}
if
(
TextUtils
.
isEmpty
(
relatedWords
)&&!
TextUtils
.
isEmpty
(
searchWordsBean
.
search_suggests
[
0
].
suggest_content
)){
relatedWords
=
searchWordsBean
.
search_suggests
[
0
].
suggest_content
}
}
doSearch
(
searchContent
,
relatedWords
,
isRecommendWords
)
}
else
{
searchSuggestList
.
clear
()
if
(!
searchWordsBean
.
search_suggests
.
isNullOrEmpty
()){
rv_search_words
.
visibility
=
View
.
VISIBLE
searchSuggestList
.
addAll
(
searchWordsBean
.
search_suggests
)
searchWordsAdapter
.
notifyDataAndSetSearchWord
(
mSearchContent
)
// 埋点
val
sign2
=
searchSuggestList
.
joinToString
(
","
){
it
.
suggest_content
}
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_YDL_USER_MAIN_PAGE
,
ConsultBIConstants
.
POSITION_YDL_USER_ASSOCIATE_WORD_VISIT
,
searchContent
,
sign2
,
"app"
)
}
else
{
rv_search_words
.
visibility
=
View
.
GONE
}
}
}
}
private
fun
initData
()
{
private
fun
initData
()
{
...
@@ -179,6 +258,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -179,6 +258,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
refreshBanner
(
null
)
refreshBanner
(
null
)
}
}
//刷新 热门搜索
//刷新 热门搜索
private
fun
refreshHotSearchData
(
keywordData
:
MutableList
<
HotSearchKeyWordDataBean
>?)
{
private
fun
refreshHotSearchData
(
keywordData
:
MutableList
<
HotSearchKeyWordDataBean
>?)
{
if
(
null
==
keywordData
||
keywordData
.
isEmpty
())
{
if
(
null
==
keywordData
||
keywordData
.
isEmpty
())
{
...
@@ -192,8 +272,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -192,8 +272,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
.
inflate
(
R
.
layout
.
consultant_item_expert_hot_search
,
flHotSearch
,
false
)
.
inflate
(
R
.
layout
.
consultant_item_expert_hot_search
,
flHotSearch
,
false
)
view
.
tvHotSearch
.
text
=
keywordData
[
index
].
keyword
view
.
tvHotSearch
.
text
=
keywordData
[
index
].
keyword
view
.
setOnClickListener
{
view
.
setOnClickListener
{
etSearch
.
setText
(
keywordData
[
index
].
keyword
)
getSearchWords
(
keywordData
[
index
].
keyword
!!
,
true
)
doSearch
()
}
}
flHotSearch
.
addView
(
view
)
flHotSearch
.
addView
(
view
)
}
}
...
@@ -225,8 +304,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -225,8 +304,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
}
}
}
view
.
setOnClickListener
{
view
.
setOnClickListener
{
etSearch
.
setText
(
hotSearchExpert
[
index
].
name
)
getSearchWords
(
etSearch
.
text
.
toString
(),
true
)
doSearch
()
}
}
flHotExpert
.
addView
(
view
)
flHotExpert
.
addView
(
view
)
}
}
...
@@ -235,9 +313,6 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -235,9 +313,6 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
//刷新 banner
//刷新 banner
private
fun
refreshBanner
(
focusList
:
MutableList
<
HotSearchFocusItemBean
>?)
{
private
fun
refreshBanner
(
focusList
:
MutableList
<
HotSearchFocusItemBean
>?)
{
if
(
null
==
focusList
)
{
if
(
null
==
focusList
)
{
// if (bannerList.isEmpty()) {
// bannerList.add("https://h2.yidianling.com/ct/list")
// }
card_view
.
visibility
=
View
.
GONE
card_view
.
visibility
=
View
.
GONE
}
}
if
(
null
!=
focusList
&&
focusList
.
isNotEmpty
())
{
if
(
null
!=
focusList
&&
focusList
.
isNotEmpty
())
{
...
@@ -291,8 +366,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -291,8 +366,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
break
break
}
}
view
.
setOnClickListener
{
view
.
setOnClickListener
{
etSearch
.
setText
(
historyStr
)
getSearchWords
(
historyStr
,
true
)
doSearch
()
}
}
fl_search_history
.
addView
(
view
)
fl_search_history
.
addView
(
view
)
}
}
...
@@ -308,32 +382,28 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
...
@@ -308,32 +382,28 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
return
rect
.
width
()
//文字宽
return
rect
.
width
()
//文字宽
}
}
//执行搜索
/**
private
fun
doSearch
()
{
* 搜索
* @param isRecommendWords 是否是推荐词
*/
private
fun
doSearch
(
searchWords
:
String
,
relatedWords
:
String
,
isRecommendWords
:
Boolean
)
{
val
view
=
this
.
currentFocus
val
view
=
this
.
currentFocus
if
(
view
!=
null
)
{
if
(
view
!=
null
)
{
val
imm
=
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
val
imm
=
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
imm
.
hideSoftInputFromWindow
(
view
.
windowToken
,
0
)
imm
.
hideSoftInputFromWindow
(
view
.
windowToken
,
0
)
}
}
val
keyWord
=
etSearch
.
text
.
toString
()
// if (TextUtils.isEmpty(keyWord.trim())) {
ActionCountUtils
.
count
(
ConsultBIConstants
.
UserMainEvent
.
YDL_USER_SEARCH_CLICK
,
searchWords
)
// ToastUtil.toastShort("请输入搜索内容")
if
(!
TextUtils
.
isEmpty
(
searchWords
))
{
// return
historyList
.
remove
(
searchWords
)
// }
historyList
.
add
(
searchWords
)
ActionCountUtils
.
count
(
ConsultBIConstants
.
UserMainEvent
.
YDL_USER_SEARCH_CLICK
,
keyWord
)
if
(!
TextUtils
.
isEmpty
(
keyWord
))
{
historyList
.
remove
(
keyWord
)
historyList
.
add
(
keyWord
)
SharedPreferencesEditor
.
putString
(
SharedPreferencesEditor
.
putString
(
CACHE_CONSULT_SEARCH_HISTORY_DATA
,
CACHE_CONSULT_SEARCH_HISTORY_DATA
,
Gson
().
toJson
(
historyList
)
Gson
().
toJson
(
historyList
)
)
)
}
}
ExpertSearchActivity
.
startSearch
(
this
,
searchWords
,
"14"
,
relatedWords
,
isRecommendWords
)
finish
()
ExpertSearchActivity
.
startSearch
(
this
,
keyWord
)
this
.
finish
()
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/IExpertSearchView.kt
View file @
a58adebe
...
@@ -3,23 +3,20 @@ package com.yidianling.consultant
...
@@ -3,23 +3,20 @@ package com.yidianling.consultant
import
android.widget.ImageView
import
android.widget.ImageView
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydlcommon.mvp.base.IView
import
com.ydl.ydlcommon.mvp.base.IView
import
com.yidianling.consultant.model.bean.DoctorServiceItem
import
com.yidianling.consultant.model.bean.ExpertServiceItem
import
com.yidianling.consultant.model.bean.ExpertBannerBean
import
com.yidianling.consultant.model.bean.Extras
import
com.yidianling.consultant.model.bean.ExpertSearchBean
import
com.yidianling.consultant.model.bean.HeadData
import
com.yidianling.consultant.model.bean.HeadData
/**
/**
* Created by zqk on 17-9-19.
* Created by zqk on 17-9-19.
*/
*/
interface
IExpertSearchView
:
IView
{
interface
IExpertSearchView
:
IView
{
fun
onServiceListFetched
(
data
:
MutableList
<
DoctorServiceItem
>,
page
:
Int
,
totalPage
:
Int
)
fun
showRefreshLayout
()
fun
showRefreshLayout
()
fun
localData
()
fun
localData
()
fun
updateCache
(
showType
:
Int
,
searchBean
:
ExpertSearchBean
)
fun
onHeadFetched
(
headData
:
HeadData
?)
fun
onHeadFetched
(
headData
:
HeadData
?)
fun
onDoctorListFetched
(
data
:
MutableList
<
DoctorServiceItem
>,
page
:
Int
,
totalPage
:
Int
)
fun
onDoctorListFetched
(
data
:
MutableList
<
ExpertServiceItem
>,
extras
:
Extras
?,
curPage
:
Int
)
fun
fetchFailed
(
msg
:
String
?)
fun
fetchFailed
(
msg
:
String
?)
fun
fetchListFailed
(
msg
:
String
?)
fun
fetchListFailed
(
msg
:
String
?)
fun
fetchListEmpty
(
msg
:
String
?)
fun
fetchListEmpty
(
msg
:
String
?)
...
...
m-consultant/src/main/java/com/yidianling/consultant/adapter/CategoryRecyclerViewAdapter.kt
View file @
a58adebe
...
@@ -32,7 +32,7 @@ class CategoryRecyclerViewAdapter(private val context: Context, private val cate
...
@@ -32,7 +32,7 @@ class CategoryRecyclerViewAdapter(private val context: Context, private val cate
override
fun
getItemCount
():
Int
=
categories
.
size
override
fun
getItemCount
():
Int
=
categories
.
size
inner
class
ViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
inner
class
ViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
val
tvSubjectName
:
TextView
=
itemView
.
tv
SubjectN
ame
val
tvSubjectName
:
TextView
=
itemView
.
tv
_sort_n
ame
init
{
init
{
itemView
.
setOnClickListener
{
itemView
.
setOnClickListener
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
View file @
a58adebe
...
@@ -2,35 +2,42 @@ package com.yidianling.consultant.adapter
...
@@ -2,35 +2,42 @@ package com.yidianling.consultant.adapter
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android
x.core.content.ContextCompat
import
android
.graphics.Typeface
import
android
x.appcompat.app.AppCompatActivity
import
android
.text.SpannableStringBuilder
import
android
x.recyclerview.widget.RecyclerView
import
android
.text.Spanned
import
android.text.TextUtils
import
android.text.TextUtils
import
android.text.style.StyleSpan
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.ImageView
import
android.widget.ImageView
import
androidx.appcompat.app.AppCompatActivity
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.RecyclerView
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
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydlcommon.base.config.HttpConfig
import
com.ydl.ydlcommon.base.config.HttpConfig
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.URLUtils
import
com.ydl.ydlcommon.utils.URLUtils
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.yidianling.consultant.ExpertSearchActivity
import
com.yidianling.consultant.IExpertSearchView
import
com.yidianling.consultant.IExpertSearchView
import
com.yidianling.consultant.R
import
com.yidianling.consultant.R
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.model.bean.
Doctor
ServiceItem
import
com.yidianling.consultant.model.bean.
Expert
ServiceItem
import
com.yidianling.consultant.modular.utils.TempH5RouteUtils
import
com.yidianling.consultant.modular.utils.TempH5RouteUtils
import
com.yidianling.consultant.router.ConsultantIn
import
com.yidianling.consultant.router.ConsultantIn
import
kotlinx.android.synthetic.main.consultant_activity_hot_search.*
import
kotlinx.android.synthetic.main.consultant_expert_search_feedbackrate.view.*
import
kotlinx.android.synthetic.main.consultant_expert_search_feedbackrate.view.*
import
kotlinx.android.synthetic.main.consultant_expert_search_header_view.view.*
import
kotlinx.android.synthetic.main.consultant_expert_search_item_view.view.*
import
kotlinx.android.synthetic.main.consultant_expert_search_item_view.view.*
import
kotlinx.android.synthetic.main.consultant_expert_search_products_item.view.*
import
kotlinx.android.synthetic.main.consultant_expert_search_products_item.view.*
import
kotlinx.android.synthetic.main.consultant_item_empty.view.*
import
kotlinx.android.synthetic.main.consultant_item_empty.view.*
import
kotlinx.android.synthetic.main.consultant_item_footer.view.*
import
kotlinx.android.synthetic.main.consultant_item_footer.view.*
import
kotlinx.android.synthetic.main.consultant_item_tag.view.*
import
kotlinx.android.synthetic.main.consultant_item_tag.view.*
import
kotlinx.android.synthetic.main.consultant_layout_search_content.*
import
java.math.BigDecimal
import
java.math.BigDecimal
/**
/**
...
@@ -39,29 +46,89 @@ import java.math.BigDecimal
...
@@ -39,29 +46,89 @@ import java.math.BigDecimal
class
ExpertSearchAdapter
(
class
ExpertSearchAdapter
(
private
val
context
:
Context
,
private
val
context
:
Context
,
private
val
expertSearchView
:
IExpertSearchView
,
private
val
expertSearchView
:
IExpertSearchView
,
private
val
listData
:
ArrayList
<
Doctor
ServiceItem
>
private
val
listData
:
ArrayList
<
Expert
ServiceItem
>
)
:
RecyclerView
.
Adapter
<
RecyclerView
.
ViewHolder
>()
{
)
:
RecyclerView
.
Adapter
<
RecyclerView
.
ViewHolder
>()
{
companion
object
{
companion
object
{
const
val
HEADER_VIEW
=
3
const
val
NORMAL_VIEW
=
0
const
val
NORMAL_VIEW
=
0
const
val
FOOT_VIEW
=
1
const
val
FOOT_VIEW
=
1
const
val
EMPTY_VIEW
=
2
const
val
EMPTY_VIEW
=
2
}
}
interface
OnClickLister
{
fun
onClick
(
searchWords
:
String
)
}
private
lateinit
var
mOnClickLister
:
OnClickLister
fun
setOnClickLister
(
lister
:
OnClickLister
)
{
mOnClickLister
=
lister
}
//记录当前选择主题的id
//记录当前选择主题的id
var
cateId
:
String
?
=
null
var
cateId
:
String
?
=
null
var
hasMore
=
true
var
hasMore
=
true
var
pageIndex
:
Int
=
0
var
pageIndex
:
Int
=
0
var
clickCount
=
0
// 搜索结果提示标签点击次数
var
mIsRecommendWords
=
false
// 是否是推荐词
fun
setEntrance
(
pageIndex
:
Int
)
{
fun
setEntrance
(
pageIndex
:
Int
)
{
this
.
pageIndex
=
pageIndex
this
.
pageIndex
=
pageIndex
}
}
fun
setIsRecommendWords
(
isRecommend
:
Boolean
){
mIsRecommendWords
=
isRecommend
}
@SuppressLint
(
"SetTextI18n"
)
@SuppressLint
(
"SetTextI18n"
)
override
fun
onBindViewHolder
(
holder
:
RecyclerView
.
ViewHolder
,
position
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
RecyclerView
.
ViewHolder
,
position
:
Int
)
{
if
(
holder
is
NormalViewHolder
)
{
if
(
holder
is
HeaderViewHolder
)
{
// 搜索结果提示头部
if
(
listData
.
size
>
0
){
if
(
listData
[
0
].
is_head_view
){
if
(
clickCount
==
0
){
holder
.
clSearchWords
.
visibility
=
View
.
VISIBLE
var
text
=
"根据匹配,为您推荐“${listData[0].related_word}”的搜索结果"
holder
.
tvSearchRelatedWord
.
text
=
setTextBold
(
text
,
listData
[
0
].
related_word
)
holder
.
tvSearchWord
.
text
=
listData
[
0
].
search_content
// 埋点
if
(
mIsRecommendWords
){
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_YDL_USER_MAIN_PAGE
,
"ydl_user_map_word_visit"
,
listData
[
0
].
search_content
,
listData
[
0
].
related_word
,
"app"
)
}
else
{
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_YDL_USER_MAIN_PAGE
,
"ydl_user_correction_word_visit"
,
listData
[
0
].
search_content
,
listData
[
0
].
related_word
,
"app"
)
}
holder
.
tvSearchWord
.
setOnClickListener
{
mOnClickLister
.
onClick
(
holder
.
tvSearchWord
.
text
.
toString
())
++
clickCount
if
(
clickCount
==
1
){
text
=
"以下是“${listData[0].search_content}”的搜索结果"
holder
.
tvSearchRelatedWord
.
text
=
setTextBold
(
text
,
listData
[
0
].
search_content
)
holder
.
tvSearchTips
.
text
=
"你要找的是不是"
holder
.
tvSearchWord
.
text
=
listData
[
0
].
related_word
// 埋点
if
(
mIsRecommendWords
){
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_YDL_USER_MAIN_PAGE
,
"ydl_user_map_inputword_click"
,
listData
[
0
].
related_word
,
listData
[
0
].
search_content
,
"app"
)
}
else
{
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_YDL_USER_MAIN_PAGE
,
"ydl_user_correction_inputword_click"
,
listData
[
0
].
related_word
,
listData
[
0
].
search_content
,
"app"
)
}
}
else
if
(
clickCount
==
2
){
// 第二次点击搜索标签隐藏搜索匹配结果提示
// 埋点
if
(
mIsRecommendWords
){
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_YDL_USER_MAIN_PAGE
,
"ydl_user_map_recommendword_click"
,
listData
[
0
].
search_content
,
listData
[
0
].
related_word
,
"app"
)
}
else
{
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_YDL_USER_MAIN_PAGE
,
"ydl_user_correction_recommendword_click"
,
listData
[
0
].
search_content
,
listData
[
0
].
related_word
,
"app"
)
}
listData
.
removeAt
(
0
)
clickCount
=
0
// 点击两次后重置为0
}
}
}
}
}
}
else
if
(
holder
is
NormalViewHolder
)
{
val
itemBean
=
listData
[
position
]
val
itemBean
=
listData
[
position
]
//头像
//头像
val
headConfig
=
SimpleImageOpConfiger
()
val
headConfig
=
SimpleImageOpConfiger
()
...
@@ -75,23 +142,23 @@ class ExpertSearchAdapter(
...
@@ -75,23 +142,23 @@ class ExpertSearchAdapter(
headConfig
headConfig
)
)
//姓名
//姓名
holder
.
tvName
.
text
=
itemBean
.
name
holder
.
tvName
.
text
=
itemBean
.
doctor_
name
//服务中
//服务中
if
(
itemBean
.
inConsult
||
itemBean
.
isListening
)
{
if
(
itemBean
.
open_chat_agency
==
2
&&
itemBean
.
service_status
==
2
)
{
holder
.
imgHead_online_server
.
visibility
=
View
.
VISIBLE
holder
.
imgHead_online_server
.
visibility
=
View
.
VISIBLE
holder
.
chat_people_in_question
.
visibility
=
View
.
GONE
holder
.
chat_people_in_question
.
visibility
=
View
.
GONE
holder
.
imgHead_online
.
visibility
=
View
.
GONE
holder
.
imgHead_online
.
visibility
=
View
.
GONE
}
else
{
}
else
{
//不是服务中且问询人数大于0
//不是服务中且问询人数大于0
when
{
when
{
itemBean
.
chat
N
um
>
5
->
{
itemBean
.
chat
_n
um
>
5
->
{
holder
.
chat_people_in_question
.
visibility
=
View
.
VISIBLE
holder
.
chat_people_in_question
.
visibility
=
View
.
VISIBLE
holder
.
chat_people_in_question
.
text
=
"多人在问询"
holder
.
chat_people_in_question
.
text
=
"多人在问询"
}
}
itemBean
.
chat
N
um
>
0
->
{
itemBean
.
chat
_n
um
>
0
->
{
holder
.
chat_people_in_question
.
visibility
=
View
.
VISIBLE
holder
.
chat_people_in_question
.
visibility
=
View
.
VISIBLE
holder
.
chat_people_in_question
.
text
=
"${itemBean.chat
N
um}人在问询"
holder
.
chat_people_in_question
.
text
=
"${itemBean.chat
_n
um}人在问询"
}
}
else
->
{
else
->
{
holder
.
chat_people_in_question
.
visibility
=
View
.
GONE
holder
.
chat_people_in_question
.
visibility
=
View
.
GONE
...
@@ -99,7 +166,7 @@ class ExpertSearchAdapter(
...
@@ -99,7 +166,7 @@ class ExpertSearchAdapter(
}
}
//可预约
//可预约
holder
.
imgHead_online_server
.
visibility
=
View
.
GONE
holder
.
imgHead_online_server
.
visibility
=
View
.
GONE
if
(
itemBean
.
is
TodayFree
==
true
)
{
if
(
itemBean
.
is
_free_today
==
1
)
{
holder
.
imgHead_online
.
visibility
=
View
.
VISIBLE
holder
.
imgHead_online
.
visibility
=
View
.
VISIBLE
}
else
{
}
else
{
holder
.
imgHead_online
.
visibility
=
View
.
GONE
holder
.
imgHead_online
.
visibility
=
View
.
GONE
...
@@ -115,10 +182,10 @@ class ExpertSearchAdapter(
...
@@ -115,10 +182,10 @@ class ExpertSearchAdapter(
}
}
//公益图标,不与其他图标冲突
//公益图标,不与其他图标冲突
if
(
1
==
itemBean
.
has
ServiceFree
)
{
if
(
1
==
itemBean
.
has
_servicefree_consult
)
{
if
(
null
!=
itemBean
.
tagsIcon
&&
!
TextUtils
.
isEmpty
(
itemBean
.
tagsIcon
.
serviceFreeI
con
))
{
if
(
null
!=
itemBean
.
icons
&&
!
TextUtils
.
isEmpty
(
itemBean
.
icons
.
service_free_i
con
))
{
expertSearchView
.
showImage
(
expertSearchView
.
showImage
(
itemBean
.
tagsIcon
.
serviceFreeI
con
,
itemBean
.
icons
.
service_free_i
con
,
holder
.
imgServiceFree
holder
.
imgServiceFree
)
)
}
else
{
}
else
{
...
@@ -133,13 +200,13 @@ class ExpertSearchAdapter(
...
@@ -133,13 +200,13 @@ class ExpertSearchAdapter(
}
}
// 展示了抗疫,就不展示其他标签
// 展示了抗疫,就不展示其他标签
if
(
itemBean
.
fightEpidemicIconShow
)
{
if
(
itemBean
.
fightEpidemicIconShow
)
{
itemBean
.
tagsIcon
?.
fightEpidemicI
con
?.
let
{
itemBean
.
icons
?.
fight_epidemic_i
con
?.
let
{
GlideApp
.
with
(
context
).
load
(
itemBean
.
tagsIcon
?.
fightEpidemicI
con
)
GlideApp
.
with
(
context
).
load
(
itemBean
.
icons
?.
fight_epidemic_i
con
)
.
into
(
holder
.
imgFightEpidemicIcon
)
.
into
(
holder
.
imgFightEpidemicIcon
)
holder
.
imgFightEpidemicIcon
.
visibility
=
View
.
VISIBLE
holder
.
imgFightEpidemicIcon
.
visibility
=
View
.
VISIBLE
}
}
if
(
itemBean
.
joinActivity
==
true
)
{
if
(
itemBean
.
joinActivity
==
true
)
{
//活动图标
//活动图标
if
(!
TextUtils
.
isEmpty
(
itemBean
.
activityImg
))
{
if
(!
TextUtils
.
isEmpty
(
itemBean
.
activityImg
))
{
holder
.
imgActivity
.
visibility
=
View
.
VISIBLE
holder
.
imgActivity
.
visibility
=
View
.
VISIBLE
...
@@ -147,7 +214,7 @@ class ExpertSearchAdapter(
...
@@ -147,7 +214,7 @@ class ExpertSearchAdapter(
}
else
{
}
else
{
holder
.
imgActivity
.
visibility
=
View
.
GONE
holder
.
imgActivity
.
visibility
=
View
.
GONE
}
}
}
else
{
}
else
{
holder
.
imgActivity
.
visibility
=
View
.
GONE
holder
.
imgActivity
.
visibility
=
View
.
GONE
}
}
...
@@ -182,10 +249,10 @@ class ExpertSearchAdapter(
...
@@ -182,10 +249,10 @@ class ExpertSearchAdapter(
holder
.
imgActivity
.
visibility
=
View
.
GONE
holder
.
imgActivity
.
visibility
=
View
.
GONE
}
}
//新驻图标
//新驻图标
if
(
itemBean
.
is
NewEnter
)
{
if
(
itemBean
.
is
_new_enter
!=
null
&&
itemBean
.
is_new_enter
!!
)
{
if
(
null
!=
itemBean
.
tagsIcon
&&
!
TextUtils
.
isEmpty
(
itemBean
.
tagsIcon
.
newEnterI
con
))
{
if
(
null
!=
itemBean
.
icons
&&
!
TextUtils
.
isEmpty
(
itemBean
.
icons
.
new_enter_i
con
))
{
expertSearchView
.
showImage
(
expertSearchView
.
showImage
(
itemBean
.
tagsIcon
.
newEnterI
con
,
itemBean
.
icons
.
new_enter_i
con
,
holder
.
imgNewEnter
holder
.
imgNewEnter
)
)
}
else
{
}
else
{
...
@@ -206,10 +273,10 @@ class ExpertSearchAdapter(
...
@@ -206,10 +273,10 @@ class ExpertSearchAdapter(
holder
.
ll_feedbackRate
,
holder
.
ll_feedbackRate
,
false
false
)
)
if
(
itemBean
.
feedbackRat
e
>=
num
)
{
if
(
itemBean
.
evaluation_average_scor
e
>=
num
)
{
(
view
.
imgRate
as
ImageView
).
background
=
(
view
.
imgRate
as
ImageView
).
background
=
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_full_star
)
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_full_star
)
}
else
if
(
itemBean
.
feedbackRate
<
num
&&
itemBean
.
feedbackRat
e
>
num
-
1
)
{
}
else
if
(
itemBean
.
evaluation_average_score
<
num
&&
itemBean
.
evaluation_average_scor
e
>
num
-
1
)
{
(
view
.
imgRate
as
ImageView
).
background
=
(
view
.
imgRate
as
ImageView
).
background
=
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_half_star
)
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_half_star
)
}
else
{
}
else
{
...
@@ -221,28 +288,39 @@ class ExpertSearchAdapter(
...
@@ -221,28 +288,39 @@ class ExpertSearchAdapter(
//XXX人点评
//XXX人点评
val
numSb
=
StringBuffer
()
val
numSb
=
StringBuffer
()
holder
.
tv_zixunOrderNum
.
text
=
holder
.
tv_zixunOrderNum
.
text
=
numSb
.
append
(
itemBean
.
zixunOrderN
um
).
append
(
""
).
toString
()
numSb
.
append
(
itemBean
.
evaluate_n
um
).
append
(
""
).
toString
()
//咨询师简介
//咨询师简介
holder
.
tvTeamCertifications
.
text
=
itemBean
.
t
eamCertifications
holder
.
tvTeamCertifications
.
text
=
itemBean
.
t
itle
//咨询师标签
//咨询师标签
holder
.
ll_tags
.
removeAllViews
()
holder
.
ll_tags
.
removeAllViews
()
itemBean
.
tagList
?.
let
{
itemBean
.
feature_tags
?.
let
{
if
(
it
.
isNotEmpty
()){
if
(
it
.
isNotEmpty
())
{
for
(
tag
in
itemBean
.
tagList
){
for
(
tag
in
itemBean
.
feature_tags
)
{
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
consultant_item_tag
,
holder
.
ll_tags
,
false
)
val
view
=
LayoutInflater
.
from
(
context
)
tag
.
tagName
?.
let
{
name
->
.
inflate
(
R
.
layout
.
consultant_item_tag
,
holder
.
ll_tags
,
false
)
if
(
name
.
length
>
4
){
tag
.
tag_name
.
let
{
name
->
view
.
tvTag
.
text
=
"${name.substring(0,4)}…"
if
(
name
.
length
>
4
)
{
}
else
{
view
.
tvTag
.
text
=
"${name.substring(0, 4)}…"
}
else
{
view
.
tvTag
.
text
=
name
view
.
tvTag
.
text
=
name
}
}
}
}
if
(
tag
.
is
High
==
1
)
{
if
(
tag
.
is
_highlight
)
{
view
.
tvTag
.
setBackgroundResource
(
R
.
drawable
.
consultant_bg_radius_line_eb892c
)
view
.
tvTag
.
setBackgroundResource
(
R
.
drawable
.
consultant_bg_radius_line_eb892c
)
view
.
tvTag
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_EB892C
))
view
.
tvTag
.
setTextColor
(
}
else
{
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_EB892C
)
)
}
else
{
view
.
tvTag
.
setBackgroundResource
(
R
.
drawable
.
consultant_bg_radius_line_gray_1
)
view
.
tvTag
.
setBackgroundResource
(
R
.
drawable
.
consultant_bg_radius_line_gray_1
)
view
.
tvTag
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
platform_color_E0E0E0
))
view
.
tvTag
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
platform_color_666666
)
)
}
}
holder
.
ll_tags
.
addView
(
view
)
holder
.
ll_tags
.
addView
(
view
)
}
}
...
@@ -250,9 +328,9 @@ class ExpertSearchAdapter(
...
@@ -250,9 +328,9 @@ class ExpertSearchAdapter(
}
}
//帮助人数
//帮助人数
val
orderUser
=
StringBuffer
()
val
orderUser
=
StringBuffer
()
holder
.
tvOrderNum
.
text
=
orderUser
.
append
(
itemBean
.
zixunOrderUser
).
append
(
""
).
toString
()
holder
.
tvOrderNum
.
text
=
orderUser
.
append
(
itemBean
.
help_num
).
append
(
""
).
toString
()
//私聊文案
//私聊文案
if
(
TextUtils
.
isEmpty
(
itemBean
.
chat
BtnT
ext
))
{
if
(
TextUtils
.
isEmpty
(
itemBean
.
chat
_btn_t
ext
))
{
holder
.
tvChat
.
text
=
"私聊"
holder
.
tvChat
.
text
=
"私聊"
holder
.
tvChat
.
setTextColor
(
holder
.
tvChat
.
setTextColor
(
ContextCompat
.
getColor
(
ContextCompat
.
getColor
(
...
@@ -260,11 +338,16 @@ class ExpertSearchAdapter(
...
@@ -260,11 +338,16 @@ class ExpertSearchAdapter(
R
.
color
.
platform_but_text_color
R
.
color
.
platform_but_text_color
)
)
)
)
holder
.
tvChat
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
platform_but_text_color
))
holder
.
tvChat
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
platform_but_text_color
)
)
holder
.
tvChat
.
background
=
holder
.
tvChat
.
background
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
consultant_expert_search_chat
)
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
consultant_expert_search_chat
)
}
else
{
}
else
{
holder
.
tvChat
.
text
=
itemBean
.
chat
BtnT
ext
holder
.
tvChat
.
text
=
itemBean
.
chat
_btn_t
ext
holder
.
tvChat
.
setTextColor
(
holder
.
tvChat
.
setTextColor
(
ContextCompat
.
getColor
(
ContextCompat
.
getColor
(
context
,
context
,
...
@@ -279,35 +362,35 @@ class ExpertSearchAdapter(
...
@@ -279,35 +362,35 @@ class ExpertSearchAdapter(
//服务时长
//服务时长
val
durationStringBuffer
=
StringBuffer
()
val
durationStringBuffer
=
StringBuffer
()
holder
.
tvSaleDurationForMonth
.
text
=
holder
.
tvSaleDurationForMonth
.
text
=
durationStringBuffer
.
append
(
itemBean
.
allSaleDuration
.
toInt
()).
append
(
""
).
toString
()
durationStringBuffer
.
append
(
itemBean
.
sum_service_time
.
toInt
()).
append
(
""
).
toString
()
//价格
//价格
val
price
=
BigDecimal
(
itemBean
.
min
BookingP
rice
)
val
price
=
BigDecimal
(
itemBean
.
min
_p
rice
)
//
去掉末尾无用的.00
//
去掉末尾无用的.00
holder
.
tvPrice
.
text
=
price
.
stripTrailingZeros
().
toPlainString
()
holder
.
tvPrice
.
text
=
price
.
stripTrailingZeros
().
toPlainString
()
//套餐
//套餐
holder
.
ll_products
.
removeAllViews
()
holder
.
ll_products
.
removeAllViews
()
if
(
null
!=
itemBean
.
products
&&
!
itemBean
.
products
.
is
Empty
())
{
if
(
null
!=
itemBean
.
doctor_products
&&
itemBean
.
doctor_products
.
isNot
Empty
())
{
for
(
item
in
itemBean
.
products
)
{
for
(
item
in
itemBean
.
doctor_
products
)
{
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
consultant_expert_search_products_item
,
R
.
layout
.
consultant_expert_search_products_item
,
holder
.
ll_tags
,
holder
.
ll_tags
,
false
false
)
)
when
(
item
.
isPackag
e
)
{
when
(
item
.
product_typ
e
)
{
1
->
{
"1"
->
{
view
.
tvTitle
.
text
=
"单次"
view
.
tvTitle
.
text
=
"单次"
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
platform_color_1DA1F2
))
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
platform_color_1DA1F2
))
view
.
tvTitle
.
background
=
view
.
tvTitle
.
background
=
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_single
)
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_single
)
view
.
tvContent
.
text
=
item
.
name
view
.
tvContent
.
text
=
item
.
product_
name
holder
.
ll_products
.
addView
(
view
)
holder
.
ll_products
.
addView
(
view
)
}
}
2
->
{
"2"
->
{
view
.
tvTitle
.
text
=
"套餐"
view
.
tvTitle
.
text
=
"套餐"
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
consultant_color_FF9500
))
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
consultant_color_FF9500
))
view
.
tvTitle
.
background
=
view
.
tvTitle
.
background
=
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_menu
)
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_menu
)
view
.
tvContent
.
text
=
item
.
name
view
.
tvContent
.
text
=
item
.
product_
name
holder
.
ll_products
.
addView
(
view
)
holder
.
ll_products
.
addView
(
view
)
}
}
else
->
{
else
->
{
...
@@ -316,9 +399,9 @@ class ExpertSearchAdapter(
...
@@ -316,9 +399,9 @@ class ExpertSearchAdapter(
}
}
}
}
}
}
}
else
if
(
holder
is
FooterViewHolder
)
{
}
else
if
(
holder
is
FooterViewHolder
)
{
LogUtil
.
e
(
"${listData.size}"
)
LogUtil
.
e
(
"${hasMore}"
)
if
(
hasMore
)
{
if
(
hasMore
)
{
holder
.
itemView
.
visibility
=
View
.
VISIBLE
holder
.
itemView
.
visibility
=
View
.
VISIBLE
holder
.
pbLoading
.
visibility
=
View
.
VISIBLE
holder
.
pbLoading
.
visibility
=
View
.
VISIBLE
...
@@ -331,7 +414,8 @@ class ExpertSearchAdapter(
...
@@ -331,7 +414,8 @@ class ExpertSearchAdapter(
}
}
override
fun
getItemCount
():
Int
=
override
fun
getItemCount
():
Int
=
if
(
listData
.
size
<
ExpertSearchActivity
.
PAGE_SIZE
&&
hasMore
)
{
// if (listData.size < ExpertSearchActivity.PAGE_SIZE && hasMore) {
if
(
listData
.
size
==
1
)
{
listData
.
size
listData
.
size
}
else
{
}
else
{
listData
.
size
+
1
listData
.
size
+
1
...
@@ -339,6 +423,10 @@ class ExpertSearchAdapter(
...
@@ -339,6 +423,10 @@ class ExpertSearchAdapter(
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
RecyclerView
.
ViewHolder
=
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
RecyclerView
.
ViewHolder
=
when
(
viewType
)
{
when
(
viewType
)
{
HEADER_VIEW
->
{
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
consultant_expert_search_header_view
,
parent
,
false
)
HeaderViewHolder
(
view
)
}
NORMAL_VIEW
->
{
NORMAL_VIEW
->
{
val
view
=
LayoutInflater
.
from
(
context
)
val
view
=
LayoutInflater
.
from
(
context
)
.
inflate
(
R
.
layout
.
consultant_expert_search_item_view
,
parent
,
false
)
.
inflate
(
R
.
layout
.
consultant_expert_search_item_view
,
parent
,
false
)
...
@@ -356,64 +444,96 @@ class ExpertSearchAdapter(
...
@@ -356,64 +444,96 @@ class ExpertSearchAdapter(
}
}
}
}
override
fun
getItemViewType
(
position
:
Int
):
Int
=
when
{
override
fun
getItemViewType
(
position
:
Int
):
Int
=
position
<
listData
.
size
->
NORMAL_VIEW
when
{
!
hasMore
&&
listData
.
size
==
0
->
EMPTY_VIEW
position
==
0
&&
listData
.
size
>
0
&&
listData
[
0
].
is_head_view
->{
else
->
FOOT_VIEW
HEADER_VIEW
}
}
position
<
listData
.
size
->
{
NORMAL_VIEW
}
!
hasMore
&&
listData
.
size
==
0
->
{
EMPTY_VIEW
}
else
->
FOOT_VIEW
}
inner
class
NormalViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
inner
class
NormalViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
//头像
//头像
val
imgHead
=
itemView
.
imgHead
!!
val
imgHead
=
itemView
.
imgHead
!!
val
cv_head_view
=
itemView
.
cv_head_view
!!
val
cv_head_view
=
itemView
.
cv_head_view
!!
//专家姓名
//专家姓名
val
tvName
=
itemView
.
tvName
!!
val
tvName
=
itemView
.
tvName
!!
//活动图标
//活动图标
val
imgActivity
=
itemView
.
img_activity
!!
val
imgActivity
=
itemView
.
img_activity
!!
//优质图标
//优质图标
val
imgAbilityLevel
=
itemView
.
imgAbilityLevel
!!
val
imgAbilityLevel
=
itemView
.
imgAbilityLevel
!!
//公益图标
//公益图标
val
imgServiceFree
=
itemView
.
imgServiceFree
!!
val
imgServiceFree
=
itemView
.
imgServiceFree
!!
//新驻图标
//新驻图标
val
imgNewEnter
=
itemView
.
imgNewEnter
!!
val
imgNewEnter
=
itemView
.
imgNewEnter
!!
//荣誉标签
//荣誉标签
val
ll_honor_layout
=
itemView
.
ll_honor_layout
!!
val
ll_honor_layout
=
itemView
.
ll_honor_layout
!!
//好评率
//好评率
val
ll_feedbackRate
=
itemView
.
ll_feedbackRate
!!
val
ll_feedbackRate
=
itemView
.
ll_feedbackRate
!!
//xxx人点评
//xxx人点评
val
tv_zixunOrderNum
=
itemView
.
tv_zixunOrderNum
!!
val
tv_zixunOrderNum
=
itemView
.
tv_zixunOrderNum
!!
//咨询师简介
//咨询师简介
val
tvTeamCertifications
=
itemView
.
tvTeamCertifications
!!
val
tvTeamCertifications
=
itemView
.
tvTeamCertifications
!!
//咨询师标签
//咨询师标签
val
ll_tags
=
itemView
.
ll_tags
!!
val
ll_tags
=
itemView
.
ll_tags
!!
//帮助人数
//帮助人数
val
tvOrderNum
=
itemView
.
tvOrderNum
!!
val
tvOrderNum
=
itemView
.
tvOrderNum
!!
//帮助人数文案
//帮助人数文案
val
tvOrderNumContent
=
itemView
.
tvOrderNumContent
val
tvOrderNumContent
=
itemView
.
tvOrderNumContent
//服务时长
//服务时长
val
tvSaleDurationForMonth
=
itemView
.
tvSaleDurationForMonth
!!
val
tvSaleDurationForMonth
=
itemView
.
tvSaleDurationForMonth
!!
//月售时长文案
//月售时长文案
val
tvSaleDurationForMonthContent
=
itemView
.
tvSaleDurationForMonthContent
val
tvSaleDurationForMonthContent
=
itemView
.
tvSaleDurationForMonthContent
//价格
//价格
val
tvPrice
=
itemView
.
tvPrice
!!
val
tvPrice
=
itemView
.
tvPrice
!!
val
tvPriceContent
=
itemView
.
tvPriceContent
!!
val
tvPriceContent
=
itemView
.
tvPriceContent
!!
val
tv_money_symbol
=
itemView
.
tv_money_symbol
!!
val
tv_money_symbol
=
itemView
.
tv_money_symbol
!!
//服务套餐
//服务套餐
val
ll_products
=
itemView
.
ll_products
!!
val
ll_products
=
itemView
.
ll_products
!!
//私聊按钮
//私聊按钮
val
tvChat
=
itemView
.
tvChat
!!
val
tvChat
=
itemView
.
tvChat
!!
//个人铭言整个布局
//个人铭言整个布局
val
group_desc
=
itemView
.
group_desc
!!
val
group_desc
=
itemView
.
group_desc
!!
//个人铭言
//个人铭言
val
tvDesc
=
itemView
.
tvDesc
!!
val
tvDesc
=
itemView
.
tvDesc
!!
//省市
//省市
val
tvCity
=
itemView
.
tvCity
!!
val
tvCity
=
itemView
.
tvCity
!!
//今日是否可约
//今日是否可约
val
imgHead_online
=
itemView
.
imgHead_online
!!
val
imgHead_online
=
itemView
.
imgHead_online
!!
//服务中(咨询中或者聆听中)
//服务中(咨询中或者聆听中)
val
imgHead_online_server
=
itemView
.
imgHead_online_server
!!
val
imgHead_online_server
=
itemView
.
imgHead_online_server
!!
//多少人在问询
//多少人在问询
val
chat_people_in_question
=
itemView
.
people_in_question
!!
val
chat_people_in_question
=
itemView
.
people_in_question
!!
// 抗疫先锋图标
// 抗疫先锋图标
val
imgFightEpidemicIcon
=
itemView
.
img_fightEpidemicIcon
val
imgFightEpidemicIcon
=
itemView
.
img_fightEpidemicIcon
...
@@ -422,25 +542,21 @@ class ExpertSearchAdapter(
...
@@ -422,25 +542,21 @@ class ExpertSearchAdapter(
//跳转专家主页
//跳转专家主页
if
(
adapterPosition
!=
RecyclerView
.
NO_POSITION
)
{
if
(
adapterPosition
!=
RecyclerView
.
NO_POSITION
)
{
val
itemBean
=
listData
[
adapterPosition
]
val
itemBean
=
listData
[
adapterPosition
]
var
linkUrl
=
itemBean
.
link
U
rl
var
linkUrl
=
itemBean
.
link
_u
rl
if
(!
TextUtils
.
isEmpty
(
cateId
))
{
if
(!
TextUtils
.
isEmpty
(
cateId
))
{
linkUrl
=
URLUtils
.
appendParmas
(
linkUrl
,
"cateId"
,
cateId
)
linkUrl
=
URLUtils
.
appendParmas
(
linkUrl
,
"cateId"
,
cateId
)
}
}
if
(
pageIndex
==
0
)
{
ActionCountUtils
.
count
(
ConsultBIConstants
.
ConsultEvent
.
APP_CONSULT_LIST_DOCTOR_CLICK
,
itemBean
.
doctorId
?:
""
)
}
else
{
ActionCountUtils
.
count
(
ConsultBIConstants
.
ConsultSearchListEvent
.
APP_CONSULT_SEARCH_LIST_CONSULT_ITEM_CLICK
,
itemBean
.
doctorId
?:
""
)
}
TempH5RouteUtils
.
tempH5Route
(
linkUrl
)
TempH5RouteUtils
.
tempH5Route
(
linkUrl
)
// 埋点
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
ConsultEvent
.
POSITION_CONSULT_COUNSELOR_CARD_CLICK
,
itemBean
.
id
?:
""
,
"app"
,
""
)
}
}
}
}
...
@@ -450,16 +566,16 @@ class ExpertSearchAdapter(
...
@@ -450,16 +566,16 @@ class ExpertSearchAdapter(
if
(
pageIndex
==
0
)
{
if
(
pageIndex
==
0
)
{
ActionCountUtils
.
count
(
ActionCountUtils
.
count
(
ConsultBIConstants
.
ConsultEvent
.
APP_CONSULT_LIST_CHAT_CLICK
,
ConsultBIConstants
.
ConsultEvent
.
APP_CONSULT_LIST_CHAT_CLICK
,
doctor
.
doctorI
d
?:
""
doctor
.
i
d
?:
""
)
)
}
else
{
}
else
{
ActionCountUtils
.
count
(
ActionCountUtils
.
count
(
ConsultBIConstants
.
ConsultSearchListEvent
.
APP_CONSULT_SEARCH_LIST_CHAT_CLICK
,
ConsultBIConstants
.
ConsultSearchListEvent
.
APP_CONSULT_SEARCH_LIST_CHAT_CLICK
,
doctor
.
doctorI
d
?:
""
doctor
.
i
d
?:
""
)
)
}
}
//判断是否已登录
//判断是否已登录
if
(!
ConsultantIn
.
getUserImpl
().
loginByOneKeyLogin
(
context
,
true
))
{
if
(!
ConsultantIn
.
getUserImpl
().
loginByOneKeyLogin
(
context
,
true
))
{
return
@setOnClickListener
return
@setOnClickListener
}
}
...
@@ -476,6 +592,13 @@ class ExpertSearchAdapter(
...
@@ -476,6 +592,13 @@ class ExpertSearchAdapter(
}
}
}
}
inner
class
HeaderViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
val
clSearchWords
=
itemView
.
cl_search_words
val
tvSearchRelatedWord
=
itemView
.
tv_search_related_word
val
tvSearchTips
=
itemView
.
tv_search_tips
val
tvSearchWord
=
itemView
.
tv_search_word
}
inner
class
FooterViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
inner
class
FooterViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
val
pbLoading
=
itemView
.
pbLoading
!!
val
pbLoading
=
itemView
.
pbLoading
!!
val
tvHint
=
itemView
.
tvHint
!!
val
tvHint
=
itemView
.
tvHint
!!
...
@@ -491,4 +614,22 @@ class ExpertSearchAdapter(
...
@@ -491,4 +614,22 @@ class ExpertSearchAdapter(
}
}
}
}
}
}
private
fun
setTextBold
(
text
:
String
,
content
:
String
):
SpannableStringBuilder
{
return
if
(
text
.
contains
(
content
))
{
val
s1
=
text
.
split
(
content
)[
0
]
val
s2
=
text
.
split
(
content
)[
1
]
val
spannableBuilder1
=
SpannableStringBuilder
(
s1
)
val
spannableBuilder2
=
SpannableStringBuilder
(
content
)
spannableBuilder2
.
setSpan
(
StyleSpan
(
Typeface
.
BOLD
),
0
,
content
.
length
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
spannableBuilder1
.
append
(
spannableBuilder2
).
append
(
SpannableStringBuilder
(
s2
))
}
else
{
SpannableStringBuilder
(
text
)
}
}
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/adapter/SearchWordsAdapter.kt
0 → 100644
View file @
a58adebe
package
com.yidianling.consultant.adapter
import
android.text.SpannableString
import
android.text.Spanned
import
android.text.style.ForegroundColorSpan
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.BaseViewHolder
import
com.yidianling.consultant.R
import
com.yidianling.consultant.bean.SearchSuggestListBean
/**
* Created by Ykai on 2022/5/30.
*/
class
SearchWordsAdapter
(
data
:
List
<
SearchSuggestListBean
>)
:
BaseQuickAdapter
<
SearchSuggestListBean
,
BaseViewHolder
>(
R
.
layout
.
consultant_item_search_words
,
data
)
{
private
var
mSearchWord
:
String
=
""
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
SearchSuggestListBean
)
{
val
tvSearchWords
=
holder
.
getView
<
TextView
>(
R
.
id
.
tv_search_words
)
tvSearchWords
.
text
=
setWordsStyle
(
item
.
suggest_content
,
mSearchWord
)
}
fun
notifyDataAndSetSearchWord
(
searchWord
:
String
){
mSearchWord
=
searchWord
notifyDataSetChanged
()
}
private
fun
setWordsStyle
(
words
:
String
,
searchWord
:
String
):
SpannableString
{
val
spannableString
=
SpannableString
(
words
)
if
(
words
.
contains
(
searchWord
)){
val
startIndex
=
words
.
indexOf
(
searchWord
)
val
endIndex
=
startIndex
+
searchWord
.
length
spannableString
.
setSpan
(
ForegroundColorSpan
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
platform_main_theme
)),
startIndex
,
endIndex
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
}
return
spannableString
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/adapter/SortAdapter.kt
0 → 100644
View file @
a58adebe
package
com.yidianling.consultant.adapter
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import
com.chad.library.adapter.base.BaseViewHolder
import
com.yidianling.consultant.R
import
com.yidianling.consultant.model.bean.ChildrenBean
/**
* Created by Ykai on 2022/5/18.
*/
class
SortAdapter
(
data
:
List
<
ChildrenBean
>)
:
BaseMultiItemQuickAdapter
<
ChildrenBean
,
BaseViewHolder
>(
data
)
{
var
isVisible
=
false
init
{
addItemType
(
1
,
R
.
layout
.
consultant_item_sort1
)
addItemType
(
2
,
R
.
layout
.
consultant_item_sort2
)
}
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
ChildrenBean
)
{
when
(
holder
.
itemViewType
){
1
->{
holder
.
setGone
(
R
.
id
.
ll_sort_item
,
item
.
isVisible
)
holder
.
setText
(
R
.
id
.
tv_sort_name
,
item
.
cate_name
)
holder
.
getView
<
TextView
>(
R
.
id
.
tv_sort_name
).
isSelected
=
item
.
isSelected
if
(
item
.
isSelected
){
holder
.
setTextColor
(
R
.
id
.
tv_sort_name
,
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
platform_main_theme
))
}
else
{
holder
.
setTextColor
(
R
.
id
.
tv_sort_name
,
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
platform_color_242424
))
}
}
2
->{
holder
.
setGone
(
R
.
id
.
ll_sort_item
,
item
.
isVisible
)
holder
.
setText
(
R
.
id
.
tv_sort_name
,
item
.
cate_name
)
holder
.
getView
<
TextView
>(
R
.
id
.
tv_sort_name
).
isSelected
=
item
.
isSelected
if
(
item
.
isSelected
){
holder
.
setTextColor
(
R
.
id
.
tv_sort_name
,
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
platform_main_theme
))
}
else
{
holder
.
setTextColor
(
R
.
id
.
tv_sort_name
,
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
platform_color_242424
))
}
}
}
}
/**
* 设置大于第12个之后的标签全部显示
*/
fun
setAllVisible
(){
mData
.
forEach
{
bean
->
bean
.
isVisible
=
true
}
notifyDataSetChanged
()
isVisible
=
true
}
/**
* 设置大于第12个之后的标签全部隐藏
*/
fun
setGone
(){
mData
.
forEachIndexed
{
index
,
bean
->
if
(
index
>
12
){
bean
.
isVisible
=
false
}
}
notifyDataSetChanged
()
isVisible
=
false
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/adapter/SortRecyclerViewAdapter.kt
View file @
a58adebe
...
@@ -31,7 +31,7 @@ class SortRecyclerViewAdapter(private val context: Context,
...
@@ -31,7 +31,7 @@ class SortRecyclerViewAdapter(private val context: Context,
val
item
=
sortItems
[
position
]
val
item
=
sortItems
[
position
]
holder
.
tvSort
.
text
=
item
.
value
holder
.
tvSort
.
text
=
item
.
value
if
(
item
.
key
==
selectedSort
.
key
)
{
if
(
item
.
key
==
selectedSort
.
key
)
{
holder
.
tvSort
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
)
holder
.
tvSort
.
typeface
=
Typeface
.
DEFAULT_BOLD
holder
.
tvSort
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
platform_main_theme
))
holder
.
tvSort
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
platform_main_theme
))
// holder.ivCheck.visibility = View.VISIBLE
// holder.ivCheck.visibility = View.VISIBLE
}
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchProductsBean.kt
View file @
a58adebe
...
@@ -11,8 +11,8 @@ data class ExpertSearchProductsBean(
...
@@ -11,8 +11,8 @@ data class ExpertSearchProductsBean(
/**
/**
* 1.单次/2.套餐
* 1.单次/2.套餐
*/
*/
val
isPackage
:
Int
?,
val
product_type
:
String
?,
/**
/**
* 套餐名称
* 套餐名称
*/
*/
val
name
:
String
?)
val
product_name
:
String
?)
\ No newline at end of file
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchTagsIconBean.kt
View file @
a58adebe
...
@@ -11,16 +11,16 @@ data class ExpertSearchTagsIconBean(
...
@@ -11,16 +11,16 @@ data class ExpertSearchTagsIconBean(
/**
/**
* 优质图标
* 优质图标
*/
*/
val
ability
LevelI
con
:
String
?,
val
ability
_level_i
con
:
String
?,
/**
/**
* 公益图标
* 公益图标
*/
*/
val
service
FreeI
con
:
String
?,
val
service
_free_i
con
:
String
?,
/**
/**
* 新入驻图标
* 新入驻图标
*/
*/
val
new
EnterI
con
:
String
?,
val
new
_enter_i
con
:
String
?,
/**
/**
* 抗疫先锋图标地址
* 抗疫先锋图标地址
*/
*/
var
fightEpidemicIcon
:
String
?
=
null
)
var
fight_epidemic_icon
:
String
?
=
null
)
\ No newline at end of file
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/bean/SearchWordsBean.kt
0 → 100644
View file @
a58adebe
package
com.yidianling.consultant.bean
/**
* Created by Ykai on 2022/5/30.
*/
data class
SearchWordsBean
(
val
search_suggests
:
ArrayList
<
SearchSuggestListBean
>?
)
data class
SearchSuggestListBean
(
val
id
:
String
,
val
score
:
String
,
val
suggest_content
:
String
,
val
suggest_relations
:
ArrayList
<
String
>,
val
search_count
:
Int
,
val
suggest_classify_types
:
ArrayList
<
String
>,
val
mapping_classify_type_exist
:
Boolean
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/constants/ConsultBIConstants.kt
View file @
a58adebe
...
@@ -19,7 +19,12 @@ class ConsultBIConstants {
...
@@ -19,7 +19,12 @@ class ConsultBIConstants {
const
val
POSITION_CONSULT_FILTER_RESET_CLICK
=
"consult_filter_reset_click"
//重置
const
val
POSITION_CONSULT_FILTER_RESET_CLICK
=
"consult_filter_reset_click"
//重置
const
val
POSITION_CONSULT_FILTER_CHECKOUT_CLICK
=
"consult_filter_checkoutallconsultants_click"
//查看XXX位咨询师
const
val
POSITION_CONSULT_FILTER_CHECKOUT_CLICK
=
"consult_filter_checkoutallconsultants_click"
//查看XXX位咨询师
const
val
POSITION_DAOYI_ADVERTISEMENT_CLICK
=
"daoyi_advertisement_page|daoyi_advertisement_click"
const
val
POSITION_DAOYI_ADVERTISEMENT_CLICK
=
"daoyi_advertisement_page|daoyi_advertisement_click"
const
val
POSITION_DAOYI_ADVERTISEMENT_VISIT
=
"daoyi_advertisement_page|daoyi_advertisement_visit"
const
val
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
=
"consult_counselor_list_page"
// 咨询师列表页面浏览part_id
const
val
PART_ID_YDL_USER_MAIN_PAGE
=
"ydl_user_main_page"
// 联想词part_id
const
val
POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT
=
"consult_counselor_list_page_visit"
// 咨询师列表页面浏览position
const
val
POSITION_YDL_USER_ASSOCIATE_WORD_VISIT
=
"ydl_user_associate_word_visit"
// 联想词曝光position
const
val
POSITION_YDL_USER_ASSOCIATE_WORD_CLICK
=
"ydl_user_associate_word_click"
// 联想词点击position
}
}
//====================APP咨询列表页(app_consult_list_page)====================
//====================APP咨询列表页(app_consult_list_page)====================
...
@@ -51,6 +56,10 @@ class ConsultBIConstants {
...
@@ -51,6 +56,10 @@ class ConsultBIConstants {
const
val
YDL_USER_CONSULT_TYPE_CLICK
:
String
=
const
val
YDL_USER_CONSULT_TYPE_CLICK
:
String
=
APP_CONSULT_LIST_PAGE
+
"ydl_user_consult_type_click"
//咨询师顶部ICON 厌学专题、限时特惠、精神心理
APP_CONSULT_LIST_PAGE
+
"ydl_user_consult_type_click"
//咨询师顶部ICON 厌学专题、限时特惠、精神心理
const
val
POSITION_CONSULT_COUNSELOR_CARD_CLICK
=
"consult_counselor_card_click"
// 咨询师列表点击position
const
val
POSITION_CHOICE_FILTER_CLICK
=
"choice_filter_click"
// 热门点击项position
const
val
POSITION_TWO_CATEGORY_CLICK
=
"two_category_click"
// 八大类标签选择埋点
const
val
POSITION_GOODAT_CROWD_CLICK
=
"goodat_crowd_click"
// 擅长人群埋点
}
}
}
}
class
ConsultSearchListEvent
{
class
ConsultSearchListEvent
{
...
@@ -69,8 +78,7 @@ class ConsultBIConstants {
...
@@ -69,8 +78,7 @@ class ConsultBIConstants {
class
UserMainEvent
{
class
UserMainEvent
{
companion
object
{
companion
object
{
private
const
val
YDL_USER_MAIN_PAGE
:
String
=
private
const
val
YDL_USER_MAIN_PAGE
:
String
=
"ydl_user_main_page|"
//壹点灵用户版首页 partId
"ydl_user_main_page|"
//壹点灵用户版首页 partId
const
val
YDL_USER_SEARCH_CLICK
:
String
=
const
val
YDL_USER_SEARCH_CLICK
:
String
=
YDL_USER_MAIN_PAGE
+
"ydl_user_search_click"
//搜索栏
YDL_USER_MAIN_PAGE
+
"ydl_user_search_click"
//搜索栏
...
...
m-consultant/src/main/java/com/yidianling/consultant/contract/IHotSearchContract.kt
View file @
a58adebe
...
@@ -5,6 +5,7 @@ import com.ydl.ydlcommon.mvp.base.IModel
...
@@ -5,6 +5,7 @@ import com.ydl.ydlcommon.mvp.base.IModel
import
com.ydl.ydlcommon.mvp.base.IPresenter
import
com.ydl.ydlcommon.mvp.base.IPresenter
import
com.ydl.ydlcommon.mvp.base.IView
import
com.ydl.ydlcommon.mvp.base.IView
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.SearchWordsBean
import
io.reactivex.Observable
import
io.reactivex.Observable
/**
/**
...
@@ -26,6 +27,11 @@ class IHotSearchContract {
...
@@ -26,6 +27,11 @@ class IHotSearchContract {
* 请求失败
* 请求失败
*/
*/
fun
requestFail
()
fun
requestFail
()
/**
* 联想词请求成功结果
*/
fun
getSearchWordsSuccess
(
searchWordsBean
:
SearchWordsBean
,
searchContent
:
String
,
isClickWords
:
Boolean
)
}
}
interface
Presenter
:
IPresenter
<
View
>
{
interface
Presenter
:
IPresenter
<
View
>
{
...
@@ -38,6 +44,11 @@ class IHotSearchContract {
...
@@ -38,6 +44,11 @@ class IHotSearchContract {
* 搜索页接口请求
* 搜索页接口请求
*/
*/
fun
searchData
()
fun
searchData
()
/**
* 获取联想词
*/
fun
getSearchWords
(
map
:
HashMap
<
String
,
Any
>,
searchContent
:
String
,
isClickWords
:
Boolean
)
}
}
interface
Model
:
IModel
{
interface
Model
:
IModel
{
...
@@ -45,5 +56,10 @@ class IHotSearchContract {
...
@@ -45,5 +56,10 @@ class IHotSearchContract {
* 搜索页接口
* 搜索页接口
*/
*/
fun
searchData
():
Observable
<
HotSearchBean
>
fun
searchData
():
Observable
<
HotSearchBean
>
/**
* 获取到联想词
*/
fun
getSearchWords
(
map
:
HashMap
<
String
,
Any
>):
Observable
<
SearchWordsBean
>
}
}
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/http/ExpertSearchHttpImpl.kt
View file @
a58adebe
...
@@ -5,8 +5,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
...
@@ -5,8 +5,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlnet.YDLHttpUtils
import
com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.consultant.bean.ExpertSearchTopShowBean
import
com.yidianling.consultant.bean.ExpertSearchTopShowBean
import
com.yidianling.consultant.model.SearchApi
import
com.yidianling.consultant.model.SearchApi
import
com.yidianling.consultant.model.bean.ExpertBannerBean
import
com.yidianling.consultant.model.bean.ExpertBean
import
com.yidianling.consultant.model.bean.ExpertSearchBean
import
io.reactivex.Observable
import
io.reactivex.Observable
/**
/**
...
@@ -45,9 +44,13 @@ class ExpertSearchHttpImpl : IExpertSearchHttp {
...
@@ -45,9 +44,13 @@ class ExpertSearchHttpImpl : IExpertSearchHttp {
return
searchApi
!!
return
searchApi
!!
}
}
override
fun
searchDoctor
(
params
:
String
?):
Observable
<
BaseAPIResponse
<
ExpertSearchBean
>>
{
// override fun searchDoctor(params: String?): Observable<BaseAPIResponse<ExpertSearchBean>> {
return
getSearchApi
().
searchDoctorService
(
HttpConfig
.
JAVA_BASE_URL
+
"doctor/nlist?"
+
params
)
// return getSearchApi().searchDoctorService(HttpConfig.JAVA_BASE_URL+ "doctor/nlist?"+params)
//
// }
override
fun
getExpertList
(
map
:
Map
<
String
,
Any
>):
Observable
<
BaseAPIResponse
<
ExpertBean
>>
{
return
getSearchApi
().
getExpertList
(
map
)
}
}
override
fun
getBigShotData
():
Observable
<
BaseAPIResponse
<
ExpertSearchTopShowBean
>>
{
override
fun
getBigShotData
():
Observable
<
BaseAPIResponse
<
ExpertSearchTopShowBean
>>
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/http/IExpertSearchHttp.kt
View file @
a58adebe
...
@@ -2,8 +2,8 @@ package com.yidianling.consultant.http
...
@@ -2,8 +2,8 @@ package com.yidianling.consultant.http
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.yidianling.consultant.bean.ExpertSearchTopShowBean
import
com.yidianling.consultant.bean.ExpertSearchTopShowBean
import
com.yidianling.consultant.
model.bean.ExpertBanner
Bean
import
com.yidianling.consultant.
bean.SearchWords
Bean
import
com.yidianling.consultant.model.bean.Expert
Search
Bean
import
com.yidianling.consultant.model.bean.ExpertBean
import
io.reactivex.Observable
import
io.reactivex.Observable
/**
/**
...
@@ -17,7 +17,17 @@ interface IExpertSearchHttp{
...
@@ -17,7 +17,17 @@ interface IExpertSearchHttp{
/**
/**
* 专家搜索页请求
* 专家搜索页请求
*/
*/
fun
searchDoctor
(
params
:
String
?):
Observable
<
BaseAPIResponse
<
ExpertSearchBean
>>
// fun searchDoctor(params : String?): Observable<BaseAPIResponse<ExpertSearchBean>>
/**
* 获取搜索联想词
*/
// fun getSearchWords(map:Map<String,Any>): Observable<BaseAPIResponse<SearchWordsBean>>
/**
* 获取专家列表
*/
fun
getExpertList
(
map
:
Map
<
String
,
Any
>):
Observable
<
BaseAPIResponse
<
ExpertBean
>>
/**
/**
* 获取当前筛选条件结果数
* 获取当前筛选条件结果数
...
...
m-consultant/src/main/java/com/yidianling/consultant/http/hotsearch/HotSearchHttpImpl.kt
View file @
a58adebe
...
@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
...
@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlnet.YDLHttpUtils
import
com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.SearchWordsBean
import
com.yidianling.consultant.http.ExpertSearchParam
import
com.yidianling.consultant.http.ExpertSearchParam
import
com.yidianling.consultant.model.SearchApi
import
com.yidianling.consultant.model.SearchApi
import
io.reactivex.Observable
import
io.reactivex.Observable
...
@@ -46,4 +47,8 @@ class HotSearchHttpImpl : IHotSearchHttp {
...
@@ -46,4 +47,8 @@ class HotSearchHttpImpl : IHotSearchHttp {
getSearchApi
().
searchPage
()
getSearchApi
().
searchPage
()
}
}
}
}
override
fun
getSearchWords
(
map
:
HashMap
<
String
,
Any
>):
Observable
<
BaseAPIResponse
<
SearchWordsBean
>>
{
return
getSearchApi
().
getSearchWords
(
map
)
}
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/http/hotsearch/IHotSearchHttp.kt
View file @
a58adebe
...
@@ -2,6 +2,7 @@ package com.yidianling.consultant.http.hotsearch
...
@@ -2,6 +2,7 @@ package com.yidianling.consultant.http.hotsearch
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.SearchWordsBean
import
io.reactivex.Observable
import
io.reactivex.Observable
/**
/**
...
@@ -13,7 +14,12 @@ import io.reactivex.Observable
...
@@ -13,7 +14,12 @@ import io.reactivex.Observable
*/
*/
interface
IHotSearchHttp
{
interface
IHotSearchHttp
{
/**
/**
*
测评首
页请求
*
搜索
页请求
*/
*/
fun
searchData
():
Observable
<
BaseAPIResponse
<
HotSearchBean
>>
fun
searchData
():
Observable
<
BaseAPIResponse
<
HotSearchBean
>>
/**
* 搜索联想词请求
*/
fun
getSearchWords
(
map
:
HashMap
<
String
,
Any
>):
Observable
<
BaseAPIResponse
<
SearchWordsBean
>>
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/layoutmanager/FlowLayoutManager.java
0 → 100644
View file @
a58adebe
package
com
.
yidianling
.
consultant
.
layoutmanager
;
import
android.graphics.Rect
;
import
android.util.Log
;
import
android.util.SparseArray
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.recyclerview.widget.RecyclerView
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* Created by Ykai on 2022/2/21.
* 流式布局layoutManager
*/
public
class
FlowLayoutManager
extends
RecyclerView
.
LayoutManager
{
private
static
final
String
TAG
=
FlowLayoutManager
.
class
.
getSimpleName
();
final
FlowLayoutManager
self
=
this
;
protected
int
width
,
height
;
private
int
left
,
top
,
right
;
//最大容器的宽度
private
int
usedMaxWidth
;
//竖直方向上的偏移量
private
int
verticalScrollOffset
=
0
;
public
int
getTotalHeight
()
{
return
totalHeight
;
}
//计算显示的内容的高度
protected
int
totalHeight
=
0
;
private
Row
row
=
new
Row
();
private
List
<
Row
>
lineRows
=
new
ArrayList
<>();
//保存所有的Item的上下左右的偏移量信息
private
SparseArray
<
Rect
>
allItemFrames
=
new
SparseArray
<>();
public
FlowLayoutManager
()
{
//设置主动测量规则,适应recyclerView高度为wrap_content
setAutoMeasureEnabled
(
true
);
}
//每个item的定义
public
class
Item
{
int
useHeight
;
View
view
;
public
void
setRect
(
Rect
rect
)
{
this
.
rect
=
rect
;
}
Rect
rect
;
public
Item
(
int
useHeight
,
View
view
,
Rect
rect
)
{
this
.
useHeight
=
useHeight
;
this
.
view
=
view
;
this
.
rect
=
rect
;
}
}
//行信息的定义
public
class
Row
{
public
void
setCuTop
(
float
cuTop
)
{
this
.
cuTop
=
cuTop
;
}
public
void
setMaxHeight
(
float
maxHeight
)
{
this
.
maxHeight
=
maxHeight
;
}
//每一行的头部坐标
float
cuTop
;
//每一行需要占据的最大高度
float
maxHeight
;
//每一行存储的item
List
<
Item
>
views
=
new
ArrayList
<>();
public
void
addViews
(
Item
view
)
{
views
.
add
(
view
);
}
}
@Override
public
RecyclerView
.
LayoutParams
generateDefaultLayoutParams
()
{
return
new
RecyclerView
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
}
//该方法主要用来获取每一个item在屏幕上占据的位置
@Override
public
void
onLayoutChildren
(
RecyclerView
.
Recycler
recycler
,
RecyclerView
.
State
state
)
{
Log
.
d
(
TAG
,
"onLayoutChildren"
);
totalHeight
=
0
;
int
cuLineTop
=
top
;
//当前行使用的宽度
int
cuLineWidth
=
0
;
int
itemLeft
;
int
itemTop
;
int
maxHeightItem
=
0
;
row
=
new
Row
();
lineRows
.
clear
();
allItemFrames
.
clear
();
removeAllViews
();
if
(
getItemCount
()
==
0
)
{
detachAndScrapAttachedViews
(
recycler
);
verticalScrollOffset
=
0
;
return
;
}
if
(
getChildCount
()
==
0
&&
state
.
isPreLayout
())
{
return
;
}
//onLayoutChildren方法在RecyclerView 初始化时 会执行两遍
detachAndScrapAttachedViews
(
recycler
);
if
(
getChildCount
()
==
0
)
{
width
=
getWidth
();
height
=
getHeight
();
left
=
getPaddingLeft
();
right
=
getPaddingRight
();
top
=
getPaddingTop
();
usedMaxWidth
=
width
-
left
-
right
;
}
for
(
int
i
=
0
;
i
<
getItemCount
();
i
++)
{
Log
.
d
(
TAG
,
"index:"
+
i
);
View
childAt
=
recycler
.
getViewForPosition
(
i
);
if
(
View
.
GONE
==
childAt
.
getVisibility
())
{
continue
;
}
measureChildWithMargins
(
childAt
,
0
,
0
);
int
childWidth
=
getDecoratedMeasuredWidth
(
childAt
);
int
childHeight
=
getDecoratedMeasuredHeight
(
childAt
);
int
childUseWidth
=
childWidth
;
int
childUseHeight
=
childHeight
;
//如果加上当前的item还小于最大的宽度的话
if
(
cuLineWidth
+
childUseWidth
<=
usedMaxWidth
)
{
itemLeft
=
left
+
cuLineWidth
;
itemTop
=
cuLineTop
;
Rect
frame
=
allItemFrames
.
get
(
i
);
if
(
frame
==
null
)
{
frame
=
new
Rect
();
}
frame
.
set
(
itemLeft
,
itemTop
,
itemLeft
+
childWidth
,
itemTop
+
childHeight
);
allItemFrames
.
put
(
i
,
frame
);
cuLineWidth
+=
childUseWidth
;
maxHeightItem
=
Math
.
max
(
maxHeightItem
,
childUseHeight
);
row
.
addViews
(
new
Item
(
childUseHeight
,
childAt
,
frame
));
}
else
{
//换行
formatAboveRow
();
cuLineTop
+=
maxHeightItem
;
totalHeight
+=
maxHeightItem
;
itemTop
=
cuLineTop
;
itemLeft
=
left
;
Rect
frame
=
allItemFrames
.
get
(
i
);
if
(
frame
==
null
)
{
frame
=
new
Rect
();
}
frame
.
set
(
itemLeft
,
itemTop
,
itemLeft
+
childWidth
,
itemTop
+
childHeight
);
allItemFrames
.
put
(
i
,
frame
);
cuLineWidth
=
childUseWidth
;
maxHeightItem
=
childUseHeight
;
row
.
addViews
(
new
Item
(
childUseHeight
,
childAt
,
frame
));
}
row
.
setCuTop
(
cuLineTop
);
row
.
setMaxHeight
(
maxHeightItem
);
//不要忘了最后一行进行刷新下布局
if
(
i
==
getItemCount
()
-
1
)
{
formatAboveRow
();
totalHeight
+=
maxHeightItem
;
}
}
totalHeight
=
Math
.
max
(
totalHeight
,
getVerticalSpace
());
Log
.
d
(
TAG
,
"onLayoutChildren totalHeight:"
+
totalHeight
);
fillLayout
(
recycler
,
state
);
}
//对出现在屏幕上的item进行展示,超出屏幕的item回收到缓存中
private
void
fillLayout
(
RecyclerView
.
Recycler
recycler
,
RecyclerView
.
State
state
)
{
if
(
state
.
isPreLayout
()
||
getItemCount
()
==
0
)
{
// 跳过preLayout,preLayout主要用于支持动画
return
;
}
// 当前scroll offset状态下的显示区域
Rect
displayFrame
=
new
Rect
(
getPaddingLeft
(),
getPaddingTop
()
+
verticalScrollOffset
,
getWidth
()
-
getPaddingRight
(),
verticalScrollOffset
+
(
getHeight
()
-
getPaddingBottom
()));
//对所有的行信息进行遍历
for
(
int
j
=
0
;
j
<
lineRows
.
size
();
j
++)
{
Row
row
=
lineRows
.
get
(
j
);
float
lineTop
=
row
.
cuTop
;
float
lineBottom
=
lineTop
+
row
.
maxHeight
;
//如果该行在屏幕中,进行放置item
// if (lineTop < displayFrame.bottom && displayFrame.top < lineBottom) {
List
<
Item
>
views
=
row
.
views
;
for
(
int
i
=
0
;
i
<
views
.
size
();
i
++)
{
View
scrap
=
views
.
get
(
i
).
view
;
measureChildWithMargins
(
scrap
,
0
,
0
);
addView
(
scrap
);
Rect
frame
=
views
.
get
(
i
).
rect
;
//将这个item布局出来
layoutDecoratedWithMargins
(
scrap
,
frame
.
left
,
frame
.
top
-
verticalScrollOffset
,
frame
.
right
,
frame
.
bottom
-
verticalScrollOffset
);
}
// } else {
// //将不在屏幕中的item放到缓存中
// List<Item> views = row.views;
// for (int i = 0; i < views.size(); i++) {
// View scrap = views.get(i).view;
// removeAndRecycleView(scrap, recycler);
// }
// }
}
}
/**
* 计算每一行没有居中的viewgroup,让居中显示
*/
private
void
formatAboveRow
()
{
List
<
Item
>
views
=
row
.
views
;
for
(
int
i
=
0
;
i
<
views
.
size
();
i
++)
{
Item
item
=
views
.
get
(
i
);
View
view
=
item
.
view
;
int
position
=
getPosition
(
view
);
//如果该item的位置不在该行中间位置的话,进行重新放置
if
(
allItemFrames
.
get
(
position
).
top
<
row
.
cuTop
+
(
row
.
maxHeight
-
views
.
get
(
i
).
useHeight
)
/
2
)
{
Rect
frame
=
allItemFrames
.
get
(
position
);
if
(
frame
==
null
)
{
frame
=
new
Rect
();
}
frame
.
set
(
allItemFrames
.
get
(
position
).
left
,
(
int
)
(
row
.
cuTop
+
(
row
.
maxHeight
-
views
.
get
(
i
).
useHeight
)
/
2
),
allItemFrames
.
get
(
position
).
right
,
(
int
)
(
row
.
cuTop
+
(
row
.
maxHeight
-
views
.
get
(
i
).
useHeight
)
/
2
+
getDecoratedMeasuredHeight
(
view
)));
allItemFrames
.
put
(
position
,
frame
);
item
.
setRect
(
frame
);
views
.
set
(
i
,
item
);
}
}
row
.
views
=
views
;
lineRows
.
add
(
row
);
row
=
new
Row
();
}
/**
* 竖直方向需要滑动的条件
*
* @return
*/
@Override
public
boolean
canScrollVertically
()
{
return
true
;
}
//监听竖直方向滑动的偏移量
@Override
public
int
scrollVerticallyBy
(
int
dy
,
RecyclerView
.
Recycler
recycler
,
RecyclerView
.
State
state
)
{
Log
.
d
(
"TAG"
,
"totalHeight:"
+
totalHeight
);
//实际要滑动的距离
int
travel
=
dy
;
//如果滑动到最顶部
if
(
verticalScrollOffset
+
dy
<
0
)
{
//限制滑动到顶部之后,不让继续向上滑动了
travel
=
-
verticalScrollOffset
;
//verticalScrollOffset=0
}
else
if
(
verticalScrollOffset
+
dy
>
totalHeight
-
getVerticalSpace
())
{
//如果滑动到最底部
travel
=
totalHeight
-
getVerticalSpace
()
-
verticalScrollOffset
;
//verticalScrollOffset=totalHeight - getVerticalSpace()
}
//将竖直方向的偏移量+travel
verticalScrollOffset
+=
travel
;
// 平移容器内的item
offsetChildrenVertical
(-
travel
);
fillLayout
(
recycler
,
state
);
return
travel
;
}
private
int
getVerticalSpace
()
{
return
self
.
getHeight
()
-
self
.
getPaddingBottom
()
-
self
.
getPaddingTop
();
}
public
int
getHorizontalSpace
()
{
return
self
.
getWidth
()
-
self
.
getPaddingLeft
()
-
self
.
getPaddingRight
();
}
}
m-consultant/src/main/java/com/yidianling/consultant/listener/OnCategoriesSelectedListener.kt
View file @
a58adebe
package
com.yidianling.consultant.listener
package
com.yidianling.consultant.listener
import
com.yidianling.consultant.model.bean.CateItem
/**
/**
* Created by zqk on 17-9-20.
* Created by zqk on 17-9-20.
*/
*/
interface
OnCategoriesSelectedListener
{
interface
OnCategoriesSelectedListener
{
fun
onCategoriesSelected
(
categories
:
ArrayList
<
CateItem
>)
fun
onCategoriesSelected
(
signLit
:
ArrayList
<
String
>)
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/HotSearchModelImpl.kt
View file @
a58adebe
...
@@ -2,6 +2,7 @@ package com.yidianling.consultant.model
...
@@ -2,6 +2,7 @@ package com.yidianling.consultant.model
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.SearchWordsBean
import
com.yidianling.consultant.contract.IHotSearchContract
import
com.yidianling.consultant.contract.IHotSearchContract
import
com.yidianling.consultant.http.hotsearch.HotSearchDataManager
import
com.yidianling.consultant.http.hotsearch.HotSearchDataManager
import
io.reactivex.Observable
import
io.reactivex.Observable
...
@@ -17,4 +18,8 @@ class HotSearchModelImpl : IHotSearchContract.Model{
...
@@ -17,4 +18,8 @@ class HotSearchModelImpl : IHotSearchContract.Model{
override
fun
searchData
():
Observable
<
HotSearchBean
>
{
override
fun
searchData
():
Observable
<
HotSearchBean
>
{
return
HotSearchDataManager
.
getHttp
().
searchData
().
compose
(
RxUtils
.
resultJavaData
())
return
HotSearchDataManager
.
getHttp
().
searchData
().
compose
(
RxUtils
.
resultJavaData
())
}
}
override
fun
getSearchWords
(
map
:
HashMap
<
String
,
Any
>):
Observable
<
SearchWordsBean
>
{
return
HotSearchDataManager
.
getHttp
().
getSearchWords
(
map
).
compose
(
RxUtils
.
resultJavaData
())
}
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/SearchApi.kt
View file @
a58adebe
...
@@ -9,7 +9,8 @@ import com.ydl.ydlnet.YDLHttpUtils
...
@@ -9,7 +9,8 @@ import com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.consultant.bean.ExpertSearchTopShowBean
import
com.yidianling.consultant.bean.ExpertSearchTopShowBean
import
com.yidianling.consultant.bean.GuideBean
import
com.yidianling.consultant.bean.GuideBean
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.model.bean.ExpertSearchBean
import
com.yidianling.consultant.bean.SearchWordsBean
import
com.yidianling.consultant.model.bean.ExpertBean
import
com.yidianling.consultant.model.bean.HeadData
import
com.yidianling.consultant.model.bean.HeadData
import
io.reactivex.Observable
import
io.reactivex.Observable
import
retrofit2.http.*
import
retrofit2.http.*
...
@@ -38,14 +39,25 @@ interface SearchApi {
...
@@ -38,14 +39,25 @@ interface SearchApi {
fun
listHead
(
@FieldMap
maps
:
Map
<
String
,
String
>):
Observable
<
BaseResponse
<
HeadData
>>
fun
listHead
(
@FieldMap
maps
:
Map
<
String
,
String
>):
Observable
<
BaseResponse
<
HeadData
>>
//搜索条件
//搜索条件
@GET
(
"consult/search/v
2
/conditions"
)
@GET
(
"consult/search/v
3
/conditions"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
searchConditions
(
@Query
(
"cateSource"
)
cateSource
:
Int
):
Observable
<
BaseAPIResponse
<
HeadData
>>
fun
searchConditions
(
@Query
(
"cateSource"
)
cateSource
:
Int
):
Observable
<
BaseAPIResponse
<
HeadData
>>
//专家服务搜索
@retrofit2
.
http
.
Headers
(
"Content-Type:application/json"
)
/**
@GET
* 新咨询师列表接口(包含搜索、筛选咨询师)
fun
searchDoctorService
(
@Url
url
:
String
):
Observable
<
BaseAPIResponse
<
ExpertSearchBean
>>
*/
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
,
"X-App-Id: plough_cloud"
)
@POST
(
"smart-rank/v1/search"
)
fun
getExpertList
(
@Body
map
:
Map
<
String
,
@JvmSuppressWildcards
Any
>):
Observable
<
BaseAPIResponse
<
ExpertBean
>>
/**
* 获取搜索联想词
*/
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@POST
(
"dmp/v1/searchsuggest"
)
fun
getSearchWords
(
@Body
map
:
Map
<
String
,
@JvmSuppressWildcards
Any
>):
Observable
<
BaseAPIResponse
<
SearchWordsBean
>>
//搜索页面接口
//搜索页面接口
@retrofit2
.
http
.
Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
,
"Content-Type:application/json"
)
@retrofit2
.
http
.
Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
,
"Content-Type:application/json"
)
...
...
m-consultant/src/main/java/com/yidianling/consultant/model/bean/AgeItem.kt
View file @
a58adebe
...
@@ -7,5 +7,5 @@ data class AgeItem(
...
@@ -7,5 +7,5 @@ data class AgeItem(
val
value
:
String
?
=
null
,
val
value
:
String
?
=
null
,
@field
:
SerializedName
(
"key"
)
@field
:
SerializedName
(
"key"
)
val
key
:
Int
?
=
null
val
key
:
Int
)
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/AllFilter.kt
View file @
a58adebe
...
@@ -23,5 +23,30 @@ data class AllFilter(
...
@@ -23,5 +23,30 @@ data class AllFilter(
val
others
:
ArrayList
<
OtherItem
>
=
ArrayList
(),
//其他筛选
val
others
:
ArrayList
<
OtherItem
>
=
ArrayList
(),
//其他筛选
val
title
:
ArrayList
<
ReorderItem
>
=
ArrayList
(),
//资质
val
title
:
ArrayList
<
ReorderItem
>
=
ArrayList
(),
//资质
val
specialityCrowd
:
ArrayList
<
SpecialityCrowdBean
>
=
ArrayList
()
// 擅长人群
val
specialityCrowd
:
ArrayList
<
SpecialityCrowdBean
>
=
ArrayList
(),
// 擅长人群
// 八大类标签集合
val
childList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 亲子教育
val
stressList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 情绪压力
val
loveEmotionList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 恋爱情感
val
marriedFamilyList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 婚姻家庭
val
personalGrowthList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 个人成长
val
interpersonalRelationshipList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 人际关系
val
careerDevelopmentList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 职场发展
val
mentalHealthList
:
ArrayList
<
ChildrenBean
>
=
ArrayList
(),
// 心理健康
// 八大类已选中标签id集合
val
categoryId2List
:
ArrayList
<
String
>
=
ArrayList
(),
// 一级类目id集合
val
categoryId3List
:
ArrayList
<
String
>
=
ArrayList
(),
// 二级类目id集合
// 八大类选中下标集合,重置的时候可以减少循坏,提升性能
val
chooseChildIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseStressIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseLoveEmotionIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseMarriedFamilyIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
choosePersonalGrowthIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseInterpersonalRelationshipIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseCareerDevelopmentIndexList
:
ArrayList
<
Int
>
=
ArrayList
(),
val
chooseMentalHealthIndexList
:
ArrayList
<
Int
>
=
ArrayList
()
)
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/CateItem.kt
View file @
a58adebe
package
com.yidianling.consultant.model.bean
package
com.yidianling.consultant.model.bean
import
android.os.Parcel
import
com.chad.library.adapter.base.entity.MultiItemEntity
import
android.os.Parcelable
import
com.google.gson.annotations.SerializedName
import
com.google.gson.annotations.SerializedName
data class
CateItem
(
data class
CateItem
(
...
@@ -10,30 +9,23 @@ data class CateItem(
...
@@ -10,30 +9,23 @@ data class CateItem(
var
cateName
:
String
?
=
null
,
var
cateName
:
String
?
=
null
,
@field
:
SerializedName
(
"cate_id"
)
@field
:
SerializedName
(
"cate_id"
)
var
cateId
:
String
?
=
null
var
cateId
:
String
?
=
null
,
)
:
Parcelable
{
constructor
(
parcel
:
Parcel
)
:
this
(
parcel
.
readString
(),
parcel
.
readString
()
)
{
}
override
fun
writeToParcel
(
parcel
:
Parcel
,
flags
:
Int
)
{
@field
:
SerializedName
(
"children"
)
parcel
.
writeString
(
cateName
)
var
children
:
ArrayList
<
ChildrenBean
>?=
null
parcel
.
writeString
(
cateId
)
)
}
override
fun
describeContents
():
Int
{
data class
ChildrenBean
(
var
cate_name
:
String
,
var
cate_id
:
String
,
var
isVisible
:
Boolean
,
var
type
:
Int
):
MultiItemEntity
{
return
0
// @field:SerializedName("cate_name")
}
// var cateName: String? = null,
// @field:SerializedName("cate_id")
// var cateId: String? = null,
companion
object
CREATOR
:
Parcelable
.
Creator
<
CateItem
>
{
// var isVisible: Boolean = false // 是否显示
override
fun
createFromParcel
(
parcel
:
Parcel
):
CateItem
{
var
isSelected
:
Boolean
=
false
// 是否选中
return
CateItem
(
parcel
)
}
override
fun
newArray
(
size
:
Int
):
Array
<
CateItem
?>
{
override
fun
getItemType
():
Int
{
return
arrayOfNulls
(
size
)
return
type
}
}
}
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/EnquiryItem.kt
View file @
a58adebe
...
@@ -8,7 +8,7 @@ data class EnquiryItem(
...
@@ -8,7 +8,7 @@ data class EnquiryItem(
val
value
:
String
?
=
null
,
val
value
:
String
?
=
null
,
@field
:
SerializedName
(
"key"
)
@field
:
SerializedName
(
"key"
)
val
key
:
Int
?
=
null
,
val
key
:
Int
,
val
checkRrl
:
String
?,
val
checkRrl
:
String
?,
val
unCheckUrl
:
String
?
val
unCheckUrl
:
String
?
...
...
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ExpertBean.kt
0 → 100644
View file @
a58adebe
package
com.yidianling.consultant.model.bean
/**
* @author yuanWai
* @描述:专家搜索页数据bean
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/11
*/
data class
ExpertBean
(
val
amount
:
Int
=
0
,
val
skip
:
Int
=
0
,
val
limit
:
Int
=
0
,
val
size
:
Int
=
10
,
val
objects
:
MutableList
<
ExpertServiceItem
>,
// 分页需要
val
extras
:
Extras
?)
data class
Extras
(
val
skips
:
HashMap
<
String
,
Int
>
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ExpertSearchBean.kt
deleted
100644 → 0
View file @
a5d2d185
package
com.yidianling.consultant.model.bean
/**
* @author yuanWai
* @描述:专家搜索页数据bean
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/11
*/
data class
ExpertSearchBean
(
val
endRow
:
Int
=
0
,
val
hasNextPage
:
Boolean
=
false
,
val
hasPreviousPage
:
Boolean
=
false
,
val
isFirstPage
:
Boolean
=
false
,
val
isLastPage
:
Boolean
=
false
,
/**
* 数据列表
*/
val
list
:
MutableList
<
DoctorServiceItem
>?,
val
navigateFirstPage
:
Int
=
0
,
val
navigateLastPage
:
Int
=
0
,
val
navigatePages
:
Int
=
0
,
val
navigatepageNums
:
MutableList
<
Int
>?,
val
nextPage
:
Int
=
0
,
val
pageNum
:
Int
=
0
,
val
pageSize
:
Int
=
0
,
/**
* 总页数
*/
val
pages
:
Int
=
0
,
val
prePage
:
Int
=
0
,
val
size
:
Int
=
0
,
val
startRow
:
Int
=
0
,
/**
* 数据总条数
*/
val
total
:
Int
=
0
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/
Doctor
ServiceItem.kt
→
m-consultant/src/main/java/com/yidianling/consultant/model/bean/
Expert
ServiceItem.kt
View file @
a58adebe
...
@@ -10,11 +10,11 @@ import com.yidianling.consultant.bean.ExpertSearchTagsIconBean
...
@@ -10,11 +10,11 @@ import com.yidianling.consultant.bean.ExpertSearchTagsIconBean
* @Company 壹点灵
* @Company 壹点灵
* @date 2018/12/11
* @date 2018/12/11
*/
*/
data class
Doctor
ServiceItem
(
data class
Expert
ServiceItem
(
/**
/**
* 专家ID
* 专家ID
*/
*/
val
doctorId
:
String
?
,
val
id
:
String
,
/**
/**
* 专家uid
* 专家uid
*/
*/
...
@@ -22,11 +22,11 @@ data class DoctorServiceItem(
...
@@ -22,11 +22,11 @@ data class DoctorServiceItem(
/**
/**
* 专家名称
* 专家名称
*/
*/
val
name
:
String
?,
val
doctor_
name
:
String
?,
/**
/**
* 跳转路由地址(正常为专家主页地址)
* 跳转路由地址(正常为专家主页地址)
*/
*/
val
link
U
rl
:
String
?,
val
link
_u
rl
:
String
?,
/**
/**
* 专家头像地址
* 专家头像地址
*/
*/
...
@@ -34,7 +34,7 @@ data class DoctorServiceItem(
...
@@ -34,7 +34,7 @@ data class DoctorServiceItem(
/**
/**
* 专家是否在线 1.在线
* 专家是否在线 1.在线
*/
*/
val
isOnline
:
Int
?,
val
chat_status
:
Int
?,
/**
/**
* 能力等级 1.实习 2.新手 3.精英
* 能力等级 1.实习 2.新手 3.精英
*/
*/
...
@@ -42,7 +42,7 @@ data class DoctorServiceItem(
...
@@ -42,7 +42,7 @@ data class DoctorServiceItem(
/**
/**
* 有免费咨询:1.有,2.无
* 有免费咨询:1.有,2.无
*/
*/
val
has
ServiceFree
:
Int
?,
val
has
_servicefree_consult
:
Int
?,
/**
/**
* 活动图标
* 活动图标
*/
*/
...
@@ -54,11 +54,11 @@ data class DoctorServiceItem(
...
@@ -54,11 +54,11 @@ data class DoctorServiceItem(
/**
/**
* 是否新入驻:true:是,false:否
* 是否新入驻:true:是,false:否
*/
*/
var
is
NewEnter
:
Boolean
=
false
,
var
is
_new_enter
:
Boolean
?
,
/**
/**
* 好评率(倾诉+咨询)
* 好评率(倾诉+咨询)
*/
*/
var
feedbackRat
e
:
Float
=
0f
,
var
evaluation_average_scor
e
:
Float
=
0f
,
/**
/**
* 是否抗疫先锋图标
* 是否抗疫先锋图标
*/
*/
...
@@ -66,59 +66,62 @@ data class DoctorServiceItem(
...
@@ -66,59 +66,62 @@ data class DoctorServiceItem(
/**
/**
* 评价数(咨询订单数)
* 评价数(咨询订单数)
*/
*/
var
zixunOrderN
um
:
Int
=
0
,
var
evaluate_n
um
:
Int
=
0
,
/**
/**
* 咨询最低价
* 咨询最低价
*/
*/
val
min
BookingP
rice
:
String
?,
val
min
_p
rice
:
String
?,
/**
/**
* 资质材料
* 资质材料
*/
*/
val
teamCertifications
:
String
?,
val
title
:
String
?,
/**
* 标签分类
*/
val
tags
:
String
?,
/**
/**
* 已帮助人数(咨询人数)
* 已帮助人数(咨询人数)
*/
*/
val
zixunOrderUser
:
String
?,
val
help_num
:
String
?,
/**
/**
* 月售时长
* 月售时长
*/
*/
var
saleDurationForMonth
:
Float
=
0f
,
var
p30d_sold_hour
:
Float
=
0f
,
/**
/**
* 服务时长
* 服务时长
*/
*/
var
allSaleDuration
:
Float
=
0f
,
var
sum_service_time
:
Float
=
0f
,
/**
/**
* 服务
* 服务
*/
*/
val
products
:
MutableList
<
ExpertSearchProductsBean
>?,
val
doctor_
products
:
MutableList
<
ExpertSearchProductsBean
>?,
/**
/**
* 标签图片
* 标签图片
*/
*/
val
tagsIcon
:
ExpertSearchTagsIconBean
?,
val
icons
:
ExpertSearchTagsIconBean
?,
/**
// /**
* 今日是否可约
// * 今日是否可约
*/
// */
val
isTodayFree
:
Boolean
?,
// val booking_status: Int,
/**
// /**
* 是否咨询中
// * 咨询状态 1-待服务 2-服务中
*/
// */
var
inConsult
:
Boolean
=
false
,
// var consult_status: Int,
/**
// /**
* 是否聆听中
// * 倾诉状态 1-待服务 2-服务中
*/
// */
var
isListening
:
Boolean
=
false
,
// var listen_status: Int,
var
open_chat_agency
:
Int
,
var
service_status
:
Int
,
var
is_free_today
:
Int
,
/**
/**
* 私聊人数
* 私聊人数
*/
*/
var
chat
N
um
:
Int
=
0
,
var
chat
_n
um
:
Int
=
0
,
/**
/**
* 个人铭言
* 个人铭言
*/
*/
val
famous
R
emark
:
String
?,
val
famous
_r
emark
:
String
?,
/**
/**
* 省
* 省
*/
*/
...
@@ -130,15 +133,36 @@ data class DoctorServiceItem(
...
@@ -130,15 +133,36 @@ data class DoctorServiceItem(
/**
/**
* 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”)
* 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”)
*/
*/
val
chat
BtnT
ext
:
String
?,
val
chat
_btn_t
ext
:
String
?,
/**
/**
* 新标签分类
* 新标签分类
*/
*/
val
tagList
:
ArrayList
<
TagBean
>?
val
feature_tags
:
ArrayList
<
FeatureTag
>?,
)
/**
* 是否是头部headView
*/
val
is_head_view
:
Boolean
=
false
,
/**
* 搜索词
*/
val
search_content
:
String
,
/**
* 联想词
*/
val
related_word
:
String
)
{
constructor
(
is_head_view
:
Boolean
,
search_content
:
String
,
related_word
:
String
)
:
this
(
""
,
""
,
""
,
""
,
""
,
1
,
1
,
1
,
""
,
false
,
true
,
1f
,
false
,
0
,
""
,
""
,
""
,
1f
,
1f
,
null
,
null
,
1
,
1
,
1
,
1
,
""
,
""
,
""
,
""
,
null
,
is_head_view
,
search_content
,
related_word
)
}
data class
TagBean
(
data class
FeatureTag
(
val
tagName
:
String
?,
val
tag_id
:
String
,
val
isHigh
:
Int
val
tag_name
:
String
,
val
is_highlight
:
Boolean
,
// 是否高亮
val
type
:
String
// 标签类型
)
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/Filters.kt
View file @
a58adebe
...
@@ -45,12 +45,6 @@ data class Filters(
...
@@ -45,12 +45,6 @@ data class Filters(
@field
:
SerializedName
(
"title"
)
@field
:
SerializedName
(
"title"
)
val
title
:
List
<
ReorderItem
>
=
ArrayList
(),
val
title
:
List
<
ReorderItem
>
=
ArrayList
(),
// /**
// * 擅长人群
// */
// @field:SerializedName("crowdsTags")
// val crowdsTags: List<AgeItem> = ArrayList()
/**
/**
* 擅长人群
* 擅长人群
...
...
m-consultant/src/main/java/com/yidianling/consultant/model/bean/OtherItem.kt
View file @
a58adebe
...
@@ -8,5 +8,11 @@ data class OtherItem(
...
@@ -8,5 +8,11 @@ data class OtherItem(
val
value
:
String
?
=
null
,
val
value
:
String
?
=
null
,
@field
:
SerializedName
(
"key"
)
@field
:
SerializedName
(
"key"
)
val
key
:
Int
?
=
null
val
key
:
Int
?
=
null
,
@field
:
SerializedName
(
"value1"
)
val
value1
:
String
,
@field
:
SerializedName
(
"key1"
)
val
key1
:
String
)
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ReorderItem.kt
View file @
a58adebe
...
@@ -8,5 +8,11 @@ data class ReorderItem(
...
@@ -8,5 +8,11 @@ data class ReorderItem(
var
value
:
String
?
=
null
,
var
value
:
String
?
=
null
,
@field
:
SerializedName
(
"key"
)
@field
:
SerializedName
(
"key"
)
var
key
:
String
?
=
null
var
key
:
String
?
=
null
,
@field
:
SerializedName
(
"value1"
)
var
value1
:
String
=
""
,
@field
:
SerializedName
(
"key1"
)
var
key1
:
String
=
""
)
)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ServiceItem.kt
deleted
100644 → 0
View file @
a5d2d185
//package com.yidianling.consultant.model.bean
//
//import com.google.gson.annotations.SerializedName
//
//data class ServiceItem(
//
// @field:SerializedName("doctor_uid")
// val doctorUid: Int = 0,
//
// @field:SerializedName("city")
// val city: String? = null,
//
// @field:SerializedName("product_name")
// val productName: String? = null,
//
// @field:SerializedName("tags")
// val tags: List<String?> = ArrayList(),
//
// @field:SerializedName("uid")
// val uid: Int? = null,
//
// @field:SerializedName("doctor_id")
// val doctorId: Int? = null,
//
// @field:SerializedName("feedback_rate")
// val feedbackRate: String? = null,
//
// @field:SerializedName("doctor_head")
// val doctorHead: String? = null,
//
// @field:SerializedName("province")
// val province: String? = null,
//
//
// @field:SerializedName("doctor_name")
// val doctorName: String? = null,
//
// @field:SerializedName("m_url")
// val mUrl: String? = null,
//
// @field:SerializedName("h_url")
// val hUrl: String? = null,
//
// @field:SerializedName("is_online")
// val isOnline: Int = 0 //1在线,2离线
//)
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/modular/singlton/ConsultAssistantDialogUtils.kt
View file @
a58adebe
...
@@ -403,7 +403,7 @@ class ConsultAssistantDialogUtils private constructor() {
...
@@ -403,7 +403,7 @@ class ConsultAssistantDialogUtils private constructor() {
.
getSecondTaskActivity
()
?.
finish
()
.
getSecondTaskActivity
()
?.
finish
()
activity
.
finish
()
activity
.
finish
()
}
else
{
}
else
{
if
(
null
!=
activity
&&
!
activity
.
isFinishing
)
{
if
(!
activity
.
isFinishing
)
{
activity
.
finish
()
activity
.
finish
()
}
}
}
}
...
@@ -417,10 +417,10 @@ class ConsultAssistantDialogUtils private constructor() {
...
@@ -417,10 +417,10 @@ class ConsultAssistantDialogUtils private constructor() {
ffrom
ffrom
)
)
}
}
if
(
null
!=
activity
&&
activity
is
ConsultAssistantCenterActivity
&&
!
activity
.
isFinishing
)
activity
.
finish
()
if
(
activity
is
ConsultAssistantCenterActivity
&&
!
activity
.
isFinishing
)
activity
.
finish
()
},
object
:
ThrowableConsumer
()
{
},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
override
fun
accept
(
msg
:
String
)
{
if
(
null
!=
activity
&&
activity
is
ConsultAssistantCenterActivity
&&
!
activity
.
isFinishing
)
activity
.
finish
()
if
(
activity
is
ConsultAssistantCenterActivity
&&
!
activity
.
isFinishing
)
activity
.
finish
()
}
}
}
}
)
)
...
...
m-consultant/src/main/java/com/yidianling/consultant/modular/utils/TempH5RouteUtils.kt
View file @
a58adebe
...
@@ -53,7 +53,7 @@ object TempH5RouteUtils {
...
@@ -53,7 +53,7 @@ object TempH5RouteUtils {
if
(!
TextUtils
.
isEmpty
(
host
)
&&
host
==
"h5"
)
{
if
(!
TextUtils
.
isEmpty
(
host
)
&&
host
==
"h5"
)
{
//如果是h5,跳转至NewH5Activity
//如果是h5,跳转至NewH5Activity
try
{
try
{
va
r
params
=
URLDecoder
.
decode
(
linkUri
.
getQueryParameter
(
"params"
),
"UTF-8"
)
va
l
params
=
URLDecoder
.
decode
(
linkUri
.
getQueryParameter
(
"params"
),
"UTF-8"
)
ARouter
.
getInstance
().
build
(
"/new_h5/h5"
).
withSerializable
(
"routerParam"
,
params
).
navigation
()
ARouter
.
getInstance
().
build
(
"/new_h5/h5"
).
withSerializable
(
"routerParam"
,
params
).
navigation
()
return
return
}
catch
(
e
:
NullPointerException
){
}
catch
(
e
:
NullPointerException
){
...
...
m-consultant/src/main/java/com/yidianling/consultant/presenter/HotSearchPresenterImpl.kt
View file @
a58adebe
package
com.yidianling.consultant.presenter
package
com.yidianling.consultant.presenter
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.text.TextUtils
import
android.text.TextUtils
import
com.google.gson.Gson
import
com.google.gson.Gson
...
@@ -8,11 +9,14 @@ import com.ydl.ydlcommon.mvp.base.BasePresenter
...
@@ -8,11 +9,14 @@ import com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.utils.RxLifecycleUtils
import
com.ydl.ydlcommon.utils.RxLifecycleUtils
import
com.ydl.ydlcommon.utils.YDLAsyncUtils
import
com.ydl.ydlcommon.utils.YDLAsyncUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.contract.IHotSearchContract
import
com.yidianling.consultant.contract.IHotSearchContract
import
com.yidianling.consultant.model.HotSearchModelImpl
import
com.yidianling.consultant.model.HotSearchModelImpl
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Consumer
import
io.reactivex.functions.Consumer
import
io.reactivex.schedulers.Schedulers
/**
/**
* @author yuanwai
* @author yuanwai
* @描述:搜索页面逻辑实现类
* @描述:搜索页面逻辑实现类
...
@@ -20,8 +24,7 @@ import io.reactivex.functions.Consumer
...
@@ -20,8 +24,7 @@ import io.reactivex.functions.Consumer
* @Company 壹点灵
* @Company 壹点灵
* @date 2019/3/19
* @date 2019/3/19
*/
*/
class
HotSearchPresenterImpl
()
:
class
HotSearchPresenterImpl
:
BasePresenter
<
IHotSearchContract
.
View
,
IHotSearchContract
.
Model
>(),
IHotSearchContract
.
Presenter
{
BasePresenter
<
IHotSearchContract
.
View
,
IHotSearchContract
.
Model
>(),
IHotSearchContract
.
Presenter
{
/**
/**
* 实例化数据模型
* 实例化数据模型
...
@@ -57,6 +60,7 @@ class HotSearchPresenterImpl () :
...
@@ -57,6 +60,7 @@ class HotSearchPresenterImpl () :
/**
/**
* 搜索页接口
* 搜索页接口
*/
*/
@SuppressLint
(
"CheckResult"
)
override
fun
searchData
()
{
override
fun
searchData
()
{
mModel
.
searchData
().
map
{
it
}
mModel
.
searchData
().
map
{
it
}
.
filter
{
it
!=
null
}
.
filter
{
it
!=
null
}
...
@@ -71,4 +75,20 @@ class HotSearchPresenterImpl () :
...
@@ -71,4 +75,20 @@ class HotSearchPresenterImpl () :
}
}
})
})
}
}
@SuppressLint
(
"CheckResult"
)
override
fun
getSearchWords
(
map
:
HashMap
<
String
,
Any
>,
searchContent
:
String
,
isClickWords
:
Boolean
)
{
mModel
.
getSearchWords
(
map
)
// .debounce(500L, TimeUnit.MILLISECONDS)
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mView
))
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
Consumer
{
mView
.
getSearchWordsSuccess
(
it
,
searchContent
,
isClickWords
)
},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
ToastUtil
.
toastShort
(
msg
)
}
})
}
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/ui/view/CategoryPopupWindow.kt
View file @
a58adebe
...
@@ -2,48 +2,693 @@ package com.yidianling.consultant.ui.view
...
@@ -2,48 +2,693 @@ package com.yidianling.consultant.ui.view
import
android.content.Context
import
android.content.Context
import
android.graphics.drawable.BitmapDrawable
import
android.graphics.drawable.BitmapDrawable
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.LinearLayout
import
android.widget.PopupWindow
import
android.widget.PopupWindow
import
com.ydl.ydlcommon.view.SpaceItemDecorator2
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.CategoryRecyclerViewAdapter
import
com.yidianling.consultant.adapter.SortAdapter
import
com.yidianling.consultant.layoutmanager.FlowLayoutManager
import
com.yidianling.consultant.listener.OnCategoriesSelectedListener
import
com.yidianling.consultant.listener.OnCategoriesSelectedListener
import
com.yidianling.consultant.model.bean.CateItem
import
com.yidianling.consultant.model.bean.AllFilter
import
com.yidianling.consultant.model.bean.ChildrenBean
import
kotlinx.android.synthetic.main.consultant_ui_subject_popup_window.view.*
import
kotlinx.android.synthetic.main.consultant_ui_subject_popup_window.view.*
/**
/**
* 主题弹窗
* 主题弹窗
* Created by zqk on 17-9-15.
* Created by zqk on 17-9-15.
*/
*/
class
CategoryPopupWindow
(
context
:
Context
,
categories
:
ArrayList
<
CateItem
>,
selectedCategories
:
ArrayList
<
CateItem
>)
class
CategoryPopupWindow
(
context
:
Context
,
allFilter
:
AllFilter
)
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
RxImageTool
.
dp2px
(
566f
))
{
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
private
var
view
:
View
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
consultant_ui_subject_popup_window
,
null
)
var
mAllFilter
:
AllFilter
private
lateinit
var
ivSortChildEducationOpen
:
ImageView
private
lateinit
var
ivSortEmotionalStress
:
ImageView
private
lateinit
var
ivSortLoveEmotion
:
ImageView
private
lateinit
var
ivSortMarriedFamily
:
ImageView
private
lateinit
var
ivSortPersonalGrowth
:
ImageView
private
lateinit
var
ivSortInterpersonalRelationship
:
ImageView
private
lateinit
var
ivSortCareerDevelopment
:
ImageView
private
lateinit
var
ivSortMentalHealth
:
ImageView
var
onSubjectsSelectedListener
:
OnCategoriesSelectedListener
?
=
null
var
onSubjectsSelectedListener
:
OnCategoriesSelectedListener
?
=
null
private
val
childList
=
ArrayList
<
ChildrenBean
>()
private
val
stressList
=
ArrayList
<
ChildrenBean
>()
private
val
loveEmotionList
=
ArrayList
<
ChildrenBean
>()
private
val
marriedFamilyList
=
ArrayList
<
ChildrenBean
>()
private
val
personalGrowthList
=
ArrayList
<
ChildrenBean
>()
private
val
interpersonalRelationshipList
=
ArrayList
<
ChildrenBean
>()
private
val
careerDevelopmentList
=
ArrayList
<
ChildrenBean
>()
private
val
mentalHealthList
=
ArrayList
<
ChildrenBean
>()
private
val
signList
=
ArrayList
<
String
>()
// 用于埋点
private
lateinit
var
childEducationAdapter
:
SortAdapter
private
lateinit
var
stressAdapter
:
SortAdapter
private
lateinit
var
loveEmotionAdapter
:
SortAdapter
private
lateinit
var
marriedFamilyAdapter
:
SortAdapter
private
lateinit
var
personalGrowthAdapter
:
SortAdapter
private
lateinit
var
interpersonalRelationshipAdapter
:
SortAdapter
private
lateinit
var
careerDevelopmentAdapter
:
SortAdapter
private
lateinit
var
mentalHealthAdapter
:
SortAdapter
init
{
init
{
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
consultant_ui_subject_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
val
rvSubject
=
view
.
rvSubject
mAllFilter
=
allFilter
val
adapter
=
CategoryRecyclerViewAdapter
(
context
,
categories
,
selectedCategories
)
initView
(
)
rvSubject
.
adapter
=
adapter
}
rvSubject
.
layoutManager
=
GridLayoutManager
(
context
,
private
fun
initView
(){
3
,
inputMethodMode
=
INPUT_METHOD_NEEDED
LinearLayoutManager
.
VERTICAL
,
// 重置
false
view
.
btn_reset
.
setOnClickListener
{
)
reset
(
)
rvSubject
.
addItemDecoration
(
SpaceItemDecorator2
(
RxImageTool
.
dp2px
(
5f
),
3
))
}
inputMethodMode
=
PopupWindow
.
INPUT_METHOD_NEEDED
// 确定
view
.
btnConfirm
.
setOnClickListener
{
view
.
btnConfirm
.
setOnClickListener
{
onSubjectsSelectedListener
?.
onCategoriesSelected
(
s
electedCategories
)
onSubjectsSelectedListener
?.
onCategoriesSelected
(
s
ignList
)
dismiss
()
dismiss
()
}
}
// 亲子教育
val
rvSortChildEducation
=
view
.
rv_sort_child_education
ivSortChildEducationOpen
=
view
.
iv_sort_child_education_open
childEducationAdapter
=
SortAdapter
(
childList
)
rvSortChildEducation
.
layoutManager
=
FlowLayoutManager
()
rvSortChildEducation
.
adapter
=
childEducationAdapter
childEducationAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
if
(
position
==
0
){
if
(
childList
[
0
].
isSelected
){
childList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
childList
[
0
].
cate_id
)
mAllFilter
.
chooseChildIndexList
.
remove
(
position
)
signList
.
remove
(
"亲子教育"
)
}
else
{
childList
.
forEachIndexed
{
index
,
_
->
childList
[
index
].
isSelected
=
index
==
0
if
(
index
==
0
){
mAllFilter
.
categoryId2List
.
add
(
childList
[
0
].
cate_id
)
signList
.
add
(
"亲子教育"
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
childList
[
index
].
cate_id
)
signList
.
remove
(
childList
[
index
].
cate_name
)
}
}
mAllFilter
.
chooseChildIndexList
.
add
(
position
)
}
}
else
{
if
(!
childList
[
position
].
isSelected
&&
childList
[
0
].
isSelected
){
childList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
childList
[
0
].
cate_id
)
signList
.
remove
(
"亲子教育"
)
}
childList
[
position
].
isSelected
=
!
childList
[
position
].
isSelected
if
(
childList
[
position
].
isSelected
){
mAllFilter
.
categoryId3List
.
add
(
childList
[
position
].
cate_id
)
mAllFilter
.
chooseChildIndexList
.
add
(
position
)
signList
.
add
(
childList
[
position
].
cate_name
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
childList
[
position
].
cate_id
)
mAllFilter
.
chooseChildIndexList
.
remove
(
position
)
signList
.
remove
(
childList
[
position
].
cate_name
)
}
}
childEducationAdapter
.
notifyDataSetChanged
()
}
// 情绪压力
val
rvSortEmotionalStress
=
view
.
rv_sort_emotional_stress
ivSortEmotionalStress
=
view
.
iv_sort_emotional_stress
stressAdapter
=
SortAdapter
(
stressList
)
rvSortEmotionalStress
.
layoutManager
=
FlowLayoutManager
()
rvSortEmotionalStress
.
adapter
=
stressAdapter
stressAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
if
(
position
==
0
){
if
(
stressList
[
0
].
isSelected
){
stressList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
stressList
[
0
].
cate_id
)
mAllFilter
.
chooseStressIndexList
.
remove
(
position
)
signList
.
remove
(
"情绪压力"
)
}
else
{
stressList
.
forEachIndexed
{
index
,
_
->
stressList
[
index
].
isSelected
=
index
==
0
if
(
index
==
0
){
mAllFilter
.
categoryId2List
.
add
(
stressList
[
0
].
cate_id
)
signList
.
add
(
"情绪压力"
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
stressList
[
index
].
cate_id
)
signList
.
remove
(
stressList
[
index
].
cate_name
)
}
}
mAllFilter
.
chooseStressIndexList
.
add
(
position
)
}
}
else
{
if
(!
stressList
[
position
].
isSelected
&&
stressList
[
0
].
isSelected
){
stressList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
stressList
[
0
].
cate_id
)
signList
.
remove
(
"情绪压力"
)
}
stressList
[
position
].
isSelected
=
!
stressList
[
position
].
isSelected
if
(
stressList
[
position
].
isSelected
){
mAllFilter
.
categoryId3List
.
add
(
stressList
[
position
].
cate_id
)
mAllFilter
.
chooseStressIndexList
.
add
(
position
)
signList
.
add
(
stressList
[
position
].
cate_name
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
stressList
[
position
].
cate_id
)
mAllFilter
.
chooseStressIndexList
.
remove
(
position
)
signList
.
remove
(
stressList
[
position
].
cate_name
)
}
}
stressAdapter
.
notifyDataSetChanged
()
}
// 恋爱情感
val
rvLoveEmotion
=
view
.
rv_sort_love_emotion
ivSortLoveEmotion
=
view
.
iv_sort_love_emotion
loveEmotionAdapter
=
SortAdapter
(
loveEmotionList
)
rvLoveEmotion
.
layoutManager
=
FlowLayoutManager
()
rvLoveEmotion
.
adapter
=
loveEmotionAdapter
loveEmotionAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
if
(
position
==
0
){
if
(
loveEmotionList
[
0
].
isSelected
){
loveEmotionList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
loveEmotionList
[
0
].
cate_id
)
mAllFilter
.
chooseLoveEmotionIndexList
.
remove
(
position
)
signList
.
remove
(
"恋爱情感"
)
}
else
{
loveEmotionList
.
forEachIndexed
{
index
,
_
->
loveEmotionList
[
index
].
isSelected
=
index
==
0
if
(
index
==
0
){
mAllFilter
.
categoryId2List
.
add
(
loveEmotionList
[
0
].
cate_id
)
signList
.
add
(
"恋爱情感"
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
loveEmotionList
[
index
].
cate_id
)
signList
.
remove
(
loveEmotionList
[
index
].
cate_name
)
}
}
mAllFilter
.
chooseLoveEmotionIndexList
.
add
(
position
)
}
}
else
{
if
(!
loveEmotionList
[
position
].
isSelected
&&
loveEmotionList
[
0
].
isSelected
){
loveEmotionList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
loveEmotionList
[
0
].
cate_id
)
signList
.
remove
(
"恋爱情感"
)
}
loveEmotionList
[
position
].
isSelected
=
!
loveEmotionList
[
position
].
isSelected
if
(
loveEmotionList
[
position
].
isSelected
){
mAllFilter
.
categoryId3List
.
add
(
loveEmotionList
[
position
].
cate_id
)
mAllFilter
.
chooseLoveEmotionIndexList
.
add
(
position
)
signList
.
add
(
loveEmotionList
[
position
].
cate_name
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
loveEmotionList
[
position
].
cate_id
)
mAllFilter
.
chooseLoveEmotionIndexList
.
remove
(
position
)
signList
.
remove
(
loveEmotionList
[
position
].
cate_name
)
}
}
loveEmotionAdapter
.
notifyDataSetChanged
()
}
// 婚姻家庭
ivSortMarriedFamily
=
view
.
iv_sort_married_family
val
rvSortMarriedFamily
=
view
.
rv_sort_married_family
marriedFamilyAdapter
=
SortAdapter
(
marriedFamilyList
)
rvSortMarriedFamily
.
layoutManager
=
FlowLayoutManager
()
rvSortMarriedFamily
.
adapter
=
marriedFamilyAdapter
marriedFamilyAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
if
(
position
==
0
){
if
(
marriedFamilyList
[
0
].
isSelected
){
marriedFamilyList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
marriedFamilyList
[
0
].
cate_id
)
mAllFilter
.
chooseMarriedFamilyIndexList
.
remove
(
position
)
signList
.
remove
(
"婚姻家庭"
)
}
else
{
marriedFamilyList
.
forEachIndexed
{
index
,
_
->
marriedFamilyList
[
index
].
isSelected
=
index
==
0
if
(
index
==
0
){
mAllFilter
.
categoryId2List
.
add
(
marriedFamilyList
[
0
].
cate_id
)
signList
.
add
(
"婚姻家庭"
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
marriedFamilyList
[
index
].
cate_id
)
signList
.
remove
(
marriedFamilyList
[
index
].
cate_name
)
}
}
mAllFilter
.
chooseMarriedFamilyIndexList
.
add
(
position
)
}
}
else
{
if
(!
marriedFamilyList
[
position
].
isSelected
&&
marriedFamilyList
[
0
].
isSelected
){
marriedFamilyList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
marriedFamilyList
[
0
].
cate_id
)
signList
.
remove
(
"婚姻家庭"
)
}
marriedFamilyList
[
position
].
isSelected
=
!
marriedFamilyList
[
position
].
isSelected
if
(
marriedFamilyList
[
position
].
isSelected
){
mAllFilter
.
categoryId3List
.
add
(
marriedFamilyList
[
position
].
cate_id
)
mAllFilter
.
chooseMarriedFamilyIndexList
.
add
(
position
)
signList
.
add
(
marriedFamilyList
[
position
].
cate_name
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
marriedFamilyList
[
position
].
cate_id
)
mAllFilter
.
chooseMarriedFamilyIndexList
.
remove
(
position
)
signList
.
remove
(
marriedFamilyList
[
position
].
cate_name
)
}
}
marriedFamilyAdapter
.
notifyDataSetChanged
()
}
// 个人成长
ivSortPersonalGrowth
=
view
.
iv_sort_personal_growth
val
rvSortPersonalGrowth
=
view
.
rv_sort_personal_growth
personalGrowthAdapter
=
SortAdapter
(
personalGrowthList
)
rvSortPersonalGrowth
.
layoutManager
=
FlowLayoutManager
()
rvSortPersonalGrowth
.
adapter
=
personalGrowthAdapter
personalGrowthAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
if
(
position
==
0
){
if
(
personalGrowthList
[
0
].
isSelected
){
personalGrowthList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
personalGrowthList
[
0
].
cate_id
)
mAllFilter
.
choosePersonalGrowthIndexList
.
remove
(
position
)
signList
.
remove
(
"个人成长"
)
}
else
{
personalGrowthList
.
forEachIndexed
{
index
,
_
->
personalGrowthList
[
index
].
isSelected
=
index
==
0
if
(
index
==
0
){
mAllFilter
.
categoryId2List
.
add
(
personalGrowthList
[
0
].
cate_id
)
signList
.
add
(
"个人成长"
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
personalGrowthList
[
index
].
cate_id
)
signList
.
remove
(
personalGrowthList
[
index
].
cate_name
)
}
}
mAllFilter
.
choosePersonalGrowthIndexList
.
add
(
position
)
}
}
else
{
if
(!
personalGrowthList
[
position
].
isSelected
&&
personalGrowthList
[
0
].
isSelected
){
personalGrowthList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
childList
[
0
].
cate_id
)
signList
.
remove
(
"个人成长"
)
}
personalGrowthList
[
position
].
isSelected
=
!
personalGrowthList
[
position
].
isSelected
if
(
personalGrowthList
[
position
].
isSelected
){
mAllFilter
.
categoryId3List
.
add
(
personalGrowthList
[
position
].
cate_id
)
mAllFilter
.
choosePersonalGrowthIndexList
.
add
(
position
)
signList
.
add
(
personalGrowthList
[
position
].
cate_name
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
personalGrowthList
[
position
].
cate_id
)
mAllFilter
.
choosePersonalGrowthIndexList
.
remove
(
position
)
signList
.
remove
(
personalGrowthList
[
position
].
cate_name
)
}
}
personalGrowthAdapter
.
notifyDataSetChanged
()
}
// 人际关系
ivSortInterpersonalRelationship
=
view
.
iv_sort_interpersonal_relationship
val
rvSortInterpersonalRelationship
=
view
.
rv_sort_interpersonal_relationship
interpersonalRelationshipAdapter
=
SortAdapter
(
interpersonalRelationshipList
)
rvSortInterpersonalRelationship
.
layoutManager
=
FlowLayoutManager
()
rvSortInterpersonalRelationship
.
adapter
=
interpersonalRelationshipAdapter
interpersonalRelationshipAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
if
(
position
==
0
){
if
(
interpersonalRelationshipList
[
0
].
isSelected
){
interpersonalRelationshipList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
interpersonalRelationshipList
[
0
].
cate_id
)
mAllFilter
.
chooseInterpersonalRelationshipIndexList
.
remove
(
position
)
signList
.
remove
(
"人际关系"
)
}
else
{
interpersonalRelationshipList
.
forEachIndexed
{
index
,
_
->
interpersonalRelationshipList
[
index
].
isSelected
=
index
==
0
if
(
index
==
0
){
mAllFilter
.
categoryId2List
.
add
(
interpersonalRelationshipList
[
0
].
cate_id
)
signList
.
add
(
"人际关系"
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
interpersonalRelationshipList
[
index
].
cate_id
)
signList
.
remove
(
interpersonalRelationshipList
[
index
].
cate_name
)
}
}
mAllFilter
.
chooseInterpersonalRelationshipIndexList
.
add
(
position
)
}
}
else
{
if
(!
interpersonalRelationshipList
[
position
].
isSelected
&&
interpersonalRelationshipList
[
0
].
isSelected
){
interpersonalRelationshipList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
interpersonalRelationshipList
[
0
].
cate_id
)
signList
.
remove
(
"人际关系"
)
}
interpersonalRelationshipList
[
position
].
isSelected
=
!
interpersonalRelationshipList
[
position
].
isSelected
if
(
interpersonalRelationshipList
[
position
].
isSelected
){
mAllFilter
.
categoryId3List
.
add
(
interpersonalRelationshipList
[
position
].
cate_id
)
mAllFilter
.
chooseInterpersonalRelationshipIndexList
.
add
(
position
)
signList
.
add
(
interpersonalRelationshipList
[
position
].
cate_name
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
interpersonalRelationshipList
[
position
].
cate_id
)
mAllFilter
.
chooseInterpersonalRelationshipIndexList
.
remove
(
position
)
signList
.
remove
(
interpersonalRelationshipList
[
position
].
cate_name
)
}
}
interpersonalRelationshipAdapter
.
notifyDataSetChanged
()
}
// 职场发展
ivSortCareerDevelopment
=
view
.
iv_sort_career_development
val
rvSortCareerDevelopment
=
view
.
rv_sort_career_development
careerDevelopmentAdapter
=
SortAdapter
(
careerDevelopmentList
)
rvSortCareerDevelopment
.
layoutManager
=
FlowLayoutManager
()
rvSortCareerDevelopment
.
adapter
=
careerDevelopmentAdapter
careerDevelopmentAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
if
(
position
==
0
){
if
(
careerDevelopmentList
[
0
].
isSelected
){
careerDevelopmentList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
childList
[
0
].
cate_id
)
mAllFilter
.
chooseCareerDevelopmentIndexList
.
remove
(
position
)
signList
.
remove
(
"职场发展"
)
}
else
{
careerDevelopmentList
.
forEachIndexed
{
index
,
_
->
careerDevelopmentList
[
index
].
isSelected
=
index
==
0
if
(
index
==
0
){
mAllFilter
.
categoryId2List
.
add
(
careerDevelopmentList
[
0
].
cate_id
)
signList
.
add
(
"职场发展"
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
careerDevelopmentList
[
index
].
cate_id
)
signList
.
remove
(
careerDevelopmentList
[
index
].
cate_name
)
}
}
mAllFilter
.
chooseCareerDevelopmentIndexList
.
add
(
position
)
}
}
else
{
if
(!
careerDevelopmentList
[
position
].
isSelected
&&
careerDevelopmentList
[
0
].
isSelected
){
careerDevelopmentList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
careerDevelopmentList
[
0
].
cate_id
)
signList
.
remove
(
"职场发展"
)
}
careerDevelopmentList
[
position
].
isSelected
=
!
careerDevelopmentList
[
position
].
isSelected
if
(
careerDevelopmentList
[
position
].
isSelected
){
mAllFilter
.
categoryId3List
.
add
(
careerDevelopmentList
[
position
].
cate_id
)
mAllFilter
.
chooseCareerDevelopmentIndexList
.
add
(
position
)
signList
.
add
(
careerDevelopmentList
[
position
].
cate_name
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
careerDevelopmentList
[
position
].
cate_id
)
mAllFilter
.
chooseCareerDevelopmentIndexList
.
remove
(
position
)
signList
.
remove
(
careerDevelopmentList
[
position
].
cate_name
)
}
}
careerDevelopmentAdapter
.
notifyDataSetChanged
()
}
// 心理健康
ivSortMentalHealth
=
view
.
iv_sort_mental_health
val
rvSortMentalHealth
=
view
.
rv_sort_mental_health
mentalHealthAdapter
=
SortAdapter
(
mentalHealthList
)
rvSortMentalHealth
.
layoutManager
=
FlowLayoutManager
()
rvSortMentalHealth
.
adapter
=
mentalHealthAdapter
mentalHealthAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
if
(
position
==
0
){
if
(
mentalHealthList
[
0
].
isSelected
){
mentalHealthList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
mentalHealthList
[
0
].
cate_id
)
mAllFilter
.
chooseMentalHealthIndexList
.
remove
(
position
)
signList
.
remove
(
"心理健康"
)
}
else
{
mentalHealthList
.
forEachIndexed
{
index
,
_
->
mentalHealthList
[
index
].
isSelected
=
index
==
0
if
(
index
==
0
){
mAllFilter
.
categoryId2List
.
add
(
mentalHealthList
[
0
].
cate_id
)
signList
.
add
(
"心理健康"
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
mentalHealthList
[
index
].
cate_id
)
signList
.
remove
(
mentalHealthList
[
index
].
cate_name
)
}
}
mAllFilter
.
chooseMentalHealthIndexList
.
add
(
position
)
}
}
else
{
if
(!
mentalHealthList
[
position
].
isSelected
&&
mentalHealthList
[
0
].
isSelected
){
mentalHealthList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
mentalHealthList
[
0
].
cate_id
)
signList
.
remove
(
"心理健康"
)
}
mentalHealthList
[
position
].
isSelected
=
!
mentalHealthList
[
position
].
isSelected
if
(
mentalHealthList
[
position
].
isSelected
){
mAllFilter
.
categoryId3List
.
add
(
mentalHealthList
[
position
].
cate_id
)
mAllFilter
.
chooseMentalHealthIndexList
.
add
(
position
)
signList
.
add
(
mentalHealthList
[
position
].
cate_name
)
}
else
{
mAllFilter
.
categoryId3List
.
remove
(
mentalHealthList
[
position
].
cate_id
)
mAllFilter
.
chooseMentalHealthIndexList
.
remove
(
position
)
signList
.
remove
(
mentalHealthList
[
position
].
cate_name
)
}
}
mentalHealthAdapter
.
notifyDataSetChanged
()
}
/**
* 原来的筛选项写在PopupWindow里边,数据太多的情况下,弹窗第一次打开很慢,所以这里做了一个骚操作,
* 先加载亲子教育和情绪压力的12条数据,之后再加载全部,后期时间充裕可以优化,直接做到页面里边,不要写在PopupWindow里边
*/
// 亲子教育
if
(
mAllFilter
.
childList
.
size
>
12
){
childList
.
addAll
(
mAllFilter
.
childList
.
subList
(
0
,
12
))
}
else
{
childList
.
addAll
(
mAllFilter
.
childList
)
}
childEducationAdapter
.
notifyDataSetChanged
()
if
(
mAllFilter
.
childList
.
size
>
12
){
ivSortChildEducationOpen
.
visibility
=
View
.
VISIBLE
view
.
ll_sort_child_education_open
.
setOnClickListener
{
val
params
=
rvSortChildEducation
.
layoutParams
as
LinearLayout
.
LayoutParams
if
(!
childEducationAdapter
.
isVisible
){
if
(
childList
.
size
<=
12
){
childList
.
addAll
(
mAllFilter
.
childList
.
subList
(
12
,
mAllFilter
.
childList
.
size
))
childEducationAdapter
.
notifyDataSetChanged
()
}
childEducationAdapter
.
setAllVisible
()
ivSortChildEducationOpen
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_open
)
// 展开的布局设置自适应
params
.
height
=
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
rvSortChildEducation
.
layoutParams
=
params
}
else
{
childEducationAdapter
.
setGone
()
ivSortChildEducationOpen
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_close
)
// 关闭的时候布局设置为固定高度
params
.
height
=
RxImageTool
.
dp2px
(
138f
)
rvSortChildEducation
.
layoutParams
=
params
}
}
}
// 情绪压力
if
(
mAllFilter
.
stressList
.
size
>
12
){
stressList
.
addAll
(
mAllFilter
.
stressList
.
subList
(
0
,
12
))
}
else
{
stressList
.
addAll
(
mAllFilter
.
stressList
)
}
stressAdapter
.
notifyDataSetChanged
()
if
(
mAllFilter
.
stressList
.
size
>
12
){
ivSortEmotionalStress
.
visibility
=
View
.
VISIBLE
view
.
ll_sort_emotional_stress
.
setOnClickListener
{
val
params
=
rvSortEmotionalStress
.
layoutParams
as
LinearLayout
.
LayoutParams
if
(!
stressAdapter
.
isVisible
){
if
(
stressList
.
size
<=
12
){
stressList
.
addAll
(
mAllFilter
.
stressList
.
subList
(
12
,
mAllFilter
.
stressList
.
size
))
stressAdapter
.
notifyDataSetChanged
()
}
stressAdapter
.
setAllVisible
()
ivSortEmotionalStress
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_open
)
// 展开的布局设置自适应
params
.
height
=
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
rvSortEmotionalStress
.
layoutParams
=
params
}
else
{
stressAdapter
.
setGone
()
ivSortEmotionalStress
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_close
)
// 关闭的时候布局设置为固定高度
params
.
height
=
RxImageTool
.
dp2px
(
138f
)
rvSortEmotionalStress
.
layoutParams
=
params
}
}
}
}
fun
updateData
(){
// 恋爱情感
loveEmotionList
.
addAll
(
mAllFilter
.
loveEmotionList
)
loveEmotionAdapter
.
notifyDataSetChanged
()
if
(
loveEmotionList
.
size
>
12
){
ivSortLoveEmotion
.
visibility
=
View
.
VISIBLE
view
.
ll_sort_love_emotion
.
setOnClickListener
{
val
params
=
view
.
rv_sort_love_emotion
.
layoutParams
as
LinearLayout
.
LayoutParams
if
(!
loveEmotionAdapter
.
isVisible
){
loveEmotionAdapter
.
setAllVisible
()
ivSortLoveEmotion
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_open
)
// 展开的布局设置自适应
params
.
height
=
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
view
.
rv_sort_love_emotion
.
layoutParams
=
params
}
else
{
loveEmotionAdapter
.
setGone
()
ivSortLoveEmotion
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_close
)
// 关闭的时候布局设置为固定高度
params
.
height
=
RxImageTool
.
dp2px
(
138f
)
view
.
rv_sort_love_emotion
.
layoutParams
=
params
}
}
}
// 婚姻家庭
marriedFamilyList
.
addAll
(
mAllFilter
.
marriedFamilyList
)
marriedFamilyAdapter
.
notifyDataSetChanged
()
if
(
marriedFamilyList
.
size
>
12
){
ivSortMarriedFamily
.
visibility
=
View
.
VISIBLE
view
.
ll_sort_married_family
.
setOnClickListener
{
val
params
=
view
.
rv_sort_married_family
.
layoutParams
as
LinearLayout
.
LayoutParams
if
(!
marriedFamilyAdapter
.
isVisible
){
marriedFamilyAdapter
.
setAllVisible
()
ivSortMarriedFamily
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_open
)
// 展开的布局设置自适应
params
.
height
=
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
view
.
rv_sort_married_family
.
layoutParams
=
params
}
else
{
marriedFamilyAdapter
.
setGone
()
ivSortMarriedFamily
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_close
)
// 关闭的时候布局设置为固定高度
params
.
height
=
RxImageTool
.
dp2px
(
138f
)
view
.
rv_sort_married_family
.
layoutParams
=
params
}
}
}
// 个人成长
personalGrowthList
.
addAll
(
mAllFilter
.
personalGrowthList
)
personalGrowthAdapter
.
notifyDataSetChanged
()
if
(
personalGrowthList
.
size
>
12
){
ivSortPersonalGrowth
.
visibility
=
View
.
VISIBLE
view
.
ll_sort_personal_growth
.
setOnClickListener
{
val
params
=
view
.
rv_sort_personal_growth
.
layoutParams
as
LinearLayout
.
LayoutParams
if
(!
personalGrowthAdapter
.
isVisible
){
personalGrowthAdapter
.
setAllVisible
()
ivSortPersonalGrowth
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_open
)
// 展开的布局设置自适应
params
.
height
=
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
view
.
rv_sort_personal_growth
.
layoutParams
=
params
}
else
{
personalGrowthAdapter
.
setGone
()
ivSortPersonalGrowth
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_close
)
// 关闭的时候布局设置为固定高度
params
.
height
=
RxImageTool
.
dp2px
(
138f
)
view
.
rv_sort_personal_growth
.
layoutParams
=
params
}
}
}
// 人际关系
interpersonalRelationshipList
.
addAll
(
mAllFilter
.
interpersonalRelationshipList
)
interpersonalRelationshipAdapter
.
notifyDataSetChanged
()
if
(
interpersonalRelationshipList
.
size
>
12
){
ivSortInterpersonalRelationship
.
visibility
=
View
.
VISIBLE
view
.
ll_sort_interpersonal_relationship
.
setOnClickListener
{
val
params
=
view
.
rv_sort_interpersonal_relationship
.
layoutParams
as
LinearLayout
.
LayoutParams
if
(!
interpersonalRelationshipAdapter
.
isVisible
){
interpersonalRelationshipAdapter
.
setAllVisible
()
ivSortInterpersonalRelationship
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_open
)
// 展开的布局设置自适应
params
.
height
=
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
view
.
rv_sort_interpersonal_relationship
.
layoutParams
=
params
}
else
{
interpersonalRelationshipAdapter
.
setGone
()
ivSortInterpersonalRelationship
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_close
)
// 关闭的时候布局设置为固定高度
params
.
height
=
RxImageTool
.
dp2px
(
138f
)
view
.
rv_sort_interpersonal_relationship
.
layoutParams
=
params
}
}
}
// 职场发展
careerDevelopmentList
.
addAll
(
mAllFilter
.
careerDevelopmentList
)
careerDevelopmentAdapter
.
notifyDataSetChanged
()
if
(
careerDevelopmentList
.
size
>
12
){
ivSortCareerDevelopment
.
visibility
=
View
.
VISIBLE
view
.
ll_sort_career_development
.
setOnClickListener
{
val
params
=
view
.
rv_sort_career_development
.
layoutParams
as
LinearLayout
.
LayoutParams
if
(!
careerDevelopmentAdapter
.
isVisible
){
careerDevelopmentAdapter
.
setAllVisible
()
ivSortCareerDevelopment
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_open
)
// 展开的布局设置自适应
params
.
height
=
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
view
.
rv_sort_career_development
.
layoutParams
=
params
}
else
{
careerDevelopmentAdapter
.
setGone
()
ivSortCareerDevelopment
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_close
)
// 关闭的时候布局设置为固定高度
params
.
height
=
RxImageTool
.
dp2px
(
138f
)
view
.
rv_sort_career_development
.
layoutParams
=
params
}
}
}
// 心理健康
mentalHealthList
.
addAll
(
mAllFilter
.
mentalHealthList
)
mentalHealthAdapter
.
notifyDataSetChanged
()
if
(
mentalHealthList
.
size
>
12
){
ivSortMentalHealth
.
visibility
=
View
.
VISIBLE
view
.
ll_sort_mental_health
.
setOnClickListener
{
val
params
=
view
.
rv_sort_mental_health
.
layoutParams
as
LinearLayout
.
LayoutParams
if
(!
mentalHealthAdapter
.
isVisible
){
mentalHealthAdapter
.
setAllVisible
()
ivSortMentalHealth
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_open
)
// 展开的布局设置自适应
params
.
height
=
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
view
.
rv_sort_mental_health
.
layoutParams
=
params
}
else
{
mentalHealthAdapter
.
setGone
()
ivSortMentalHealth
.
setImageResource
(
R
.
drawable
.
consultant_ic_sort_close
)
// 关闭的时候布局设置为固定高度
params
.
height
=
RxImageTool
.
dp2px
(
138f
)
view
.
rv_sort_mental_health
.
layoutParams
=
params
}
}
}
}
/**
* 重置
*/
fun
reset
(){
if
(
mAllFilter
.
chooseChildIndexList
.
size
>
0
){
mAllFilter
.
chooseChildIndexList
.
forEach
{
childList
[
it
].
isSelected
=
false
}
childEducationAdapter
.
notifyDataSetChanged
()
}
if
(
mAllFilter
.
chooseStressIndexList
.
size
>
0
){
mAllFilter
.
chooseStressIndexList
.
forEach
{
stressList
[
it
].
isSelected
=
false
}
stressAdapter
.
notifyDataSetChanged
()
}
if
(
mAllFilter
.
chooseLoveEmotionIndexList
.
size
>
0
){
mAllFilter
.
chooseLoveEmotionIndexList
.
forEach
{
loveEmotionList
[
it
].
isSelected
=
false
}
loveEmotionAdapter
.
notifyDataSetChanged
()
}
if
(
mAllFilter
.
chooseMarriedFamilyIndexList
.
size
>
0
){
mAllFilter
.
chooseMarriedFamilyIndexList
.
forEach
{
marriedFamilyList
[
it
].
isSelected
=
false
}
marriedFamilyAdapter
.
notifyDataSetChanged
()
}
if
(
mAllFilter
.
choosePersonalGrowthIndexList
.
size
>
0
){
mAllFilter
.
choosePersonalGrowthIndexList
.
forEach
{
personalGrowthList
[
it
].
isSelected
=
false
}
personalGrowthAdapter
.
notifyDataSetChanged
()
}
if
(
mAllFilter
.
chooseInterpersonalRelationshipIndexList
.
size
>
0
){
mAllFilter
.
chooseInterpersonalRelationshipIndexList
.
forEach
{
interpersonalRelationshipList
[
it
].
isSelected
=
false
}
interpersonalRelationshipAdapter
.
notifyDataSetChanged
()
}
if
(
mAllFilter
.
chooseCareerDevelopmentIndexList
.
size
>
0
){
mAllFilter
.
chooseCareerDevelopmentIndexList
.
forEach
{
careerDevelopmentList
[
it
].
isSelected
=
false
}
careerDevelopmentAdapter
.
notifyDataSetChanged
()
}
if
(
mAllFilter
.
chooseMentalHealthIndexList
.
size
>
0
){
mAllFilter
.
chooseMentalHealthIndexList
.
forEach
{
mentalHealthList
[
it
].
isSelected
=
false
}
mentalHealthAdapter
.
notifyDataSetChanged
()
}
mAllFilter
.
categoryId2List
.
clear
()
mAllFilter
.
categoryId3List
.
clear
()
signList
.
clear
()
}
}
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
View file @
a58adebe
...
@@ -4,47 +4,40 @@ import android.annotation.SuppressLint
...
@@ -4,47 +4,40 @@ import android.annotation.SuppressLint
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.content.Context
import
android.graphics.drawable.BitmapDrawable
import
android.graphics.drawable.BitmapDrawable
import
android.os.Build
import
androidx.core.content.ContextCompat
import
android.text.*
import
android.text.*
import
android.text.style.AbsoluteSizeSpan
import
android.text.style.AbsoluteSizeSpan
import
android.util.Log
import
android.util.Log
import
android.view.*
import
android.view.KeyEvent
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.view.inputmethod.EditorInfo
import
android.view.inputmethod.EditorInfo
import
android.view.inputmethod.InputMethodManager
import
android.view.inputmethod.InputMethodManager
import
android.widget.*
import
android.widget.*
import
com.bumptech.glide.Glide
import
com.bumptech.glide.Glide
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.remind.ToastHelper
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.common.tools.RxKeyboardTool
import
com.yidianling.common.tools.RxKeyboardTool
import
com.yidianling.consultant.R
import
com.yidianling.consultant.R
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.http.ExpertSearchDataManager
import
com.yidianling.consultant.listener.OnFilterConfirmListener
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
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.disposables.CompositeDisposable
import
io.reactivex.disposables.CompositeDisposable
import
io.reactivex.disposables.Disposable
import
io.reactivex.disposables.Disposable
import
io.reactivex.schedulers.Schedulers
import
kotlinx.android.synthetic.main.consultant_item_filter.view.*
import
kotlinx.android.synthetic.main.consultant_item_filter.view.*
import
kotlinx.android.synthetic.main.consultant_item_price_range.view.*
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.*
import
kotlin.math.roundToInt
/**
/**
* 筛选弹窗
* 筛选弹窗
* Created by zqk on 17-9-15.
* Created by zqk on 17-9-15.
*/
*/
class
FilterPopupWindow
(
class
FilterPopupWindow
(
private
val
context
:
Context
,
private
val
filterData
:
Filters
,
private
val
tempFilter
:
AllFilter
)
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
private
val
context
:
Context
,
private
val
filterData
:
Filters
,
private
val
tempFilter
:
AllFilter
)
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
private
val
mDisposableList
=
CompositeDisposable
()
private
val
mDisposableList
=
CompositeDisposable
()
...
@@ -121,7 +114,7 @@ class FilterPopupWindow(
...
@@ -121,7 +114,7 @@ class FilterPopupWindow(
@SuppressLint
(
"ClickableViewAccessibility"
)
@SuppressLint
(
"ClickableViewAccessibility"
)
private
fun
initKeyboardListener
(
view
:
View
)
{
private
fun
initKeyboardListener
(
view
:
View
)
{
va
r
svFilter
=
view
.
findViewById
<
ScrollView
>(
R
.
id
.
sv_filter
)
va
l
svFilter
=
view
.
findViewById
<
ScrollView
>(
R
.
id
.
sv_filter
)
val
imm
=
context
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
val
imm
=
context
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
svFilter
.
setOnTouchListener
{
_
,
_
->
svFilter
.
setOnTouchListener
{
_
,
_
->
...
@@ -246,13 +239,6 @@ class FilterPopupWindow(
...
@@ -246,13 +239,6 @@ class FilterPopupWindow(
biEventParams
=
tempFilter
.
doctorEdu
.
map
{
it
.
value
}.
joinToString
(
","
)
biEventParams
=
tempFilter
.
doctorEdu
.
map
{
it
.
value
}.
joinToString
(
","
)
}
}
}
}
// 擅长人群拼接
if
(
tempFilter
.
specialityCrowd
.
isNotEmpty
()){
sb
.
append
(
"&crowdsTags="
).
append
(
tempFilter
.
specialityCrowd
.
map
{
it
.
key
}.
joinToString
(
","
))
if
(
ConsultBIConstants
.
POSITION_GOOD_AT_CLICK
==
biEventName
){
biEventParams
=
tempFilter
.
specialityCrowd
.
map
{
it
.
key
}.
joinToString
(
","
)
}
}
if
(
tempFilter
.
others
.
isNotEmpty
())
{
if
(
tempFilter
.
others
.
isNotEmpty
())
{
sb
.
append
(
"&others="
).
append
(
tempFilter
.
others
.
map
{
it
.
key
}.
joinToString
(
","
))
sb
.
append
(
"&others="
).
append
(
tempFilter
.
others
.
map
{
it
.
key
}.
joinToString
(
","
))
if
(
ConsultBIConstants
.
POSITION_OTHER_CHOICE_CLICK
==
biEventName
)
{
if
(
ConsultBIConstants
.
POSITION_OTHER_CHOICE_CLICK
==
biEventName
)
{
...
@@ -282,50 +268,49 @@ class FilterPopupWindow(
...
@@ -282,50 +268,49 @@ class FilterPopupWindow(
account
+=
tempFilter
.
priceRanges
?.
maxPrice
?.
toDouble
()
!!
account
+=
tempFilter
.
priceRanges
?.
maxPrice
?.
toDouble
()
!!
}
}
biEventParams
=
(
Math
.
round
(
account
/
2
)).
toString
()
biEventParams
=
(
(
account
/
2
).
roundToInt
(
)).
toString
()
}
}
}
}
//用户行为数据埋点
//用户行为数据埋点
biEvent
(
biEventName
,
biEventParams
)
biEvent
(
biEventName
,
biEventParams
)
// sb.append("&page=").append(1)
// ExpertSearchDataManager.getHttp().getFilterCount(sb.toString())
ExpertSearchDataManager
.
getHttp
().
getFilterCount
(
sb
.
toString
())
// .subscribeOn(Schedulers.io())
.
subscribeOn
(
Schedulers
.
io
())
// .compose(RxUtils.resultJavaData())
.
compose
(
RxUtils
.
resultJavaData
())
// .map { it }
.
map
{
it
}
// .filter { true }
.
filter
{
it
!=
null
}
// .observeOn(AndroidSchedulers.mainThread())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
// .subscribe({
.
subscribe
({
//
// contentView.btnConfirm.text = if (it > 0) "确定" else "暂无匹配咨询师"
contentView
.
btnConfirm
.
text
=
if
(
it
>
0
)
"确定"
else
"暂无匹配咨询师"
// //按钮置灰/解除置灰
//按钮置灰/解除置灰
// contentView.btnConfirm.isEnabled = it > 0
contentView
.
btnConfirm
.
isEnabled
=
it
>
0
// if (it > 0) {
if
(
it
>
0
)
{
// contentView.btnConfirm.setTextColor(
contentView
.
btnConfirm
.
setTextColor
(
// ContextCompat.getColor(
ContextCompat
.
getColor
(
// context,
context
,
// R.color.platform_but_text_color
R
.
color
.
platform_but_text_color
// )
)
// )
)
// contentView.btnConfirm.background =
contentView
.
btnConfirm
.
background
=
// ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_dark)
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
consultant_bg_radius_5_dark
)
//// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.consultant_white))
// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.consultant_white))
// } else {
}
else
{
// contentView.btnConfirm.setTextColor(
contentView
.
btnConfirm
.
setTextColor
(
// ContextCompat.getColor(
ContextCompat
.
getColor
(
// context,
context
,
// R.color.platform_text_light_color
R
.
color
.
platform_text_light_color
// )
)
// )
)
// contentView.btnConfirm.background =
contentView
.
btnConfirm
.
background
=
// ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_light)
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
consultant_bg_radius_5_light
)
//// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.color_999999))
// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.color_999999))
// }
}
//
// }, {
},
{
// ToastHelper.show(it.message!!)
ToastHelper
.
show
(
it
.
message
!!
)
// })
})
}
}
private
fun
biEvent
(
biEventName
:
String
,
biEventParams
:
String
=
""
)
{
private
fun
biEvent
(
biEventName
:
String
,
biEventParams
:
String
=
""
)
{
...
@@ -465,7 +450,6 @@ class FilterPopupWindow(
...
@@ -465,7 +450,6 @@ class FilterPopupWindow(
textView
.
isSelected
=
true
textView
.
isSelected
=
true
textView
.
paint
.
isFakeBoldText
=
true
textView
.
paint
.
isFakeBoldText
=
true
}
}
updateCount
(
ConsultBIConstants
.
POSITION_GOOD_AT_CLICK
)
}
}
if
(
index
>
19
){
if
(
index
>
19
){
...
...
m-consultant/src/main/java/com/yidianling/consultant/ui/view/SortPopupWindow.kt
View file @
a58adebe
...
@@ -16,7 +16,7 @@ import kotlinx.android.synthetic.main.consultant_ui_sort_popup_window.view.*
...
@@ -16,7 +16,7 @@ import kotlinx.android.synthetic.main.consultant_ui_sort_popup_window.view.*
* 排序弹窗
* 排序弹窗
* Created by zqk on 17-9-15.
* Created by zqk on 17-9-15.
*/
*/
class
SortPopupWindow
(
val
context
:
Context
,
private
val
sortItems
:
ArrayList
<
ReorderItem
>,
var
selectedSort
:
ReorderItem
,
private
val
onSortItemSelectedListener
:
OnSortItemSelectedListener
)
class
SortPopupWindow
(
val
context
:
Context
,
sortItems
:
ArrayList
<
ReorderItem
>,
var
selectedSort
:
ReorderItem
,
onSortItemSelectedListener
:
OnSortItemSelectedListener
)
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
private
var
adapter
:
SortRecyclerViewAdapter
private
var
adapter
:
SortRecyclerViewAdapter
...
@@ -31,12 +31,7 @@ class SortPopupWindow(val context: Context, private val sortItems: ArrayList<Reo
...
@@ -31,12 +31,7 @@ class SortPopupWindow(val context: Context, private val sortItems: ArrayList<Reo
val
rvSortItem
=
view
.
rvSortItem
val
rvSortItem
=
view
.
rvSortItem
adapter
=
SortRecyclerViewAdapter
(
context
,
sortItems
,
selectedSort
,
onSortItemSelectedListener
)
adapter
=
SortRecyclerViewAdapter
(
context
,
sortItems
,
selectedSort
,
onSortItemSelectedListener
)
rvSortItem
.
adapter
=
adapter
rvSortItem
.
adapter
=
adapter
rvSortItem
.
layoutManager
=
rvSortItem
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
false
)
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
false
)
// rvSortItem.addItemDecoration(DividerItemDecoration(context, LinearLayoutManager.VERTICAL))
// rvSortItem.addItemDecoration(DividerItemDecoration(context, LinearLayoutManager.VERTICAL))
}
}
...
...
m-consultant/src/main/res/drawable-xhdpi/consultant_ic_sort_close.png
0 → 100644
View file @
a58adebe
973 Bytes
m-consultant/src/main/res/drawable-xhdpi/consultant_ic_sort_open.png
0 → 100644
View file @
a58adebe
1.09 KB
m-consultant/src/main/res/drawable/consultant_solid_main_theme_color_r_8.xml
0 → 100644
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"8dp"
/>
<solid
android:color=
"@color/platform_main_theme"
/>
</shape>
\ No newline at end of file
m-consultant/src/main/res/drawable/consultant_stroke_ebebeb_r_8.xml
0 → 100644
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"8dp"
/>
<stroke
android:width=
"1dp"
android:color=
"@color/platform_color_EBEBEB"
/>
</shape>
\ No newline at end of file
m-consultant/src/main/res/drawable/consultant_stroke_ebebeb_solid_f9f9f9_r_4.xml
0 → 100644
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"4dp"
/>
<stroke
android:width=
"0.5dp"
android:color=
"@color/platform_color_EBEBEB"
/>
<solid
android:color=
"#f9f9f9"
/>
</shape>
\ No newline at end of file
m-consultant/src/main/res/layout/consultant_activity_hot_search.xml
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
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=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/platform_white"
>
android:background=
"@color/platform_white"
>
<
Linear
Layout
<
Relative
Layout
android:id=
"@+id/
clContainer
"
android:id=
"@+id/
rl_search
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"@dimen/consultant_title_bar_height"
android:orientation=
"vertical"
>
<RelativeLayout
android:paddingStart=
"15dp"
android:id=
"@+id/rl_search"
android:tag=
"tag_search_input"
app:layout_constraintTop_toTopOf=
"parent"
>
<View
android:id=
"@+id/view_search_input_bg"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/consultant_title_bar_height"
android:layout_height=
"32dp"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"60dp"
android:background=
"@drawable/consultant_bg_hot_search_input"
android:tag=
"tag_search_input_bg"
/>
<ImageView
android:id=
"@+id/iv_search_icon"
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"10dp"
android:scaleType=
"centerCrop"
android:src=
"@drawable/consultant_icon_input_search"
android:tag=
"tag_search_input_img"
/>
<EditText
android:id=
"@+id/etSearch"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"20dp"
android:layout_toLeftOf=
"@+id/iv_delete_icon"
android:layout_toRightOf=
"@id/iv_search_icon"
android:background=
"@null"
android:cursorVisible=
"true"
android:focusable=
"true"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:focusableInTouchMode=
"true"
android:paddingLeft=
"15dp"
android:hint=
"搜索心理问题或专家姓名"
android:tag=
"tag_search_input"
>
android:imeOptions=
"actionSearch"
android:maxLength=
"100"
android:singleLine=
"true"
android:tag=
"tag_search_input_edit"
android:textColor=
"#242424"
android:textColorHint=
"#b3b3b3"
android:textCursorDrawable=
"@drawable/consultant_edit_cursor_drawable"
android:textSize=
"13sp"
/>
<ImageView
android:id=
"@+id/iv_delete_icon"
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_alignRight=
"@+id/view_search_input_bg"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"12dp"
android:scaleType=
"centerCrop"
android:src=
"@drawable/platform_delete"
android:visibility=
"invisible"
/>
<TextView
android:id=
"@+id/tv_search_cancle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"10dp"
android:padding=
"5dp"
android:text=
"取消"
android:textColor=
"#242424"
android:textSize=
"15dp"
/>
</RelativeLayout>
<View
android:id=
"@+id/v_topLine"
android:layout_width=
"match_parent"
android:layout_height=
"0.5dp"
android:layout_below=
"@+id/rl_search"
android:layout_marginTop=
"@dimen/platform_dp_6"
android:background=
"@color/platform_color_E0E0E0"
app:layout_constraintTop_toBottomOf=
"@id/rl_search"
/>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
app:layout_constraintTop_toBottomOf=
"@id/v_topLine"
>
<LinearLayout
android:id=
"@+id/clContainer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<View
android:id=
"@+id/view_search_input_bg"
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:id=
"@+id/iv_daoyi_image"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"32dp"
android:layout_height=
"90dp"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"60dp"
android:background=
"@drawable/consultant_bg_hot_search_input"
android:tag=
"tag_search_input_bg"
/>
<ImageView
android:id=
"@+id/iv_search_icon"
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"15dp"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"1
0
dp"
android:layout_marginRight=
"1
5
dp"
android:scaleType=
"centerCrop"
android:scaleType=
"centerCrop"
android:src=
"@drawable/consultant_icon_input_search"
android:visibility=
"gone"
android:tag=
"tag_search_input_img"
/>
app:pa_borderRadius=
"8dp"
app:pa_type=
"pa_round"
tools:visibility=
"visible"
/>
<
EditTex
t
<
LinearLayou
t
android:id=
"@+id/
etSearch
"
android:id=
"@+id/
ll_search_history
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_below=
"@+id/v_topLine"
android:layout_marginRight=
"20dp"
android:layout_marginTop=
"13dp"
android:layout_toLeftOf=
"@+id/iv_delete_icon"
android:clickable=
"true"
android:layout_toRightOf=
"@id/iv_search_icon"
android:background=
"@null"
android:cursorVisible=
"true"
android:focusable=
"true"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:orientation=
"vertical"
android:hint=
"搜索心理问题或专家姓名"
android:paddingLeft=
"15dp"
android:imeOptions=
"actionSearch"
android:paddingRight=
"15dp"
>
android:maxLength=
"100"
android:singleLine=
"true"
android:tag=
"tag_search_input_edit"
android:textColor=
"#242424"
android:textColorHint=
"#b3b3b3"
android:textCursorDrawable=
"@drawable/consultant_edit_cursor_drawable"
android:textSize=
"13sp"
/>
<ImageView
android:id=
"@+id/iv_delete_icon"
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_alignRight=
"@+id/view_search_input_bg"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"12dp"
android:scaleType=
"centerCrop"
android:src=
"@drawable/platform_delete"
android:visibility=
"invisible"
/>
<TextView
<LinearLayout
android:id=
"@+id/tv_search_cancle"
android:layout_width=
"match_parent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:layout_alignParentRight=
"true"
android:orientation=
"horizontal"
>
android:layout_centerVertical=
"true"
android:layout_marginRight=
"10dp"
android:padding=
"5dp"
android:text=
"取消"
android:textColor=
"#242424"
android:textSize=
"15dp"
/>
</RelativeLayout>
<
View
<Text
View
android:id=
"@+id/v_topLine
"
android:layout_width=
"0dp
"
android:layout_width=
"match_par
ent"
android:layout_height=
"wrap_cont
ent"
android:layout_height=
"1px
"
android:layout_weight=
"1
"
android:layout_below=
"@+id/rl_search
"
android:text=
"历史搜索
"
android:layout_marginTop=
"@dimen/platform_dp_6
"
android:textColor=
"#242424
"
android:layout_marginBottom=
"13dp
"
android:textSize=
"@dimen/platform_dp_16
"
android:background=
"@color/platform_color_E0E0E0
"
/>
android:textStyle=
"bold
"
/>
<ImageView
android:id=
"@+id/iv_delete_history"
android:layout_width=
"28dp"
android:layout_height=
"28dp"
android:padding=
"5dp"
android:src=
"@drawable/consultant_hot_search_delete_icon"
/>
<com.ydl.ydlcommon.view.widgets.RoundImageView
</LinearLayout>
android:id=
"@+id/iv_daoyi_image"
android:layout_width=
"match_parent"
android:layout_height=
"90dp"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"15dp"
android:scaleType=
"centerCrop"
android:visibility=
"gone"
app:pa_borderRadius=
"8dp"
app:pa_type=
"pa_round"
tools:visibility=
"visible"
/>
<cn.lankton.flowlayout.FlowLayout
android:id=
"@+id/fl_search_history"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"12dp"
/>
<LinearLayout
</LinearLayout>
android:id=
"@+id/ll_search_history"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/v_topLine"
android:layout_marginTop=
"13dp"
android:clickable=
"true"
android:focusable=
"true"
android:orientation=
"vertical"
android:paddingLeft=
"15dp"
android:paddingRight=
"15dp"
>
<LinearLayout
<LinearLayout
android:id=
"@+id/llHotSearch"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:layout_below=
"@id/ll_search_history"
android:orientation=
"horizontal"
>
android:layout_marginTop=
"13dp"
android:clickable=
"true"
android:focusable=
"true"
android:orientation=
"vertical"
android:paddingLeft=
"15dp"
android:paddingRight=
"15dp"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<TextView
<TextView
android:layout_width=
"
0dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"热门搜索"
android:text=
"历史搜索"
android:textColor=
"#242424"
android:textColor=
"#242424"
android:textSize=
"@dimen/platform_dp_16"
android:textSize=
"@dimen/platform_dp_16"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<ImageView
<cn.lankton.flowlayout.FlowLayout
android:id=
"@+id/iv_delete_history"
android:id=
"@+id/flHotSearch"
android:layout_width=
"28dp"
android:layout_width=
"match_parent"
android:layout_height=
"28dp"
android:layout_height=
"match_parent"
android:padding=
"5dp"
android:layout_marginTop=
"12dp"
/>
android:src=
"@drawable/consultant_hot_search_delete_icon"
/>
</LinearLayout>
</LinearLayout>
<
cn.lankton.flowlayout.Flow
Layout
<
Linear
Layout
android:id=
"@+id/
fl_search_history
"
android:id=
"@+id/
llHotExpert
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"12dp"
/>
android:layout_below=
"@id/llHotSearch"
android:layout_marginTop=
"13dp"
android:clickable=
"true"
android:focusable=
"true"
android:orientation=
"vertical"
android:paddingLeft=
"15dp"
android:paddingRight=
"15dp"
android:visibility=
"gone"
tools:visibility=
"visible"
>
</LinearLayout>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"本周热门专家"
android:textColor=
"#242424"
android:textSize=
"@dimen/platform_dp_16"
android:textStyle=
"bold"
/>
<LinearLayout
<cn.lankton.flowlayout.FlowLayout
android:id=
"@+id/llHotSearch"
android:id=
"@+id/flHotExpert"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_below=
"@id/ll_search_history"
android:layout_marginTop=
"12dp"
/>
android:layout_marginTop=
"13dp"
</LinearLayout>
android:clickable=
"true"
android:focusable=
"true"
android:orientation=
"vertical"
android:paddingLeft=
"15dp"
android:paddingRight=
"15dp"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"热门搜索"
android:textColor=
"#242424"
android:textSize=
"@dimen/platform_dp_16"
android:textStyle=
"bold"
/>
<
cn.lankton.flowlayout.FlowLayout
<
androidx.cardview.widget.CardView
android:id=
"@+id/
flHotSearch
"
android:id=
"@+id/
card_view
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"80dp"
android:layout_marginTop=
"12dp"
/>
android:layout_below=
"@+id/llHotExpert"
</LinearLayout>
android:layout_marginLeft=
"@dimen/platform_dp_15"
android:layout_marginTop=
"@dimen/platform_dp_28"
android:layout_marginRight=
"@dimen/platform_dp_15"
android:layout_marginBottom=
"@dimen/platform_dp_28"
app:cardCornerRadius=
"@dimen/platform_dp_4"
app:cardElevation=
"0px"
>
<LinearLayout
<com.ydl.ydlcommon.view.banner.Banner
android:id=
"@+id/llHotExpert"
android:id=
"@+id/banner"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"80dp"
android:layout_below=
"@id/llHotSearch"
android:scaleType=
"centerCrop"
android:layout_marginTop=
"13dp"
android:tag=
"overScroll"
android:clickable=
"true"
app:pa_indicator_different_width=
"14dp"
android:focusable=
"true"
app:pa_indicator_drawable_selected=
"@drawable/consultant_banner_indicator_select"
android:orientation=
"vertical"
app:pa_indicator_drawable_unselected=
"@drawable/consultant_banner_indicator_unselect"
android:paddingLeft=
"15dp"
app:pa_indicator_height=
"5dp"
android:paddingRight=
"15dp"
app:pa_indicator_margin=
"1.25dp"
android:visibility=
"gone"
app:pa_is_selected_same_unselected=
"false"
/>
tools:visibility=
"visible"
>
</androidx.cardview.widget.CardView>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"本周热门专家"
android:textColor=
"#242424"
android:textSize=
"@dimen/platform_dp_16"
android:textStyle=
"bold"
/>
<cn.lankton.flowlayout.FlowLayout
android:id=
"@+id/flHotExpert"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"12dp"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_search_words"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
app:layout_constraintTop_toBottomOf=
"@id/v_topLine"
app:layout_constraintBottom_toBottomOf=
"parent"
android:background=
"@color/white"
android:layout_marginTop=
"8dp"
android:visibility=
"gone"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.cardview.widget.CardView
android:id=
"@+id/card_view"
android:layout_width=
"match_parent"
android:layout_height=
"80dp"
android:layout_below=
"@+id/llHotExpert"
android:layout_marginLeft=
"@dimen/platform_dp_15"
android:layout_marginTop=
"@dimen/platform_dp_28"
android:layout_marginRight=
"@dimen/platform_dp_15"
android:layout_marginBottom=
"@dimen/platform_dp_28"
app:cardCornerRadius=
"@dimen/platform_dp_4"
app:cardElevation=
"0px"
>
<com.ydl.ydlcommon.view.banner.Banner
android:id=
"@+id/banner"
android:layout_width=
"match_parent"
android:layout_height=
"80dp"
android:scaleType=
"centerCrop"
android:tag=
"overScroll"
app:pa_indicator_different_width=
"14dp"
app:pa_indicator_drawable_selected=
"@drawable/consultant_banner_indicator_select"
app:pa_indicator_drawable_unselected=
"@drawable/consultant_banner_indicator_unselect"
app:pa_indicator_height=
"5dp"
app:pa_indicator_margin=
"1.25dp"
app:pa_is_selected_same_unselected=
"false"
/>
</androidx.cardview.widget.CardView>
</LinearLayout>
</ScrollView>
m-consultant/src/main/res/layout/consultant_expert_search_header_view.xml
0 → 100644
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_search_words"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingStart=
"19dp"
android:paddingEnd=
"19dp"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_search_related_word"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/platform_color_242424"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
android:textSize=
"15sp"
android:fontFamily=
"sans-serif"
android:layout_marginTop=
"14dp"
android:includeFontPadding=
"false"
tools:text=
"根据匹配,为您推荐恋爱情感相关词"
/>
<TextView
android:id=
"@+id/tv_search_tips"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_search_word"
app:layout_constraintBottom_toBottomOf=
"@id/tv_search_word"
android:textSize=
"15sp"
android:textColor=
"@color/platform_color_666666"
android:fontFamily=
"sans-serif"
android:includeFontPadding=
"false"
android:text=
"仍搜索"
/>
<TextView
android:id=
"@+id/tv_search_word"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintStart_toEndOf=
"@id/tv_search_tips"
app:layout_constraintTop_toBottomOf=
"@id/tv_search_related_word"
android:layout_marginTop=
"9dp"
android:layout_marginStart=
"6dp"
android:textSize=
"14sp"
android:paddingTop=
"4dp"
android:paddingBottom=
"4dp"
android:paddingStart=
"12dp"
android:paddingEnd=
"12dp"
android:textColor=
"@color/platform_color_242424"
android:includeFontPadding=
"false"
android:background=
"@drawable/consultant_stroke_ebebeb_solid_f9f9f9_r_4"
tools:text=
"恋爱情感"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
\ No newline at end of file
m-consultant/src/main/res/layout/consultant_item_search_words.xml
0 → 100644
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:src=
"http://schemas.android.com/tools"
android:paddingTop=
"12dp"
android:paddingBottom=
"12dp"
>
<ImageView
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_centerVertical=
"true"
android:src=
"@drawable/consultant_icon_input_search"
app:layout_constraintStart_toStartOf=
"parent"
android:layout_marginStart=
"16dp"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_search_words"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
src:text=
"李哈哈"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
android:textColor=
"@color/platform_color_242424"
android:layout_marginStart=
"38dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
m-consultant/src/main/res/layout/consultant_item_sort1.xml
0 → 100644
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingStart=
"10dp"
android:paddingTop=
"12dp"
android:orientation=
"vertical"
android:id=
"@+id/ll_sort_item"
>
<TextView
android:id=
"@+id/tv_sort_name"
android:layout_width=
"75dp"
android:layout_height=
"34dp"
android:gravity=
"center"
android:textColor=
"@color/consultant_color_search_filter_selector"
android:orientation=
"vertical"
android:background=
"@drawable/consultant_bg_search_filter_selector"
android:textSize=
"14sp"
tools:text=
"恋爱婚姻"
/>
</LinearLayout>
m-consultant/src/main/res/layout/consultant_item_sort2.xml
0 → 100644
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingStart=
"10dp"
android:paddingTop=
"12dp"
android:orientation=
"vertical"
android:id=
"@+id/ll_sort_item"
>
<TextView
android:id=
"@+id/tv_sort_name"
android:layout_width=
"wrap_content"
android:layout_height=
"34dp"
android:gravity=
"center"
android:textColor=
"@color/consultant_color_search_filter_selector"
android:orientation=
"vertical"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:background=
"@drawable/consultant_bg_search_filter_selector"
android:textSize=
"14sp"
tools:text=
"恋爱婚姻"
/>
</LinearLayout>
m-consultant/src/main/res/layout/consultant_item_subject.xml
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/tv
SubjectName"
android:id=
"@+id/tv
_sort_name"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"36dp"
android:layout_height=
"36dp"
android:gravity=
"center"
android:gravity=
"center"
android:textColor=
"@color/consultant_color_search_filter_selector"
android:textColor=
"@color/consultant_color_search_filter_selector"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:background=
"@drawable/consultant_bg_search_filter_selector"
android:background=
"@drawable/consultant_bg_search_filter_selector"
android:textSize=
"14dp"
android:textSize=
"14dp"
tools:text=
"恋爱婚姻"
/>
tools:text=
"恋爱婚姻"
/>
m-consultant/src/main/res/layout/consultant_item_tag.xml
View file @
a58adebe
...
@@ -8,6 +8,6 @@
...
@@ -8,6 +8,6 @@
android:gravity=
"center"
android:gravity=
"center"
android:layout_marginEnd=
"6dp"
android:layout_marginEnd=
"6dp"
android:padding=
"3dp"
android:padding=
"3dp"
android:textColor=
"@color/platform_color_
999999
"
android:textColor=
"@color/platform_color_
666666
"
android:textSize=
"10sp"
android:textSize=
"10sp"
tools:text=
"恋爱情感"
/>
tools:text=
"恋爱情感"
/>
m-consultant/src/main/res/layout/consultant_layout_search_content.xml
View file @
a58adebe
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
xmlns:tools=
"http://schemas.android.com/tools"
android:background=
"@color/platform_white"
android:background=
"@color/platform_white"
android:orientation=
"vertical"
android:orientation=
"vertical"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
>
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
>
...
...
m-consultant/src/main/res/layout/consultant_ui_filter_popup.xml
View file @
a58adebe
...
@@ -211,12 +211,11 @@
...
@@ -211,12 +211,11 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"44dp"
android:layout_height=
"44dp"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
android:layout_marginLeft=
"10dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@drawable/consultant_bg_radius_5_
light
"
android:background=
"@drawable/consultant_bg_radius_5_
dark
"
android:gravity=
"center"
android:gravity=
"center"
android:hint=
"
暂无匹配咨询师
"
android:hint=
"
确定
"
android:textColor=
"@color/
platform_but_text_color
"
android:textColor=
"@color/
white
"
android:textColorHint=
"@color/platform_color_E0E0E0"
android:textColorHint=
"@color/platform_color_E0E0E0"
android:textSize=
"16sp"
/>
android:textSize=
"16sp"
/>
</LinearLayout>
</LinearLayout>
...
...
m-consultant/src/main/res/layout/consultant_ui_subject_popup_window.xml
View file @
a58adebe
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
566dp
"
android:background=
"@color/platform_white"
android:background=
"@color/platform_white"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
<androidx.core.widget.NestedScrollView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"服务类型"
android:textSize=
"@dimen/platform_dp_16"
android:textColor=
"@color/platform_color_242424"
android:textStyle=
"bold"
android:layout_marginTop=
"@dimen/platform_dp_24"
android:layout_marginLeft=
"@dimen/platform_dp_15"
android:layout_marginBottom=
"7dp"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvSubject"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"10dp"
app:layout_constraintTop_toTopOf=
"parent"
>
android:layout_marginRight=
"10dp"
android:overScrollMode=
"never"
/>
<TextView
<LinearLayout
android:id=
"@+id/btnConfirm"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"68dp"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/ll_sort_child_education_open"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_17"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"@dimen/platform_dp_16"
android:paddingEnd=
"@dimen/platform_dp_16"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:includeFontPadding=
"false"
android:textStyle=
"bold"
android:text=
"亲子教育"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"16sp"
/>
<ImageView
android:id=
"@+id/iv_sort_child_education_open"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:src=
"@drawable/consultant_ic_sort_close"
android:visibility=
"gone"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_sort_child_education"
android:layout_width=
"match_parent"
android:layout_height=
"138dp"
android:layout_marginStart=
"6dp"
android:layout_marginEnd=
"12dp"
android:nestedScrollingEnabled=
"false"
android:overScrollMode=
"never"
/>
<LinearLayout
android:id=
"@+id/ll_sort_emotional_stress"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_25"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"@dimen/platform_dp_16"
android:paddingEnd=
"@dimen/platform_dp_16"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textStyle=
"bold"
android:includeFontPadding=
"false"
android:text=
"情绪压力"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"16sp"
/>
<ImageView
android:id=
"@+id/iv_sort_emotional_stress"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:src=
"@drawable/consultant_ic_sort_close"
android:visibility=
"gone"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_sort_emotional_stress"
android:layout_width=
"match_parent"
android:layout_height=
"138dp"
android:layout_marginEnd=
"12dp"
android:layout_marginStart=
"6dp"
android:nestedScrollingEnabled=
"false"
android:overScrollMode=
"never"
/>
<LinearLayout
android:id=
"@+id/ll_sort_love_emotion"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_25"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"@dimen/platform_dp_16"
android:paddingEnd=
"@dimen/platform_dp_16"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textStyle=
"bold"
android:includeFontPadding=
"false"
android:text=
"恋爱情感"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"16sp"
/>
<ImageView
android:id=
"@+id/iv_sort_love_emotion"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:src=
"@drawable/consultant_ic_sort_close"
android:visibility=
"gone"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_sort_love_emotion"
android:layout_width=
"match_parent"
android:layout_height=
"138dp"
android:layout_marginStart=
"6dp"
android:layout_marginEnd=
"12dp"
android:nestedScrollingEnabled=
"false"
android:overScrollMode=
"never"
/>
<LinearLayout
android:id=
"@+id/ll_sort_married_family"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_25"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"@dimen/platform_dp_16"
android:paddingEnd=
"@dimen/platform_dp_16"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textStyle=
"bold"
android:includeFontPadding=
"false"
android:text=
"婚姻家庭"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"16sp"
/>
<ImageView
android:id=
"@+id/iv_sort_married_family"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:src=
"@drawable/consultant_ic_sort_close"
android:visibility=
"gone"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_sort_married_family"
android:layout_width=
"match_parent"
android:layout_height=
"138dp"
android:layout_marginStart=
"6dp"
android:layout_marginEnd=
"12dp"
android:nestedScrollingEnabled=
"false"
android:overScrollMode=
"never"
/>
<LinearLayout
android:id=
"@+id/ll_sort_personal_growth"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_25"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"@dimen/platform_dp_16"
android:paddingEnd=
"@dimen/platform_dp_16"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textStyle=
"bold"
android:includeFontPadding=
"false"
android:text=
"个人成长"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"16sp"
/>
<ImageView
android:id=
"@+id/iv_sort_personal_growth"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:src=
"@drawable/consultant_ic_sort_close"
android:visibility=
"gone"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_sort_personal_growth"
android:layout_width=
"match_parent"
android:layout_height=
"138dp"
android:layout_marginStart=
"6dp"
android:layout_marginEnd=
"12dp"
android:nestedScrollingEnabled=
"false"
android:overScrollMode=
"never"
/>
<LinearLayout
android:id=
"@+id/ll_sort_interpersonal_relationship"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_25"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"@dimen/platform_dp_16"
android:paddingEnd=
"@dimen/platform_dp_16"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textStyle=
"bold"
android:includeFontPadding=
"false"
android:text=
"人际关系"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"16sp"
/>
<ImageView
android:id=
"@+id/iv_sort_interpersonal_relationship"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:src=
"@drawable/consultant_ic_sort_close"
android:visibility=
"gone"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_sort_interpersonal_relationship"
android:layout_width=
"match_parent"
android:layout_height=
"138dp"
android:layout_marginStart=
"6dp"
android:layout_marginEnd=
"12dp"
android:nestedScrollingEnabled=
"false"
android:overScrollMode=
"never"
/>
<LinearLayout
android:id=
"@+id/ll_sort_career_development"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_25"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"@dimen/platform_dp_16"
android:paddingEnd=
"@dimen/platform_dp_16"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textStyle=
"bold"
android:includeFontPadding=
"false"
android:text=
"职场发展"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"16sp"
/>
<ImageView
android:id=
"@+id/iv_sort_career_development"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:src=
"@drawable/consultant_ic_sort_close"
android:visibility=
"gone"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_sort_career_development"
android:layout_width=
"match_parent"
android:layout_height=
"138dp"
android:layout_marginStart=
"6dp"
android:layout_marginEnd=
"12dp"
android:nestedScrollingEnabled=
"false"
android:overScrollMode=
"never"
/>
<LinearLayout
android:id=
"@+id/ll_sort_mental_health"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_25"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingStart=
"@dimen/platform_dp_16"
android:paddingEnd=
"@dimen/platform_dp_16"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textStyle=
"bold"
android:includeFontPadding=
"false"
android:text=
"心理健康"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"16sp"
/>
<ImageView
android:id=
"@+id/iv_sort_mental_health"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:src=
"@drawable/consultant_ic_sort_close"
android:visibility=
"gone"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_sort_mental_health"
android:layout_width=
"match_parent"
android:layout_height=
"138dp"
android:layout_marginStart=
"6dp"
android:layout_marginEnd=
"12dp"
android:nestedScrollingEnabled=
"false"
android:overScrollMode=
"never"
/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"44dp"
android:layout_height=
"68dp"
android:layout_marginBottom=
"16dp"
android:background=
"@color/white"
android:layout_marginLeft=
"15dp"
android:orientation=
"horizontal"
android:layout_marginRight=
"15dp"
android:paddingStart=
"16dp"
android:layout_marginTop=
"19dp"
android:paddingTop=
"8dp"
android:background=
"@drawable/consultant_bg_radius_5_dark"
android:paddingEnd=
"16dp"
android:gravity=
"center"
app:layout_constraintBottom_toBottomOf=
"parent"
>
android:text=
"@string/platform_confirm"
android:textSize=
"17dp"
<TextView
android:textColor=
"@color/platform_but_text_color"
/>
android:id=
"@+id/btn_reset"
android:layout_width=
"0dp"
</LinearLayout>
android:layout_height=
"44dp"
android:layout_weight=
"1"
android:background=
"@drawable/consultant_stroke_ebebeb_r_8"
android:gravity=
"center"
android:text=
"@string/platform_reset"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/btnConfirm"
android:layout_width=
"0dp"
android:layout_height=
"44dp"
android:layout_marginStart=
"13dp"
android:layout_weight=
"1"
android:background=
"@drawable/consultant_solid_main_theme_color_r_8"
android:gravity=
"center"
android:text=
"@string/platform_confirm"
android:textColor=
"@color/white"
android:textSize=
"16sp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
m-home/src/main/java/com/yidianling/home/event/HomeBaseImpl.kt
View file @
a58adebe
...
@@ -23,7 +23,6 @@ import com.ydl.ydlcommon.base.config.HttpConfig
...
@@ -23,7 +23,6 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import
com.ydl.ydlcommon.bean.ShareData
import
com.ydl.ydlcommon.bean.ShareData
import
com.ydl.ydlcommon.data.PlatformRamImpl
import
com.ydl.ydlcommon.data.PlatformRamImpl
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager.provide
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.Utils
...
@@ -213,9 +212,7 @@ open class HomeBaseImpl : IHomeBaseEvent {
...
@@ -213,9 +212,7 @@ open class HomeBaseImpl : IHomeBaseEvent {
return
return
}
}
EventBus
.
getDefault
().
post
(
EventBus
.
getDefault
().
post
(
HomeModuleTabEvent
(
HomeModuleTabEvent
(
2
,
"12"
)
2
)
)
)
ActionCountUtils
.
count
(
HomeBIConstants
.
YDL_USER_CONSULT_MORE_CLICK
)
ActionCountUtils
.
count
(
HomeBIConstants
.
YDL_USER_CONSULT_MORE_CLICK
)
}
}
...
@@ -286,9 +283,7 @@ open class HomeBaseImpl : IHomeBaseEvent {
...
@@ -286,9 +283,7 @@ open class HomeBaseImpl : IHomeBaseEvent {
return
return
}
}
EventBus
.
getDefault
().
post
(
EventBus
.
getDefault
().
post
(
HomeModuleTabEvent
(
HomeModuleTabEvent
(
2
,
"11"
)
2
)
)
)
ActionCountUtils
.
count
(
HomeBIConstants
.
YDL_USER_CONSULT_CLICK
)
ActionCountUtils
.
count
(
HomeBIConstants
.
YDL_USER_CONSULT_CLICK
)
}
}
...
...
m-home/src/main/java/com/yidianling/home/event/IHomeBaseEvent.kt
View file @
a58adebe
...
@@ -75,7 +75,7 @@ interface IHomeBaseEvent {
...
@@ -75,7 +75,7 @@ interface IHomeBaseEvent {
fun
categoryClick
(
category
:
HomeHeaderBean
.
AskCategoryDataBean
)
fun
categoryClick
(
category
:
HomeHeaderBean
.
AskCategoryDataBean
)
/**
/**
*
预约专家
点击事件
*
心理咨询
点击事件
*/
*/
fun
reservationExpertsClick
()
fun
reservationExpertsClick
()
...
...
m-home/src/main/modular_api/com/yidianling/home/api/event/HomeModuleTabEvent.java
View file @
a58adebe
...
@@ -3,6 +3,12 @@ package com.yidianling.home.api.event;
...
@@ -3,6 +3,12 @@ package com.yidianling.home.api.event;
public
class
HomeModuleTabEvent
{
public
class
HomeModuleTabEvent
{
private
int
tabIndex
;
private
int
tabIndex
;
public
String
sign
;
// 用于埋点参数
public
HomeModuleTabEvent
(
int
index
,
String
sign
)
{
tabIndex
=
index
;
this
.
sign
=
sign
;
}
public
HomeModuleTabEvent
(
int
index
)
{
public
HomeModuleTabEvent
(
int
index
)
{
tabIndex
=
index
;
tabIndex
=
index
;
...
...
m-home/src/ydl/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
View file @
a58adebe
...
@@ -119,10 +119,10 @@ class YdlHomeAdapter(private val mContext: Context,
...
@@ -119,10 +119,10 @@ class YdlHomeAdapter(private val mContext: Context,
}
}
override
fun
getItemViewType
(
position
:
Int
):
Int
{
override
fun
getItemViewType
(
position
:
Int
):
Int
{
if
(
position
<
list
.
size
)
{
return
if
(
position
<
list
.
size
)
{
return
list
[
position
].
type
!!
list
[
position
].
type
!!
}
else
{
}
else
{
return
-
1
-
1
}
}
}
}
...
...
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
View file @
a58adebe
...
@@ -145,10 +145,9 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
...
@@ -145,10 +145,9 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
private
fun
initView
()
{
private
fun
initView
()
{
if
(
HomeViewConfig
.
getOrder
().
bannerIndex
==
null
||
HomeViewConfig
.
getOrder
().
bannerIndex
==
-
1
)
{
if
(
HomeViewConfig
.
getOrder
().
bannerIndex
==
null
||
HomeViewConfig
.
getOrder
().
bannerIndex
==
-
1
)
{
var
marginTop
=
this
.
resources
.
getDimension
(
R
.
dimen
.
home_home_title_bar_height
)
var
marginTop
=
this
.
resources
.
getDimension
(
R
.
dimen
.
home_home_title_bar_height
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//4.4以下不支持状态栏变色
//4.4以下不支持状态栏变色
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
mActivity
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
mActivity
)
marginTop
+=
statusBarHeight
marginTop
+=
statusBarHeight
}
val
lp
=
home_swipe_refresh_layout
.
layoutParams
as
FrameLayout
.
LayoutParams
val
lp
=
home_swipe_refresh_layout
.
layoutParams
as
FrameLayout
.
LayoutParams
lp
.
topMargin
=
marginTop
.
toInt
()
lp
.
topMargin
=
marginTop
.
toInt
()
home_swipe_refresh_layout
.
layoutParams
=
lp
home_swipe_refresh_layout
.
layoutParams
=
lp
...
@@ -179,17 +178,16 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
...
@@ -179,17 +178,16 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
* 初始化状态栏位置
* 初始化状态栏位置
*/
*/
private
fun
initStatus
()
{
private
fun
initStatus
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//4.4以下不支持状态栏变色
//4.4以下不支持状态栏变色
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
mActivity
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
mActivity
)
var
homeTitleBarHeight
=
resources
.
getDimension
(
R
.
dimen
.
home_home_title_bar_height
)
val
homeTitleBarHeight
=
resources
.
getDimension
(
R
.
dimen
.
home_home_title_bar_height
)
val
lp1
=
view_rl_top_bg
.
layoutParams
as
RelativeLayout
.
LayoutParams
val
lp1
=
view_rl_top_bg
.
layoutParams
as
RelativeLayout
.
LayoutParams
lp1
.
height
=
(
homeTitleBarHeight
+
statusBarHeight
).
toInt
()
lp1
.
height
=
(
homeTitleBarHeight
+
statusBarHeight
).
toInt
()
view_rl_top_bg
.
layoutParams
=
lp1
view_rl_top_bg
.
layoutParams
=
lp1
val
lp2
=
rl_top
.
layoutParams
as
RelativeLayout
.
LayoutParams
val
lp2
=
rl_top
.
layoutParams
as
RelativeLayout
.
LayoutParams
lp2
.
topMargin
=
statusBarHeight
lp2
.
topMargin
=
statusBarHeight
rl_top
.
layoutParams
=
lp2
rl_top
.
layoutParams
=
lp2
}
}
}
override
fun
initDataAndEventLazy
()
{
override
fun
initDataAndEventLazy
()
{
...
@@ -297,7 +295,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
...
@@ -297,7 +295,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
val
act
=
homeHeaderBean
.
activityResponse
val
act
=
homeHeaderBean
.
activityResponse
if
(
act
!=
null
)
{
if
(
act
!=
null
)
{
if
(!
TextUtils
.
isEmpty
(
act
!!
.
imageUrl
))
{
if
(!
TextUtils
.
isEmpty
(
act
.
imageUrl
))
{
img_ad
.
visibility
=
View
.
VISIBLE
img_ad
.
visibility
=
View
.
VISIBLE
GlideApp
.
with
(
this
).
load
(
act
!!
.
imageUrl
).
into
(
img_ad
)
GlideApp
.
with
(
this
).
load
(
act
!!
.
imageUrl
).
into
(
img_ad
)
img_ad
.
setOnClickListener
{
img_ad
.
setOnClickListener
{
...
...
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeButtonBannerView.kt
View file @
a58adebe
...
@@ -69,9 +69,9 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
...
@@ -69,9 +69,9 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
*/
*/
private
fun
initButtonView
()
{
private
fun
initButtonView
()
{
if
(
null
==
buttonParams
)
{
if
(
null
==
buttonParams
)
{
va
r
screenWidth
=
RxDeviceTool
.
getScreenWidth
(
mContext
)
va
l
screenWidth
=
RxDeviceTool
.
getScreenWidth
(
mContext
)
va
r
viewWidth
=
((
screenWidth
-
2
*
9
*
RxDeviceTool
.
getScreenDensity
(
mContext
))
/
4
).
toInt
()
va
l
viewWidth
=
((
screenWidth
-
2
*
9
*
RxDeviceTool
.
getScreenDensity
(
mContext
))
/
4
).
toInt
()
va
r
viewHeight
=
viewWidth
*
78
/
80
va
l
viewHeight
=
viewWidth
*
78
/
80
buttonParams
=
LinearLayout
.
LayoutParams
(
viewWidth
,
viewHeight
)
buttonParams
=
LinearLayout
.
LayoutParams
(
viewWidth
,
viewHeight
)
buttonParamsFrame
=
FrameLayout
.
LayoutParams
(
viewWidth
,
viewHeight
)
buttonParamsFrame
=
FrameLayout
.
LayoutParams
(
viewWidth
,
viewHeight
)
buttonParamsFrame2
=
FrameLayout
.
LayoutParams
((
viewWidth
/
2.0
).
toInt
(),
(
viewHeight
/
2.3
).
toInt
())
buttonParamsFrame2
=
FrameLayout
.
LayoutParams
((
viewWidth
/
2.0
).
toInt
(),
(
viewHeight
/
2.3
).
toInt
())
...
...
ydl-net/src/main/java/com/ydl/ydlnet/builder/interceptor/log/DefaultFormatPrinter.java
View file @
a58adebe
...
@@ -2,9 +2,12 @@ package com.ydl.ydlnet.builder.interceptor.log;
...
@@ -2,9 +2,12 @@ package com.ydl.ydlnet.builder.interceptor.log;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
com.ydl.ydlnet.utils.CharacterHandler
;
import
com.ydl.ydlnet.utils.CharacterHandler
;
import
com.ydl.ydlnet.utils.NetLogUtils
;
import
com.ydl.ydlnet.utils.NetLogUtils
;
import
okhttp3.MediaType
;
import
okhttp3.MediaType
;
import
okhttp3.Request
;
import
okhttp3.Request
;
...
@@ -48,17 +51,17 @@ public class DefaultFormatPrinter {
...
@@ -48,17 +51,17 @@ public class DefaultFormatPrinter {
* @param request
* @param request
* @param bodyString
* @param bodyString
*/
*/
public
void
printJsonRequest
(
@NonNull
Request
request
,
@NonNull
String
bodyString
)
{
public
void
printJsonRequest
(
@NonNull
Request
request
,
@NonNull
String
bodyString
)
{
final
String
requestBody
=
LINE_SEPARATOR
+
BODY_TAG
+
LINE_SEPARATOR
+
bodyString
;
final
String
requestBody
=
LINE_SEPARATOR
+
BODY_TAG
+
LINE_SEPARATOR
+
bodyString
;
final
String
tag
=
getTag
(
true
);
final
String
tag
=
getTag
(
true
);
if
(!
request
.
url
().
toString
().
contains
(
"writeMaiDianData"
)){
//
if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils
.
debugInfo
(
tag
,
REQUEST_UP_LINE
);
NetLogUtils
.
debugInfo
(
tag
,
REQUEST_UP_LINE
);
logLines
(
tag
,
new
String
[]{
URL_TAG
+
request
.
url
()},
false
);
logLines
(
tag
,
new
String
[]{
URL_TAG
+
request
.
url
()},
false
);
logLines
(
tag
,
getRequest
(
request
),
true
);
logLines
(
tag
,
getRequest
(
request
),
true
);
logLines
(
tag
,
requestBody
.
split
(
LINE_SEPARATOR
),
true
);
logLines
(
tag
,
requestBody
.
split
(
LINE_SEPARATOR
),
true
);
NetLogUtils
.
debugInfo
(
tag
,
END_LINE
);
NetLogUtils
.
debugInfo
(
tag
,
END_LINE
);
}
//
}
}
}
...
@@ -67,16 +70,16 @@ public class DefaultFormatPrinter {
...
@@ -67,16 +70,16 @@ public class DefaultFormatPrinter {
*
*
* @param request
* @param request
*/
*/
public
void
printFileRequest
(
@NonNull
Request
request
)
{
public
void
printFileRequest
(
@NonNull
Request
request
)
{
final
String
tag
=
getTag
(
true
);
final
String
tag
=
getTag
(
true
);
if
(!
request
.
url
().
toString
().
contains
(
"writeMaiDianData"
)){
//
if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils
.
debugInfo
(
tag
,
REQUEST_UP_LINE
);
NetLogUtils
.
debugInfo
(
tag
,
REQUEST_UP_LINE
);
logLines
(
tag
,
new
String
[]{
URL_TAG
+
request
.
url
()},
false
);
logLines
(
tag
,
new
String
[]{
URL_TAG
+
request
.
url
()},
false
);
logLines
(
tag
,
getRequest
(
request
),
true
);
logLines
(
tag
,
getRequest
(
request
),
true
);
logLines
(
tag
,
OMITTED_REQUEST
,
true
);
logLines
(
tag
,
OMITTED_REQUEST
,
true
);
NetLogUtils
.
debugInfo
(
tag
,
END_LINE
);
NetLogUtils
.
debugInfo
(
tag
,
END_LINE
);
}
//
}
}
}
...
@@ -93,7 +96,7 @@ public class DefaultFormatPrinter {
...
@@ -93,7 +96,7 @@ public class DefaultFormatPrinter {
* @param message 响应信息
* @param message 响应信息
* @param responseUrl 请求地址
* @param responseUrl 请求地址
*/
*/
public
void
printJsonResponse
(
long
chainMs
,
boolean
isSuccessful
,
int
code
,
@NonNull
String
headers
,
@Nullable
MediaType
contentType
,
public
void
printJsonResponse
(
long
chainMs
,
boolean
isSuccessful
,
int
code
,
@NonNull
String
headers
,
@Nullable
MediaType
contentType
,
@Nullable
String
bodyString
,
@NonNull
List
<
String
>
segments
,
@NonNull
String
message
,
@NonNull
final
String
responseUrl
)
{
@Nullable
String
bodyString
,
@NonNull
List
<
String
>
segments
,
@NonNull
String
message
,
@NonNull
final
String
responseUrl
)
{
bodyString
=
RequestLogInterceptor
.
isJson
(
contentType
)
?
CharacterHandler
.
jsonFormat
(
bodyString
)
bodyString
=
RequestLogInterceptor
.
isJson
(
contentType
)
?
CharacterHandler
.
jsonFormat
(
bodyString
)
...
@@ -102,13 +105,13 @@ public class DefaultFormatPrinter {
...
@@ -102,13 +105,13 @@ public class DefaultFormatPrinter {
final
String
responseBody
=
LINE_SEPARATOR
+
BODY_TAG
+
LINE_SEPARATOR
+
bodyString
;
final
String
responseBody
=
LINE_SEPARATOR
+
BODY_TAG
+
LINE_SEPARATOR
+
bodyString
;
final
String
tag
=
getTag
(
false
);
final
String
tag
=
getTag
(
false
);
final
String
[]
urlLine
=
{
URL_TAG
+
responseUrl
,
N
};
final
String
[]
urlLine
=
{
URL_TAG
+
responseUrl
,
N
};
if
(!
responseUrl
.
contains
(
"writeMaiDianData"
))
{
// if (!responseUrl.contains("writeMaiDianData"))
{
NetLogUtils
.
debugInfo
(
tag
,
RESPONSE_UP_LINE
);
NetLogUtils
.
debugInfo
(
tag
,
RESPONSE_UP_LINE
);
logLines
(
tag
,
urlLine
,
true
);
logLines
(
tag
,
urlLine
,
true
);
logLines
(
tag
,
getResponse
(
headers
,
chainMs
,
code
,
isSuccessful
,
segments
,
message
),
true
);
logLines
(
tag
,
getResponse
(
headers
,
chainMs
,
code
,
isSuccessful
,
segments
,
message
),
true
);
logLines
(
tag
,
responseBody
.
split
(
LINE_SEPARATOR
),
true
);
logLines
(
tag
,
responseBody
.
split
(
LINE_SEPARATOR
),
true
);
NetLogUtils
.
debugInfo
(
tag
,
END_LINE
);
NetLogUtils
.
debugInfo
(
tag
,
END_LINE
);
}
//
}
}
}
/**
/**
...
@@ -122,18 +125,18 @@ public class DefaultFormatPrinter {
...
@@ -122,18 +125,18 @@ public class DefaultFormatPrinter {
* @param message 响应信息
* @param message 响应信息
* @param responseUrl 请求地址
* @param responseUrl 请求地址
*/
*/
public
void
printFileResponse
(
long
chainMs
,
boolean
isSuccessful
,
int
code
,
@NonNull
String
headers
,
public
void
printFileResponse
(
long
chainMs
,
boolean
isSuccessful
,
int
code
,
@NonNull
String
headers
,
@NonNull
List
<
String
>
segments
,
@NonNull
String
message
,
@NonNull
final
String
responseUrl
)
{
@NonNull
List
<
String
>
segments
,
@NonNull
String
message
,
@NonNull
final
String
responseUrl
)
{
final
String
tag
=
getTag
(
false
);
final
String
tag
=
getTag
(
false
);
final
String
[]
urlLine
=
{
URL_TAG
+
responseUrl
,
N
};
final
String
[]
urlLine
=
{
URL_TAG
+
responseUrl
,
N
};
if
(!
responseUrl
.
contains
(
"writeMaiDianData"
))
{
// if (!responseUrl.contains("writeMaiDianData"))
{
NetLogUtils
.
debugInfo
(
tag
,
RESPONSE_UP_LINE
);
NetLogUtils
.
debugInfo
(
tag
,
RESPONSE_UP_LINE
);
logLines
(
tag
,
urlLine
,
true
);
logLines
(
tag
,
urlLine
,
true
);
logLines
(
tag
,
getResponse
(
headers
,
chainMs
,
code
,
isSuccessful
,
segments
,
message
),
true
);
logLines
(
tag
,
getResponse
(
headers
,
chainMs
,
code
,
isSuccessful
,
segments
,
message
),
true
);
logLines
(
tag
,
OMITTED_RESPONSE
,
true
);
logLines
(
tag
,
OMITTED_RESPONSE
,
true
);
NetLogUtils
.
debugInfo
(
tag
,
END_LINE
);
NetLogUtils
.
debugInfo
(
tag
,
END_LINE
);
}
//
}
}
}
/**
/**
...
@@ -157,7 +160,7 @@ public class DefaultFormatPrinter {
...
@@ -157,7 +160,7 @@ public class DefaultFormatPrinter {
}
}
private
static
ThreadLocal
<
Integer
>
last
=
new
ThreadLocal
<
Integer
>()
{
private
static
ThreadLocal
<
Integer
>
last
=
new
ThreadLocal
<
Integer
>()
{
protected
Integer
initialValue
()
{
protected
Integer
initialValue
()
{
return
0
;
return
0
;
}
}
...
...
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