Commit f17008fd by konghaorui

补充flutter获取子频道配置信息方法

parent 1039e831
......@@ -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" />
......
......@@ -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 {
......
......@@ -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);
//
......
ext {
kotlin_version = "1.3.21"
dev_mode = true
dev_mode = false
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
//基础组件 <<--- 先发这个,发完改这里的版本号
......
......@@ -10,6 +10,12 @@ 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 {
......@@ -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)
}
//首页问答 - 点赞
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment