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
16db7270
Commit
16db7270
authored
Nov 20, 2019
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加flutter公共channel模块
parent
2659147b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
42 additions
and
29 deletions
+42
-29
app-release.aar
app/aars/app-release.aar
+0
-0
shared_preferences-release.aar
app/aars/shared_preferences-release.aar
+0
-0
build.gradle
app/build.gradle
+2
-0
DemoAppLifecycles.java
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.java
+13
-0
CustomBinaryMessagerImpl.kt
app/src/main/java/com/ydl/component/single/CustomBinaryMessagerImpl.kt
+23
-0
YDLCommonPlugin.kt
app/src/main/java/com/ydl/component/single/YDLCommonPlugin.kt
+3
-24
config.gradle
config.gradle
+1
-1
build.gradle
m-tests/build.gradle
+0
-4
build.gradle
ydl-flutter-base/build.gradle
+0
-0
BaseFlutterActivity.kt
ydl-flutter-base/src/main/java/com/ydl/ydl_flutter/flutter/base/BaseFlutterActivity.kt
+0
-0
BaseFlutterFragment.kt
ydl-flutter-base/src/main/java/com/ydl/ydl_flutter/flutter/base/BaseFlutterFragment.kt
+0
-0
No files found.
ydl-flutter-base/lib
/app-release.aar
→
app/aars
/app-release.aar
View file @
16db7270
No preview for this file type
ydl-flutter-base/lib
/shared_preferences-release.aar
→
app/aars
/shared_preferences-release.aar
View file @
16db7270
File moved
app/build.gradle
View file @
16db7270
...
...
@@ -178,6 +178,7 @@ dependencies {
if
(
true
)
{
//开发模式
implementation
fileTree
(
dir:
'aars'
,
include:
[
'*.aar'
])
api
project
(
':m-user'
)
implementation
modularPublication
(
'com.ydl:m-user-api'
)
api
project
(
':m-tests'
)
...
...
@@ -212,6 +213,7 @@ dependencies {
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
transitive
=
true
}
api
rootProject
.
ext
.
dependencies
[
"ydl-flutter"
]
}
...
...
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.java
View file @
16db7270
...
...
@@ -5,6 +5,8 @@ import android.app.Application;
import
android.content.Context
;
import
android.content.Intent
;
import
com.ydl.component.single.CustomBinaryMessagerImpl
;
import
com.ydl.component.single.YDLCommonPlugin
;
import
com.ydl.devicesidlib.DeviceIDHelper
;
import
com.ydl.media.audio.PlayService
;
import
com.ydl.ydlcommon.base.delegate.IAppLifecycles
;
...
...
@@ -13,6 +15,8 @@ import com.yidianling.course.lifeCallback.CoursePlayLifecycle;
import
org.jetbrains.annotations.NotNull
;
import
io.flutter.plugin.common.BinaryMessenger
;
import
io.flutter.plugin.common.MethodChannel
;
import
io.flutter.view.FlutterMain
;
/**
...
...
@@ -35,6 +39,7 @@ public class DemoAppLifecycles implements IAppLifecycles {
//Flutter 初始化需要在主线程中执行
FlutterMain
.
startInitialization
(
application
);
initFlutterChannel
();
Intent
intent
=
new
Intent
(
application
,
PlayService
.
class
);
application
.
startService
(
intent
);
...
...
@@ -42,6 +47,14 @@ public class DemoAppLifecycles implements IAppLifecycles {
application
.
registerActivityLifecycleCallbacks
(
new
CoursePlayLifecycle
());
}
/**
* 初始化一个公共channel
*/
private
void
initFlutterChannel
()
{
YDLCommonPlugin
commonPlugin
=
new
YDLCommonPlugin
();
new
MethodChannel
(
CustomBinaryMessagerImpl
.
Companion
.
getINSTANCE
(),
commonPlugin
.
CHANNEL
).
setMethodCallHandler
(
commonPlugin
);
}
@Override
public
void
onTerminate
(
@NotNull
Application
application
)
{
...
...
app/src/main/java/com/ydl/component/single/CustomBinaryMessagerImpl.kt
0 → 100644
View file @
16db7270
package
com.ydl.component.single
import
io.flutter.plugin.common.BinaryMessenger
import
java.nio.ByteBuffer
/**
* Created by xj on 2019/11/20.
*/
class
CustomBinaryMessagerImpl
:
BinaryMessenger
{
override
fun
setMessageHandler
(
p0
:
String
,
p1
:
BinaryMessenger
.
BinaryMessageHandler
?)
{
}
override
fun
send
(
p0
:
String
,
p1
:
ByteBuffer
?)
{
}
override
fun
send
(
p0
:
String
,
p1
:
ByteBuffer
?,
p2
:
BinaryMessenger
.
BinaryReply
?)
{
}
companion
object
{
val
INSTANCE
by
lazy
{
CustomBinaryMessagerImpl
()
}
}
}
\ No newline at end of file
ydl-flutter-base/src/main/java/com/ydl/ydl_flutter/flutter/base/plugin/
CommonPlugin.kt
→
app/src/main/java/com/ydl/component/single/YDL
CommonPlugin.kt
View file @
16db7270
package
com.ydl.
ydl_flutter.flutter.base.plugin
package
com.ydl.
component.single
import
android.text.TextUtils
import
com.ydl.ydl_flutter.BuildConfig
import
com.ydl.ydl_flutter.flutter.base.BaseFlutterFragment
import
com.ydl.component.BuildConfig
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.yidianling.common.tools.RxDeviceTool
import
io.flutter.app.FlutterActivity
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodChannel
import
io.flutter.view.FlutterView
/**
* Created by xj on 2019/11/19.
*/
class
CommonPlugin
:
MethodChannel
.
MethodCallHandler
{
private
var
mActivity
:
FlutterActivity
?
=
null
private
var
mFragment
:
BaseFlutterFragment
?
=
null
private
constructor
(
activity
:
FlutterActivity
)
{
mActivity
=
activity
}
private
constructor
(
fragment
:
BaseFlutterFragment
)
{
mFragment
=
fragment
}
class
YDLCommonPlugin
:
MethodChannel
.
MethodCallHandler
{
companion
object
{
const
val
CHANNEL
:
String
=
"lib/common/channel"
const
val
GETPUBLICPARAMAS
:
String
=
"getPublicParamas"
fun
rigisterActivity
(
activity
:
FlutterActivity
,
flutterView
:
FlutterView
)
{
MethodChannel
(
flutterView
,
CHANNEL
).
setMethodCallHandler
(
CommonPlugin
(
activity
))
}
fun
rigisterFragment
(
fragment
:
BaseFlutterFragment
,
flutterView
:
FlutterView
)
{
MethodChannel
(
flutterView
,
CHANNEL
).
setMethodCallHandler
(
CommonPlugin
(
fragment
))
}
}
override
fun
onMethodCall
(
methodCall
:
MethodCall
,
result
:
MethodChannel
.
Result
)
{
...
...
config.gradle
View file @
16db7270
ext
{
kotlin_version
=
"1.3.21"
dev_mode
=
fals
e
dev_mode
=
tru
e
ydl_app
=
[
appName
:
"心理咨询壹点灵"
,
...
...
m-tests/build.gradle
View file @
16db7270
...
...
@@ -75,7 +75,6 @@ dependencies {
//开发时使用
api
project
(
':ydl-webview'
)
api
project
(
':ydl-platform'
)
api
project
(
":ydl-flutter-base"
)
implementation
modularPublication
(
'com.ydl:m-test-api'
)
implementation
modularPublication
(
'com.ydl:m-user-api'
)
}
else
{
...
...
@@ -83,9 +82,6 @@ dependencies {
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-tests-api"
]
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-user-api"
]
api
rootProject
.
ext
.
dependencies
[
"ydl-webview"
]
api
(
rootProject
.
ext
.
dependencies
[
"ydl-flutter-base"
]){
transitive
=
true
}
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
transitive
=
true
}
...
...
ydl-flutter-base/build.gradle
deleted
100644 → 0
View file @
2659147b
ydl-flutter-base/src/main/java/com/ydl/ydl_flutter/flutter/base/BaseFlutterActivity.kt
deleted
100644 → 0
View file @
2659147b
ydl-flutter-base/src/main/java/com/ydl/ydl_flutter/flutter/base/BaseFlutterFragment.kt
deleted
100644 → 0
View file @
2659147b
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