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
b850da15
Commit
b850da15
authored
May 25, 2020
by
ydl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backup
parent
44eeea65
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
4 deletions
+71
-4
config.gradle
config.gradle
+3
-3
AVChatKit.java
m-im/src/main/java/com/yidianling/avchatkit/AVChatKit.java
+5
-1
BaseActivityMgr.java
ydl-platform/src/main/java/com/ydl/ydlcommon/base/BaseActivityMgr.java
+59
-0
AppDelegate.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/delegate/AppDelegate.kt
+4
-0
No files found.
config.gradle
View file @
b850da15
...
...
@@ -10,7 +10,7 @@ ext {
"m-fm"
:
"0.0.30.00"
,
"m-user"
:
"0.0.60.20"
,
"m-home"
:
"0.0.22.18"
,
"m-im"
:
"0.0.18.1
0
"
,
"m-im"
:
"0.0.18.1
1
"
,
"m-dynamic"
:
"0.0.7.70"
,
"m-article"
:
"0.0.0.6"
,
...
...
@@ -33,7 +33,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.39.3
4
"
,
"ydl-platform"
:
"0.0.39.3
9
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.32"
,
...
...
@@ -114,7 +114,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.39.3
4
"
,
"ydl-platform"
:
"0.0.39.3
9
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.31"
,
...
...
m-im/src/main/java/com/yidianling/avchatkit/AVChatKit.java
View file @
b850da15
...
...
@@ -9,6 +9,7 @@ import com.netease.nimlib.sdk.Observer;
import
com.netease.nimlib.sdk.avchat.AVChatManager
;
import
com.netease.nimlib.sdk.avchat.constant.AVChatControlCommand
;
import
com.netease.nimlib.sdk.avchat.model.AVChatData
;
import
com.ydl.ydlcommon.base.BaseActivityMgr
;
import
com.yidianling.avchatkit.activity.AVChatActivity
;
import
com.yidianling.avchatkit.common.log.ILogUtil
;
import
com.yidianling.avchatkit.common.log.LogUtil
;
...
...
@@ -178,13 +179,16 @@ public class AVChatKit {
String
extra
=
data
.
getExtra
();
Log
.
e
(
"Extra"
,
"Extra Message->"
+
extra
);
if
(
PhoneCallStateObserver
.
getInstance
().
getPhoneCallState
()
!=
PhoneCallStateObserver
.
PhoneCallStateEnum
.
IDLE
||
AVChatProfile
.
getInstance
().
isAVChatting
()
||
TeamAVChatProfile
.
sharedInstance
().
isTeamAVChatting
()
||
AVChatManager
.
getInstance
().
getCurrentChatId
()
!=
0
)
{
LogUtil
.
i
(
TAG
,
"reject incoming call data ="
+
data
.
toString
()
+
" as local phone is not idle"
);
AVChatManager
.
getInstance
().
sendControlCommand
(
data
.
getChatId
(),
AVChatControlCommand
.
BUSY
,
null
);
return
;
}
if
(
BaseActivityMgr
.
INST
.
getTopActivity
()
instanceof
AVChatActivity
)
{
// already open
return
;
}
// 有网络来电打开AVChatActivity
AVChatProfile
.
getInstance
().
setAVChatting
(
true
);
AVChatProfile
.
getInstance
().
launchActivity
(
data
,
userInfoProvider
.
getUserDisplayName
(
data
.
getAccount
()),
AVChatActivity
.
FROM_BROADCASTRECEIVER
);
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/base/BaseActivityMgr.java
0 → 100644
View file @
b850da15
package
com
.
ydl
.
ydlcommon
.
base
;
import
android.app.Activity
;
import
android.app.Application
;
import
android.os.Bundle
;
import
java.lang.ref.WeakReference
;
/**
*
*/
public
final
class
BaseActivityMgr
implements
Application
.
ActivityLifecycleCallbacks
{
public
static
final
BaseActivityMgr
INST
=
new
BaseActivityMgr
();
private
WeakReference
<
Activity
>
top
;
private
BaseActivityMgr
()
{
}
public
void
init
(
Application
application
)
{
if
(
application
==
null
)
{
// do nothing
}
else
{
application
.
unregisterActivityLifecycleCallbacks
(
INST
);
application
.
registerActivityLifecycleCallbacks
(
INST
);
}
}
public
Activity
getTopActivity
()
{
return
top
!=
null
?
top
.
get
()
:
null
;
}
@Override
public
void
onActivityCreated
(
Activity
activity
,
Bundle
savedInstanceState
)
{
this
.
top
=
new
WeakReference
(
activity
);
}
@Override
public
void
onActivityStarted
(
Activity
activity
)
{
this
.
top
=
new
WeakReference
(
activity
);
}
@Override
public
void
onActivityResumed
(
Activity
activity
)
{
this
.
top
=
new
WeakReference
(
activity
);
}
@Override
public
void
onActivityPaused
(
Activity
activity
)
{
}
@Override
public
void
onActivityStopped
(
Activity
activity
)
{
}
@Override
public
void
onActivitySaveInstanceState
(
Activity
activity
,
Bundle
outState
)
{
}
@Override
public
void
onActivityDestroyed
(
Activity
activity
)
{
}
}
ydl-platform/src/main/java/com/ydl/ydlcommon/base/delegate/AppDelegate.kt
View file @
b850da15
...
...
@@ -3,6 +3,7 @@ package com.ydl.ydlcommon.base.delegate
import
android.app.Application
import
android.content.Context
import
com.ydl.ydlcommon.app.YdlRepository
import
com.ydl.ydlcommon.base.BaseActivityMgr
import
com.ydl.ydlcommon.base.config.GlobalConfig
import
com.ydl.ydlcommon.base.config.IApp
import
com.ydl.ydlcommon.base.config.IConfigModule
...
...
@@ -22,6 +23,7 @@ class AppDelegate(context: Context) : IAppLifecycles,IApp{
private
var
mAppLifecycles
:
ArrayList
<
IAppLifecycles
>?
=
ArrayList
()
private
val
mActivityLifecycleForRxLifecycle
=
ActivityDelegate
()
private
val
mActivityMgrLifecycle
=
BaseActivityMgr
.
INST
private
var
mGlobalConfig
:
GlobalConfig
?=
null
init
{
...
...
@@ -56,6 +58,7 @@ class AppDelegate(context: Context) : IAppLifecycles,IApp{
//注册实现的 RxLifecycle 逻辑
mApplication
!!
.
registerActivityLifecycleCallbacks
(
mActivityLifecycleForRxLifecycle
)
mApplication
!!
.
registerActivityLifecycleCallbacks
(
mActivityMgrLifecycle
)
//遵循单一功能原则,这个lifecycle单独用于管理获取顶部activity的功能
}
...
...
@@ -76,6 +79,7 @@ class AppDelegate(context: Context) : IAppLifecycles,IApp{
}
override
fun
onTerminate
(
application
:
Application
)
{
mApplication
!!
.
unregisterActivityLifecycleCallbacks
(
mActivityLifecycleForRxLifecycle
)
mApplication
!!
.
unregisterActivityLifecycleCallbacks
(
mActivityMgrLifecycle
)
if
(
mAppLifecycles
!=
null
&&
mAppLifecycles
!!
.
size
>
0
)
{
for
(
lifecycle
in
mAppLifecycles
!!
)
{
lifecycle
.
onTerminate
(
mApplication
!!
)
...
...
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