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
5383ebb2
Commit
5383ebb2
authored
Apr 19, 2022
by
upwork.021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改ui
parent
0a951fc3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
13 deletions
+78
-13
VideoCallingActivity.java
ydl-tuicalling/src/main/java/com/tencent/liteav/videocall/VideoCallingActivity.java
+67
-13
trtccalling_ic_network_bad.png
ydl-tuicalling/src/main/res/drawable-xxhdpi/trtccalling_ic_network_bad.png
+0
-0
trtccalling_ic_network_excellent.png
ydl-tuicalling/src/main/res/drawable-xxhdpi/trtccalling_ic_network_excellent.png
+0
-0
trtccalling_ic_network_good.png
ydl-tuicalling/src/main/res/drawable-xxhdpi/trtccalling_ic_network_good.png
+0
-0
trtccalling_ic_network_poor.png
ydl-tuicalling/src/main/res/drawable-xxhdpi/trtccalling_ic_network_poor.png
+0
-0
trtccalling_shape_white_r_10.xml
ydl-tuicalling/src/main/res/drawable/trtccalling_shape_white_r_10.xml
+9
-0
videocall_activity_calling.xml
ydl-tuicalling/src/main/res/layout/videocall_activity_calling.xml
+0
-0
colors.xml
ydl-tuicalling/src/main/res/values/colors.xml
+2
-0
No files found.
ydl-tuicalling/src/main/java/com/tencent/liteav/videocall/VideoCallingActivity.java
View file @
5383ebb2
...
...
@@ -19,6 +19,7 @@ import com.tencent.rtmp.ui.TXCloudVideoView;
import
com.tencent.trtc.TRTCCloud
;
import
com.tencent.trtc.TRTCCloudDef
;
import
com.tencent.trtc.TRTCCloudListener
;
import
com.yidianling.common.tools.LogUtil
;
import
java.lang.ref.WeakReference
;
import
java.util.ArrayList
;
...
...
@@ -39,8 +40,8 @@ import java.util.List;
*/
public
class
VideoCallingActivity
extends
TRTCBaseActivity
implements
View
.
OnClickListener
{
private
static
final
String
TAG
=
"VideoCallingActivity"
;
private
static
final
int
OVERLAY_PERMISSION_REQ_CODE
=
1234
;
private
static
final
String
TAG
=
"VideoCallingActivity"
;
private
static
final
int
OVERLAY_PERMISSION_REQ_CODE
=
1234
;
private
TextView
mTextTitle
;
private
TXCloudVideoView
mTXCVVLocalPreviewView
;
...
...
@@ -56,6 +57,9 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
private
boolean
mIsFrontCamera
=
true
;
private
List
<
String
>
mRemoteUidList
;
private
List
<
TXCloudVideoView
>
mRemoteViewList
;
private
List
<
ImageView
>
mIvNetWorkViewList
;
private
List
<
ImageView
>
mIvAudioViewList
;
private
List
<
LinearLayout
>
mLlUserViewList
;
private
int
mUserCount
=
0
;
private
String
mRoomId
;
private
String
mUserId
;
...
...
@@ -118,14 +122,33 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
mRemoteUidList
=
new
ArrayList
<>();
mRemoteViewList
=
new
ArrayList
<>();
mIvNetWorkViewList
=
new
ArrayList
<>();
mIvAudioViewList
=
new
ArrayList
<>();
mLlUserViewList
=
new
ArrayList
<>();
mRemoteViewList
.
add
(
findViewById
(
R
.
id
.
trtc_view_1
));
mRemoteViewList
.
add
(
findViewById
(
R
.
id
.
trtc_view_2
));
mRemoteViewList
.
add
(
findViewById
(
R
.
id
.
trtc_view_3
));
mRemoteViewList
.
add
(
findViewById
(
R
.
id
.
trtc_view_4
));
mRemoteViewList
.
add
(
findViewById
(
R
.
id
.
trtc_view_5
));
mRemoteViewList
.
add
(
findViewById
(
R
.
id
.
trtc_view_6
));
mRemoteViewList
.
add
(
findViewById
(
R
.
id
.
trtc_view_main
));
mIvNetWorkViewList
.
add
(
findViewById
(
R
.
id
.
iv_network_1
));
mIvNetWorkViewList
.
add
(
findViewById
(
R
.
id
.
iv_network_2
));
mIvNetWorkViewList
.
add
(
findViewById
(
R
.
id
.
iv_network_3
));
mIvNetWorkViewList
.
add
(
findViewById
(
R
.
id
.
iv_network_4
));
mIvNetWorkViewList
.
add
(
findViewById
(
R
.
id
.
iv_network_5
));
mIvNetWorkViewList
.
add
(
findViewById
(
R
.
id
.
iv_network_6
));
mIvAudioViewList
.
add
(
findViewById
(
R
.
id
.
iv_other_audio_1
));
mIvAudioViewList
.
add
(
findViewById
(
R
.
id
.
iv_other_audio_2
));
mIvAudioViewList
.
add
(
findViewById
(
R
.
id
.
iv_other_audio_3
));
mIvAudioViewList
.
add
(
findViewById
(
R
.
id
.
iv_other_audio_4
));
mIvAudioViewList
.
add
(
findViewById
(
R
.
id
.
iv_other_audio_5
));
mIvAudioViewList
.
add
(
findViewById
(
R
.
id
.
iv_other_audio_6
));
mLlUserViewList
.
add
(
findViewById
(
R
.
id
.
ll_user_1
));
mLlUserViewList
.
add
(
findViewById
(
R
.
id
.
ll_user_2
));
mLlUserViewList
.
add
(
findViewById
(
R
.
id
.
ll_user_3
));
mLlUserViewList
.
add
(
findViewById
(
R
.
id
.
ll_user_4
));
mLlUserViewList
.
add
(
findViewById
(
R
.
id
.
ll_user_5
));
mLlUserViewList
.
add
(
findViewById
(
R
.
id
.
ll_user_6
));
}
private
void
enterRoom
()
{
...
...
@@ -137,6 +160,7 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
trtcParams
.
sdkAppId
=
userModel
.
appId
;
trtcParams
.
userId
=
mUserId
;
trtcParams
.
roomId
=
Integer
.
parseInt
(
mRoomId
);
LogUtil
.
d
(
"userSig"
,
userModel
.
userSig
);
trtcParams
.
userSig
=
userModel
.
userSig
;
mTRTCCloud
.
startLocalPreview
(
mIsFrontCamera
,
mTXCVVLocalPreviewView
);
...
...
@@ -251,6 +275,7 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
}
}
private
class
TRTCCloudImplListener
extends
TRTCCloudListener
{
private
WeakReference
<
VideoCallingActivity
>
mContext
;
...
...
@@ -267,13 +292,9 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
*/
@Override
public
void
onNetworkQuality
(
TRTCCloudDef
.
TRTCQuality
localQuality
,
ArrayList
<
TRTCCloudDef
.
TRTCQuality
>
remoteQuality
)
{
// public static final int TRTC_QUALITY_UNKNOWN = 0;
// public static final int TRTC_QUALITY_Excellent = 1;
// public static final int TRTC_QUALITY_Good = 2;
// public static final int TRTC_QUALITY_Poor = 3;
// public static final int TRTC_QUALITY_Bad = 4;
// public static final int TRTC_QUALITY_Vbad = 5;
// public static final int TRTC_QUALITY_Down = 6;
// if (remoteQuality.size()>0){
// refreshNetWorkStatus(remoteQuality);
// }
}
/**
...
...
@@ -283,7 +304,10 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
*/
@Override
public
void
onUserAudioAvailable
(
String
userId
,
boolean
available
)
{
Log
.
e
(
TAG
,
"onUserAudioAvailable userId "
+
userId
+
", mUserCount "
+
mUserCount
+
",available "
+
available
);
if
(!
TextUtils
.
isEmpty
(
userId
)){
refreshAudioStatus
(
userId
,
available
);
}
}
/**
...
...
@@ -293,7 +317,7 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
*/
@Override
public
void
onUserVideoAvailable
(
String
userId
,
boolean
available
)
{
Log
.
d
(
TAG
,
"onUserVideoAvailable userId "
+
userId
+
", mUserCount "
+
mUserCount
+
",available "
+
available
);
Log
.
e
(
TAG
,
"onUserVideoAvailable userId "
+
userId
+
", mUserCount "
+
mUserCount
+
",available "
+
available
);
int
index
=
mRemoteUidList
.
indexOf
(
userId
);
if
(
available
)
{
if
(
index
!=
-
1
)
{
...
...
@@ -323,6 +347,36 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
}
}
private
void
refreshAudioStatus
(
String
userId
,
boolean
available
){
if
(
mRemoteUidList
.
size
()>
0
){
for
(
int
i
=
0
;
i
<
mIvAudioViewList
.
size
();
i
++)
{
if
(
userId
.
equals
(
mRemoteUidList
.
get
(
i
))){
if
(
available
){
mIvAudioViewList
.
get
(
i
).
setImageResource
(
R
.
drawable
.
trtccalling_ic_other_audio_open
);
}
else
{
mIvAudioViewList
.
get
(
i
).
setImageResource
(
R
.
drawable
.
trtccalling_ic_other_audio_close
);
}
return
;
}
}
}
}
private
void
refreshNetWorkStatus
(
ArrayList
<
TRTCCloudDef
.
TRTCQuality
>
remoteQuality
){
for
(
int
i
=
0
;
i
<
mIvNetWorkViewList
.
size
();
i
++)
{
int
quality
=
remoteQuality
.
get
(
i
).
quality
;
if
(
quality
==
TRTCCloudDef
.
TRTC_QUALITY_Excellent
){
mIvNetWorkViewList
.
get
(
i
).
setImageResource
(
R
.
drawable
.
trtccalling_ic_network_excellent
);
}
else
if
(
quality
==
TRTCCloudDef
.
TRTC_QUALITY_Good
){
mIvNetWorkViewList
.
get
(
i
).
setImageResource
(
R
.
drawable
.
trtccalling_ic_network_good
);
}
else
if
(
quality
==
TRTCCloudDef
.
TRTC_QUALITY_Poor
){
mIvNetWorkViewList
.
get
(
i
).
setImageResource
(
R
.
drawable
.
trtccalling_ic_network_poor
);
}
else
if
(
quality
==
TRTCCloudDef
.
TRTC_QUALITY_Bad
){
mIvNetWorkViewList
.
get
(
i
).
setImageResource
(
R
.
drawable
.
trtccalling_ic_network_bad
);
}
}
}
@Override
public
void
onError
(
int
errCode
,
String
errMsg
,
Bundle
extraInfo
)
{
Log
.
d
(
TAG
,
"sdk callback onError"
);
...
...
ydl-tuicalling/src/main/res/drawable-xxhdpi/trtccalling_ic_network_bad.png
0 → 100644
View file @
5383ebb2
555 Bytes
ydl-tuicalling/src/main/res/drawable-xxhdpi/trtccalling_ic_network_excellent.png
0 → 100644
View file @
5383ebb2
533 Bytes
ydl-tuicalling/src/main/res/drawable-xxhdpi/trtccalling_ic_network_good.png
0 → 100644
View file @
5383ebb2
679 Bytes
ydl-tuicalling/src/main/res/drawable-xxhdpi/trtccalling_ic_network_poor.png
0 → 100644
View file @
5383ebb2
559 Bytes
ydl-tuicalling/src/main/res/drawable/trtccalling_shape_white_r_10.xml
0 → 100644
View file @
5383ebb2
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/white"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
ydl-tuicalling/src/main/res/layout/videocall_activity_calling.xml
View file @
5383ebb2
This diff is collapsed.
Click to expand it.
ydl-tuicalling/src/main/res/values/colors.xml
View file @
5383ebb2
...
...
@@ -26,4 +26,5 @@
<color
name=
"trtccalling_color_green"
>
#FF29CC85
</color>
<color
name=
"color_8595a9"
>
#859aa9
</color>
<color
name=
"color_F0504A"
>
#F0504A
</color>
<color
name=
"color_2D2F33"
>
#2D2F33
</color>
</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