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
......@@ -4,33 +4,27 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/platform_color_80353535">
android:background="@drawable/audiohome_background">
<TextView
android:id="@+id/tv_change_route"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="25dp"
android:layout_marginRight="10dp"
android:background="?android:attr/selectableItemBackground"
android:drawablePadding="6dp"
android:padding="5dp"
android:text="后可切换至传统电话"
android:textColor="@color/platform_color_50FFFFFF"
android:textSize="13sp"
android:visibility="visible" />
<TextView
android:id="@+id/tv_change_time_counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/tv_change_route"
android:layout_toLeftOf="@+id/tv_change_route"
android:textColor="@color/white"
android:textSize="15dp"
tools:text="60s" />
android:text="联系客服"
android:id="@+id/jump_kefu"
android:drawableLeft="@drawable/audioim_kefu"
android:layout_alignParentRight="true"
android:layout_marginTop="44dp"
android:layout_marginRight="@dimen/platform_dp_15"
android:drawablePadding="@dimen/platform_dp_3"
android:background="@drawable/audio_border_white_kefu"
android:paddingTop="@dimen/platform_dp_5"
android:paddingBottom="@dimen/platform_dp_5"
android:paddingStart="@dimen/platform_dp_8"
android:paddingEnd="@dimen/platform_dp_8"
>
</TextView>
<RelativeLayout
......@@ -58,55 +52,35 @@
android:layout_height="120dp"
android:layout_centerInParent="true"
android:scaleType="centerCrop"
android:src="@drawable/audioim_head_place_hold_pic" />
</RelativeLayout>
android:src="@drawable/audioim_head_place_hold_pic"
/>
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rl_head"
android:layout_below="@+id/iv_head"
android:layout_centerHorizontal="true"
android:layout_marginTop="-20dp"
android:layout_marginTop="@dimen/platform_dp_12"
android:textColor="@color/white"
android:textSize="26sp"
android:textSize="22sp"
tools:text="留意" />
<TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_name"
android:layout_centerHorizontal="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="6dp"
android:layout_marginRight="25dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:textColor="@color/white"
android:textSize="15sp"
tools:text="你存在的本身就是值得被爱的你存在的本身就是值得被爱的" />
</RelativeLayout>
<!-- 倾诉剩余时间-->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/rl_remain_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/ll_three_icon"
android:layout_marginBottom="20dp"
android:layout_below="@+id/rl_head"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/tv_notes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="剩余时长"
android:text="已通话时长"
android:textColor="@color/white"
android:textSize="15dp"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="@+id/tv_remain_time"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
......@@ -120,7 +94,7 @@
android:layout_toRightOf="@+id/tv_notes"
android:text="23:23"
android:textColor="@color/white"
android:textSize="16dp"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tv_notes"
app:layout_constraintTop_toTopOf="parent" />
......@@ -129,15 +103,34 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_notes"
android:layout_marginTop="2dp"
android:text="(限24小时内拨打)"
android:textColor="#80FFFFFF"
android:textSize="15dp"
android:layout_marginTop="4dp"
android:text="(满25分钟自动挂断,限24小时内拨打)"
android:textColor="#60ffffff"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_remain_time" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rl_remain_time"
android:layout_centerHorizontal="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="@dimen/platform_dp_10"
android:layout_marginRight="25dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:textColor="@color/white"
android:textSize="15sp"
tools:text="你存在的本身就是值得被爱的你存在的本身就是值得被爱的" />
<TextView
android:id="@+id/tv_change_doctor"
android:layout_width="wrap_content"
......@@ -162,6 +155,34 @@
android:textSize="12sp"
android:visibility="visible"
tools:visibility="gone" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_above="@id/ll_three_icon"
android:gravity="center"
android:orientation="vertical"
android:id="@+id/ll_changeRoute"
android:layout_marginBottom="@dimen/platform_dp_88"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/iv_change_route"
android:id="@+id/iv_change_route"
>
</ImageView>
<TextView
android:id="@+id/tv_change_time_counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/tv_change_route"
android:layout_toLeftOf="@+id/tv_change_route"
android:textColor="#60ffffff"
android:textSize="15dp"
tools:text="转传统电话(60s)" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_three_icon"
......@@ -171,47 +192,45 @@
android:layout_marginBottom="@dimen/platform_dp_18"
android:orientation="horizontal">
<!--静音按钮-->
<RelativeLayout
<LinearLayout
android:id="@+id/rl_mute_on_off"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
android:orientation="vertical"
android:gravity="center"
>
<ImageView
android:id="@+id/iv_mute_on_off"
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp"
android:src="@drawable/audioim_img_hang_up_unuse"
android:src="@drawable/audiohome_muteon"
android:visibility="visible" />
<TextView
android:id="@+id/audio_mute_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_mute_on_off"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:text="麦克风已开"
android:textColor="@color/white"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
<!--挂断按钮-->
<RelativeLayout
<LinearLayout
android:id="@+id/rl_hang_up"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:layout_height="wrap_content">
<com.ydl.ydlcommon.view.ProgressView
android:id="@+id/progress_view"
android:layout_width="70dp"
android:layout_height="70dp"
app:pa_progressBackColor="#45E6AB"
app:pa_progressWidth="4dp" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_hang_up"
android:layout_width="66dp"
......@@ -220,7 +239,13 @@
android:layout_marginTop="1dp"
android:src="@drawable/audioim_img_hang_up_unuse"
android:visibility="visible" />
<com.ydl.ydlcommon.view.ProgressView
android:id="@+id/progress_view"
android:layout_width="70dp"
android:layout_height="70dp"
app:pa_progressBackColor="#45E6AB"
app:pa_progressWidth="4dp" />
</FrameLayout>
<TextView
android:id="@+id/audio_hangup_text"
android:layout_width="wrap_content"
......@@ -231,34 +256,32 @@
android:text="挂断"
android:textColor="@color/white"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
<!-- 免提按钮-->
<RelativeLayout
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:gravity="center">
android:orientation="vertical"
android:gravity="center"
>
<ImageView
android:id="@+id/iv_hands_free"
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_marginTop="1dp"
android:src="@drawable/audioim_img_hands_free_unuse" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_hands_free"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:text="免提"
android:textColor="@color/white"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
......
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