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
691f4ad3
Commit
691f4ad3
authored
3 years ago
by
fengquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 通话界面弹框提醒
parent
143a5d99
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
216 additions
and
30 deletions
+216
-30
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+154
-30
ZDialog.java
m-audioim/src/main/java/com/ydl/audioim/widget/ZDialog.java
+6
-0
audioim_activity_time_alarm_dialog.xml
m-audioim/src/main/res/layout/audioim_activity_time_alarm_dialog.xml
+53
-0
strings.xml
m-audioim/src/main/res/values/strings.xml
+3
-0
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
691f4ad3
...
@@ -18,6 +18,7 @@ import android.text.TextUtils
...
@@ -18,6 +18,7 @@ import android.text.TextUtils
import
android.view.View
import
android.view.View
import
android.view.WindowManager
import
android.view.WindowManager
import
android.view.animation.AccelerateInterpolator
import
android.view.animation.AccelerateInterpolator
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.alibaba.android.arouter.launcher.ARouter
import
com.alibaba.android.arouter.launcher.ARouter
...
@@ -49,6 +50,7 @@ import com.ydl.ydlcommon.base.BaseMvpActivity
...
@@ -49,6 +50,7 @@ import com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.ScreenUtil
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
...
@@ -152,6 +154,16 @@ class AudioHomeActivity :
...
@@ -152,6 +154,16 @@ class AudioHomeActivity :
private
var
localRemainTime
:
Int
?
=
0
private
var
localRemainTime
:
Int
?
=
0
/**
/**
* 挂断电话需要等待时间
*/
private
var
onlineCallTime
:
Long
?
=
0
/**
* 跳转传统电话需要等待时间
*/
private
var
traditionCallTime
:
Long
?
=
0
/**
* 50s自动挂断倒计时
* 50s自动挂断倒计时
*/
*/
private
var
waitDisposable
:
Disposable
?
=
null
private
var
waitDisposable
:
Disposable
?
=
null
...
@@ -192,7 +204,6 @@ class AudioHomeActivity :
...
@@ -192,7 +204,6 @@ class AudioHomeActivity :
private
var
voiceManage
:
YDLVoiceManager
?
=
null
private
var
voiceManage
:
YDLVoiceManager
?
=
null
//频道管理器
//频道管理器
// private var channelManager: ChannelManager? = null
// private var channelManager: ChannelManager? = null
...
@@ -208,6 +219,14 @@ class AudioHomeActivity :
...
@@ -208,6 +219,14 @@ class AudioHomeActivity :
private
var
mStorageDialog
:
ZDialog
?
=
null
private
var
mStorageDialog
:
ZDialog
?
=
null
private
var
mHangUpTimeTraditionalDialog
:
ZDialog
?
=
null
private
var
mHangUpTimeOnlineDialog
:
ZDialog
?
=
null
private
var
canHangUp
:
Boolean
=
false
private
var
canChangeRoute
:
Boolean
=
false
/**
/**
* 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
* 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
*/
*/
...
@@ -231,6 +250,7 @@ class AudioHomeActivity :
...
@@ -231,6 +250,7 @@ class AudioHomeActivity :
// 声网发出警告错误码,不应该直接离开房间
// 声网发出警告错误码,不应该直接离开房间
}
}
/**
/**
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html
* */
* */
...
@@ -316,6 +336,7 @@ class AudioHomeActivity :
...
@@ -316,6 +336,7 @@ class AudioHomeActivity :
// leaveChannel()
// leaveChannel()
// }
// }
}
}
/**
/**
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e
* */
* */
...
@@ -383,7 +404,6 @@ class AudioHomeActivity :
...
@@ -383,7 +404,6 @@ class AudioHomeActivity :
},
500
)
},
500
)
}
}
...
@@ -542,7 +562,7 @@ class AudioHomeActivity :
...
@@ -542,7 +562,7 @@ class AudioHomeActivity :
writeAgoraLog
(
"主叫方发送的邀请通话消息内容:$content"
,
true
)
writeAgoraLog
(
"主叫方发送的邀请通话消息内容:$content"
,
true
)
AliYunRichLogsHelper
.
getInstance
()
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"主叫方发送的邀请通话消息内容:$content"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"主叫方发送的邀请通话消息内容:$content"
)
localRemainTime
=
(
totalDuration
?:
1500
).
minus
(
remainTime
?.
toInt
()
?:
1500
)
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
?
...
@@ -550,9 +570,9 @@ class AudioHomeActivity :
...
@@ -550,9 +570,9 @@ class AudioHomeActivity :
var
count
=
0
var
count
=
0
phoneHandler
?.
postDelayed
(
object
:
Runnable
{
phoneHandler
?.
postDelayed
(
object
:
Runnable
{
override
fun
run
()
{
override
fun
run
()
{
if
(
count
%
2
==
0
)
{
if
(
count
%
2
==
0
)
{
tv_tips
.
text
=
"正在发送倾诉请求…"
tv_tips
.
text
=
"正在发送倾诉请求…"
}
else
{
}
else
{
tv_tips
.
text
=
"正在等待聆听者接受邀请…"
tv_tips
.
text
=
"正在等待聆听者接受邀请…"
}
}
count
++
count
++
...
@@ -582,7 +602,6 @@ class AudioHomeActivity :
...
@@ -582,7 +602,6 @@ class AudioHomeActivity :
writeAgoraLog
(
"用户拨打电话界面开启"
)
writeAgoraLog
(
"用户拨打电话界面开启"
)
AliYunRichLogsHelper
.
getInstance
()
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户拨打电话界面开启"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户拨打电话界面开启"
)
ll_changeRoute
.
isEnabled
=
false
//水波纹view初始化
//水波纹view初始化
wave_view
.
setDuration
(
6000
)
wave_view
.
setDuration
(
6000
)
wave_view
.
setStyle
(
Paint
.
Style
.
STROKE
)
wave_view
.
setStyle
(
Paint
.
Style
.
STROKE
)
...
@@ -591,7 +610,7 @@ class AudioHomeActivity :
...
@@ -591,7 +610,7 @@ class AudioHomeActivity :
wave_view
.
setInitialRadius
(
140f
)
wave_view
.
setInitialRadius
(
140f
)
wave_view
.
setInterpolator
(
AccelerateInterpolator
(
1.2f
))
wave_view
.
setInterpolator
(
AccelerateInterpolator
(
1.2f
))
//挂断按钮默认不可点击
//挂断按钮默认不可点击
iv_hang_up
.
isEnabled
=
false
//设置默认关闭扬声器
//设置默认关闭扬声器
iv_hands_free
.
isSelected
=
false
iv_hands_free
.
isSelected
=
false
...
@@ -626,22 +645,32 @@ class AudioHomeActivity :
...
@@ -626,22 +645,32 @@ class AudioHomeActivity :
if
(
iv_mute_on_off
.
isSelected
)
{
if
(
iv_mute_on_off
.
isSelected
)
{
iv_mute_on_off
.
isSelected
=
false
iv_mute_on_off
.
isSelected
=
false
iv_mute_on_off
.
setImageResource
(
R
.
drawable
.
audiohome_muteoff
)
iv_mute_on_off
.
setImageResource
(
R
.
drawable
.
audiohome_muteoff
)
audio_mute_text
.
text
=
"麦克风已关"
audio_mute_text
.
text
=
"麦克风已关"
voiceManage
?.
getVoiceApi
()
?.
enableLocalAudio
(
false
)
voiceManage
?.
getVoiceApi
()
?.
enableLocalAudio
(
false
)
}
else
{
}
else
{
iv_mute_on_off
.
isSelected
=
true
iv_mute_on_off
.
isSelected
=
true
iv_mute_on_off
.
setImageResource
(
R
.
drawable
.
audiohome_muteon
)
iv_mute_on_off
.
setImageResource
(
R
.
drawable
.
audiohome_muteon
)
audio_mute_text
.
text
=
"麦克风已开"
audio_mute_text
.
text
=
"麦克风已开"
voiceManage
?.
getVoiceApi
()
?.
enableLocalAudio
(
true
)
voiceManage
?.
getVoiceApi
()
?.
enableLocalAudio
(
true
)
}
}
}
}
//切换线路
//切换线路
ll_changeRoute
.
setOnClickListener
{
ll_changeRoute
.
setOnClickListener
{
if
(!
canChangeRoute
)
{
showHangUpTimeTraditionalDialog
()
return
@setOnClickListener
}
ActionCountUtils
.
record
(
"call_phone_page"
,
"call_phone_icon_click"
,
"0"
,
"4"
)
ActionCountUtils
.
record
(
"call_phone_page"
,
"call_phone_icon_click"
,
"0"
,
"4"
)
showChooseDialog
(
1
)
showChooseDialog
(
1
)
}
}
//挂断
//挂断
iv_hang_up
.
setOnClickListener
{
iv_hang_up
.
setOnClickListener
{
if
(!
canHangUp
)
{
showHangUpTimeOnlineDialog
()
return
@setOnClickListener
}
if
(
Utils
.
isFastClick
())
{
if
(
Utils
.
isFastClick
())
{
//防止连击
//防止连击
return
@setOnClickListener
return
@setOnClickListener
...
@@ -738,19 +767,20 @@ class AudioHomeActivity :
...
@@ -738,19 +767,20 @@ class AudioHomeActivity :
}
}
}
}
private
fun
showStorageDialog
()
{
private
fun
showStorageDialog
()
{
if
(
mStorageDialog
==
null
)
{
if
(
mStorageDialog
==
null
)
{
mStorageDialog
=
ZDialog
.
Builder
(
this
)
mStorageDialog
=
ZDialog
.
Builder
(
this
)
.
setContentView
(
R
.
layout
.
audioim_activity_permission_dialog
)
.
setContentView
(
R
.
layout
.
audioim_activity_permission_dialog
)
.
setOnClickListener
(
R
.
id
.
cancel_dialog
)
{
.
setOnClickListener
(
R
.
id
.
cancel_dialog
)
{
mStorageDialog
?.
dismiss
()
mStorageDialog
?.
dismiss
()
mStorageDialog
=
null
mStorageDialog
=
null
finish
()
finish
()
}
}
.
setAnimation
(
0
)
//取消动画
.
setAnimation
(
0
)
//取消动画
.
setOnClickListener
(
R
.
id
.
dial_right_now
)
{
.
setOnClickListener
(
R
.
id
.
dial_right_now
)
{
mStorageDialog
?.
dismiss
()
mStorageDialog
?.
dismiss
()
mStorageDialog
=
null
mStorageDialog
=
null
finish
()
finish
()
val
intent
=
Intent
(
Settings
.
ACTION_APPLICATION_DETAILS_SETTINGS
)
val
intent
=
Intent
(
Settings
.
ACTION_APPLICATION_DETAILS_SETTINGS
)
val
uri
=
Uri
.
fromParts
(
"package"
,
packageName
,
null
)
val
uri
=
Uri
.
fromParts
(
"package"
,
packageName
,
null
)
...
@@ -760,6 +790,66 @@ class AudioHomeActivity :
...
@@ -760,6 +790,66 @@ class AudioHomeActivity :
.
show
()
.
show
()
}
}
}
}
private
fun
showHangUpTimeTraditionalDialog
()
{
if
(
mHangUpTimeTraditionalDialog
==
null
)
{
mHangUpTimeTraditionalDialog
=
ZDialog
.
Builder
(
this
)
.
setContentView
(
R
.
layout
.
audioim_activity_time_alarm_dialog
)
.
setOnClickListener
(
R
.
id
.
dial_right_now
)
{
mHangUpTimeTraditionalDialog
?.
dismiss
()
mHangUpTimeTraditionalDialog
=
null
}
.
setCancelAble
(
false
)
.
setAnimation
(
0
)
//取消动画
.
width
((
resources
.
displayMetrics
.
widthPixels
*
0.8f
).
toInt
())
.
show
()
val
text
=
String
.
format
(
getString
(
R
.
string
.
audioim_audio_time_alarm_msg_tradition_dialog
),
traditionCallTime
)
(
mHangUpTimeTraditionalDialog
?.
findDialogView
(
R
.
id
.
third_title
)
as
TextView
).
text
=
text
}
}
private
fun
dismissHangUpTimeTraditionalDialog
()
{
if
(
mHangUpTimeTraditionalDialog
!=
null
&&
mHangUpTimeTraditionalDialog
!!
.
isShowing
)
{
mHangUpTimeTraditionalDialog
!!
.
dismiss
()
mHangUpTimeTraditionalDialog
=
null
}
}
private
fun
dismissHangUpTimeOnlineDialog
()
{
if
(
mHangUpTimeOnlineDialog
!=
null
&&
mHangUpTimeOnlineDialog
!!
.
isShowing
)
{
mHangUpTimeOnlineDialog
!!
.
dismiss
()
mHangUpTimeOnlineDialog
=
null
}
}
private
fun
showHangUpTimeOnlineDialog
()
{
if
(
mHangUpTimeOnlineDialog
==
null
)
{
mHangUpTimeOnlineDialog
=
ZDialog
.
Builder
(
this
)
.
setContentView
(
R
.
layout
.
audioim_activity_time_alarm_dialog
)
.
setOnClickListener
(
R
.
id
.
dial_right_now
)
{
mHangUpTimeOnlineDialog
?.
dismiss
()
mHangUpTimeOnlineDialog
=
null
}
.
setCancelAble
(
false
)
.
setAnimation
(
0
)
//取消动画
.
width
((
resources
.
displayMetrics
.
widthPixels
*
0.8f
).
toInt
())
.
show
()
val
text
=
String
.
format
(
getString
(
R
.
string
.
audioim_audio_time_alarm_msg_online_dialog
),
onlineCallTime
)
(
mHangUpTimeOnlineDialog
?.
findDialogView
(
R
.
id
.
third_title
)
as
TextView
).
text
=
text
}
}
@SuppressLint
(
"CheckResult"
,
"SetTextI18n"
)
@SuppressLint
(
"CheckResult"
,
"SetTextI18n"
)
private
fun
init
()
{
private
fun
init
()
{
wave_view
.
start
()
wave_view
.
start
()
...
@@ -773,7 +863,7 @@ class AudioHomeActivity :
...
@@ -773,7 +863,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
,
totalDuration
?:
1500
,
relationId
,
relationId
,
callId
,
callId
,
null
,
null
,
...
@@ -791,23 +881,43 @@ class AudioHomeActivity :
...
@@ -791,23 +881,43 @@ class AudioHomeActivity :
Observable
.
interval
(
0
,
100
,
TimeUnit
.
MILLISECONDS
).
subscribeOn
(
Schedulers
.
computation
())
Observable
.
interval
(
0
,
100
,
TimeUnit
.
MILLISECONDS
).
subscribeOn
(
Schedulers
.
computation
())
.
take
(
600
).
observeOn
(
AndroidSchedulers
.
mainThread
()).
subscribe
({
.
take
(
600
).
observeOn
(
AndroidSchedulers
.
mainThread
()).
subscribe
({
val
remainTime
=
50
-
it
/
10
val
remainTime
=
50
-
it
/
10
traditionCallTime
=
remainTime
if
(
remainTime
<=
0
)
{
if
(
remainTime
<=
0
)
{
dismissHangUpTimeTraditionalDialog
()
waittingStatus
()
waittingStatus
()
}
else
{
}
else
{
tv_change_time_counter
.
text
=
"转传统电话(${remainTime}s)"
tv_change_time_counter
.
text
=
"转传统电话(${remainTime}s)"
if
(
mHangUpTimeTraditionalDialog
!=
null
&&
mHangUpTimeTraditionalDialog
!!
.
isShowing
)
{
val
callTime
=
String
.
format
(
getString
(
R
.
string
.
audioim_audio_time_alarm_msg_tradition_dialog
),
traditionCallTime
)
(
mHangUpTimeTraditionalDialog
!!
.
findDialogView
(
R
.
id
.
third_title
)
as
TextView
).
text
=
callTime
}
}
onlineCallTime
=
remainTime
-
20
if
(
remainTime
<=
20
)
{
audio_hangup_text
.
text
=
"挂断"
dismissHangUpTimeOnlineDialog
()
}
else
{
audio_hangup_text
.
text
=
"挂断(${remainTime - 20}s)"
if
(
mHangUpTimeOnlineDialog
!=
null
&&
mHangUpTimeOnlineDialog
!!
.
isShowing
)
{
val
callTime
=
String
.
format
(
getString
(
R
.
string
.
audioim_audio_time_alarm_msg_online_dialog
),
onlineCallTime
)
(
mHangUpTimeOnlineDialog
!!
.
findDialogView
(
R
.
id
.
third_title
)
as
TextView
).
text
=
callTime
}
}
if
(
remainTime
<=
20
){
audio_hangup_text
.
text
=
"挂断"
}
else
{
audio_hangup_text
.
text
=
"挂断(${remainTime-20}s)"
}
}
var
result
=
it
.
toFloat
()
/
3f
var
result
=
it
.
toFloat
()
/
3f
progress_view
.
setProgress
(
result
)
progress_view
.
setProgress
(
result
)
if
(
result
>=
100f
&&
!
iv_hang_up
.
isEnabled
)
{
if
(
result
>=
100f
&&
!
canHangUp
)
{
audio_hangup_text
.
text
=
"挂断"
audio_hangup_text
.
text
=
"挂断"
//挂断按钮可点击
//挂断按钮可点击
iv_hang_up
.
isEnabled
=
true
canHangUp
=
true
iv_hang_up
.
setImageResource
(
R
.
drawable
.
audioim_img_hang_up
)
iv_hang_up
.
setImageResource
(
R
.
drawable
.
audioim_img_hang_up
)
}
}
...
@@ -817,10 +927,20 @@ class AudioHomeActivity :
...
@@ -817,10 +927,20 @@ class AudioHomeActivity :
LogUtil
.
d
(
it
.
message
)
LogUtil
.
d
(
it
.
message
)
AliYunRichLogsHelper
.
getInstance
()
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"倒计时异常${it.message}"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"倒计时异常${it.message}"
)
dismissHangUpTimeOnlineDialog
()
dismissHangUpTimeTraditionalDialog
()
})
{
})
{
// waittingStatus()
// waittingStatus()
if
(!
isConnectSuccess
)
{
if
(!
isConnectSuccess
)
{
//关闭音乐
//关闭音乐
dismissHangUpTimeOnlineDialog
()
dismissHangUpTimeTraditionalDialog
()
stopPlaying
()
stopPlaying
()
callEventSave
(
"34"
,
"未接通挂断:50s等待倒计时结束挂断"
)
callEventSave
(
"34"
,
"未接通挂断:50s等待倒计时结束挂断"
)
...
@@ -1034,7 +1154,7 @@ class AudioHomeActivity :
...
@@ -1034,7 +1154,7 @@ class AudioHomeActivity :
private
fun
waittingStatus
()
{
private
fun
waittingStatus
()
{
tv_change_time_counter
.
visibility
=
View
.
GONE
tv_change_time_counter
.
visibility
=
View
.
GONE
//挂断按钮可点击
//挂断按钮可点击
iv_hang_up
.
isEnabled
=
true
canHangUp
=
true
iv_hang_up
.
setImageResource
(
R
.
drawable
.
audioim_img_hang_up
)
iv_hang_up
.
setImageResource
(
R
.
drawable
.
audioim_img_hang_up
)
// if (!isConnectSuccess) {
// if (!isConnectSuccess) {
// //页面等待文案调整
// //页面等待文案调整
...
@@ -1046,7 +1166,7 @@ class AudioHomeActivity :
...
@@ -1046,7 +1166,7 @@ class AudioHomeActivity :
ll_changeRoute
.
visibility
=
View
.
GONE
ll_changeRoute
.
visibility
=
View
.
GONE
}
else
{
}
else
{
//切换线路按钮可见
//切换线路按钮可见
ll_changeRoute
.
isEnabled
=
true
canChangeRoute
=
true
}
}
}
}
...
@@ -1077,7 +1197,10 @@ class AudioHomeActivity :
...
@@ -1077,7 +1197,10 @@ class AudioHomeActivity :
mPlayer
!!
.
setCompletionListener
(
MediaPlayer
.
OnCompletionListener
{
mPlayer
!!
.
setCompletionListener
(
MediaPlayer
.
OnCompletionListener
{
LogUtil
.
e
(
"播放结束"
)
LogUtil
.
e
(
"播放结束"
)
//通话剩余时间不足60s时,默认
//通话剩余时间不足60s时,默认
if
(
localRemainTime
!!
>
(
totalDuration
?:
1500
).
minus
(
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
)
}
}
...
@@ -1139,11 +1262,12 @@ class AudioHomeActivity :
...
@@ -1139,11 +1262,12 @@ class AudioHomeActivity :
.
take
(
remainTime
!!
.
toLong
()
+
1
)
.
take
(
remainTime
!!
.
toLong
()
+
1
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
.
subscribe
({
localRemainTime
=
(
totalDuration
?:
1500
).
minus
(
remainTime
!!
.
toInt
()).
plus
(
it
.
toInt
())
localRemainTime
=
(
totalDuration
?:
1500
).
minus
(
remainTime
!!
.
toInt
()).
plus
(
it
.
toInt
())
if
(
localRemainTime
!!
>=
(
totalDuration
?:
1500
).
minus
(
60
))
{
if
(
localRemainTime
!!
>=
(
totalDuration
?:
1500
).
minus
(
60
))
{
if
(
ll_changeRoute
.
isEnabled
)
{
if
(
canChangeRoute
)
{
ll_changeRoute
.
isEnabled
=
false
canChangeRoute
=
false
}
}
}
}
tv_remain_time
.
text
=
DateUtils
.
formatTime
(
localRemainTime
.
toString
())
tv_remain_time
.
text
=
DateUtils
.
formatTime
(
localRemainTime
.
toString
())
...
@@ -1195,7 +1319,7 @@ class AudioHomeActivity :
...
@@ -1195,7 +1319,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
,
totalDuration
?:
1500
,
relationId
,
relationId
,
callId
,
callId
,
null
,
null
,
...
@@ -1388,7 +1512,7 @@ class AudioHomeActivity :
...
@@ -1388,7 +1512,7 @@ class AudioHomeActivity :
handler
=
null
handler
=
null
}
}
if
(
phoneHandler
!=
null
){
if
(
phoneHandler
!=
null
)
{
phoneHandler
=
null
phoneHandler
=
null
}
}
...
@@ -1443,7 +1567,7 @@ class AudioHomeActivity :
...
@@ -1443,7 +1567,7 @@ class AudioHomeActivity :
session
:
String
?
=
channelId
,
session
:
String
?
=
channelId
,
line
:
String
=
"7"
line
:
String
=
"7"
)
{
)
{
YDLavManager
.
instances
.
callEventSave
(
status
,
res
,
session
,
line
)
YDLavManager
.
instances
.
callEventSave
(
status
,
res
,
session
,
line
)
}
}
private
fun
onStartCall
()
{
private
fun
onStartCall
()
{
...
...
This diff is collapsed.
Click to expand it.
m-audioim/src/main/java/com/ydl/audioim/widget/ZDialog.java
View file @
691f4ad3
...
@@ -2,6 +2,7 @@ package com.ydl.audioim.widget;
...
@@ -2,6 +2,7 @@ package com.ydl.audioim.widget;
import
android.app.Dialog
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.content.Context
;
import
android.os.Build
;
import
android.view.Gravity
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
...
@@ -123,6 +124,11 @@ public class ZDialog extends Dialog {
...
@@ -123,6 +124,11 @@ public class ZDialog extends Dialog {
return
this
;
return
this
;
}
}
public
Builder
width
(
int
width
){
mDialogParams
.
defaultWidth
=
width
;
return
this
;
}
public
Builder
setGravity
(
@ZDialogDirection
.
ZGravity
int
direction
)
{
public
Builder
setGravity
(
@ZDialogDirection
.
ZGravity
int
direction
)
{
switch
(
direction
)
{
switch
(
direction
)
{
case
ZDialogDirection
.
FROM_TOP
:
case
ZDialogDirection
.
FROM_TOP
:
...
...
This diff is collapsed.
Click to expand it.
m-audioim/src/main/res/layout/audioim_activity_time_alarm_dialog.xml
0 → 100644
View file @
691f4ad3
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/platform_dp_38"
android:layout_marginLeft=
"@dimen/platform_dp_38"
android:layout_marginEnd=
"@dimen/platform_dp_38"
android:background=
"@drawable/shape_bg_white_fillet8"
app:layout_goneMarginEnd=
"@dimen/platform_dp_38"
>
<TextView
android:id=
"@+id/third_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_20"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"15sp"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:layout_editor_absoluteY=
"85dp"
/>
<View
android:id=
"@+id/line"
android:layout_width=
"match_parent"
android:layout_height=
"0.5dp"
android:layout_marginTop=
"@dimen/platform_dp_28"
android:background=
"@color/platform_color_D8D8D8"
app:layout_constraintTop_toBottomOf=
"@id/third_title"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/line"
>
<TextView
android:id=
"@+id/dial_right_now"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/platform_dp_48"
android:gravity=
"center"
android:text=
"@string/audioim_got_it"
android:textColor=
"@color/platform_color_1DA1F2"
android:textSize=
"17sp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
m-audioim/src/main/res/values/strings.xml
View file @
691f4ad3
<resources>
<resources>
<string
name=
"audioim_need_storage_permission_hint"
>
App正常工作需要内部存储使用权限,请开启
</string>
<string
name=
"audioim_need_storage_permission_hint"
>
App正常工作需要内部存储使用权限,请开启
</string>
<string
name=
"audioim_got_it"
>
知道了
</string>
<string
name=
"audioim_audio_time_alarm_msg_tradition_dialog"
>
请等待 %s 秒后,点击跳转传统电话
</string>
<string
name=
"audioim_audio_time_alarm_msg_online_dialog"
>
请等待 %s 秒后,点击挂断
</string>
</resources>
</resources>
This diff is collapsed.
Click to expand it.
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