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
f17008fd
Commit
f17008fd
authored
Apr 11, 2020
by
konghaorui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充flutter获取子频道配置信息方法
parent
1039e831
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
34 deletions
+69
-34
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-1
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+17
-17
DemoAppLifecycles.kt
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.kt
+9
-0
config.gradle
config.gradle
+9
-9
HomeBaseHttp.kt
m-home/src/main/java/com/yidianling/home/http/HomeBaseHttp.kt
+13
-7
YDLCommonPlugin.kt
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/plugin/YDLCommonPlugin.kt
+20
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
f17008fd
...
...
@@ -21,7 +21,7 @@
android:supportsRtl=
"true"
android:theme=
"@style/platform_CommonTheme"
tools:ignore=
"GoogleAppIndexingWarning"
tools:replace=
"android:allowBackup, android:icon, android:label"
>
tools:replace=
"android:allowBackup, android:icon, android:label
,android:name
"
>
<activity
android:name=
".music.FragmentContainerActivity"
android:theme=
"@style/platform_NoTitleTheme"
/>
...
...
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
f17008fd
...
...
@@ -22,9 +22,9 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.fm.api.service.IFMService
import
com.yidianling.tests.home.NewTestHomeActivity
import
com.yidianling.user.ui.collect.CollectSexAndBirthActivity
import
com.yidianling.user.widget.SecretDescriptionDialog
import
com.yidianling.user.widget.SecretDescriptionDialog.OnSecretDescriptionDialogListener
import
com.yidianling.user.widget.SecretDialog
import
com.yidianling.user.widget.SecretDialog.OnSecretDialogListener
import
kotlinx.android.synthetic.main.activity_main.*
...
...
@@ -103,23 +103,23 @@ 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
))
// SecretActivity.Companion.startProtocol(this, it.data.getContent());
secretDescriptionDialog
=
SecretDescriptionDialog
(
this
@MainActivity
,
"122342453653456345674356"
,
object
:
OnSecretDescriptionDialogListener
{
override
fun
onCancel
()
{
secretDescriptionDialog
!!
.
dismiss
()
showEnsureDialog
()
}
override
fun
onSure
()
{
secretDescriptionDialog
!!
.
dismiss
()
}
})
secretDescriptionDialog
!!
.
setCanceledOnTouchOutside
(
false
)
secretDescriptionDialog
!!
.
show
()
//
secretDescriptionDialog = SecretDescriptionDialog(
//
this@MainActivity,
//
"122342453653456345674356",
//
object : OnSecretDescriptionDialogListener {
//
override fun onCancel() {
//
secretDescriptionDialog!!.dismiss()
//
showEnsureDialog()
//
}
//
//
override fun onSure() {
//
secretDescriptionDialog!!.dismiss()
//
}
//
})
//
secretDescriptionDialog!!.setCanceledOnTouchOutside(false)
//
secretDescriptionDialog!!.show()
}
bt_to_collect_info
.
setOnClickListener
{
...
...
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.kt
View file @
f17008fd
...
...
@@ -60,6 +60,15 @@ class DemoAppLifecycles : IAppLifecycles {
map
[
"platform_main_theme"
]
=
"#34CD65"
return
map
}
override
fun
getSubChannelTheme
(
channelName
:
String
):
ArrayList
<
Any
>
{
val
channelTheme
=
arrayListOf
<
Any
>()
val
items
=
mutableMapOf
<
String
,
String
>()
items
[
"index"
]
=
"1"
items
[
"type"
]
=
"sort"
channelTheme
.
add
(
items
)
return
channelTheme
}
}
// FlutterMain.ensureInitializationComplete(application, null);
//
...
...
config.gradle
View file @
f17008fd
ext
{
kotlin_version
=
"1.3.21"
dev_mode
=
tru
e
dev_mode
=
fals
e
ydl_app
=
[
appName
:
"心理咨询壹点灵"
,
...
...
@@ -43,11 +43,11 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.48.10"
,
"m-consultant"
:
"0.0.58.
4
"
,
"m-consultant"
:
"0.0.58.
7
"
,
"m-fm"
:
"0.0.29.8"
,
"m-user"
:
"0.0.60.2"
,
"m-home"
:
"0.0.20.
6
"
,
"m-im"
:
"0.0.17.
1
"
,
"m-home"
:
"0.0.20.
8
"
,
"m-im"
:
"0.0.17.
6
"
,
"m-dynamic"
:
"0.0.7.6"
,
"m-muse"
:
"0.0.28.11"
,
...
...
@@ -69,14 +69,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.39.
18
"
,
"ydl-platform"
:
"0.0.39.
23
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.25"
,
"ydl-media"
:
"0.0.21.4"
,
"ydl-pay"
:
"0.0.18.7"
,
"m-audioim"
:
"0.0.48.2.9"
,
"ydl-flutter-base"
:
"0.0.14.
5
"
,
"ydl-flutter-base"
:
"0.0.14.
10
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
@@ -115,14 +115,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.39.
18
"
,
"ydl-platform"
:
"0.0.39.
23
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.25"
,
"ydl-media"
:
"0.0.21.4"
,
"ydl-pay"
:
"0.0.18.7"
,
"m-audioim"
:
"0.0.48.2.9"
,
"ydl-flutter-base"
:
"0.0.14.
5
"
,
"ydl-flutter-base"
:
"0.0.14.
7
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
@@ -270,7 +270,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base"
:
"com.ydl:ydl-flutter-base:${ydlCompileVersion["
ydl
-
flutter
-
base
"]}"
,
//组件化项目中的flutter base模块
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.18.
1
@aar"
,
//flutter aar
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.18.
6
@aar"
,
//flutter aar
"ydl-flutter-sp"
:
"com.ydl:ydl-flutter-sp:0.0.2@aar"
,
//flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号
...
...
m-home/src/main/java/com/yidianling/home/http/HomeBaseHttp.kt
View file @
f17008fd
...
...
@@ -10,7 +10,13 @@ import com.yidianling.user.api.service.IUserService
import
io.reactivex.Observable
class
HomeBaseHttp
{
open
var
consultListSize
:
String
=
"3"
open
var
confideListSize
:
String
=
"3"
open
var
courseListSize
:
String
=
"3"
open
var
articleListSize
:
String
=
"4"
open
var
fmListSize
:
String
=
"4"
open
var
dynamicListSize
:
String
=
"6"
companion
object
{
fun
getInstance
():
HomeBaseHttp
{
return
Holder
.
INSTANCE
...
...
@@ -39,14 +45,14 @@ class HomeBaseHttp {
fun
getConfideData
(
goodType
:
String
):
Observable
<
BaseAPIResponse
<
HomeConfideBean
>>
{
val
loginBean
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
var
userId
=
loginBean
?.
uid
?:
""
;
return
getHomePagerApi
().
getConfideData
(
goodType
,
uid
=
userId
);
return
getHomePagerApi
().
getConfideData
(
goodType
,
uid
=
userId
,
limit
=
confideListSize
);
}
//首页课程请求
fun
getCourseData
(
listType
:
String
=
"10"
):
Observable
<
BaseAPIResponse
<
HomeCourseBean
>>
{
val
loginBean
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
var
userId
=
loginBean
?.
uid
?:
""
;
return
getHomePagerApi
().
getCourseData
(
listType
,
uid
=
userId
);
return
getHomePagerApi
().
getCourseData
(
listType
,
uid
=
userId
,
limit
=
courseListSize
);
}
//首页测试请求
...
...
@@ -61,24 +67,24 @@ class HomeBaseHttp {
val
loginBean
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
var
userId
=
loginBean
?.
uid
?:
""
;
var
token
=
loginBean
?.
accessToken
?:
""
;
return
getHomePagerApi
().
getAskData
(
accessToken
=
token
,
uid
=
userId
);
return
getHomePagerApi
().
getAskData
(
accessToken
=
token
,
uid
=
userId
,
perPageRows
=
dynamicListSize
);
}
//首页电台请求
fun
getFMData
():
Observable
<
BaseAPIResponse
<
HomeFMBean
>>
{
return
getHomePagerApi
().
getFMData
();
return
getHomePagerApi
().
getFMData
(
perPageRows
=
fmListSize
);
}
//首页文章请求
fun
getArticleData
(
perPageRows
:
String
=
"4"
):
Observable
<
BaseAPIResponse
<
HomeArticleBean
>>
{
return
getHomePagerApi
().
getArticleData
()
return
getHomePagerApi
().
getArticleData
(
perPageRows
=
articleListSize
)
}
//首页咨询请求
fun
getConsultData
(
goodType
:
String
):
Observable
<
BaseAPIResponse
<
HomeConsultBean
>>
{
val
loginBean
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
var
userId
=
loginBean
?.
uid
?:
""
return
getHomePagerApi
().
getConsultData
(
category
=
goodType
,
uid
=
userId
)
return
getHomePagerApi
().
getConsultData
(
category
=
goodType
,
uid
=
userId
,
limit
=
consultListSize
)
}
//首页问答 - 点赞
...
...
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/plugin/YDLCommonPlugin.kt
View file @
f17008fd
...
...
@@ -48,6 +48,7 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
const
val
ACTION_PUSH_EVENT_TRACKING_TAP
:
String
=
"action_push_event_tracking_tap"
// 点击事件埋点
const
val
ACTION_PUSH_EVENT_TRACKING_PV
:
String
=
"action_push_event_tracking_pv"
//pv埋点
const
val
ACTION_ORIGIN_THEME
:
String
=
"platform_origin_theme"
//马甲包获取应用各个主题色的action
const
val
ACTION_GET_SUB_CHANNEL_THEME
:
String
=
"action_page_layout_params"
//获取子频道主页样式
const
val
REQUESTMAINSCROLLFOCUS
:
String
=
"requestMainScrollFocus"
const
val
RELEASEMAINSCROLLFOCUS
:
String
=
"releaseMainScrollFocus"
...
...
@@ -144,6 +145,22 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
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"
)
LogUtil
.
i
(
"platform_sub_channel_theme channelName:$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
))
result
.
success
(
mMap
)
}
REQUESTMAINSCROLLFOCUS
->
{
EventBus
.
getDefault
().
post
(
MainScrollEnableEvent
(
...
...
@@ -163,5 +180,7 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
interface
CommonPluginDelegate
{
fun
getAppTheme
():
HashMap
<
String
,
String
>
fun
getSubChannelTheme
(
channelName
:
String
):
ArrayList
<
Any
>
}
}
\ 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