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
0804dda8
Commit
0804dda8
authored
Apr 24, 2022
by
upwork.021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 通话页面ui和逻辑编写优化,通话组件升级
parent
f02775dc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
242 additions
and
15 deletions
+242
-15
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-1
config.gradle
config.gradle
+1
-1
AndroidManifest.xml
ydl-tuicore/src/main/AndroidManifest.xml
+7
-2
LoginTUI.kt
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/login/LoginTUI.kt
+1
-1
TRTCCalling.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/trtccalling/model/TRTCCalling.java
+5
-3
VideoCallingActivity.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/videocall/VideoCallingActivity.java
+0
-0
YDLInvitionActivity.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/videocall/YDLInvitionActivity.java
+4
-0
StatusBarUtil.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/StatusBarUtil.java
+162
-0
videocall_activity_calling.xml
ydl-tuicore/src/main/res/layout/videocall_activity_calling.xml
+51
-7
styles.xml
ydl-tuicore/src/main/res/values/styles.xml
+10
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
0804dda8
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
<activity
<activity
android:name=
".home.HomeActivity"
android:name=
".home.HomeActivity"
android:launchMode=
"singleTask"
android:launchMode=
"singleTask"
android:noHistory=
"true"
></activity
>
android:noHistory=
"true"
/
>
<activity
<activity
...
...
config.gradle
View file @
0804dda8
...
@@ -33,7 +33,7 @@ ext {
...
@@ -33,7 +33,7 @@ ext {
//-------------- 功能组件 --------------
//-------------- 功能组件 --------------
//mdt 组件
//mdt 组件
"ydl-tuicore"
:
"0.0.1
2
"
,
"ydl-tuicore"
:
"0.0.1
4
"
,
// "m-tuicore-ydl" : "0.0.10",
// "m-tuicore-ydl" : "0.0.10",
//第一步
//第一步
"ydl-platform"
:
"0.0.40.90"
,
"ydl-platform"
:
"0.0.40.90"
,
...
...
ydl-tuicore/src/main/AndroidManifest.xml
View file @
0804dda8
...
@@ -19,11 +19,15 @@
...
@@ -19,11 +19,15 @@
<activity
<activity
android:name=
".calling.videocall.VideoCallingActivity"
android:name=
".calling.videocall.VideoCallingActivity"
android:launchMode=
"singleTask"
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
/>
android:screenOrientation=
"portrait"
android:theme=
"@style/VideoCallActivityTheme"
/>
<!--接听界面-->
<!--接听界面-->
<activity
<activity
android:name=
".calling.videocall.YDLInvitionActivity"
android:name=
".calling.videocall.YDLInvitionActivity"
android:launchMode=
"singleTask"
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
/>
android:screenOrientation=
"portrait"
android:theme=
"@style/VideoCallActivityTheme"
/>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/login/LoginTUI.kt
View file @
0804dda8
package
com.tencent.
liteav
.login
package
com.tencent.
qcloud.tuicore.calling
.login
import
android.content.Context
import
android.content.Context
import
android.util.Log
import
android.util.Log
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/trtccalling/model/TRTCCalling.java
View file @
0804dda8
...
@@ -332,11 +332,12 @@ public class TRTCCalling {
...
@@ -332,11 +332,12 @@ public class TRTCCalling {
intent
.
putExtra
(
Constant
.
USER_ID
,
userModel
.
userId
);
intent
.
putExtra
(
Constant
.
USER_ID
,
userModel
.
userId
);
intent
.
putExtra
(
Constant
.
INVITE_ID
,
inviter
);
intent
.
putExtra
(
Constant
.
INVITE_ID
,
inviter
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
mContext
.
startActivity
(
intent
);
mContext
.
startActivity
(
intent
);
}
}
}
}
// handleRecvCallModel(inviteID, inviter, groupID, inviteeList, data);
// 响铃
startRing
();
}
}
@Override
@Override
...
@@ -2083,7 +2084,8 @@ public class TRTCCalling {
...
@@ -2083,7 +2084,8 @@ public class TRTCCalling {
}
}
}
}
private
void
stopRing
()
{
public
void
stopRing
()
{
stopMusic
();
stopMusic
();
}
}
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/videocall/VideoCallingActivity.java
View file @
0804dda8
This diff is collapsed.
Click to expand it.
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/videocall/YDLInvitionActivity.java
View file @
0804dda8
...
@@ -14,6 +14,7 @@ import com.tencent.qcloud.tuicore.calling.basic.UserModel;
...
@@ -14,6 +14,7 @@ import com.tencent.qcloud.tuicore.calling.basic.UserModel;
import
com.tencent.qcloud.tuicore.calling.trtccalling.model.TRTCCalling
;
import
com.tencent.qcloud.tuicore.calling.trtccalling.model.TRTCCalling
;
import
com.tencent.qcloud.tuicore.calling.trtccalling.model.impl.base.CallingInfoManager
;
import
com.tencent.qcloud.tuicore.calling.trtccalling.model.impl.base.CallingInfoManager
;
import
com.tencent.qcloud.tuicore.calling.trtccalling.ui.common.RoundCornerImageView
;
import
com.tencent.qcloud.tuicore.calling.trtccalling.ui.common.RoundCornerImageView
;
import
com.tencent.qcloud.tuicore.util.StatusBarUtil
;
/**
/**
* @Author: 刘鹏
* @Author: 刘鹏
...
@@ -50,6 +51,7 @@ public class YDLInvitionActivity extends TRTCBaseActivity {
...
@@ -50,6 +51,7 @@ public class YDLInvitionActivity extends TRTCBaseActivity {
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
StatusBarUtil
.
transparencyBar
(
this
);
handleIntent
();
handleIntent
();
setContentView
(
R
.
layout
.
video_invition_activity
);
setContentView
(
R
.
layout
.
video_invition_activity
);
initView
();
initView
();
...
@@ -98,6 +100,8 @@ public class YDLInvitionActivity extends TRTCBaseActivity {
...
@@ -98,6 +100,8 @@ public class YDLInvitionActivity extends TRTCBaseActivity {
mIvVideoInviteRefuse
=
findViewById
(
R
.
id
.
iv_video_invite_refuse
);
mIvVideoInviteRefuse
=
findViewById
(
R
.
id
.
iv_video_invite_refuse
);
//接听
//接听
mIvVideoInviteAccept
.
setOnClickListener
(
v
->
{
mIvVideoInviteAccept
.
setOnClickListener
(
v
->
{
// 接听后停止响铃
TRTCCalling
.
sharedInstance
(
YDLInvitionActivity
.
this
).
stopRing
();
Intent
intent
=
new
Intent
(
YDLInvitionActivity
.
this
,
VideoCallingActivity
.
class
);
Intent
intent
=
new
Intent
(
YDLInvitionActivity
.
this
,
VideoCallingActivity
.
class
);
intent
.
putExtra
(
Constant
.
ROOM_ID
,
mRoomId
);
intent
.
putExtra
(
Constant
.
ROOM_ID
,
mRoomId
);
intent
.
putExtra
(
Constant
.
USER_ID
,
mUserId
);
intent
.
putExtra
(
Constant
.
USER_ID
,
mUserId
);
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/StatusBarUtil.java
0 → 100644
View file @
0804dda8
package
com
.
tencent
.
qcloud
.
tuicore
.
util
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
/**
* Created by Ykai on 2022/4/24.
*/
public
class
StatusBarUtil
{
/**
* 修改状态栏为全透明
*
* @param activity
*/
@SuppressLint
(
"ObsoleteSdkInt"
)
@TargetApi
(
19
)
public
static
void
transparencyBar
(
Activity
activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
Window
window
=
activity
.
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
window
=
activity
.
getWindow
();
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
}
/**
* 状态栏亮色模式,设置状态栏黑色文字、图标,
* <p>
* 适配4.4以上版本MIUIV、Flyme和6.0以上版本其他Android
*
* @param activity
* @return 1:MIUUI 2:Flyme 3:android6.0
*/
public
static
int
StatusBarLightMode
(
Activity
activity
)
{
int
result
=
0
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
if
(
MIUISetStatusBarLightMode
(
activity
,
true
))
{
//小米
result
=
1
;
}
else
if
(
FlymeSetStatusBarLightMode
(
activity
.
getWindow
(),
true
))
{
//魅族
result
=
2
;
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
//6.0以上
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
result
=
3
;
}
}
return
result
;
}
/**
* 设置状态栏图标为深色和魅族特定的文字风格
* <p>
* 可以用来判断是否为Flyme用户
*
* @param window 需要设置的窗口
* @param dark 是否把状态栏文字及图标颜色设置为深色
* @return boolean 成功执行返回true
*/
public
static
boolean
FlymeSetStatusBarLightMode
(
Window
window
,
boolean
dark
)
{
boolean
result
=
false
;
if
(
window
!=
null
)
{
try
{
WindowManager
.
LayoutParams
lp
=
window
.
getAttributes
();
Field
darkFlag
=
WindowManager
.
LayoutParams
.
class
.
getDeclaredField
(
"MEIZU_FLAG_DARK_STATUS_BAR_ICON"
);
Field
meizuFlags
=
WindowManager
.
LayoutParams
.
class
.
getDeclaredField
(
"meizuFlags"
);
darkFlag
.
setAccessible
(
true
);
meizuFlags
.
setAccessible
(
true
);
int
bit
=
darkFlag
.
getInt
(
null
);
int
value
=
meizuFlags
.
getInt
(
lp
);
if
(
dark
)
{
value
|=
bit
;
}
else
{
value
&=
~
bit
;
}
meizuFlags
.
setInt
(
lp
,
value
);
window
.
setAttributes
(
lp
);
result
=
true
;
}
catch
(
Exception
e
)
{
}
}
return
result
;
}
/**
* 需要MIUIV6以上
*
* @param activity
* @param dark 是否把状态栏文字及图标颜色设置为深色
* @return boolean 成功执行返回true
*/
public
static
boolean
MIUISetStatusBarLightMode
(
Activity
activity
,
boolean
dark
)
{
boolean
result
=
false
;
Window
window
=
activity
.
getWindow
();
if
(
window
!=
null
)
{
Class
clazz
=
window
.
getClass
();
try
{
int
darkModeFlag
=
0
;
Class
layoutParams
=
Class
.
forName
(
"android.view.MiuiWindowManager$LayoutParams"
);
Field
field
=
layoutParams
.
getField
(
"EXTRA_FLAG_STATUS_BAR_DARK_MODE"
);
darkModeFlag
=
field
.
getInt
(
layoutParams
);
Method
extraFlagField
=
clazz
.
getMethod
(
"setExtraFlags"
,
int
.
class
,
int
.
class
);
if
(
dark
)
{
extraFlagField
.
invoke
(
window
,
darkModeFlag
,
darkModeFlag
);
//状态栏透明且黑色字体
}
else
{
extraFlagField
.
invoke
(
window
,
0
,
darkModeFlag
);
//清除黑色字体
}
result
=
true
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
//开发版 7.7.13 及以后版本采用了系统API,旧方法无效但不会报错,所以两个方式都要加上
if
(
dark
)
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
}
else
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_VISIBLE
);
}
}
}
catch
(
Exception
e
)
{
}
}
return
result
;
}
}
ydl-tuicore/src/main/res/layout/videocall_activity_calling.xml
View file @
0804dda8
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"true"
android:background=
"#f6f7f9"
>
android:background=
"#f6f7f9"
>
<LinearLayout
<LinearLayout
...
@@ -49,7 +50,7 @@
...
@@ -49,7 +50,7 @@
android:id=
"@+id/trtc_view_1"
android:id=
"@+id/trtc_view_1"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
app:layout_constraintBottom_toTopOf=
"@id/trtc_view_m
ain
"
app:layout_constraintBottom_toTopOf=
"@id/trtc_view_m
e
"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toLeftOf=
"@id/trtc_view_2"
app:layout_constraintRight_toLeftOf=
"@id/trtc_view_2"
...
@@ -158,7 +159,7 @@
...
@@ -158,7 +159,7 @@
</LinearLayout>
</LinearLayout>
<com.tencent.rtmp.ui.TXCloudVideoView
<com.tencent.rtmp.ui.TXCloudVideoView
android:id=
"@+id/trtc_view_m
ain
"
android:id=
"@+id/trtc_view_m
e
"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
app:layout_constraintBottom_toTopOf=
"@id/trtc_view_5"
app:layout_constraintBottom_toTopOf=
"@id/trtc_view_5"
...
@@ -168,6 +169,49 @@
...
@@ -168,6 +169,49 @@
app:layout_constraintTop_toBottomOf=
"@id/trtc_view_1"
app:layout_constraintTop_toBottomOf=
"@id/trtc_view_1"
app:layout_constraintVertical_weight=
"1"
/>
app:layout_constraintVertical_weight=
"1"
/>
<LinearLayout
android:id=
"@+id/ll_me"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
app:layout_constraintStart_toStartOf=
"@id/trtc_view_me"
app:layout_constraintBottom_toBottomOf=
"@id/trtc_view_me"
android:layout_marginStart=
"4dp"
android:layout_marginBottom=
"4dp"
android:background=
"@drawable/trtccalling_shape_white_r_10"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:gravity=
"center_vertical"
android:paddingTop=
"4dp"
android:paddingBottom=
"4dp"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_me"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/color_2D2F33"
android:textSize=
"12sp"
/>
<ImageView
android:id=
"@+id/iv_network_me"
android:layout_width=
"17dp"
android:layout_height=
"10dp"
android:src=
"@drawable/trtccalling_ic_network_excellent"
android:layout_marginStart=
"8dp"
/>
<ImageView
android:id=
"@+id/iv_audio_me"
android:layout_width=
"12dp"
android:layout_height=
"12dp"
android:layout_marginStart=
"8dp"
android:src=
"@drawable/trtccalling_ic_other_audio_open"
/>
</LinearLayout>
<com.tencent.rtmp.ui.TXCloudVideoView
<com.tencent.rtmp.ui.TXCloudVideoView
android:id=
"@+id/trtc_view_3"
android:id=
"@+id/trtc_view_3"
...
@@ -175,11 +219,11 @@
...
@@ -175,11 +219,11 @@
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_below=
"@id/trtc_view_2"
android:layout_below=
"@id/trtc_view_2"
android:layout_alignParentRight=
"true"
android:layout_alignParentRight=
"true"
app:layout_constraintBottom_toBottomOf=
"@id/trtc_view_m
ain
"
app:layout_constraintBottom_toBottomOf=
"@id/trtc_view_m
e
"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintLeft_toRightOf=
"@id/trtc_view_m
ain
"
app:layout_constraintLeft_toRightOf=
"@id/trtc_view_m
e
"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/trtc_view_m
ain
"
app:layout_constraintTop_toTopOf=
"@id/trtc_view_m
e
"
app:layout_constraintVertical_weight=
"1"
/>
app:layout_constraintVertical_weight=
"1"
/>
<LinearLayout
<LinearLayout
...
@@ -292,8 +336,8 @@
...
@@ -292,8 +336,8 @@
app:layout_constraintBottom_toTopOf=
"@id/ll_bottom"
app:layout_constraintBottom_toTopOf=
"@id/ll_bottom"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"@id/trtc_view_m
ain
"
app:layout_constraintRight_toRightOf=
"@id/trtc_view_m
e
"
app:layout_constraintTop_toBottomOf=
"@id/trtc_view_m
ain
"
app:layout_constraintTop_toBottomOf=
"@id/trtc_view_m
e
"
app:layout_constraintVertical_weight=
"1"
/>
app:layout_constraintVertical_weight=
"1"
/>
<LinearLayout
<LinearLayout
...
...
ydl-tuicore/src/main/res/values/styles.xml
View file @
0804dda8
...
@@ -18,4 +18,13 @@
...
@@ -18,4 +18,13 @@
<item
name=
"android:windowBackground"
>
@color/trtccalling_color_countrycode_bg_dialog
</item>
<item
name=
"android:windowBackground"
>
@color/trtccalling_color_countrycode_bg_dialog
</item>
<item
name=
"android:windowSoftInputMode"
>
adjustResize
</item>
<item
name=
"android:windowSoftInputMode"
>
adjustResize
</item>
</style>
</style>
<style
name=
"VideoCallActivityTheme"
parent=
"Theme.AppCompat.Light.NoActionBar"
>
<!-- Customize your theme here. -->
<item
name=
"colorPrimary"
>
@color/white
</item>
<item
name=
"colorPrimaryDark"
>
@color/white
</item>
<item
name=
"colorAccent"
>
@color/white
</item>
<!--<item name="android:windowIsTranslucent">true</item>-->
<!--<item name="android:windowNoTitle">true</item>-->
</style>
</resources>
</resources>
\ No newline at end of file
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