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
ba310efb
Commit
ba310efb
authored
Apr 29, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新域名配置flutter升级
parent
73336195
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
48 deletions
+77
-48
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+1
-1
config.gradle
config.gradle
+12
-12
CoursePlugin.kt
m-course/src/main/java/com/yidianling/course/flutterPlugin/CoursePlugin.kt
+11
-1
app-release.aar
ydl-flutter-base/aars/app-release.aar
+0
-0
YDLCommonPlugin.kt
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/plugin/YDLCommonPlugin.kt
+32
-20
AppUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/AppUtils.kt
+21
-14
No files found.
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
ba310efb
...
...
@@ -21,7 +21,7 @@ public final class DemoGlobalConfig implements IConfigModule {
String
APP_DOMAIN
=
"https://api.github.com/"
;
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_TEST;
public
static
String
appEnv
=
"new_test"
;
//配置未上传到maven库
public
static
String
appEnv
=
YDLConstants
.
ENV_NEW_TEST
;
//配置未上传到maven库
// public static String appEnv = YDLConstants.ENV_PROD;
@Override
...
...
config.gradle
View file @
ba310efb
...
...
@@ -12,11 +12,11 @@ ext {
"m-home"
:
"0.0.22.60"
,
"m-im"
:
"0.0.18.53"
,
"m-dynamic"
:
"0.0.7.21"
,
"m-article"
:
"0.0.0.
8
"
,
"m-article"
:
"0.0.0.
9
"
,
"m-muse"
:
"0.0.28.2
2
"
,
"m-tests"
:
"0.0.24.1
2
"
,
"m-course"
:
"0.0.42.2
3
"
,
"m-muse"
:
"0.0.28.2
3
"
,
"m-tests"
:
"0.0.24.1
3
"
,
"m-course"
:
"0.0.42.2
4
"
,
//-------------- 业务模块 API 层 --------------
"m-audioim-api"
:
"0.0.6"
,
...
...
@@ -33,14 +33,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.40.0
2
"
,
"ydl-platform"
:
"0.0.40.0
3
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.44"
,
"ydl-media"
:
"0.0.21.9"
,
"ydl-pay"
:
"0.0.18.19"
,
"m-audioim"
:
"0.0.49.29.37"
,
"ydl-flutter-base"
:
"0.0.14.2
5
"
,
"ydl-flutter-base"
:
"0.0.14.2
6
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
@@ -95,11 +95,11 @@ ext {
"m-home"
:
"0.0.22.54"
,
"m-im"
:
"0.0.18.53"
,
"m-dynamic"
:
"0.0.7.19"
,
"m-article"
:
"0.0.0.
6
"
,
"m-article"
:
"0.0.0.
9
"
,
"m-muse"
:
"0.0.2
0.7
"
,
"m-tests"
:
"0.0.24.
9
"
,
"m-course"
:
"0.0.42.2
0
"
,
"m-muse"
:
"0.0.2
8.23
"
,
"m-tests"
:
"0.0.24.
13
"
,
"m-course"
:
"0.0.42.2
4
"
,
//-------------- 业务模块 API 层 --------------
"m-audioim-api"
:
"0.0.6"
,
"m-confide-api"
:
"0.0.2.1"
,
...
...
@@ -115,14 +115,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.40.0
2
"
,
"ydl-platform"
:
"0.0.40.0
3
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.44"
,
"ydl-media"
:
"0.0.21.9"
,
"ydl-pay"
:
"0.0.18.19"
,
"m-audioim"
:
"0.0.49.29.37"
,
"ydl-flutter-base"
:
"0.0.14.2
5
"
,
"ydl-flutter-base"
:
"0.0.14.2
6
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
m-course/src/main/java/com/yidianling/course/flutterPlugin/CoursePlugin.kt
View file @
ba310efb
...
...
@@ -16,6 +16,7 @@ import com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
import
com.ydl.ydl_router.manager.YDLRouterManager
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.config.YDLConstants
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager.provide
...
...
@@ -71,10 +72,19 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
override
fun
onMethodCall
(
methodCall
:
MethodCall
,
result
:
MethodChannel
.
Result
)
{
when
(
methodCall
.
method
)
{
GETPUBLICPARAMAS
->
{
val
appEnv
=
BaseApp
.
instance
.
getGlobalConfig
().
appEnv
var
isDevelopment
=
0
if
(
YDLConstants
.
ENV_TEST
==
appEnv
)
{
isDevelopment
=
1
}
else
if
(
YDLConstants
.
ENV_NEW_TEST
==
appEnv
)
{
isDevelopment
=
2
}
val
loginBean
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
val
mMap
=
mutableMapOf
<
String
,
Any
>()
var
uid
=
loginBean
?.
userId
?:
""
mMap
[
"isDevelopment"
]
=
false
mMap
[
"isDevelopment"
]
=
isDevelopment
mMap
[
"uid"
]
=
if
(
TextUtils
.
isEmpty
(
uid
))
"0"
else
uid
mMap
[
"accessToken"
]
=
loginBean
?.
token
?:
""
?:
""
...
...
ydl-flutter-base/aars/app-release.aar
View file @
ba310efb
No preview for this file type
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/plugin/YDLCommonPlugin.kt
View file @
ba310efb
...
...
@@ -44,7 +44,7 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
}
companion
object
{
var
pluginDelegate
:
CommonPluginDelegate
?=
null
var
pluginDelegate
:
CommonPluginDelegate
?
=
null
const
val
CHANNEL
:
String
=
"lib/common/channel"
const
val
GETPUBLICPARAMAS
:
String
=
"getPublicParamas"
const
val
GET_PACKAGE_AND_FFROM
:
String
=
"get_package_and_ffrom"
// 获取包名和渠道名,中间用,分割
...
...
@@ -81,13 +81,24 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
val
appEnv
=
BaseApp
.
instance
.
getGlobalConfig
().
appEnv
val
cacheAppEnv
=
YDLCacheUtils
.
getCacheApi
()
var
isDevelopment
:
Boolean
=
false
var
isDevelopment
=
0
if
(!
TextUtils
.
isEmpty
(
cacheAppEnv
))
{
isDevelopment
=
YDLConstants
.
ENV_TEST
==
cacheAppEnv
if
(
YDLConstants
.
ENV_TEST
==
cacheAppEnv
||
YDLConstants
.
ENV_AUTO_TEST
==
cacheAppEnv
)
{
isDevelopment
=
1
}
else
if
(
YDLConstants
.
ENV_NEW_TEST
==
cacheAppEnv
)
{
isDevelopment
=
2
}
}
else
{
isDevelopment
=
YDLConstants
.
ENV_TEST
==
appEnv
||
YDLConstants
.
ENV_AUTO_TEST
==
appEnv
if
(
YDLConstants
.
ENV_TEST
==
cacheAppEnv
||
YDLConstants
.
ENV_AUTO_TEST
==
appEnv
)
{
isDevelopment
=
1
}
else
if
(
YDLConstants
.
ENV_NEW_TEST
==
cacheAppEnv
)
{
isDevelopment
=
2
}
}
mMap
[
"isDevelopment"
]
=
if
(
isDevelopment
)
"1"
else
"0"
mMap
[
"isDevelopment"
]
=
isDevelopment
mMap
[
"uid"
]
=
if
(
TextUtils
.
isEmpty
(
uid
))
"0"
else
uid
mMap
[
"accessToken"
]
=
loginBean
?.
token
?:
""
...
...
@@ -114,8 +125,8 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
field
.
isAccessible
=
true
val
property
=
field
.
get
(
ownerClass
)
if
(
property
is
Boolean
&&
property
)
{
var
activity
:
Activity
?=
mActivity
if
(
mActivity
==
null
&&
mFragment
!=
null
)
{
var
activity
:
Activity
?
=
mActivity
if
(
mActivity
==
null
&&
mFragment
!=
null
)
{
activity
=
mFragment
?.
activity
!!
}
activity
?.
let
{
...
...
@@ -143,27 +154,27 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
}
ACTION_ORIGIN_THEME
->
{
val
mMap
=
mutableMapOf
<
String
,
String
>()
if
(
pluginDelegate
!=
null
)
{
if
(
pluginDelegate
!=
null
)
{
val
appTheme
=
pluginDelegate
?.
getAppTheme
()
appTheme
?.
let
{
mMap
.
putAll
(
it
)
}
}
LogUtil
.
i
(
"platform_origin_theme:"
+
GsonProvider
.
getGson
().
toJson
(
mMap
))
LogUtil
.
i
(
"platform_origin_theme:"
+
GsonProvider
.
getGson
().
toJson
(
mMap
))
result
.
success
(
mMap
)
}
ACTION_GET_SUB_CHANNEL_THEME
->
{
val
mMap
=
arrayListOf
<
Any
>()
if
(
pluginDelegate
!=
null
)
{
if
(
methodCall
.
hasArgument
(
"channelName"
)){
val
channelName
=
methodCall
.
argument
<
String
>(
"channelName"
)
if
(
pluginDelegate
!=
null
)
{
if
(
methodCall
.
hasArgument
(
"channelName"
))
{
val
channelName
=
methodCall
.
argument
<
String
>(
"channelName"
)
LogUtil
.
i
(
"platform_sub_channel_theme channelName:$channelName"
)
if
(!
TextUtils
.
isEmpty
(
channelName
)){
if
(!
TextUtils
.
isEmpty
(
channelName
))
{
val
appTheme
=
pluginDelegate
?.
getSubChannelTheme
(
channelName
!!
)
appTheme
?.
let
{
mMap
.
addAll
(
it
)
}
}
}
}
LogUtil
.
i
(
"platform_sub_channel_theme:"
+
GsonProvider
.
getGson
().
toJson
(
mMap
))
LogUtil
.
i
(
"platform_sub_channel_theme:"
+
GsonProvider
.
getGson
().
toJson
(
mMap
))
result
.
success
(
mMap
)
}
REQUESTMAINSCROLLFOCUS
->
{
...
...
@@ -185,24 +196,24 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
val
ffrom
=
PlatformDataManager
.
getRam
().
getChannelName
()
result
.
success
(
"$packageName,$ffrom"
)
}
ACTION_HTTP_BURIED_POINT
->{
ACTION_HTTP_BURIED_POINT
->
{
val
map
=
methodCall
.
arguments
as
HashMap
<*,
*>
val
position
=
map
[
"position"
]
as
String
val
partId
=
map
[
"partId"
]
as
String
val
sign
=
map
[
"sign"
]
as
String
ActionCountUtils
.
count
(
"$partId|$position"
,
sign
)
ActionCountUtils
.
count
(
"$partId|$position"
,
sign
)
}
PAGE_GO_BACK
->{
PAGE_GO_BACK
->
{
mActivity
?.
finish
()
}
}
}
interface
CommonPluginDelegate
{
fun
getAppTheme
():
HashMap
<
String
,
String
>
interface
CommonPluginDelegate
{
fun
getAppTheme
():
HashMap
<
String
,
String
>
fun
getSubChannelTheme
(
channelName
:
String
):
ArrayList
<
Any
>
fun
getSubChannelTheme
(
channelName
:
String
):
ArrayList
<
Any
>
}
}
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/AppUtils.kt
View file @
ba310efb
...
...
@@ -2,14 +2,11 @@ package com.ydl.ydlcommon.utils
import
android.app.ActivityManager
import
android.content.Context
import
com.ydl.ydlcommon.BuildConfig
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.config.YDLConstants
import
com.ydl.ydlcommon.base.config.YDLConstants
.ENV_NEW_TEST
import
com.ydl.ydlcommon.base.config.YDLConstants.ENV_TEST
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.data.http.YdlCommonApi
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.router.YdlCommonOut
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxDeviceTool
...
...
@@ -23,8 +20,10 @@ object AppUtils {
return
false
}
var
isRunning
:
Boolean
=
false
val
activityManager
:
ActivityManager
=
context
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
)
as
ActivityManager
val
serviceList
:
List
<
ActivityManager
.
RunningServiceInfo
>
=
activityManager
.
getRunningServices
(
30
)
val
activityManager
:
ActivityManager
=
context
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
)
as
ActivityManager
val
serviceList
:
List
<
ActivityManager
.
RunningServiceInfo
>
=
activityManager
.
getRunningServices
(
30
)
if
(
serviceList
.
isEmpty
())
{
return
false
}
...
...
@@ -41,20 +40,28 @@ object AppUtils {
* 获取http请求公用参数
*
*/
fun
getHttpCommonParams
():
Map
<
String
,
Any
>
{
fun
getHttpCommonParams
():
Map
<
String
,
Any
>
{
val
mMap
=
mutableMapOf
<
String
,
Any
>()
val
appEnv
=
BaseApp
.
instance
.
getGlobalConfig
().
appEnv
va
l
isTest
=
ENV_TEST
==
appEnv
va
r
isDevelopment
=
0
val
osBuild
=
"${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()},${RxAppTool.getAppVersionName(
BaseApp
.
getApp
()
)}
"
if
(
ENV_TEST
==
appEnv
)
{
isDevelopment
=
1
}
else
if
(
ENV_NEW_TEST
==
appEnv
)
{
isDevelopment
=
2
}
val
osBuild
=
"${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()},${
RxAppTool
.
getAppVersionName
(
BaseApp
.
getApp
()
)
}
"
val
loginBean
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
mMap
[
"isDevelopment"
]
=
is
Tes
t
mMap
[
"uid"
]
=
loginBean
?.
userId
?:
""
mMap
[
"accessToken"
]
=
loginBean
?.
token
?:
""
mMap
[
"isDevelopment"
]
=
is
Developmen
t
mMap
[
"uid"
]
=
loginBean
?.
userId
?:
""
mMap
[
"accessToken"
]
=
loginBean
?.
token
?:
""
mMap
[
"isFromApp"
]
=
"1"
mMap
[
"version"
]
=
RxAppTool
.
getAppVersionName
(
BaseApp
.
getApp
())
mMap
[
"osBuild"
]
=
osBuild
...
...
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