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
ace085a8
Commit
ace085a8
authored
Mar 05, 2020
by
konghaorui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充flutterFragment设置状态栏方法
parent
a6fc5e2d
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
73 additions
and
19 deletions
+73
-19
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+3
-3
FragmentContainerActivity.kt
app/src/main/java/com/ydl/component/music/FragmentContainerActivity.kt
+4
-0
config.gradle
config.gradle
+6
-6
modular.gradle
m-tests/modular.gradle
+1
-1
NewTestHomeActivity.kt
m-tests/src/main/java/com/yidianling/tests/home/NewTestHomeActivity.kt
+2
-1
NewTestHomeFragment.kt
m-tests/src/main/java/com/yidianling/tests/home/NewTestHomeFragment.kt
+26
-0
TestPlugin.kt
m-tests/src/main/java/com/yidianling/tests/home/plugin/TestPlugin.kt
+10
-3
BaseFlutterFragment.kt
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/base/BaseFlutterFragment.kt
+16
-2
FlutterFragment.java
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/base/FlutterFragment.java
+2
-1
platform_net_loss_reset_bg.xml
ydl-platform/src/main/res/drawable/platform_net_loss_reset_bg.xml
+3
-2
No files found.
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
ace085a8
package
com.ydl.component
//import com.ydl.confide.home.ConfideHomeActivity
//import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import
android.Manifest
import
android.annotation.SuppressLint
import
android.content.ComponentName
...
...
@@ -26,10 +27,8 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.yidianling.common.tools.ToastUtil
//import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import
com.yidianling.consultant.api.IConsultantService
import
com.yidianling.fm.api.service.IFMService
import
com.yidianling.tests.home.NewTestHomeActivity
import
com.yidianling.user.widget.SecretDescriptionDialog
import
com.yidianling.user.widget.SecretDialog
import
kotlinx.android.synthetic.main.activity_main.*
...
...
@@ -106,7 +105,8 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
FragmentContainerActivity
.
start
(
this
,
"TrendsHomeFragment"
)
}
bt_to_tests
.
setOnClickListener
{
startActivity
(
Intent
(
this
,
NewTestHomeActivity
::
class
.
java
))
// startActivity(Intent(this, NewTestHomeActivity::class.java))
FragmentContainerActivity
.
start
(
this
,
"NewTestHomeFragment"
)
}
bt_to_confide
.
setOnClickListener
{
// YDLavManager.instances.login("1193016")
...
...
app/src/main/java/com/ydl/component/music/FragmentContainerActivity.kt
View file @
ace085a8
...
...
@@ -13,6 +13,7 @@ import com.yidianling.home.ui.fragment.YdlHomeFragment
//import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
//import com.yidianling.home.ui.fragment.YdlHomeFragment
import
com.yidianling.im.ui.page.NewMultiMessageFragment
import
com.yidianling.tests.home.NewTestHomeFragment
import
com.yidianling.user.mine.MineFragment
...
...
@@ -79,6 +80,9 @@ class FragmentContainerActivity : BaseLceActivity<DemoContract.View, DemoContrac
if
(
"MineFragment"
==
fragmentName
)
{
return
MineFragment
()
}
if
(
"NewTestHomeFragment"
==
fragmentName
)
{
return
NewTestHomeFragment
()
}
return
PlayFragment
()
}
}
config.gradle
View file @
ace085a8
...
...
@@ -50,9 +50,9 @@ ext {
"m-im"
:
"0.0.15.5"
,
"m-dynamic"
:
"0.0.7.3"
,
"m-muse"
:
"0.0.28.
2
"
,
"m-tests"
:
"0.0.23.
2
"
,
"m-course"
:
"0.0.41.
8
"
,
"m-muse"
:
"0.0.28.
8
"
,
"m-tests"
:
"0.0.23.
8
"
,
"m-course"
:
"0.0.41.
9
"
,
//-------------- 业务模块 API 层 --------------
"m-audioim-api"
:
"0.0.6"
,
...
...
@@ -69,14 +69,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.39.
3
"
,
"ydl-platform"
:
"0.0.39.
4
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.4"
,
"ydl-media"
:
"0.0.21.3"
,
"ydl-pay"
:
"0.0.18.3"
,
"m-audioim"
:
"0.0.48.0"
,
"ydl-flutter-base"
:
"0.0.10.
3
"
,
"ydl-flutter-base"
:
"0.0.10.
8
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
@@ -122,7 +122,7 @@ ext {
"ydl-media"
:
"0.0.21.3"
,
"ydl-pay"
:
"0.0.18.3"
,
"m-audioim"
:
"0.0.48.0"
,
"ydl-flutter-base"
:
"0.0.10.
3
"
,
"ydl-flutter-base"
:
"0.0.10.
8
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
m-tests/modular.gradle
View file @
ace085a8
...
...
@@ -24,7 +24,7 @@ modular {
groupId
=
"com.ydl"
artifactId
=
"m-tests-api"
//开发时注释掉版本号,发布api时打开
version
=
rootProject
.
ext
.
ydlPublishVersion
[
childProject
.
getName
()+
"-api"
]
//
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies
{
implementation
"com.google.code.gson:gson:2.8.2"
...
...
m-tests/src/main/java/com/yidianling/tests/home/NewTestHomeActivity.kt
View file @
ace085a8
...
...
@@ -16,6 +16,6 @@ class NewTestHomeActivity : BaseFlutterActivity() {
}
override
fun
initChannelPlugin
(
jsonObject
:
JSONObject
)
{
TestPlugin
.
Companion
.
r
i
gister
(
this
)
TestPlugin
.
Companion
.
r
e
gister
(
this
)
}
}
\ No newline at end of file
m-tests/src/main/java/com/yidianling/tests/home/NewTestHomeFragment.kt
0 → 100644
View file @
ace085a8
package
com.yidianling.tests.home
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.channel.ydl_flutter_base.base.BaseFlutterFragment
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.yidianling.tests.home.plugin.TestPlugin
import
io.flutter.view.FlutterView
/**
* flutter版测评首页
* Created by xj on 2019/11/19.
*/
@Route
(
path
=
"/tests/home"
)
class
NewTestHomeFragment
:
BaseFlutterFragment
()
{
override
fun
initChannelPlugin
(
flutterView
:
FlutterView
)
{
var
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
context
);
flutterView
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
TestPlugin
.
Companion
.
register
(
this
,
flutterView
)
}
override
fun
initialRoute
():
String
{
return
"test/home"
}
}
\ No newline at end of file
m-tests/src/main/java/com/yidianling/tests/home/plugin/TestPlugin.kt
View file @
ace085a8
package
com.yidianling.tests.home.plugin
import
android.app.Activity
import
android.net.Uri
import
com.channel.ydl_flutter_base.base.BaseFlutterFragment
import
com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
import
com.ydl.ydl_router.manager.YDLRouterManager
...
...
@@ -14,14 +16,15 @@ import com.yidianling.tests.search.TestSearchActivity
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
TestPlugin
:
MethodChannel
.
MethodCallHandler
{
private
var
mActivity
:
Flutter
Activity
?
=
null
private
constructor
(
activity
:
Flutter
Activity
)
{
private
var
mActivity
:
Activity
?
=
null
private
constructor
(
activity
:
Activity
)
{
mActivity
=
activity
}
companion
object
{
...
...
@@ -37,9 +40,13 @@ class TestPlugin : MethodChannel.MethodCallHandler {
const
val
IS_HIDE_LEFT_BACK
=
"hideLeftBackLL"
// 是否隐藏标题左侧布局
public
var
testDelegate
:
TestPluginDelegate
?=
null
fun
r
i
gister
(
activity
:
FlutterActivity
)
{
fun
r
e
gister
(
activity
:
FlutterActivity
)
{
MethodChannel
(
activity
.
flutterView
,
CHANNEL
).
setMethodCallHandler
(
TestPlugin
(
activity
))
}
fun
register
(
fragment
:
BaseFlutterFragment
,
flutterView
:
FlutterView
)
{
MethodChannel
(
flutterView
,
CHANNEL
).
setMethodCallHandler
(
TestPlugin
(
fragment
.
activity
))
}
}
override
fun
onMethodCall
(
methodCall
:
MethodCall
,
result
:
MethodChannel
.
Result
)
{
...
...
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/base/BaseFlutterFragment.kt
View file @
ace085a8
...
...
@@ -2,8 +2,11 @@ package com.channel.ydl_flutter_base.base
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
com.channel.ydl_flutter_base.plugin.YDLCommonPlugin
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
io.flutter.view.FlutterView
/**
...
...
@@ -14,16 +17,27 @@ import io.flutter.view.FlutterView
abstract
class
BaseFlutterFragment
:
FlutterFragment
()
{
private
var
mFlutterView
:
FlutterView
?
=
null
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
FlutterView
{
open
fun
getStatusViewOptions
():
StatusBarOptions
{
return
StatusBarOptions
(
true
,
statusBarDarkMode
=
true
)
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
{
mFlutterView
=
Flutter
.
createView
(
activity
!!
,
activity
,
lifecycle
,
initialRoute
())
YDLCommonPlugin
.
fragmentRegister
(
this
,
mFlutterView
!!
)
initChannelPlugin
(
mFlutterView
!!
)
if
(
getStatusViewOptions
().
isAddStatusView
){
val
returnViews
=
StatusBarUtils
.
initStatusBarView
(
activity
!!
,
mFlutterView
!!
,
getStatusViewOptions
())
return
returnViews
[
0
]
}
else
{
return
mFlutterView
!!
}
}
/**
* 路由,例 "quick_reply"
*/
...
...
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/base/FlutterFragment.java
View file @
ace085a8
...
...
@@ -6,6 +6,7 @@ import android.support.annotation.NonNull;
import
android.support.v4.app.Fragment
;
import
android.util.AttributeSet
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
com.example.fm_plugin.base.Flutter
;
...
...
@@ -36,7 +37,7 @@ public class FlutterFragment extends Fragment {
}
@Override
public
Flutter
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
return
Flutter
.
createView
(
getActivity
(),
getLifecycle
(),
mRoute
);
}
}
ydl-platform/src/main/res/drawable/platform_net_loss_reset_bg.xml
View file @
ace085a8
...
...
@@ -5,7 +5,7 @@
<corners
android:radius=
"@dimen/platform_dp_14"
/>
<gradient
android:endColor=
"@color/platform_
color_1EA6FA
"
android:startColor=
"@color/platform_
color_5CC8F7
"
/>
android:endColor=
"@color/platform_
main_gradient_end_color
"
android:startColor=
"@color/platform_
main_gradient_start_color
"
/>
</shape>
\ 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