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
13c8abee
Commit
13c8abee
authored
Nov 15, 2019
by
konghaorui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component
into dev
# Conflicts: # app/build.gradle
parents
fe80751a
86325d4b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
33 deletions
+79
-33
build.gradle
app/build.gradle
+4
-0
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+6
-0
ExpertSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
+3
-4
ConsultantServiceImp.kt
m-consultant/src/main/java/com/yidianling/consultant/modular/ConsultantServiceImp.kt
+2
-1
ConsultAssistantDialogUtils.kt
m-consultant/src/main/java/com/yidianling/consultant/modular/singlton/ConsultAssistantDialogUtils.kt
+64
-28
No files found.
app/build.gradle
View file @
13c8abee
...
...
@@ -173,6 +173,10 @@ dependencies {
api
project
(
':m-consultant'
)
implementation
modularPublication
(
'com.ydl:m-consultant-api'
)
api
project
(
':m-confide'
)
// api "com.ydl:m-consultant-api:0.0.2"
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
api
(
project
(
':ydl-platform'
)){
transitive
=
true
}
...
...
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
13c8abee
...
...
@@ -173,6 +173,12 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
ModularServiceManager
.
provide
(
IConsultantService
::
class
.
java
).
showConsultAssistantDialog
(
this
)
}
override
fun
onPause
()
{
super
.
onPause
()
ModularServiceManager
.
provide
(
IConsultantService
::
class
.
java
).
hideConsultAssistantDialog
()
}
// override fun onDestroy() {
// if (serviceConnection != null) {
...
...
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
View file @
13c8abee
...
...
@@ -13,6 +13,7 @@ import android.support.v4.content.ContextCompat
import
android.support.v7.widget.LinearLayoutManager
import
android.support.v7.widget.RecyclerView
import
android.text.TextUtils
import
android.util.Log
import
android.view.Gravity
import
android.view.View
import
android.view.WindowManager
...
...
@@ -311,6 +312,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
// })
image_scroll_top
.
setOnClickListener
(
this
)
// initStatus()
ConsultAssistantDialogUtils
.
INSTANCE
.
fitRequest
(
this
,
"doctor_list"
)
}
private
fun
initNetLossView
()
{
...
...
@@ -1468,14 +1471,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
super
.
onResume
()
ActionCountUtils
.
count
(
ConsultBIConstants
.
ConsultEvent
.
APP_CONSULT_LIST_PAGE_VISIT
)
ConsultAssistantDialogUtils
.
INSTANCE
.
fitRequest
(
this
,
"doctor_list"
)
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
ConsultAssistantDialogUtils
.
INSTANCE
.
hide
()
ConsultAssistantDialogUtils
.
INSTANCE
.
resetStatus
()
}
}
m-consultant/src/main/java/com/yidianling/consultant/modular/ConsultantServiceImp.kt
View file @
13c8abee
...
...
@@ -23,7 +23,7 @@ class ConsultantServiceImp: IConsultantService {
}
override
fun
hideConsultAssistantDialog
()
{
ConsultAssistantDialogUtils
.
INSTANCE
.
hide
()
ConsultAssistantDialogUtils
.
INSTANCE
.
hide
FromHomePage
()
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/modular/singlton/ConsultAssistantDialogUtils.kt
View file @
13c8abee
...
...
@@ -6,6 +6,7 @@ import com.yidianling.common.tools.ToastUtil
import
com.yidianling.consultant.dialog.ConsultAssistantDialog
import
com.yidianling.consultant.model.SearchApi
import
com.yidianling.consultant.router.ConsultantIn
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
java.util.*
...
...
@@ -13,13 +14,14 @@ import java.util.*
/**
* Created by xj on 2019/11/14.
*/
class
ConsultAssistantDialogUtils
private
constructor
(){
class
ConsultAssistantDialogUtils
private
constructor
()
{
companion
object
{
val
INSTANCE
by
lazy
{
ConsultAssistantDialogUtils
()
}
}
var
consultAssistantDialog
:
ConsultAssistantDialog
?
=
null
var
consultAssistantDialogFromHomePage
:
ConsultAssistantDialog
?
=
null
// 首页展示的dialog
var
consultAssistantDialog
:
ConsultAssistantDialog
?
=
null
//咨询师列表页面展示的dialog
var
expertSearchPageHasShown
:
Boolean
=
false
// 专家咨询列表页面是否已经展示
var
timer
:
Timer
?
=
null
...
...
@@ -45,78 +47,112 @@ class ConsultAssistantDialogUtils private constructor(){
SearchApi
.
getSearchApi
().
getConsultAssistantRequest
(
origin
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
.
subscribe
{
if
(
it
.
data
)
{
if
(
origin
==
"home_index"
)
{
show
(
activity
,
false
)
}
else
if
(
origin
==
"doctor_list"
)
{
show
(
activity
,
true
)
show
FromYdlHome
(
activity
)
}
else
if
(
origin
==
"doctor_list"
)
{
show
(
activity
)
}
}
}
}
////////////////////////////////////// 首页的展示隐藏逻辑 代码块start ///////////////////////////////////////////////////
/**
* 首页页展示
*/
fun
showFromYdlHome
(
activity
:
Activity
)
{
consultAssistantDialogFromHomePage
?.
dismiss
()
consultAssistantDialogFromHomePage
=
null
consultAssistantDialogFromHomePage
=
ConsultAssistantDialog
(
activity
,
object
:
ConsultAssistantDialog
.
OnConsultAssistantClickListener
{
override
fun
onClickAction
()
{
//获取用户uid
getConsultAssistantUid
(
activity
)
}
})
consultAssistantDialogFromHomePage
?.
show
()
}
/**
* 首页隐藏
*/
fun
hideFromHomePage
()
{
consultAssistantDialogFromHomePage
?.
dismiss
()
}
////////////////////////////////////// 首页的展示隐藏逻辑 代码块end ///////////////////////////////////////////////////
////////////////////////////////////// 咨询师列表页面的展示隐藏逻辑 代码块start ///////////////////////////////////////////////////
/**
* 展示
* isDelay 是否延迟展示
* 咨询师列表页展示
*/
fun
show
(
activity
:
Activity
,
isDelay
:
Boolean
)
{
fun
show
(
activity
:
Activity
)
{
if
(
isDelay
&&
!
expertSearchPageHasShown
&&
timer
==
null
)
{
if
(!
expertSearchPageHasShown
&&
timer
==
null
)
{
timer
=
Timer
()
timer
!!
.
schedule
(
object
:
TimerTask
()
{
override
fun
run
()
{
showDialog
(
activity
)
expertSearchPageHasShown
=
true
Observable
.
just
(
1
).
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
showDialog
(
activity
)
expertSearchPageHasShown
=
true
}
}
},
10000
)
}
else
{
}
else
{
showDialog
(
activity
)
}
}
/**
* 展示浮层
*
咨询师列表页
展示浮层
*/
fun
showDialog
(
activity
:
Activity
)
{
if
(
consultAssistantDialog
==
null
)
{
consultAssistantDialog
=
ConsultAssistantDialog
(
activity
,
object
:
ConsultAssistantDialog
.
OnConsultAssistantClickListener
{
override
fun
onClickAction
()
{
//获取用户uid
getConsultAssistantUid
(
activity
)
}
consultAssistantDialog
?.
dismiss
()
consultAssistantDialog
=
null
consultAssistantDialog
=
ConsultAssistantDialog
(
activity
,
object
:
ConsultAssistantDialog
.
OnConsultAssistantClickListener
{
override
fun
onClickAction
()
{
//获取用户uid
getConsultAssistantUid
(
activity
)
}
})
}
consultAssistantDialog
!!
.
show
()
})
consultAssistantDialog
?.
show
()
}
/**
* 隐藏
*
咨询师列表页
隐藏
*/
fun
hide
()
{
consultAssistantDialog
?.
hide
()
consultAssistantDialog
?.
dismiss
()
}
/**
* 重置本单例关于专家咨询列表页面得状态
*
咨询师列表页面使用的
重置本单例关于专家咨询列表页面得状态
*/
fun
resetStatus
()
{
consultAssistantDialog
?.
dismiss
()
timer
?.
cancel
()
timer
=
null
expertSearchPageHasShown
=
false
consultAssistantDialog
=
null
}
////////////////////////////////////// 咨询师列表页面的展示隐藏逻辑 代码块end ///////////////////////////////////////////////////
private
fun
getConsultAssistantUid
(
activity
:
Activity
)
{
// 请求接口获取咨询助理的uid
SearchApi
.
getSearchApi
().
getConsultAssistantUidRequest
()
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
.
subscribe
{
if
(
it
.
code
==
"200"
&&
it
.
data
!=
0
.
toLong
())
{
ConsultantIn
.
startP2PSession
(
activity
as
AppCompatActivity
,
it
.
data
.
toString
())
}
else
{
}
else
{
ToastUtil
.
toastShort
(
"咨询助理忙碌中,请稍后再试"
)
}
}
...
...
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