Commit 0d167ce7 by YKai

feat: ModularServiceManager.provider改为findRouteService,代码格式化

parent 220aae18
......@@ -26,9 +26,7 @@ class AudioImServiceImp : IAudioImService {
}
override fun loginRtm(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
YDLavManager.instances.login(userId) { success: Boolean, _ ->
event(success, "")
}
YDLavManager.instances.login(userId, event)
}
override fun loginRtm(userId: String?) {
......
package com.ydl.confide.home
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.graphics.Color
......@@ -52,7 +51,6 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.base.config.HttpConfig.Companion.YDL_H5
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
......@@ -62,7 +60,6 @@ import com.ydl.ydlcommon.view.DrawableRightTextView
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.main.confide_home_activity.*
......@@ -251,8 +248,8 @@ class ConfideHomeActivity :
}
if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) {
if (!ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm()) {
ModularServiceManager.provide(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { _: Boolean, _ ->
if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { _: Boolean, _ ->
showPayOrDetail(confidedId, doctorId)
}
} else {
......
......@@ -18,7 +18,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.webview.TellData
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.YDLCacheUtils
/**
......@@ -72,7 +72,7 @@ class ConfdieServiceImpl : IConfideService {
override fun ydlAvManagerLogin(uid: String?) {
ModularServiceManager.provide(IAudioImService::class.java).loginRtm(uid)
findRouteService(IAudioImService::class.java).loginRtm(uid)
}
override fun startCondifeHomePage(context: Context, isSplash: Boolean) {
......@@ -108,15 +108,15 @@ class ConfdieServiceImpl : IConfideService {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830"
}
ModularServiceManager.provide(IAudioImService::class.java).yDLAvManagerInit(app,avManagerKey)
findRouteService(IAudioImService::class.java).yDLAvManagerInit(app, avManagerKey)
}
override fun isOnlineRtm(): Boolean {
return ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm()
return findRouteService(IAudioImService::class.java).getIsOnlineRtm()
}
override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) {
ModularServiceManager.provide(IAudioImService::class.java).openAxbDialog(activity,type,phoneNumber)
findRouteService(IAudioImService::class.java).openAxbDialog(activity, type, phoneNumber)
}
override fun closePlayer() {
......
......@@ -18,7 +18,6 @@ import com.ydl.confide.router.PhoneCallIn
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.webview.TellData
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.ui.Loading
import com.ydl.ydlcommon.utils.log.AliYunLogConfig
......@@ -107,7 +106,7 @@ class ConfideWebServiceImpl {
data: ConfideConnectResponse?
) {
val expertInfo = data?.dialDetail?.agoraExpertInfo ?: return
if (!ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm()) { // 判断如果账号在其它设备登录rtm是否在线
if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) { // 判断如果账号在其它设备登录rtm是否在线
ToastUtil.toastShort("网络通话错误代码001")
return
}
......@@ -128,7 +127,7 @@ class ConfideWebServiceImpl {
fun axb(activity: Activity, phone: String?) {
if (phone.isNullOrEmpty())
return
ModularServiceManager.provide(IAudioImService::class.java).openAxbDialog(activity,1,phone)
findRouteService(IAudioImService::class.java).openAxbDialog(activity,1,phone)
}
//java版axb和声网接口
......@@ -140,8 +139,8 @@ class ConfideWebServiceImpl {
tellData: TellData?,
callType: String?
) {
if (!ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm()) {
ModularServiceManager.provide(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) {
toDial(id, type, callType, activity, tellData)
} else {
......@@ -326,7 +325,7 @@ class ConfideWebServiceImpl {
expertInfo.remainingTime =
ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration);
}
ModularServiceManager.provide(IAudioImService::class.java).callEventSave("10","用户点击拨打",expertInfo.channelId, "7")
findRouteService(IAudioImService::class.java).callEventSave("10", "用户点击拨打", expertInfo.channelId, "7")
Loading.close()
ARouter.getInstance().build("/av/AudioHomeActivity")
.withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl)
......
......@@ -27,7 +27,6 @@ import com.ydl.confide.router.PhoneCallIn
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
......@@ -37,7 +36,6 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.confide_home_activity.*
import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.io.UnsupportedEncodingException
import java.net.URLDecoder
......@@ -124,8 +122,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
else -> {
if (!item.confideId.isNullOrBlank()) {
if (!ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm()) {
ModularServiceManager.provide(IAudioImService::class.java).loginRtm(
if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
findRouteService(IAudioImService::class.java).loginRtm(
PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ ->
showPayOrDetail(item, it)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment