Commit a51ef1ed by 霍志良

feat:通话界面UI

parent 4f63d2ad
......@@ -21,6 +21,7 @@ import android.view.View
import android.view.animation.AccelerateInterpolator
import androidx.core.content.ContextCompat
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.google.gson.Gson
import com.hjq.permissions.OnPermissionCallback
import com.hjq.permissions.XXPermissions
......@@ -41,6 +42,7 @@ import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.webview.RefreshWebEvent
import com.ydl.ydl_av.chat.bean.AudioMessageBean
import com.ydl.ydl_av.voice.impl.YDLVoiceApiImpl
import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler
import com.ydl.ydl_av.voice.manager.YDLVoiceManager
import com.ydl.ydl_image.config.SimpleImageOpConfiger
......@@ -56,6 +58,7 @@ import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import io.agora.rtc.Constants
......@@ -546,7 +549,7 @@ class AudioHomeActivity :
writeAgoraLog("用户拨打电话界面开启")
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "用户拨打电话界面开启")
tv_change_route.isEnabled = false
ll_changeRoute.isEnabled = false
//水波纹view初始化
wave_view.setDuration(6000)
wave_view.setStyle(Paint.Style.STROKE)
......@@ -573,14 +576,33 @@ class AudioHomeActivity :
}
if (!isShowAXB) {
tv_change_route.visibility = View.GONE
ll_changeRoute.visibility = View.GONE
tv_change_time_counter.visibility = View.GONE
}
}
private fun setClickEvent() {
//跳转客服小壹
jump_kefu.setOnClickListener {
val imService = ARouter.getInstance().navigation(IImService::class.java)
imService?.startKefuChat(this, "", 0, 0)
}
//静音开启
rl_mute_on_off.setOnClickListener {
if (iv_mute_on_off.isSelected) {
iv_mute_on_off.isSelected = false
iv_mute_on_off.setImageResource(R.drawable.audiohome_muteoff)
audio_mute_text.text="麦克风已关"
voiceManage?.getVoiceApi()?.enableLocalAudio(false)
} else {
iv_mute_on_off.isSelected = true
iv_mute_on_off.setImageResource(R.drawable.audiohome_muteon)
audio_mute_text.text="麦克风已开"
voiceManage?.getVoiceApi()?.enableLocalAudio(true)
}
}
//切换线路
tv_change_route.setOnClickListener {
ll_changeRoute.setOnClickListener {
showChooseDialog(1)
}
//挂断
......@@ -997,13 +1019,10 @@ class AudioHomeActivity :
// tv_change_doctor.visibility = View.VISIBLE
// }
if (!isShowAXB) {
tv_change_route.visibility = View.GONE
ll_changeRoute.visibility = View.GONE
} else {
//切换线路按钮可见
tv_change_route.isEnabled = true
tv_change_route.text = "切换至传统电话"
tv_change_route.setTextColor(ContextCompat.getColor(this, R.color.platform_white))
ll_changeRoute.isEnabled = true
}
}
......@@ -1102,23 +1121,8 @@ class AudioHomeActivity :
playNoticeMusic(1)
}
if (localRemainTime!! <= 60) {
if (tv_change_route.isEnabled) {
tv_change_route.isEnabled = false
tv_change_route.setTextColor(
ContextCompat.getColor(
this,
R.color.audioim_color_50ffffff
)
)
tv_change_route.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
ContextCompat.getDrawable(
this,
R.drawable.audioim_img_choose_arrow_unuse
),
null
)
if (ll_changeRoute.isEnabled) {
ll_changeRoute.isEnabled = false
}
}
tv_remain_time.text = DateUtils.formatTime(localRemainTime.toString())
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/platform_dp_14" />
<solid android:color="@color/transparent" />
<stroke
android:color="#ffffff"
android:width="0.5dp"
>
</stroke>
</shape>
\ No newline at end of file
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