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
75b25194
Commit
75b25194
authored
Jul 01, 2022
by
范玉宾
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'd/v4.3.99' into 'feat/lancet/review_2.0'
# Conflicts: # config.gradle
parents
31075c3f
c5637804
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
796 additions
and
235 deletions
+796
-235
JsMethod.kt
app/src/main/java/com/ydl/component/service/web/JsMethod.kt
+3
-3
WVClickAbstractListener.java
app/src/main/java/com/ydl/component/service/web/WVClickAbstractListener.java
+9
-0
WebJavascriptHandler.kt
app/src/main/java/com/ydl/component/service/web/WebJavascriptHandler.kt
+3
-0
WebViewClientClickListener.java
app/src/main/java/com/ydl/component/service/web/WebViewClientClickListener.java
+2
-0
config.gradle
config.gradle
+20
-22
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+4
-0
AudioImIn.kt
m-audioim/src/main/java/com/ydl/audioim/router/AudioImIn.kt
+4
-1
ConfideBottomSheetDialogFragment.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideBottomSheetDialogFragment.kt
+9
-3
DialStatus.kt
m-confide/src/main/java/com/ydl/confide/home/bean/DialStatus.kt
+1
-0
ItemIntroHolder.kt
m-confide/src/main/java/com/ydl/confide/intro/ItemIntroHolder.kt
+23
-12
ExpertSearchPresenter.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchPresenter.kt
+3
-6
HotSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/HotSearchActivity.kt
+0
-0
FilterPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
+26
-11
consultant_ui_region_popup_window.xml
m-consultant/src/main/res/layout/consultant_ui_region_popup_window.xml
+2
-2
MembersActivity.java
m-dynamic/src/main/java/com/yidianling/dynamic/members/MembersActivity.java
+1
-1
TrendsListFragment.kt
m-dynamic/src/main/java/com/yidianling/dynamic/trendList/TrendsListFragment.kt
+7
-7
dynamic_fragment_trends_list.xml
m-dynamic/src/main/res/layout/dynamic_fragment_trends_list.xml
+34
-48
YdlHomeFragment.kt
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
+7
-1
home_fragment.xml
m-home/src/ydl/res/layout/home_fragment.xml
+3
-3
build.gradle
m-im/build.gradle
+1
-1
SessionHelper.java
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
+2
-2
MsgListAdapter.java
m-im/src/main/java/com/yidianling/im/ui/adapter/MsgListAdapter.java
+4
-0
YDLP2PMessageActivity.java
m-im/src/main/java/com/yidianling/uikit/business/session/activity/YDLP2PMessageActivity.java
+3
-2
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+18
-10
AndroidManifest.xml
m-tests/src/main/AndroidManifest.xml
+3
-0
TestListCommand.kt
m-tests/src/main/java/com/yidianling/tests/list/model/TestListCommand.kt
+3
-0
TestCategoryListActivity.kt
m-tests/src/main/java/com/yidianling/tests/list/view/TestCategoryListActivity.kt
+82
-44
TestListRecyclerAdapter.kt
m-tests/src/main/java/com/yidianling/tests/list/view/adapter/TestListRecyclerAdapter.kt
+2
-2
TestSearchActivity.kt
m-tests/src/main/java/com/yidianling/tests/search/TestSearchActivity.kt
+33
-13
TestSearchKeyActivity.kt
m-tests/src/main/java/com/yidianling/tests/search/TestSearchKeyActivity.kt
+291
-0
TestSearchPresenter.kt
m-tests/src/main/java/com/yidianling/tests/search/TestSearchPresenter.kt
+2
-1
tests_bg_indicator_search.xml
m-tests/src/main/res/drawable/tests_bg_indicator_search.xml
+13
-0
tests_testhome_recom_price_red_bg.xml
m-tests/src/main/res/drawable/tests_testhome_recom_price_red_bg.xml
+6
-0
tests_activity_test_category_list.xml
m-tests/src/main/res/layout/tests_activity_test_category_list.xml
+28
-35
tests_activity_test_key_search.xml
m-tests/src/main/res/layout/tests_activity_test_key_search.xml
+107
-0
tests_item_category_testlist_view.xml
m-tests/src/main/res/layout/tests_item_category_testlist_view.xml
+1
-1
tests_testlist_item_view.xml
m-tests/src/main/res/layout/tests_testlist_item_view.xml
+1
-1
styles.xml
m-tests/src/main/res/values/styles.xml
+6
-0
DatePickerDialogFragment.java
m-user/src/main/java/com/yidianling/user/mine/DatePickerDialogFragment.java
+15
-3
StatusBarUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/StatusBarUtils.kt
+14
-0
No files found.
app/src/main/java/com/ydl/component/service/web/JsMethod.kt
View file @
75b25194
...
...
@@ -36,12 +36,12 @@ class JsMethod {
return
true
}
"show_loading"
->
{
val
topActivity
=
BaseActivityMgr
.
INST
.
getTopActivity
()
Loading
.
show
(
topActivity
)
//
val topActivity = BaseActivityMgr.INST.getTopActivity()
//
Loading.show(topActivity)
return
true
}
"close_loading"
->
{
Loading
.
close
()
//
Loading.close()
return
true
}
"open_app_eval_list"
->{
...
...
app/src/main/java/com/ydl/component/service/web/WVClickAbstractListener.java
View file @
75b25194
...
...
@@ -490,6 +490,15 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
}
@Override
public
void
switchPushStatus
(
H5JsBean
.
H5JsCmd
.
Params
params
)
{
if
(
params
.
getSwitchStatus
()
==
1
)
{
// MsgPushLifecycle.Companion.setH5Open(true);
}
else
{
// MsgPushLifecycle.Companion.setH5Open(false);
}
}
@Override
public
void
switchSound
(
int
mediaId
,
long
meditationId
,
int
meditationType
,
int
businessType
,
String
buried
,
String
mediaUrl
,
String
mediaCoverUrl
,
String
title
,
String
desc
,
int
status
)
{
...
...
app/src/main/java/com/ydl/component/service/web/WebJavascriptHandler.kt
View file @
75b25194
...
...
@@ -460,6 +460,9 @@ class WebJavascriptHandler : IJavascriptHandler{
findRouteService
(
IConfideService
::
class
.
java
).
showExpertDetailDialog
(
topActivity
,
url
,
doctorId
,
uid
?:
""
)
}
}
"switch_push_status"
->
{
wvEnventPro
?.
switchPushStatus
(
jsData
.
cmd
?.
params
)
}
}
}
...
...
app/src/main/java/com/ydl/component/service/web/WebViewClientClickListener.java
View file @
75b25194
...
...
@@ -201,4 +201,6 @@ public interface WebViewClientClickListener {
void
getNextExpertStatus
(
String
doctorID
,
String
title
,
String
uid
,
String
linkUrl
);
//h5页面是否需要打开推送
void
switchPushStatus
(
H5JsBean
.
H5JsCmd
.
Params
params
);
}
config.gradle
View file @
75b25194
ext
{
kotlin_version
=
"1.3.21"
dev_mode
=
false
dev_mode
=
false
//组件发布的时候需要设置为false
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.50.4
4
"
,
"m-consultant"
:
"0.0.60.
68
"
,
"m-confide"
:
"0.0.50.4
5
"
,
"m-consultant"
:
"0.0.60.
73
"
,
"m-fm"
:
"0.0.30.09"
,
"m-user"
:
"0.0.62.71"
,
"m-home"
:
"0.0.23.9
5
"
,
"m-im"
:
"0.0.21.6
4
"
,
"m-dynamic"
:
"0.0.7.7
4
"
,
"m-home"
:
"0.0.23.9
8
"
,
"m-im"
:
"0.0.21.6
6
"
,
"m-dynamic"
:
"0.0.7.7
9
"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.84"
,
"m-tests"
:
"0.0.24.
18
"
,
"m-tests"
:
"0.0.24.
21
"
,
"m-course"
:
"0.0.43.39"
,
...
...
@@ -23,7 +23,7 @@ ext {
//mdt 组件
"ydl-tuicore"
:
"0.0.25"
,
//第一步
"ydl-platform"
:
"0.0.41.
48
"
,
"ydl-platform"
:
"0.0.41.
50
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.99"
,
...
...
@@ -31,7 +31,7 @@ ext {
"ydl-pay"
:
"0.0.18.21"
,
"m-audioim"
:
"0.0.49.30.23"
,
"ydl-flutter-base"
:
"0.0.14.
38
"
,
"ydl-flutter-base"
:
"0.0.14.
40
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
@@ -91,33 +91,31 @@ ext {
ydlCompileVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.50.4
4
"
,
"m-consultant"
:
"0.0.60.
68
"
,
"m-confide"
:
"0.0.50.4
5
"
,
"m-consultant"
:
"0.0.60.
73
"
,
"m-fm"
:
"0.0.30.09"
,
"m-user"
:
"0.0.62.71"
,
"m-home"
:
"0.0.23.9
5
"
,
"m-im"
:
"0.0.21.6
4
"
,
"m-dynamic"
:
"0.0.7.7
4
"
,
"m-home"
:
"0.0.23.9
8
"
,
"m-im"
:
"0.0.21.6
6
"
,
"m-dynamic"
:
"0.0.7.7
9
"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.84"
,
"m-tests"
:
"0.0.24.
18
"
,
"m-tests"
:
"0.0.24.
21
"
,
"m-course"
:
"0.0.43.39"
,
//-------------- 功能组件 --------------
//mdt 组件
"ydl-tuicore"
:
"0.0.25"
,
//第一步
"ydl-platform"
:
"0.0.41.48"
,
"ydl-platform"
:
"0.0.41.50"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.99"
,
"ydl-media"
:
"0.0.21.52"
,
"ydl-pay"
:
"0.0.18.21"
,
"m-audioim"
:
"0.0.49.30.23"
,
"ydl-flutter-base"
:
"0.0.14.
38
"
,
"ydl-flutter-base"
:
"0.0.14.
40
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
@@ -264,7 +262,7 @@ ext {
"ydl-pushagent"
:
"com.ydl:pushagent:0.1.1"
,
"ydl-notracepoint"
:
"com.ydl:notracepoint-lib:0.2.3.3@aar"
,
"ydl-js"
:
"com.ydl:ydl-js:1.0.7-SNAPSHOT@aar"
,
"ydl-router"
:
"com.ydl:ydl-router:1.4.
2
"
,
"ydl-router"
:
"com.ydl:ydl-router:1.4.
4
"
,
"xrecyclerview"
:
"com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar"
,
"mmkv"
:
"com.tencent:mmkv-static:1.2.6"
,
"arouter-api"
:
"com.alibaba:arouter-api:1.4.1"
,
...
...
@@ -283,7 +281,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base"
:
"com.ydl:ydl-flutter-base:${ydlCompileVersion["
ydl
-
flutter
-
base
"]}"
,
//组件化项目中的flutter base模块
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.4
4
@aar"
,
//flutter aar
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.4
6
@aar"
,
//flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号
...
...
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
75b25194
...
...
@@ -33,6 +33,7 @@ import com.ydl.audioim.http.command.NoticePushCommand
import
com.ydl.audioim.http.command.PayLoad
import
com.ydl.audioim.player.AudioPlayer
import
com.ydl.audioim.presenter.AudioHomePresenterImpl
import
com.ydl.audioim.router.AudioImIn
import
com.ydl.audioim.utils.AudioLogUtils
import
com.ydl.audioim.utils.DateUtils
import
com.ydl.audioim.utils.onConfideEvent
...
...
@@ -636,6 +637,9 @@ class AudioHomeActivity :
private
fun
setClickEvent
()
{
//跳转客服小壹
jump_kefu
.
setOnClickListener
{
if
(!
AudioImIn
.
getUserService
().
loginByOneKeyLogin
(
this
@AudioHomeActivity
,
true
))
{
return
@setOnClickListener
}
val
imService
=
ARouter
.
getInstance
().
navigation
(
IImService
::
class
.
java
)
imService
?.
startKefuChat
(
this
,
""
,
0
,
0
)
}
...
...
m-audioim/src/main/java/com/ydl/audioim/router/AudioImIn.kt
View file @
75b25194
...
...
@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import
com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack
import
com.yidianling.im.api.bean.IMSendCustomNotificationResultCallBack
import
com.yidianling.im.api.service.IImService
import
com.yidianling.user.api.service.IUserService
/**
...
...
@@ -17,7 +18,9 @@ object AudioImIn {
private
fun
getImService
():
IImService
{
return
ModularServiceManager
.
provide
(
IImService
::
class
.
java
)
}
fun
getUserService
():
IUserService
{
return
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
)
}
/**
* 发送自定义通知
*/
...
...
m-confide/src/main/java/com/ydl/confide/home/ConfideBottomSheetDialogFragment.kt
View file @
75b25194
...
...
@@ -145,7 +145,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
uid
=
arguments
?.
getString
(
KEY_UID
)
listen_free
=
arguments
?.
getBoolean
(
KEY_LISTEN_FREE
)
?:
false
onLoadDialStatus
(
doctorId
)
// +
wv_content
=
view
.
findViewById
<
ProgressWebView
>(
com
.
ydl
.
webview
.
R
.
id
.
wv_content
)
wv_content
.
progressbar
.
visibility
=
View
.
GONE
close_webview_Icon
=
view
.
findViewById
<
View
>(
R
.
id
.
close_webview_Icon
)
...
...
@@ -392,7 +391,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
layout_change_text
.
visibility
=
View
.
VISIBLE
this
.
doctorId
=
doctorId
onLoadDialStatus
(
doctorId
)
this
.
expertUrl
=
linkUrl
callJsFun
(
wv_content
,
"setUnRead(${getUnReadByUid(uid = uid)})"
)
}
...
...
@@ -449,6 +447,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
override
fun
onProgressChanged
(
view
:
WebView
,
newProgress
:
Int
)
{
if
(
newProgress
==
100
)
{
wv_content
.
progressbar
.
visibility
=
View
.
GONE
}
else
{
if
(
wv_content
.
progressbar
.
visibility
==
View
.
GONE
)
{
wv_content
.
progressbar
.
visibility
=
View
.
VISIBLE
}
wv_content
.
progressbar
.
progress
=
newProgress
}
if
(
newProgress
==
100
)
{
callJsFun
(
wv_content
,
"setUnRead(${uid?.let { getUnReadByUid(uid = it) }})"
)
}
super
.
onProgressChanged
(
view
,
newProgress
)
...
...
@@ -582,7 +588,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
if
(
resp
.
code
==
"200"
)
{
layoutCall
.
visibility
=
View
.
VISIBLE
lineStatus
=
resp
.
data
?.
confideLine
?:
2
expertUrl
=
resp
.
data
?.
linkUrl
?:
""
if
(
isLogin
&&
listen_free
)
{
free
.
visibility
=
View
.
VISIBLE
val
controller
:
DraweeController
=
Fresco
.
newDraweeControllerBuilder
()
...
...
m-confide/src/main/java/com/ydl/confide/home/bean/DialStatus.kt
View file @
75b25194
...
...
@@ -2,6 +2,7 @@ package com.ydl.confide.home.bean
class
DialStatus
{
var
confideLine
:
Int
?
=
null
var
linkUrl
:
String
?
=
""
var
remainingTime
:
RemainingTime
?
=
null
}
...
...
m-confide/src/main/java/com/ydl/confide/intro/ItemIntroHolder.kt
View file @
75b25194
...
...
@@ -82,20 +82,24 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
val
status
=
item
.
lineStatus
.
get
()
when
(
status
)
{
5
->
{
if
(!
TextUtils
.
isEmpty
(
item
.
linkedUrl
.
get
())){
if
(!
TextUtils
.
isEmpty
(
item
.
linkedUrl
.
get
()))
{
val
linkUri
=
Uri
.
parse
(
item
.
linkedUrl
.
get
())
if
(
linkUri
!=
null
)
{
val
host
=
linkUri
.
host
if
(!
TextUtils
.
isEmpty
(
host
)
&&
host
==
"h5"
)
{
//如果是h5,跳转至NewH5Activity
try
{
var
params
=
URLDecoder
.
decode
(
linkUri
.
getQueryParameter
(
"params"
),
"UTF-8"
)
ARouter
.
getInstance
().
build
(
"/new_h5/h5"
).
withSerializable
(
"routerParam"
,
params
).
navigation
()
}
catch
(
e
:
NullPointerException
){
var
params
=
URLDecoder
.
decode
(
linkUri
.
getQueryParameter
(
"params"
),
"UTF-8"
)
ARouter
.
getInstance
().
build
(
"/new_h5/h5"
)
.
withSerializable
(
"routerParam"
,
params
).
navigation
()
}
catch
(
e
:
NullPointerException
)
{
com
.
yidianling
.
common
.
tools
.
LogUtil
.
e
(
"params参数为空"
)
}
catch
(
e
:
UnsupportedEncodingException
)
{
}
catch
(
e
:
UnsupportedEncodingException
)
{
com
.
yidianling
.
common
.
tools
.
LogUtil
.
e
(
"解码错误"
)
}
catch
(
e
:
UnsupportedOperationException
)
{
}
catch
(
e
:
UnsupportedOperationException
)
{
com
.
yidianling
.
common
.
tools
.
LogUtil
.
e
(
"这不是一个uri格式的地址"
)
}
}
...
...
@@ -118,7 +122,12 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
else
->
{
if
(!
item
.
confideId
.
isNullOrBlank
())
{
ConfideWebServiceImpl
().
connectionJava
(
item
.
confideId
!!
.
toInt
(),
3
,
it
.
context
as
Activity
,
null
)
{
ConfideWebServiceImpl
().
connectionJava
(
item
.
confideId
!!
.
toInt
(),
3
,
it
.
context
as
Activity
,
null
)
{
showDoctorDetail
(
item
,
true
)
}
}
...
...
@@ -165,7 +174,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
item
.
confideId
?:
""
,
"4"
)
showDoctorDetail
(
item
,
false
)
showDoctorDetail
(
item
,
false
)
}
binding
.
ivAvatar
.
setOnClickListener
{
ActionCountUtils
.
record
(
...
...
@@ -181,7 +190,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
item
.
confideId
?:
""
,
"3"
)
showDoctorDetail
(
item
,
false
)
showDoctorDetail
(
item
,
false
)
}
binding
.
vDisableClick
.
setOnClickListener
{
}
binding
.
btnShare
.
setOnClickListener
{
...
...
@@ -363,16 +372,18 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
disposable
?.
dispose
()
}
private
fun
showDoctorDetail
(
item
:
VideoViewModel
,
toPay
:
Boolean
)
{
private
fun
showDoctorDetail
(
item
:
VideoViewModel
,
toPay
:
Boolean
)
{
item
.
confideId
?.
let
{
val
url
=
HttpConfig
.
MH5_URL
+
ConfideRoute
.
h5ConfideIntro
(
it
)+
if
(
toPay
)
"&payPage=1"
else
""
val
url
=
HttpConfig
.
MH5_URL
+
ConfideRoute
.
h5ConfideIntro
(
it
)
+
if
(
toPay
)
"&payPage=1"
else
""
ConfideBottomSheetDialogFragment
()
.
showBottomSheetDialog
(
itemView
.
context
as
FragmentActivity
,
url
,
item
.
doctorId
!!
,
uid
=
item
.
uid
,
listenFree
=
item
.
listenFree
.
get
()
listenFree
=
item
.
listenFree
.
get
(),
expertUrl
=
item
.
linkedUrl
.
get
()
?:
""
)
}
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchPresenter.kt
View file @
75b25194
...
...
@@ -61,7 +61,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
if
(
allFilter
.
categoryId2List
.
size
>
0
){
val
categoryMap2
=
HashMap
<
String
,
Any
>()
val
categoryIdMap2
=
HashMap
<
String
,
Any
>()
categoryIdMap2
[
"in"
]
=
allFilter
.
categoryId2List
categoryIdMap2
[
"in"
]
=
allFilter
.
categoryId2List
.
toSortedSet
().
toList
()
categoryMap2
[
"product_cates.category_id2"
]
=
categoryIdMap2
categoryList
.
add
(
categoryMap2
)
}
...
...
@@ -69,7 +69,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
if
(
allFilter
.
categoryId3List
.
size
>
0
){
val
categoryMap3
=
HashMap
<
String
,
Any
>()
val
categoryIdMap3
=
HashMap
<
String
,
Any
>()
categoryIdMap3
[
"in"
]
=
allFilter
.
categoryId3List
categoryIdMap3
[
"in"
]
=
allFilter
.
categoryId3List
.
toSortedSet
().
toList
()
categoryMap3
[
"product_cates.category_id3"
]
=
categoryIdMap3
categoryList
.
add
(
categoryMap3
)
}
...
...
@@ -105,7 +105,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
val
wayMap
=
HashMap
<
String
,
Any
>()
wayMap
[
"in"
]
=
way
filterMap
[
"
service_type_list.service_type
"
]
=
wayMap
filterMap
[
"
product_specs.spec_id
"
]
=
wayMap
}
// 服务均价
if
(
allFilter
.
priceRanges
!=
null
)
{
...
...
@@ -187,9 +187,6 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
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
...
...
m-consultant/src/main/java/com/yidianling/consultant/HotSearchActivity.kt
View file @
75b25194
This diff is collapsed.
Click to expand it.
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
View file @
75b25194
...
...
@@ -37,7 +37,11 @@ import kotlin.math.roundToInt
* 筛选弹窗
* Created by zqk on 17-9-15.
*/
class
FilterPopupWindow
(
private
val
context
:
Context
,
private
val
filterData
:
Filters
,
private
val
tempFilter
:
AllFilter
)
:
PopupWindow
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
{
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
mDisposableList
=
CompositeDisposable
()
...
...
@@ -139,7 +143,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
tempFilter
.
showType
=
filterData
.
showType
[
0
]
tempFilter
.
ages
.
clear
()
tempFilter
.
doctorEdu
.
clear
()
tempFilter
.
enquiries
.
clear
()
// 擅长人群
tempFilter
.
specialityCrowd
.
clear
()
tempFilter
.
others
.
clear
()
...
...
@@ -158,17 +161,26 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
showTypeViews
[
1
].
isSelected
=
true
for
(
v
in
enquiryViews
)
{
v
.
isSelected
=
false
if
(
v
is
TextView
)
{
v
.
paint
.
isFakeBoldText
=
false
val
textView
:
TextView
=
v
.
findViewById
(
R
.
id
.
tvFilterName
)
val
ivIcon
:
ImageView
=
v
.
findViewById
(
R
.
id
.
iv_consultant_method
)
textView
.
paint
.
isFakeBoldText
=
false
tempFilter
.
enquiries
.
forEach
{
if
(
textView
.
text
.
toString
()
==
it
.
value
)
{
Glide
.
with
(
context
)
.
load
(
it
.
unCheckUrl
)
.
into
(
ivIcon
)
}
}
}
tempFilter
.
enquiries
.
clear
()
for
(
v
in
ageViews
)
{
v
.
isSelected
=
false
if
(
v
is
TextView
)
{
v
.
paint
.
isFakeBoldText
=
false
}
}
for
(
v
in
goodAtViews
){
for
(
v
in
goodAtViews
)
{
v
.
isSelected
=
false
v
.
paint
.
isFakeBoldText
=
false
}
...
...
@@ -325,6 +337,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
fun
addSubscription
(
disposable
:
Disposable
)
{
mDisposableList
.
add
(
disposable
)
}
/**
* 其他选择
* */
...
...
@@ -413,13 +426,13 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
if
(
text
==
"展开"
)
{
view
.
tv_crowd_open
.
text
=
"收起"
view
.
iv_crowd_open
.
setImageResource
(
R
.
drawable
.
ic_crowd_close
)
for
(
i
in
20
until
goodAtViews
.
size
){
for
(
i
in
20
until
goodAtViews
.
size
)
{
goodAtViews
[
i
].
visibility
=
View
.
VISIBLE
}
}
else
{
view
.
tv_crowd_open
.
text
=
"展开"
view
.
iv_crowd_open
.
setImageResource
(
R
.
drawable
.
ic_crowd_open
)
for
(
i
in
20
until
goodAtViews
.
size
){
for
(
i
in
20
until
goodAtViews
.
size
)
{
goodAtViews
[
i
].
visibility
=
View
.
GONE
}
}
...
...
@@ -452,7 +465,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
}
}
if
(
index
>
19
)
{
if
(
index
>
19
)
{
textView
.
visibility
=
View
.
GONE
}
goodAtViews
.
add
(
textView
)
...
...
@@ -460,6 +473,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
}
}
/**
* 年龄
* */
...
...
@@ -500,6 +514,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
view
.
flAge
.
addView
(
textView
)
}
}
/**
* 学历
* */
...
...
@@ -545,8 +560,8 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
val
mWidth
=
(
popWidth
-
RxImageTool
.
dp2px
(
52f
))
/
enquirySize
for
((
index
,
enquiry
)
in
filterData
.
enquiry
.
withIndex
())
{
val
llLayout
=
View
.
inflate
(
context
,
R
.
layout
.
consultant_method_item_filter
,
null
)
val
textView
:
TextView
=
llLayout
.
findViewById
(
R
.
id
.
tvFilterName
)
val
ivIcon
:
ImageView
=
llLayout
.
findViewById
(
R
.
id
.
iv_consultant_method
)
val
textView
:
TextView
=
llLayout
.
findViewById
(
R
.
id
.
tvFilterName
)
val
ivIcon
:
ImageView
=
llLayout
.
findViewById
(
R
.
id
.
iv_consultant_method
)
val
params
=
FrameLayout
.
LayoutParams
(
mWidth
,
RxImageTool
.
dp2px
(
36f
))
val
marginNum
=
RxImageTool
.
dp2px
(
5f
)
params
.
setMargins
(
...
...
@@ -561,7 +576,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
.
load
(
enquiry
.
unCheckUrl
)
.
into
(
ivIcon
)
enquiryViews
.
add
(
view
)
enquiryViews
.
add
(
llLayout
)
if
(
tempFilter
.
enquiries
.
contains
(
enquiry
))
{
llLayout
.
isSelected
=
true
textView
.
paint
.
isFakeBoldText
=
true
...
...
m-consultant/src/main/res/layout/consultant_ui_region_popup_window.xml
View file @
75b25194
...
...
@@ -6,7 +6,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvRegion"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"match_parent"
android:background=
"@color/platform_white"
android:layout_weight=
"1"
...
...
@@ -15,7 +15,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvSub"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"match_parent"
android:background=
"@color/platform_color_F7F7F7"
android:layout_weight=
"2"
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/members/MembersActivity.java
View file @
75b25194
...
...
@@ -137,7 +137,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
initListeners
();
// initDatas();
setTabSelection
(
0
);
StatusBarUtils
.
Companion
.
setCustomStatusView
(
this
,
members_title_rel
,
true
);
StatusBarUtils
.
Companion
.
setCustomStatusView
ForMembers
(
this
,
members_title_rel
,
true
);
}
private
void
initEvent
()
{
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/trendList/TrendsListFragment.kt
View file @
75b25194
...
...
@@ -37,6 +37,7 @@ import com.yidianling.dynamic.trendList.adapter.RecommendTopicListAdapter
import
com.yidianling.dynamic.trendList.adapter.TrendsListAdapter
import
com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTER_STATE_NO_DATA
import
com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTRE_STATE_LOAD_MORE
import
com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTRE_STATE_INIT
import
com.yidianling.dynamic.trendsDetail.TrendsDetailActivity
import
com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import
io.reactivex.android.schedulers.AndroidSchedulers
...
...
@@ -428,17 +429,13 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
if
(
trend_list_no_datas_rel
!!
.
visibility
!=
View
.
GONE
)
{
trend_list_no_datas_rel
!!
.
visibility
=
View
.
GONE
}
if
(
cdl
!!
.
visibility
!=
View
.
VISIBLE
)
{
cdl
!!
.
visibility
=
View
.
VISIBLE
}
}
private
fun
showErrorView
()
{
if
(
page
==
1
)
{
cdl
!!
.
visibility
=
View
.
GONE
trend_list_no_datas_rel
!!
.
visibility
=
View
.
VISIBLE
}
else
{
cdl
!!
.
visibility
=
View
.
VISIBLE
trend_list_no_datas_rel
!!
.
visibility
=
View
.
GONE
}
}
...
...
@@ -590,8 +587,11 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
}
else
{
LogUtil
.
i
(
"get datas no more data$data"
)
trendsDatas
!!
.
addAll
(
data
)
if
(
trendsDatas
==
null
||
trendsDatas
!!
.
size
<=
0
)
{
cdl
!!
.
visibility
=
View
.
GONE
if
(
trendsDatas
==
null
||
trendsDatas
!!
.
size
==
0
)
{
mRcvAdapter
!!
.
setDatas
(
trendsDatas
,
FOOTRE_STATE_INIT
)
if
(
page
==
1
)
{
mRcvAdapter
!!
.
notifyDataSetChanged
()
}
trend_list_no_datas_rel
!!
.
visibility
=
View
.
VISIBLE
return
}
...
...
m-dynamic/src/main/res/layout/dynamic_fragment_trends_list.xml
View file @
75b25194
<?xml version="1.0" encoding="utf-8"?>
<com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/trends_lastr_swl"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<
Linea
rLayout
<
androidx.coordinatorlayout.widget.Coordinato
rLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
android:layout_alignParentTop=
"true"
android:orientation=
"vertical"
android:background=
"@color/dynamic_white"
>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id=
"@+id/cdl"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/trends_rcv"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/dynamic_f5f5f5"
android:descendantFocusability=
"blocksDescendants"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
<RelativeLayout
android:id=
"@+id/trend_list_no_datas_rel"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_centerInParent=
"true"
android:gravity=
"center"
android:visibility=
"gone"
>
<ImageView
android:id=
"@+id/trend_list_no_datas_iv"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:layout_centerHorizontal=
"true"
android:src=
"@drawable/dynamic_blank"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/trend_list_no_datas_iv"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"15dp"
android:text=
"暂无相关记录~"
android:textColor=
"@color/dynamic_text_gray"
/>
</RelativeLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id=
"@+id/image_scroll_top"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"85dp"
android:layout_marginRight=
"28dp"
android:padding=
"0
dp"
android:layout_marginBottom=
"85
dp"
android:background=
"@color/dynamic_white"
android:padding=
"0dp"
android:scaleType=
"center"
android:src=
"@drawable/dynamic_newsfeed_top"
android:visibility=
"visible"
app:backgroundTint=
"@color/dynamic_white"
app:borderWidth=
"0dp"
app:fabSize=
"mini"
android:scaleType=
"center"
app:layout_anchor=
"@+id/trends_rcv"
app:layout_anchorGravity=
"bottom|right|end"
app:layout_behavior=
"com.yidianling.dynamic.common.behavior.ScrollAwareFABBehavior"
/>
app:layout_behavior=
"com.yidianling.dynamic.common.behavior.ScrollAwareFABBehavior"
/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id=
"@+id/recommend_trend_add_iv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"20dp"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"20dp"
android:background=
"@color/platform_main_theme"
android:elevation=
"3dp"
android:padding=
"0dp"
...
...
@@ -60,37 +75,9 @@
app:borderWidth=
"0dp"
app:fabSize=
"normal"
app:layout_anchor=
"@+id/trends_rcv"
app:layout_anchorGravity=
"bottom|right|end"
/>
app:layout_anchorGravity=
"bottom|right|end"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<RelativeLayout
android:id=
"@+id/trend_list_no_datas_rel"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_centerInParent=
"true"
android:gravity=
"center"
android:visibility=
"gone"
>
<ImageView
android:id=
"@+id/trend_list_no_datas_iv"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:layout_centerHorizontal=
"true"
android:src=
"@drawable/dynamic_blank"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/trend_list_no_datas_iv"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"15dp"
android:text=
"暂无相关记录~"
android:textColor=
"@color/dynamic_text_gray"
/>
</RelativeLayout>
</LinearLayout>
</com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout>
\ No newline at end of file
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
View file @
75b25194
...
...
@@ -176,7 +176,13 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
if
(!
TextUtils
.
isEmpty
(
doctorName
))
{
searchText
=
doctorName
}
home_tv
.
setOnClickListener
{
homeEvent
?.
searchTvClick
(
searchText
)
}
home_tv
.
setOnClickListener
{
homeEvent
?.
searchTvClick
(
searchText
)
}
iv_search_icon
.
setOnClickListener
{
homeEvent
?.
searchTvClick
(
searchText
)
}
home_tv
.
text
=
searchText
}
...
...
m-home/src/ydl/res/layout/home_fragment.xml
View file @
75b25194
...
...
@@ -154,10 +154,10 @@
<ImageView
android:id=
"@+id/iv_search_icon"
android:layout_width=
"
12dp
"
android:layout_height=
"
12dp
"
android:layout_width=
"
@dimen/platform_dp_26
"
android:layout_height=
"
@dimen/platform_dp_14
"
android:layout_gravity=
"center_vertical"
android:
layout_margin
Left=
"12dp"
android:
padding
Left=
"12dp"
android:src=
"@drawable/home_icon_search"
/>
<TextView
...
...
m-im/build.gradle
View file @
75b25194
...
...
@@ -84,7 +84,7 @@ dependencies {
androidTestImplementation
'androidx.test.espresso:espresso-core:3.1.0'
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
kapt
'com.alibaba:arouter-compiler:1.2.2'
implementation
'com.ydl:nim-base:1.1.0.
4
'
implementation
'com.ydl:nim-base:1.1.0.
7
'
// implementation 'com.netease.nimlib:basesdk:8.5.0'
implementation
'com.netease.nimlib:avchat:9.1.1'
implementation
'com.netease.nimlib:nrtc:9.1.1'
...
...
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
View file @
75b25194
...
...
@@ -371,9 +371,9 @@ public class SessionHelper {
};
infoButton
.
iconId
=
R
.
drawable
.
im_more12x
;
buttons
.
add
(
infoButton
);
if
(
p2pCustomization
!=
null
){
p2pCustomization
.
buttons
=
buttons
;
}
myP2pCustomization
.
withSticker
=
true
;
return
myP2pCustomization
;
}
...
...
m-im/src/main/java/com/yidianling/im/ui/adapter/MsgListAdapter.java
View file @
75b25194
...
...
@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.base.lifecycle.ILifecycleable;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
;
import
com.ydl.ydlcommon.utils.StringUtils
;
import
com.ydl.ydlcommon.utils.Utils
;
import
com.ydl.ydlcommon.utils.remind.ToastHelper
;
import
com.yidianling.im.bean.MsgData
;
import
com.yidianling.im.config.constants.ImConstants
;
...
...
@@ -64,6 +65,9 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
}
((
MsgListItemView
)
convertView
).
setData
(
mDataList
.
get
(
position
));
convertView
.
setOnClickListener
(
v
->
{
if
(
Utils
.
isFastClick
())
{
return
;
}
//动态消息暂时不需要访问以下接口
boolean
fla
=
false
;
//判断是否是跳转专家主页
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/activity/YDLP2PMessageActivity.java
View file @
75b25194
...
...
@@ -167,7 +167,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
//读取未发送的临时消息
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
)
{
if
(
messageFragment
.
getInputPanel
()
==
null
||
messageFragment
.
getInputPanel
().
getInputContent
()
==
null
||
messageFragment
.
getInputPanel
().
getInputContent
().
equals
(
""
))
{
if
(
messageFragment
.
getInputPanel
()
==
null
||
messageFragment
.
getInputPanel
().
getInputContent
()
==
null
||
messageFragment
.
getInputPanel
().
getInputContent
().
equals
(
""
))
{
if
(
messageFragment
.
getInputPanel
()!=
null
){
messageFragment
.
getInputPanel
().
setInputContent
(
ActionHandlerStorage
.
getL
(
sessionId
).
getImTempData
(
sessionId
));
}
...
...
@@ -300,9 +300,10 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
if
(
isFinishing
())
{
//聊天返回时,检查是否有未发送内容,如果有则保存到ImTempData 临时map中,再次进入时读取
if
(
messageFragment
!=
null
)
{
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
)
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
)
{
ActionHandlerStorage
.
getL
(
sessionId
).
saveImTempData
(
sessionId
,
messageFragment
.
getInputPanel
().
getInputContent
());
}
}
ActionHandlerStorage
.
recycleL
(
sessionId
);
}
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
75b25194
...
...
@@ -60,6 +60,7 @@ import com.ydl.ydlcommon.view.CircleImageView;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.config.constants.ImConstants
;
import
com.yidianling.im.event.CloseBottomWebviewEvent
;
import
com.yidianling.im.event.MultipleAnswerBean
;
import
com.yidianling.im.event.MultipleSelectedEvent
;
...
...
@@ -311,7 +312,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@SuppressLint
(
"CheckResult"
)
private
void
initView
()
{
if
(
ChatStatusCacheHelper
.
getStatusCache
(
"chatEvent"
)&&
SessionTypeEnum
.
Team
!=
sessionType
)
{
if
(
ChatStatusCacheHelper
.
getStatusCache
(
"chatEvent"
)&&
SessionTypeEnum
.
Team
!=
sessionType
)
{
// 获取首问语数据
ServiceImpl
.
Companion
.
getInstance
().
getFirstQuestion
()
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -326,22 +327,29 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
ToastUtil
.
toastShort
(
throwable
.
getMessage
());
});
}
boolean
isExpert
=
null
!=
ActionHandlerStorage
.
getL
(
sessionId
)&&
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
==
2
;
ServiceImpl
.
Companion
.
getInstance
().
canViewConsult
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
doctorId
)
IP2PCustomActionHandler
actionHandler
=
ActionHandlerStorage
.
getL
(
sessionId
);
//是咨询师
boolean
isExpert
=
null
!=
actionHandler
&&
actionHandler
.
getUserType
()
==
2
;
//不是群聊
boolean
notTeam
=
sessionType
!=
SessionTypeEnum
.
Team
;
//不是客服
boolean
notKefu
=
!
ImConstants
.
KEFUXIAOYI
.
equals
(
sessionId
);
if
(
isExpert
&&
notTeam
&&
actionHandler
.
getInfo
()
!=
null
&&
notKefu
&&
actionHandler
.
getInfo
().
doctorId
!=
null
)
{
String
doctorId
=
actionHandler
.
getInfo
().
doctorId
;
ServiceImpl
.
Companion
.
getInstance
().
canViewConsult
(
doctorId
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
response
->
{
if
(
response
.
code
.
equals
(
"200"
)){
if
(
response
.
data
!=
null
&&
response
.
data
.
getCanViewConsult
()){
if
(
isExpert
&&
sessionType
!=
SessionTypeEnum
.
Team
)
{
if
(
response
.
code
.
equals
(
"200"
))
{
if
(
response
.
data
!=
null
&&
response
.
data
.
getCanViewConsult
())
{
rela_zixun
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
}
);
}
//有未完成订单或者有未评价订单时,显示订单布局
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
()
!=
null
)
{
...
...
@@ -359,7 +367,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
else
{
titleBar
.
setTitleRightDraw
(
getResources
().
getDrawable
(
R
.
drawable
.
im_erduoxiaolv
));
}
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
){
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
){
titleBar
.
setTitle
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
name
);
}
// 初始化顶部专家信息栏
...
...
m-tests/src/main/AndroidManifest.xml
View file @
75b25194
...
...
@@ -18,6 +18,9 @@
android:screenOrientation=
"portrait"
android:theme=
"@style/tests_NoTitleTheme"
/>
<activity
android:name=
".search.TestSearchKeyActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/tests_NoTitleTheme"
/>
<!--测评首页-->
<activity
android:name=
".home.NewTestHomeActivity"
...
...
m-tests/src/main/java/com/yidianling/tests/list/model/TestListCommand.kt
View file @
75b25194
...
...
@@ -14,4 +14,6 @@ class TestListCommand : BaseCommand() {
var
tab
:
String
?
=
null
@JvmField
var
keyword
:
String
?
=
null
@JvmField
var
type
:
Int
=
0
}
\ No newline at end of file
m-tests/src/main/java/com/yidianling/tests/list/view/TestCategoryListActivity.kt
View file @
75b25194
...
...
@@ -3,12 +3,13 @@ package com.yidianling.tests.list.view
import
android.app.Activity
import
android.content.Context
import
android.content.Intent
import
androidx.core.content.ContextCompat
import
androidx.viewpager.widget.ViewPager
import
android.view.View
import
android.widget.PopupWindow
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.viewpager.widget.ViewPager
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.google.android.material.tabs.TabLayout
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.utils.BuryPointUtils
...
...
@@ -32,7 +33,8 @@ import com.yidianling.tests.search.TestSearchActivity
import
kotlinx.android.synthetic.main.tests_activity_test_category_list.*
@Route
(
path
=
"/ceshi/category_list"
)
class
TestCategoryListActivity
:
BaseMvpActivity
<
TestListActivityView
,
TestListActivityPresenter
>(),
TestListActivityView
,
PopupWindow
.
OnDismissListener
{
class
TestCategoryListActivity
:
BaseMvpActivity
<
TestListActivityView
,
TestListActivityPresenter
>(),
TestListActivityView
,
PopupWindow
.
OnDismissListener
{
private
var
isMine
:
Boolean
=
false
private
var
tabName
:
String
?
=
null
...
...
@@ -51,12 +53,13 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
var
selectedConditionList
:
HashMap
<
Int
,
HashMap
<
String
,
CategotyPopItem
>>
=
HashMap
()
var
sortPopup
:
CategoryPopupWindow
?
=
null
;
var
filterPopup
:
CategoryPopupWindow
?
=
null
;
var
currentPageIndex
:
Int
=
0
val
SELECT_SORT
:
String
=
"SELECT_SORT"
val
SELECT_FILTER
:
String
=
"SELECT_FILTER"
private
var
testCategoryAdapter
:
TestListPagerAdapter
?
=
null
var
title
=
arrayOf
(
"全部"
,
"付费"
,
"免费"
)
companion
object
{
private
const
val
EXTRA_IS_MINE
=
"is_mine"
...
...
@@ -116,15 +119,50 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
showSortPopupWindow
()
}
dr_filter
.
setOnClickListener
{
showFilterPopupWindow
()
for
(
i
in
title
)
{
val
tab
=
tab_tabLayout
.
newTab
().
setText
(
i
)
tab_tabLayout
.
addTab
(
tab
)
}
tab_tabLayout
.
addOnTabSelectedListener
(
object
:
TabLayout
.
OnTabSelectedListener
{
override
fun
onTabSelected
(
tab
:
TabLayout
.
Tab
?)
{
when
(
tab
?.
text
.
toString
())
{
"全部"
->
{
selectFilterItem
=
filterList
[
0
]
}
"付费"
->
{
selectFilterItem
=
filterList
[
1
]
}
"免费"
->
{
selectFilterItem
=
filterList
[
2
]
}
}
onDismiss
()
}
override
fun
onTabUnselected
(
tab
:
TabLayout
.
Tab
?)
{
}
override
fun
onTabReselected
(
tab
:
TabLayout
.
Tab
?)
{
}
})
mPresenter
.
fetchTestTypeList
()
vvp_test
.
addOnPageChangeListener
(
object
:
ViewPager
.
OnPageChangeListener
{
override
fun
onPageScrollStateChanged
(
state
:
Int
)
{}
override
fun
onPageScrolled
(
position
:
Int
,
positionOffset
:
Float
,
positionOffsetPixels
:
Int
)
{}
override
fun
onPageScrolled
(
position
:
Int
,
positionOffset
:
Float
,
positionOffsetPixels
:
Int
)
{
}
override
fun
onPageSelected
(
position
:
Int
)
{
currentPageIndex
=
position
...
...
@@ -136,8 +174,11 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
BuryPointUtils
.
getInstance
().
createMap
()
.
put
(
"test_type_click"
,
testCategory
?.
get
(
position
)
?.
name
+
""
)
.
burryPoint
(
"Testtype_click"
)
if
((
"my"
==
testCategory
?.
get
(
position
)
?.
tab
||
"unpay"
==
testCategory
?.
get
(
position
)
?.
tab
)
)
{
TestsIn
.
loginByOneKeyLogin
(
this
@TestCategoryListActivity
,
true
)
if
((
"my"
==
testCategory
?.
get
(
position
)
?.
tab
||
"unpay"
==
testCategory
?.
get
(
position
)
?.
tab
)
)
{
TestsIn
.
loginByOneKeyLogin
(
this
@TestCategoryListActivity
,
true
)
}
}
})
...
...
@@ -154,7 +195,8 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
filterList
.
add
(
CategotyPopItem
(
"免费"
,
"2"
))
sortPopup
=
CategoryPopupWindow
(
this
,
sortList
.
toList
()
as
ArrayList
<
CategotyPopItem
>,
object
:
CategoryConditionRecyclerViewAdapter
.
OnItemSelectedListener
{
sortList
.
toList
()
as
ArrayList
<
CategotyPopItem
>,
object
:
CategoryConditionRecyclerViewAdapter
.
OnItemSelectedListener
{
override
fun
onSortItemSelected
(
sortItem
:
CategotyPopItem
)
{
selectSortItem
=
sortItem
if
(
selectSortItem
.
key
==
sortConditionDefaultKey
)
{
...
...
@@ -166,21 +208,8 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
}
})
filterPopup
=
CategoryPopupWindow
(
this
,
filterList
.
toList
()
as
ArrayList
<
CategotyPopItem
>,
object
:
CategoryConditionRecyclerViewAdapter
.
OnItemSelectedListener
{
override
fun
onSortItemSelected
(
sortItem
:
CategotyPopItem
)
{
selectFilterItem
=
sortItem
if
(
selectFilterItem
.
key
==
filterConditionDefaultKey
)
{
updateFilterTextViewStatus
(
dr_filter
,
sortItem
.
value
!!
,
true
)
}
else
{
updateFilterTextViewStatus
(
dr_filter
,
sortItem
.
value
!!
,
false
)
}
filterPopup
?.
dismiss
()
}
})
sortPopup
?.
setOnDismissListener
(
this
)
filterPopup
?.
setOnDismissListener
(
this
)
}
override
fun
onDismiss
()
{
...
...
@@ -200,24 +229,18 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
updateFilterTextViewStatus
(
dr_sort
,
selectSortItem
.
value
!!
,
false
)
}
if
(
selectFilterItem
.
key
==
filterConditionDefaultKey
)
{
updateFilterTextViewStatus
(
dr_filter
,
selectFilterItem
.
value
!!
,
true
)
updateTabLayoutStatus
(
tab_tabLayout
,
selectFilterItem
.
value
!!
)
}
else
{
updateFilterTextViewStatus
(
dr_filter
,
selectFilterItem
.
value
!!
,
false
)
}
}
else
{
selectSortItem
=
CategotyPopItem
(
"综合排序"
,
sortConditionDefaultKey
)
selectFilterItem
=
CategotyPopItem
(
"全部"
,
filterConditionDefaultKey
)
selectFilterItem
=
CategotyPopItem
(
"全部"
,
filterConditionDefaultKey
)
updateFilterTextViewStatus
(
dr_sort
,
selectSortItem
.
value
!!
,
true
)
update
FilterTextViewStatus
(
dr_filter
,
selectFilterItem
.
value
!!
,
true
)
update
TabLayoutStatus
(
tab_tabLayout
,
selectFilterItem
.
value
!!
)
}
sortPopup
?.
adapter
?.
lastSelectText
=
selectSortItem
.
value
filterPopup
?.
adapter
?.
lastSelectText
=
selectFilterItem
.
value
sortPopup
?.
adapter
?.
notifyDataSetChanged
()
filterPopup
?.
adapter
?.
notifyDataSetChanged
()
}
private
fun
updateConditionList
()
{
...
...
@@ -229,11 +252,11 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
conditionList
[
SELECT_FILTER
]
=
selectFilterItem
selectedConditionList
[
currentPageIndex
]
=
conditionList
refreshFragmentPageData
(
selectSortItem
.
key
!!
,
selectFilterItem
.
key
!!
)
refreshFragmentPageData
(
selectSortItem
.
key
!!
,
selectFilterItem
.
key
!!
)
}
private
fun
refreshFragmentPageData
(
sort
:
String
,
filter
:
String
)
{
testCategoryAdapter
?.
getFragmentByPosition
(
currentPageIndex
)
?.
refreshListData
(
sort
,
filter
)
private
fun
refreshFragmentPageData
(
sort
:
String
,
filter
:
String
)
{
testCategoryAdapter
?.
getFragmentByPosition
(
currentPageIndex
)
?.
refreshListData
(
sort
,
filter
)
}
...
...
@@ -294,23 +317,38 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
view_mask
.
visibility
=
View
.
VISIBLE
}
//显示筛选弹窗
private
fun
showFilterPopupWindow
()
{
filterPopup
?.
showAsDropDown
(
ll_sort
)
view_mask
.
visibility
=
View
.
VISIBLE
}
private
fun
updateFilterTextViewStatus
(
tv
:
TextView
,
text
:
String
,
isNormal
:
Boolean
)
{
tv
.
text
=
text
if
(
isNormal
)
{
tv
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
platform_colorTextDefault
))
tv
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
R
.
drawable
.
platform_ic_arrow_drop_down_grey_500_18dp
,
0
)
tv
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
R
.
drawable
.
platform_ic_arrow_drop_down_grey_500_18dp
,
0
)
}
else
{
tv
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
platform_main_theme
))
tv
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
R
.
drawable
.
tests_ic_arrow_drop_down
,
0
)
}
}
private
fun
updateTabLayoutStatus
(
tabLayout
:
TabLayout
,
text
:
String
)
{
when
(
text
)
{
"全部"
->
{
tabLayout
.
getTabAt
(
0
)
?.
select
()
}
"付费"
->
{
tabLayout
.
getTabAt
(
1
)
?.
select
()
}
"免费"
->
{
tabLayout
.
getTabAt
(
2
)
?.
select
()
}
}
}
override
fun
onFailed
(
msg
:
String
?)
{
ToastUtil
.
toastShort
(
msg
?:
""
)
}
...
...
m-tests/src/main/java/com/yidianling/tests/list/view/adapter/TestListRecyclerAdapter.kt
View file @
75b25194
...
...
@@ -117,8 +117,8 @@ class TestListRecyclerAdapter(private val context: Context,
tvCoupon
.
visibility
=
View
.
GONE
textView
.
setPadding
(
dp5
!!
,
dp2
!!
,
dp5
!!
,
dp2
!!
)
textView
.
text
=
"免费"
textView
.
setBackgroundResource
(
R
.
drawable
.
tests_testhome_recom_price_bg
)
textView
.
setTextColor
(
Color
.
parseColor
(
"#
34CD6
5"
))
textView
.
setBackgroundResource
(
R
.
drawable
.
tests_testhome_recom_price_
red_
bg
)
textView
.
setTextColor
(
Color
.
parseColor
(
"#
FF5B0
5"
))
}
else
{
var
newPrice
=
TestHomeUtils
.
getOriginalPrice
(
tvCoupon
,
price
,
couponMoney
)
textView
.
setPadding
(
0
,
dp5
!!
,
dp5
!!
,
0
)
...
...
m-tests/src/main/java/com/yidianling/tests/search/TestSearchActivity.kt
View file @
75b25194
...
...
@@ -33,8 +33,9 @@ import de.greenrobot.event.EventBus
import
kotlinx.android.synthetic.main.tests_activity_test_search.*
import
kotlinx.android.synthetic.main.tests_item_hot_search.view.*
@Route
(
path
=
"/tests/search"
)
class
TestSearchActivity
:
BaseMvpActivity
<
TestSearchView
,
TestSearchPresenter
>(),
TestSearchView
,
View
.
OnClickListener
{
@Route
(
path
=
"/tests/search"
)
class
TestSearchActivity
:
BaseMvpActivity
<
TestSearchView
,
TestSearchPresenter
>(),
TestSearchView
,
View
.
OnClickListener
{
private
var
isFirstLoad
=
true
override
fun
getStatusViewOptions
():
StatusBarOptions
{
...
...
@@ -76,7 +77,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
}
fun
initData
()
{
var
lastCouponMoney
=
SharedPreferencesEditor
.
getString
(
TestHomeUtils
.
TEST_MAX_COUPON_MONEY_SP_KEY
)
var
lastCouponMoney
=
SharedPreferencesEditor
.
getString
(
TestHomeUtils
.
TEST_MAX_COUPON_MONEY_SP_KEY
)
if
(!
TextUtils
.
isEmpty
(
lastCouponMoney
))
{
searchAdapter
?.
couponMoney
=
lastCouponMoney
hotSearchAdapter
?.
couponMoney
=
lastCouponMoney
...
...
@@ -95,8 +97,16 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
private
fun
initRecyclerView
()
{
swipe_refresh_layout
.
isEnabled
=
false
searchAdapter
=
TestListRecyclerAdapter
(
this
,
searchedTestList
,
TestListRecyclerAdapter
.
PAGE_TYPE_SEARCH
)
hotSearchAdapter
=
TestListRecyclerAdapter
(
this
,
hotSearchedTestList
,
TestListRecyclerAdapter
.
PAGE_TYPE_SEARCH
)
searchAdapter
=
TestListRecyclerAdapter
(
this
,
searchedTestList
,
TestListRecyclerAdapter
.
PAGE_TYPE_SEARCH
)
hotSearchAdapter
=
TestListRecyclerAdapter
(
this
,
hotSearchedTestList
,
TestListRecyclerAdapter
.
PAGE_TYPE_SEARCH
)
searchAdapter
?.
onItemClickListener
=
MyBaseAdapter
.
OnItemClickListener
{
_
,
_
,
data
->
TestsIn
.
getTestsImpl
().
testDetailH5
(
data
.
id
.
toString
())
...
...
@@ -106,7 +116,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
TestsIn
.
getTestsImpl
().
testDetailH5
(
data
.
id
.
toString
())
}
headerHotSearch
=
View
.
inflate
(
this
,
R
.
layout
.
tests_header_hot_search
,
null
)
as
LinearLayout
?;
headerHotSearch
=
View
.
inflate
(
this
,
R
.
layout
.
tests_header_hot_search
,
null
)
as
LinearLayout
?;
searchHeader
=
View
.
inflate
(
this
,
R
.
layout
.
tests_header_search_list
,
null
);
tvSearchHint
=
searchHeader
?.
findViewById
(
R
.
id
.
tv_search_hint
);
...
...
@@ -135,13 +146,13 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
onScrollListener
=
object
:
EndlessRecyclerViewScrollListener
(
layoutManager
)
{
override
fun
onLoadMore
(
page
:
Int
,
totalItemsCount
:
Int
,
view
:
RecyclerView
?)
{
if
(
isSearch
)
{
mPresenter
.
searchTests
(
keyword
,
searchListCurrentPage
)
mPresenter
.
searchTests
(
keyword
,
searchListCurrentPage
,
0
)
}
}
}
rv_hot_list
.
addOnScrollListener
(
object
:
RecyclerView
.
OnScrollListener
()
{
override
fun
onScrolled
(
recyclerView
:
RecyclerView
,
dx
:
Int
,
dy
:
Int
)
{
if
(!
isFirstLoad
&&
dx
!=
0
&&
dx
!=
0
)
{
if
(!
isFirstLoad
&&
dx
!=
0
&&
dx
!=
0
)
{
hideSoftInput
()
}
}
...
...
@@ -168,7 +179,14 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
})
etSearch
.
setOnEditorActionListener
{
_
,
actionId
,
_
->
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
doSearch
()
keyword
=
etSearch
.
text
.
toString
()
if
(
TextUtils
.
isEmpty
(
keyword
))
{
ToastUtil
.
toastShort
(
getString
(
R
.
string
.
tests_no_search_keyword_hint
))
}
else
{
val
intent
=
Intent
(
this
,
TestSearchKeyActivity
::
class
.
java
)
intent
.
putExtra
(
"keyword"
,
keyword
)
startActivity
(
intent
)
}
}
true
}
...
...
@@ -193,7 +211,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
isSearch
=
true
searchListCurrentPage
=
1
onScrollListener
.
resetState
()
mPresenter
.
searchTests
(
keyword
,
searchListCurrentPage
)
mPresenter
.
searchTests
(
keyword
,
searchListCurrentPage
,
0
)
}
fun
hideSoftInput
()
{
...
...
@@ -241,11 +259,13 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
headerHotSearch
?.
visibility
=
View
.
VISIBLE
flHotSearch
?.
removeAllViews
()
for
(
index
in
keywordData
.
indices
)
{
val
view
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
tests_item_recommend_hot_search
,
flHotSearch
,
false
)
val
view
=
LayoutInflater
.
from
(
this
)
.
inflate
(
R
.
layout
.
tests_item_recommend_hot_search
,
flHotSearch
,
false
)
view
.
tvHotSearch
.
text
=
keywordData
[
index
].
keyWord
view
.
setOnClickListener
{
etSearch
.
setText
(
keywordData
[
index
].
keyWord
)
doSearch
()
val
intent
=
Intent
(
this
,
TestSearchKeyActivity
::
class
.
java
)
intent
.
putExtra
(
"keyword"
,
keywordData
[
index
].
keyWord
)
startActivity
(
intent
)
}
flHotSearch
?.
addView
(
view
)
...
...
m-tests/src/main/java/com/yidianling/tests/search/TestSearchKeyActivity.kt
0 → 100644
View file @
75b25194
package
com.yidianling.tests.search
import
android.content.Context
import
androidx.recyclerview.widget.LinearLayoutManager
import
android.text.Editable
import
android.text.TextUtils
import
android.text.TextWatcher
import
android.view.View
import
android.view.inputmethod.EditorInfo
import
android.view.inputmethod.InputMethodManager
import
androidx.recyclerview.widget.RecyclerView
import
com.google.android.material.tabs.TabLayout
import
com.ydl.ydlcommon.adapter.MyBaseAdapter
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.tests.R
import
com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import
com.yidianling.tests.home.utils.TestHomeUtils
import
com.yidianling.tests.list.model.bean.RecommendSearchItemBean
import
com.yidianling.tests.list.model.bean.Test
import
com.yidianling.tests.list.view.adapter.TestListRecyclerAdapter
import
com.yidianling.tests.router.TestsIn
import
de.greenrobot.event.EventBus
import
kotlinx.android.synthetic.main.tests_activity_test_key_search.*
class
TestSearchKeyActivity
:
BaseMvpActivity
<
TestSearchView
,
TestSearchPresenter
>(),
TestSearchView
,
View
.
OnClickListener
{
private
var
keyWord
:
String
?
=
""
private
var
searchListCurrentAllPage
=
1
private
var
searchListCurrentPastPage
=
1
private
var
searchListCurrentFreePage
=
1
private
val
TYPE_ALL
=
"all"
private
val
TYPE_PAST
=
"past"
private
val
TYPE_FREE
=
"free"
private
lateinit
var
onScrollListener
:
EndlessRecyclerViewScrollListener
private
var
currentSelectedPage
=
TYPE_ALL
var
title
=
arrayOf
(
"全部"
,
"付费"
,
"免费"
)
private
var
searchAdapter
:
TestListRecyclerAdapter
?
=
null
private
val
searchedTestList
:
MutableList
<
Test
>
=
ArrayList
()
override
fun
createPresenter
():
TestSearchPresenter
=
TestSearchPresenter
()
override
fun
layoutResId
():
Int
{
return
R
.
layout
.
tests_activity_test_key_search
}
override
fun
getStatusViewOptions
():
StatusBarOptions
{
return
StatusBarOptions
(
true
,
statusBarDarkMode
=
true
)
}
override
fun
initDataAndEvent
()
{
EventBus
.
getDefault
().
register
(
this
)
this
.
keyWord
=
intent
.
getStringExtra
(
"keyword"
)
setupListeners
()
initView
()
initRecyclerView
()
tv_search_key_empty
?.
text
=
String
.
format
(
"为您找到以下跟“%s”有关的内容"
,
keyWord
)
etKeySearch
?.
setText
(
keyWord
)
}
private
fun
initView
()
{
for
(
i
in
title
)
{
val
tab
=
tabLayout
.
newTab
().
setText
(
i
);
tabLayout
.
addTab
(
tab
)
}
}
private
fun
initRecyclerView
()
{
swipe_refresh_layout_key
.
isEnabled
=
false
searchAdapter
=
TestListRecyclerAdapter
(
this
,
searchedTestList
,
TestListRecyclerAdapter
.
PAGE_TYPE_SEARCH
)
var
lastCouponMoney
=
SharedPreferencesEditor
.
getString
(
TestHomeUtils
.
TEST_MAX_COUPON_MONEY_SP_KEY
)
if
(!
TextUtils
.
isEmpty
(
lastCouponMoney
))
{
searchAdapter
?.
couponMoney
=
lastCouponMoney
}
searchAdapter
?.
onItemClickListener
=
MyBaseAdapter
.
OnItemClickListener
{
_
,
_
,
data
->
TestsIn
.
getTestsImpl
().
testDetailH5
(
data
.
id
.
toString
())
}
rv_search_key_list
.
adapter
=
searchAdapter
val
layoutManager
=
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
)
rv_search_key_list
.
layoutManager
=
layoutManager
onScrollListener
=
object
:
EndlessRecyclerViewScrollListener
(
layoutManager
)
{
override
fun
onLoadMore
(
page
:
Int
,
totalItemsCount
:
Int
,
view
:
RecyclerView
?)
{
when
(
currentSelectedPage
)
{
TYPE_ALL
->
{
mPresenter
.
searchTests
(
keyWord
,
searchListCurrentAllPage
,
0
)
}
TYPE_PAST
->
{
mPresenter
.
searchTests
(
keyWord
,
searchListCurrentPastPage
,
1
)
}
TYPE_FREE
->
{
mPresenter
.
searchTests
(
keyWord
,
searchListCurrentFreePage
,
2
)
}
}
}
}
rv_search_key_list
.
addOnScrollListener
(
onScrollListener
)
}
private
fun
setupListeners
()
{
tvKeyBack
.
setOnClickListener
(
this
)
etKeySearch
.
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
)
{
if
(
TextUtils
.
isEmpty
(
s
.
toString
()))
{
}
}
})
etKeySearch
.
setOnEditorActionListener
{
_
,
actionId
,
_
->
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
this
.
keyWord
=
etKeySearch
.
text
.
toString
()
tv_search_key_empty
?.
text
=
String
.
format
(
"为您找到以下跟“%s”有关的内容"
,
keyWord
)
if
(
TextUtils
.
isEmpty
(
keyWord
))
{
ToastUtil
.
toastShort
(
getString
(
R
.
string
.
tests_no_search_keyword_hint
))
}
else
{
doSearch
(
keyWord
)
}
}
true
}
tabLayout
.
addOnTabSelectedListener
(
object
:
TabLayout
.
OnTabSelectedListener
{
override
fun
onTabSelected
(
tab
:
TabLayout
.
Tab
?)
{
when
(
tab
?.
text
.
toString
())
{
"全部"
->
{
currentSelectedPage
=
TYPE_ALL
searchListCurrentAllPage
=
1
mPresenter
.
searchTests
(
keyWord
,
searchListCurrentAllPage
,
0
)
}
"付费"
->
{
currentSelectedPage
=
TYPE_PAST
searchListCurrentPastPage
=
1
mPresenter
.
searchTests
(
keyWord
,
searchListCurrentPastPage
,
1
)
}
"免费"
->
{
currentSelectedPage
=
TYPE_FREE
searchListCurrentFreePage
=
1
mPresenter
.
searchTests
(
keyWord
,
searchListCurrentFreePage
,
2
)
}
}
}
override
fun
onTabUnselected
(
tab
:
TabLayout
.
Tab
?)
{
}
override
fun
onTabReselected
(
tab
:
TabLayout
.
Tab
?)
{
}
})
}
fun
doSearch
(
keyword
:
String
?)
{
currentSelectedPage
=
TYPE_ALL
searchListCurrentAllPage
=
1
mPresenter
.
searchTests
(
keyword
,
searchListCurrentAllPage
,
0
)
tabLayout
.
getTabAt
(
0
)
?.
select
()
}
override
fun
showLoadingView
()
{
swipe_refresh_layout_key
.
isRefreshing
=
true
}
override
fun
hideLoadingView
()
{
swipe_refresh_layout_key
.
isRefreshing
=
false
}
override
fun
showError
(
msg
:
String
)
{
ToastUtil
.
toastShort
(
msg
)
}
override
fun
showNoResultView
()
{
llKeyEmpty
.
visibility
=
View
.
VISIBLE
iv_Key_empty
.
visibility
=
View
.
VISIBLE
}
override
fun
hideNoResultView
()
{
llKeyEmpty
.
visibility
=
View
.
GONE
}
override
fun
showSearchResultView
(
testList
:
List
<
Test
>?,
page
:
Int
)
{
hideSoftInput
()
if
(
page
==
1
)
{
rv_search_key_list
.
adapter
=
searchAdapter
onScrollListener
.
resetState
()
searchedTestList
.
clear
()
}
if
(
testList
!=
null
&&
testList
.
isNotEmpty
())
{
searchedTestList
.
addAll
(
testList
)
searchAdapter
?.
notifyDataSetChanged
()
}
else
{
searchAdapter
?.
hasMore
=
false
searchAdapter
?.
notifyDataSetChanged
()
}
when
(
currentSelectedPage
)
{
TYPE_ALL
->
{
searchListCurrentAllPage
++
}
TYPE_PAST
->
{
searchListCurrentPastPage
++
}
TYPE_FREE
->
{
searchListCurrentFreePage
++
}
}
}
fun
hideSoftInput
()
{
val
view
=
this
.
currentFocus
if
(
view
!=
null
)
{
val
imm
=
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
imm
.
hideSoftInputFromWindow
(
view
.
windowToken
,
0
)
}
}
override
fun
onRecommendSearchListResponse
(
testList
:
List
<
RecommendSearchItemBean
>)
{
}
override
fun
onHotRecommendResponse
(
datalist
:
List
<
Test
>)
{
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
tvKeyBack
->
{
finish
()
}
}
}
override
fun
onResume
()
{
super
.
onResume
()
//每次可见,更新优惠券信息
TestHomeUtils
.
updateCouponMoney
()
}
fun
onEvent
(
updateCouponMoneyEvent
:
UpdateCouponMoneyEvent
)
{
searchAdapter
?.
couponMoney
=
updateCouponMoneyEvent
.
money
searchAdapter
?.
notifyDataSetChanged
()
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
EventBus
.
getDefault
().
unregister
(
this
)
}
}
m-tests/src/main/java/com/yidianling/tests/search/TestSearchPresenter.kt
View file @
75b25194
...
...
@@ -79,7 +79,7 @@ class TestSearchPresenter : SimplePresenter<TestSearchView>() {
})
}
fun
searchTests
(
keyword
:
String
?,
page
:
Int
)
{
fun
searchTests
(
keyword
:
String
?,
page
:
Int
,
type
:
Int
)
{
if
(
page
==
1
)
{
mView
.
showLoadingView
()
}
...
...
@@ -88,6 +88,7 @@ class TestSearchPresenter : SimplePresenter<TestSearchView>() {
cmd
.
tab
=
"search"
cmd
.
page
=
page
cmd
.
keyword
=
keyword
cmd
.
type
=
type
TestRetrofitApi
.
getTestRetrofitApi
()
.
fetchTestList
(
NetworkParamsUtils
.
getMaps
(
cmd
))
.
subscribeOn
(
Schedulers
.
io
())
...
...
m-tests/src/main/res/drawable/tests_bg_indicator_search.xml
0 → 100644
View file @
75b25194
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<item
android:gravity=
"center"
>
<shape>
<size
android:width=
"@dimen/platform_dp_20"
android:height=
"@dimen/platform_dp_4"
/>
<corners
android:radius=
"@dimen/platform_dp_5"
/>
</shape>
</item>
</layer-list>
m-tests/src/main/res/drawable/tests_testhome_recom_price_red_bg.xml
0 → 100644
View file @
75b25194
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"3dp"
/>
<solid
android:color=
"#1AFF5B05"
/>
</shape>
\ No newline at end of file
m-tests/src/main/res/layout/tests_activity_test_category_list.xml
View file @
75b25194
...
...
@@ -11,31 +11,28 @@
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/platform_title_bar_height"
android:background=
"@color/white"
android:gravity=
"center_vertical"
>
android:gravity=
"center_vertical"
>
<ImageView
android:id=
"@+id/iv_test_list_back"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingLeft=
"15dp"
android:src=
"@drawable/tests_icon_test_back"
/>
android:src=
"@drawable/tests_icon_test_back"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"32dp"
android:background=
"@drawable/tests_bg_test_search_input"
android:orientation=
"horizontal"
android:layout_marginRight=
"15dp"
>
android:background=
"@drawable/tests_bg_test_search_input"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"13dp"
android:layout_height=
"13dp"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"12dp"
android:src=
"@drawable/tests_search_gray"
/>
android:src=
"@drawable/tests_search_gray"
/>
<TextView
android:id=
"@+id/tv_test_search"
...
...
@@ -48,7 +45,7 @@
android:textColor=
"#BFBFBF"
android:textSize=
"@dimen/platform_default_text_size_small"
android:textStyle=
"normal"
android:typeface=
"sans"
/>
android:typeface=
"sans"
/>
</LinearLayout>
...
...
@@ -66,50 +63,48 @@
android:layout_width=
"72dp"
android:layout_height=
"match_parent"
android:background=
"#F7F7F7"
app:pa_indicator_color=
"@color/platform_main_theme"
app:pa_tab_height=
"44dp"
app:pa_tab_indicator_margin=
"13dp"
app:pa_tab_mode=
"scrollable"
app:pa_indicator_color=
"@color/platform_main_theme"
/>
app:pa_tab_mode=
"scrollable"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/ll_sort"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<com.google.android.material.tabs.TabLayout
android:id=
"@+id/tab_tabLayout"
android:layout_width=
"0dp"
android:layout_height=
"44dp"
android:layout_weight=
"1"
app:tabIndicator=
"@drawable/tests_bg_indicator_search"
app:tabIndicatorColor=
"#2BB5F5"
app:tabIndicatorFullWidth=
"false"
app:tabIndicatorHeight=
"3dp"
app:tabTextAppearance=
"@style/tests_MyTabLayout"
app:tabPaddingTop=
"@dimen/platform_dp_5"
/>
<com.ydl.ydlcommon.view.DrawableRightTextView
android:id=
"@+id/dr_sort"
style=
"@style/tests_FilterTextViewStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"44dp"
android:layout_marginLeft=
"@dimen/platform_dp_16"
android:layout_marginTop=
"@dimen/platform_dp_4"
android:layout_height=
"@dimen/platform_dp_40"
android:layout_marginLeft=
"@dimen/platform_dp_26"
android:drawableEnd=
"@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight=
"@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text=
"综合排序"
android:textColor=
"@color/platform_color_242424"
/>
android:textColor=
"@color/platform_color_242424"
/>
<com.ydl.ydlcommon.view.DrawableRightTextView
android:id=
"@+id/dr_filter"
style=
"@style/tests_FilterTextViewStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"44dp"
android:drawableEnd=
"@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight=
"@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:paddingLeft=
"15dp"
android:text=
"全部"
android:textColor=
"@color/platform_color_242424"
/>
</LinearLayout>
<RelativeLayout
...
...
@@ -119,16 +114,14 @@
<com.ydl.ydlcommon.view.verticaltablayout.VerticalViewPager
android:id=
"@+id/vvp_test"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
<View
android:id=
"@+id/view_mask"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#3c000000"
android:visibility=
"gone"
/>
android:visibility=
"gone"
/>
</RelativeLayout>
...
...
m-tests/src/main/res/layout/tests_activity_test_key_search.xml
0 → 100644
View file @
75b25194
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/clContainer"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
tools:context=
".search.TestSearchActivity"
>
<LinearLayout
android:id=
"@+id/ll_title"
android:layout_width=
"match_parent"
android:layout_height=
"45dp"
android:gravity=
"center_vertical"
app:layout_constraintTop_toTopOf=
"parent"
>
<com.ydl.ydlcommon.view.DeleteEditTextView
android:id=
"@+id/etKeySearch"
android:layout_width=
"0dp"
android:layout_height=
"36dp"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"5dp"
android:layout_weight=
"1"
android:background=
"@drawable/tests_bg_test_search_input"
android:drawableStart=
"@drawable/tests_search_gray"
android:drawableLeft=
"@drawable/tests_search_gray"
android:drawablePadding=
"8dp"
android:ems=
"10"
android:hint=
"输入标题与内容"
android:imeOptions=
"actionSearch"
android:inputType=
"text|textPersonName"
android:lines=
"1"
android:paddingLeft=
"8dp"
android:paddingRight=
"8dp"
android:textCursorDrawable=
"@color/platform_color_42C1FF"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/tvKeyBack"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"6dp"
android:padding=
"10dp"
android:text=
"@string/platform_cancel"
android:textColor=
"@color/platform_color_999999"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_search_key_empty"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"15dp"
/>
<com.google.android.material.tabs.TabLayout
android:id=
"@+id/tabLayout"
android:layout_width=
"match_parent"
android:layout_height=
"44dp"
app:tabIndicator=
"@drawable/tests_bg_indicator_search"
app:tabIndicatorColor=
"#2BB5F5"
app:tabIndicatorFullWidth=
"false"
app:tabIndicatorHeight=
"3dp"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"0.5dp"
android:background=
"#F7F7F7"
/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id=
"@+id/swipe_refresh_layout_key"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_search_key_list"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<LinearLayout
android:id=
"@+id/llKeyEmpty"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<ImageView
android:id=
"@+id/iv_Key_empty"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"30dp"
android:src=
"@drawable/platform_ico_img_zixun_empty"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
</LinearLayout>
</RelativeLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>
m-tests/src/main/res/layout/tests_item_category_testlist_view.xml
View file @
75b25194
...
...
@@ -34,7 +34,7 @@
android:maxLines=
"2"
android:minHeight=
"24dp"
android:minLines=
"2"
android:textColor=
"#
666
"
android:textColor=
"#
C5C5C5
"
android:textSize=
"12sp"
tools:text=
"这里是副标题,这里是副标题,这里是副标题,这里是副标题"
/>
...
...
m-tests/src/main/res/layout/tests_testlist_item_view.xml
View file @
75b25194
...
...
@@ -30,7 +30,7 @@
android:layout_marginRight=
"146dp"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"#
666
"
android:textColor=
"#
B5B5B5
"
android:textSize=
"12sp"
android:lineSpacingExtra=
"4dp"
android:minLines=
"2"
...
...
m-tests/src/main/res/values/styles.xml
View file @
75b25194
...
...
@@ -30,4 +30,9 @@
<item
name=
"colorAccent"
>
@color/platform_main_theme
</item>
</style>
<style
name=
"tests_MyTabLayout"
parent=
"TextAppearance.Design.Tab"
>
<item
name=
"android:textStyle"
>
bold
</item>
</style>
</resources>
\ No newline at end of file
m-user/src/main/java/com/yidianling/user/mine/DatePickerDialogFragment.java
View file @
75b25194
...
...
@@ -67,9 +67,21 @@ public class DatePickerDialogFragment extends BaseDialogFragment implements Date
@Override
public
void
onDateChanged
(
DatePicker
view
,
int
year
,
int
monthOfYear
,
int
dayOfMonth
)
{
this
.
year
=
year
;
this
.
month
=
monthOfYear
;
this
.
day
=
dayOfMonth
;
if
(
isDataAfter
(
view
))
{
Calendar
mCalendar
=
Calendar
.
getInstance
();
view
.
init
(
mCalendar
.
get
(
Calendar
.
YEAR
),
mCalendar
.
get
(
Calendar
.
MONTH
),
mCalendar
.
get
(
Calendar
.
DAY_OF_MONTH
),
this
);
}
}
private
boolean
isDataAfter
(
DatePicker
datePicker
)
{
Calendar
mCalendar
=
Calendar
.
getInstance
();
Calendar
tempCalendar
=
Calendar
.
getInstance
();
tempCalendar
.
set
(
datePicker
.
getYear
(),
datePicker
.
getMonth
(),
datePicker
.
getDayOfMonth
(),
0
,
0
,
0
);
if
(
tempCalendar
.
after
(
mCalendar
))
{
return
true
;
}
else
{
return
false
;
}
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/StatusBarUtils.kt
View file @
75b25194
...
...
@@ -1097,6 +1097,20 @@ class StatusBarUtils {
statusBarLightMode
(
context
)
}
}
/**
* 适配 One Plus手机顶部返回按钮被截取问题
*/
fun
setCustomStatusViewForMembers
(
context
:
Activity
,
statusView
:
View
,
isDarkMode
:
Boolean
=
false
)
{
val
params
=
statusView
.
layoutParams
setTransparentForImageView
(
context
,
null
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
context
)
params
.
height
=
RxImageTool
.
dp2px
(
48f
)
+
statusBarHeight
statusView
.
setPadding
(
0
,
statusBarHeight
-
25
,
0
,
0
)
if
(
isDarkMode
)
{
statusBarLightMode
(
context
)
}
}
}
//====================设置Activity状态栏View END====================
...
...
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