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
a51ef1ed
Commit
a51ef1ed
authored
May 20, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:通话界面UI
parent
4f63d2ad
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
145 additions
and
105 deletions
+145
-105
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+29
-25
audiohome_background.webp
m-audioim/src/main/res/drawable-xhdpi/audiohome_background.webp
+0
-0
audiohome_muteoff.webp
m-audioim/src/main/res/drawable-xhdpi/audiohome_muteoff.webp
+0
-0
audiohome_muteon.webp
m-audioim/src/main/res/drawable-xhdpi/audiohome_muteon.webp
+0
-0
audioim_img_hands_free.png
m-audioim/src/main/res/drawable-xhdpi/audioim_img_hands_free.png
+0
-0
audioim_img_hands_free.webp
m-audioim/src/main/res/drawable-xhdpi/audioim_img_hands_free.webp
+0
-0
audioim_img_hands_free_unuse.png
m-audioim/src/main/res/drawable-xhdpi/audioim_img_hands_free_unuse.png
+0
-0
audioim_img_hands_free_unuse.webp
m-audioim/src/main/res/drawable-xhdpi/audioim_img_hands_free_unuse.webp
+0
-0
audioim_kefu.webp
m-audioim/src/main/res/drawable-xhdpi/audioim_kefu.webp
+0
-0
iv_change_route.webp
m-audioim/src/main/res/drawable-xhdpi/iv_change_route.webp
+0
-0
audio_border_white_kefu.xml
m-audioim/src/main/res/drawable/audio_border_white_kefu.xml
+13
-0
audioim_activity_audio_home.xml
m-audioim/src/main/res/layout/audioim_activity_audio_home.xml
+103
-80
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
a51ef1ed
...
...
@@ -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_r
oute
.
isEnabled
=
false
ll_changeR
oute
.
isEnabled
=
false
//水波纹view初始化
wave_view
.
setDuration
(
6000
)
wave_view
.
setStyle
(
Paint
.
Style
.
STROKE
)
...
...
@@ -573,14 +576,33 @@ class AudioHomeActivity :
}
if
(!
isShowAXB
)
{
tv_change_r
oute
.
visibility
=
View
.
GONE
ll_changeR
oute
.
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_r
oute
.
setOnClickListener
{
ll_changeR
oute
.
setOnClickListener
{
showChooseDialog
(
1
)
}
//挂断
...
...
@@ -997,13 +1019,10 @@ class AudioHomeActivity :
// tv_change_doctor.visibility = View.VISIBLE
// }
if
(!
isShowAXB
)
{
tv_change_r
oute
.
visibility
=
View
.
GONE
ll_changeR
oute
.
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
())
...
...
m-audioim/src/main/res/drawable-xhdpi/audiohome_background.webp
0 → 100644
View file @
a51ef1ed
File added
m-audioim/src/main/res/drawable-xhdpi/audiohome_muteoff.webp
0 → 100644
View file @
a51ef1ed
File added
m-audioim/src/main/res/drawable-xhdpi/audiohome_muteon.webp
0 → 100644
View file @
a51ef1ed
File added
m-audioim/src/main/res/drawable-xhdpi/audioim_img_hands_free.png
deleted
100644 → 0
View file @
4f63d2ad
6.62 KB
m-audioim/src/main/res/drawable-xhdpi/audioim_img_hands_free.webp
0 → 100644
View file @
a51ef1ed
File added
m-audioim/src/main/res/drawable-xhdpi/audioim_img_hands_free_unuse.png
deleted
100644 → 0
View file @
4f63d2ad
7.01 KB
m-audioim/src/main/res/drawable-xhdpi/audioim_img_hands_free_unuse.webp
0 → 100644
View file @
a51ef1ed
File added
m-audioim/src/main/res/drawable-xhdpi/audioim_kefu.webp
0 → 100644
View file @
a51ef1ed
File added
m-audioim/src/main/res/drawable-xhdpi/iv_change_route.webp
0 → 100644
View file @
a51ef1ed
File added
m-audioim/src/main/res/drawable/audio_border_white_kefu.xml
0 → 100644
View file @
a51ef1ed
<?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
m-audioim/src/main/res/layout/audioim_activity_audio_home.xml
View file @
a51ef1ed
...
...
@@ -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=
"26
sp"
android:textSize=
"22
sp"
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=
"1
5d
p"
android:textSize=
"1
8s
p"
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=
"1
6d
p"
android:textSize=
"1
8s
p"
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=
"
2
dp"
android:text=
"(限24小时内拨打)"
android:textColor=
"#
80FFFFFF
"
android:textSize=
"1
5d
p"
android:layout_marginTop=
"
4
dp"
android:text=
"(
满25分钟自动挂断,
限24小时内拨打)"
android:textColor=
"#
60ffffff
"
android:textSize=
"1
6s
p"
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"
>
<!--静音按钮-->
<
Relative
Layout
<
Linear
Layout
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/audio
im_img_hang_up_unuse
"
android:src=
"@drawable/audio
home_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"
/>
</
Relative
Layout>
</
Linear
Layout>
<!--挂断按钮-->
<
Relative
Layout
<
Linear
Layout
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"
/>
</
Relative
Layout>
</
Linear
Layout>
<!-- 免提按钮-->
<
Relative
Layout
<
Linear
Layout
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"
/>
</
Relative
Layout>
</
Linear
Layout>
</LinearLayout>
...
...
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