Commit 1fb7673c by 刘鹏

Merge branch 'feat/lp/lp_confide_2' into 'd/v_confide_2.0'

feat: 通话时长问题修复

See merge request app_android_lib/YDL-Component!77
parents af04c26c 36c0ed2a
...@@ -5,7 +5,7 @@ ext { ...@@ -5,7 +5,7 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.88", "m-confide" : "0.0.49.94",
"m-consultant" : "0.0.60.27", "m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18", "m-user" : "0.0.62.18",
...@@ -41,7 +41,7 @@ ext { ...@@ -41,7 +41,7 @@ ext {
"ydl-webview" : "0.0.38.80", "ydl-webview" : "0.0.38.80",
"ydl-media" : "0.0.21.45", "ydl-media" : "0.0.21.45",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.93", "m-audioim" : "0.0.49.30.00",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -90,7 +90,7 @@ ext { ...@@ -90,7 +90,7 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.88", "m-confide" : "0.0.49.94",
"m-consultant" : "0.0.60.27", "m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18", "m-user" : "0.0.62.18",
...@@ -124,7 +124,7 @@ ext { ...@@ -124,7 +124,7 @@ ext {
"ydl-webview" : "0.0.38.80", "ydl-webview" : "0.0.38.80",
"ydl-media" : "0.0.21.45", "ydl-media" : "0.0.21.45",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.93", "m-audioim" : "0.0.49.30.00",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
......
...@@ -75,7 +75,7 @@ dependencies { ...@@ -75,7 +75,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler" kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api" api "com.alibaba:arouter-api:$arouter_api"
implementation "com.ydl:ydl-av:1.3.9" implementation "com.ydl:ydl-av:1.4.2"
implementation 'com.volcengine:apm_insight:1.4.6.cn' implementation 'com.volcengine:apm_insight:1.4.6.cn'
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
......
...@@ -524,7 +524,7 @@ class AudioHomeActivity : ...@@ -524,7 +524,7 @@ class AudioHomeActivity :
writeAgoraLog("主叫方发送的邀请通话消息内容:$content", true) writeAgoraLog("主叫方发送的邀请通话消息内容:$content", true)
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "主叫方发送的邀请通话消息内容:$content") .sendRichLog(AliYunLogConfig.AGORA, "主叫方发送的邀请通话消息内容:$content")
localRemainTime = remainTime?.toInt() localRemainTime = (totalDuration?:1500).minus(remainTime?.toInt()?:1500)
handler = Handler() handler = Handler()
vibrator = getSystemService(Service.VIBRATOR_SERVICE) as Vibrator? vibrator = getSystemService(Service.VIBRATOR_SERVICE) as Vibrator?
} }
...@@ -564,8 +564,8 @@ class AudioHomeActivity : ...@@ -564,8 +564,8 @@ class AudioHomeActivity :
tv_name.text = expertName tv_name.text = expertName
tv_tips.text = expertTips tv_tips.text = expertTips
var time = totalDuration?.minus(remainTime!!.toInt())
tv_remain_time.text = DateUtils.formatTime(remainTime) tv_remain_time.text = DateUtils.formatTime((time).toString())
if (!TextUtils.isEmpty(expertHeadUrl)) { if (!TextUtils.isEmpty(expertHeadUrl)) {
var option = SimpleImageOpConfiger() var option = SimpleImageOpConfiger()
...@@ -740,6 +740,7 @@ class AudioHomeActivity : ...@@ -740,6 +740,7 @@ class AudioHomeActivity :
YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.headUrl, YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.headUrl,
YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.userName, YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.userName,
remainTime!!.toInt(), remainTime!!.toInt(),
totalDuration?:1500,
relationId, relationId,
callId, callId,
null, null,
...@@ -901,20 +902,6 @@ class AudioHomeActivity : ...@@ -901,20 +902,6 @@ class AudioHomeActivity :
if (finishStatus == 0) { if (finishStatus == 0) {
callStartTime = System.currentTimeMillis() callStartTime = System.currentTimeMillis()
} }
// if(finishStatus==1){
// var param = ConnectFinishCommand(listenerUid!!, relationId!!, "0",
// remainTime!!.toInt() - localRemainTime!!, callId!!,
// "0","0","$callStartTime",
// "${System.currentTimeMillis()}",3)
// mPresenter.connectFinish(param)
// }else{
// 接通开始回调
// callStartTime = System.currentTimeMillis()
// var param = ConnectStartCommand(listenerUid!!, relationId!!, callId!!,
// "${System.currentTimeMillis()}","3","0","0","0","0")
// mPresenter.connectStart(param)
// }
} }
/** /**
...@@ -1057,7 +1044,7 @@ class AudioHomeActivity : ...@@ -1057,7 +1044,7 @@ class AudioHomeActivity :
mPlayer!!.setCompletionListener(MediaPlayer.OnCompletionListener { mPlayer!!.setCompletionListener(MediaPlayer.OnCompletionListener {
LogUtil.e("播放结束") LogUtil.e("播放结束")
//通话剩余时间不足60s时,默认 //通话剩余时间不足60s时,默认
if (localRemainTime!! < 60 && !TextUtils.isEmpty(commentUrl)) { if (localRemainTime!! > (totalDuration?:1500).minus(60) && !TextUtils.isEmpty(commentUrl)) {
val h5Params = H5Params(commentUrl!!, "评价") val h5Params = H5Params(commentUrl!!, "评价")
NewH5Activity.start(this@AudioHomeActivity, h5Params) NewH5Activity.start(this@AudioHomeActivity, h5Params)
} }
...@@ -1114,17 +1101,14 @@ class AudioHomeActivity : ...@@ -1114,17 +1101,14 @@ class AudioHomeActivity :
//剩余倾诉时长倒计时 //剩余倾诉时长倒计时
totalDisposable = totalDisposable =
Observable.interval(0, 1, TimeUnit.SECONDS).subscribeOn(Schedulers.computation()) Observable.interval(0, 1, TimeUnit.SECONDS)
.take(remainTime!!.toLong() + 1).observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.computation())
.take(remainTime!!.toLong() + 1)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
localRemainTime = remainTime!!.toInt() - it.toInt() localRemainTime = (totalDuration?:1500).minus(remainTime!!.toInt()).plus(it.toInt())
if (localRemainTime == 180) {
playNoticeMusic(3) if (localRemainTime!! >= (totalDuration?:1500).minus(60)) {
}
if (localRemainTime == 60) {
playNoticeMusic(1)
}
if (localRemainTime!! <= 60) {
if (ll_changeRoute.isEnabled) { if (ll_changeRoute.isEnabled) {
ll_changeRoute.isEnabled = false ll_changeRoute.isEnabled = false
} }
...@@ -1178,6 +1162,7 @@ class AudioHomeActivity : ...@@ -1178,6 +1162,7 @@ class AudioHomeActivity :
YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.headUrl, YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.headUrl,
YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.userName, YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()!!.userName,
remainTime!!.toInt(), remainTime!!.toInt(),
totalDuration?:1500,
relationId, relationId,
callId, callId,
null, null,
......
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