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
a54799e5
Commit
a54799e5
authored
Aug 24, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修复云信唤起多个界面问题
parent
00a90f23
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
17 deletions
+34
-17
build.gradle
app2/build.gradle
+3
-3
build.gradle
build.gradle
+1
-1
AndroidManifest.xml
m-im/src/main/AndroidManifest.xml
+1
-0
AVChatProfile.java
m-im/src/main/java/com/yidianling/avchatkit/AVChatProfile.java
+29
-13
No files found.
app2/build.gradle
View file @
a54799e5
...
...
@@ -137,9 +137,9 @@ dependencies {
//====================云信基础库====================
implementation
'com.ydl:nim-base:1.1.1.2'
implementation
'com.netease.nimlib:basesdk:9.
1
.1'
implementation
'com.netease.nimlib:avchat:9.
1
.1'
implementation
'com.netease.nimlib:nrtc:9.
1
.1'
implementation
'com.netease.nimlib:basesdk:9.
2
.1'
implementation
'com.netease.nimlib:avchat:9.
2
.1'
implementation
'com.netease.nimlib:nrtc:9.
2
.1'
//OPPO推送需要单独引入
implementation
'com.google.code.gson:gson:2.6.2'
implementation
'commons-codec:commons-codec:1.6'
...
...
build.gradle
View file @
a54799e5
...
...
@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version
=
'1.2.3'
constrait_support_version
=
'1.0.2'
componentVersion
=
"0.3.0.42.
2
-SNAPSHOT"
componentVersion
=
"0.3.0.42.
4
-SNAPSHOT"
}
repositories
{
mavenCentral
()
...
...
m-im/src/main/AndroidManifest.xml
View file @
a54799e5
...
...
@@ -118,6 +118,7 @@
<activity
android:name=
"com.yidianling.avchatkit.activity.AVChatActivity"
android:screenOrientation=
"portrait"
android:launchMode=
"singleTask"
android:theme=
"@style/FullScreenTheme"
android:windowSoftInputMode=
"stateAlwaysHidden"
/>
...
...
m-im/src/main/java/com/yidianling/avchatkit/AVChatProfile.java
View file @
a54799e5
package
com
.
yidianling
.
avchatkit
;
import
android.app.NotificationManager
;
import
android.os.Build
;
import
android.os.Handler
;
import
android.text.TextUtils
;
import
androidx.annotation.Nullable
;
import
com.netease.nimlib.app.AppForegroundWatcherCompat
;
import
com.netease.nimlib.sdk.avchat.model.AVChatData
;
import
com.yidianling.avchatkit.activity.AVChatActivity
;
import
com.yidianling.avchatkit.common.Handlers
;
...
...
@@ -21,6 +23,18 @@ public class AVChatProfile {
private
boolean
isAVChatting
=
false
;
// 是否正在音视频通话
private
NotificationManager
notificationManager
;
public
static
AVChatProfile
getInstance
()
{
return
InstanceHolder
.
instance
;
}
public
boolean
isAVChatting
()
{
return
isAVChatting
;
}
public
void
setAVChatting
(
boolean
chating
)
{
isAVChatting
=
chating
;
}
@Nullable
private
AVChatData
backgroundIncomingCallData
;
@Nullable
...
...
@@ -33,6 +47,11 @@ public class AVChatProfile {
return
TextUtils
.
equals
(
backgroundIncomingCallData
.
getAccount
(),
account
);
}
private
static
class
InstanceHolder
{
public
final
static
AVChatProfile
instance
=
new
AVChatProfile
();
}
public
void
removeBackgroundIncomingCall
(
boolean
activeMissCall
)
{
backgroundIncomingCallData
=
null
;
...
...
@@ -50,6 +69,15 @@ public class AVChatProfile {
@Override
public
void
run
()
{
// 启动,如果 task正在启动,则稍等一下
if
(
Build
.
VERSION
.
SDK_INT
>=
29
&&
AppForegroundWatcherCompat
.
isBackground
())
{
backgroundIncomingCallData
=
data
;
backgroundIncomingCallNotification
=
new
AVChatNotification
(
AVChatKit
.
getContext
());
backgroundIncomingCallNotification
.
init
(
data
.
getAccount
(),
displayName
);
backgroundIncomingCallNotification
.
activeIncomingCallNotification
(
true
,
backgroundIncomingCallData
);
}
else
{
// 启动,如果 task正在启动,则稍等一下
if
(
AVChatKit
.
isMainTaskLaunching
())
{
launchIncomingCall
(
data
,
displayName
,
source
);
}
else
{
...
...
@@ -57,25 +85,13 @@ public class AVChatProfile {
AVChatActivity
.
incomingCall
(
AVChatKit
.
getContext
(),
data
,
displayName
,
source
);
}
}
}
};
Handlers
.
sharedHandler
(
AVChatKit
.
getContext
()).
postDelayed
(
runnable
,
200
);
}
public
static
AVChatProfile
getInstance
()
{
return
InstanceHolder
.
instance
;
}
public
boolean
isAVChatting
()
{
return
isAVChatting
;
}
public
void
setAVChatting
(
boolean
chating
)
{
isAVChatting
=
chating
;
}
private
static
class
InstanceHolder
{
public
final
static
AVChatProfile
instance
=
new
AVChatProfile
();
}
public
void
launchActivity
(
final
AVChatData
data
,
final
String
displayName
,
final
int
source
)
{
Runnable
runnable
=
new
Runnable
()
{
...
...
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