Commit 257c5c1c by konghaorui

Merge branch 'dev' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into dev

# Conflicts:
#	app/src/main/java/com/ydl/component/MainActivity.kt
parents 5c7df153 fd5e7e89
......@@ -117,6 +117,7 @@ android {
signingConfig signingConfigs.ydl
}
xlzx {
applicationId rootProject.ext.xlzx_app["applicationId"]
versionName rootProject.ext.xlzx_app["versionName"]
......@@ -167,9 +168,11 @@ dependencies {
if (true) {
//开发模式
api project(':m-user')
api project(':m-tests')
implementation modularPublication('com.ydl:m-user-api')
// api project(':m-tests')
api project(':m-consultant')
api project(':m-confide')
implementation modularPublication('com.ydl:m-consultant-api')
// api project(':m-confide')
api (project(':ydl-platform')){
transitive = true
}
......
......@@ -16,7 +16,7 @@ import com.umeng.analytics.MobclickAgent
import com.ydl.component.music.MusicPlayActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
import com.ydl.confide.home.ConfideHomeActivity
//import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.media.audio.PlayService
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
......@@ -25,8 +25,9 @@ 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.TestHomeActivity
//import com.yidianling.tests.home.TestHomeActivity
import kotlinx.android.synthetic.main.activity_main.*
/**
......@@ -90,10 +91,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
startActivity(Intent(this, MusicPlayActivity::class.java))
}
bt_to_tests.setOnClickListener {
startActivity(Intent(this, TestHomeActivity::class.java))
// startActivity(Intent(this, TestHomeActivity::class.java))
}
bt_to_confide.setOnClickListener {
startActivity(Intent(this, ConfideHomeActivity::class.java))
// startActivity(Intent(this, ConfideHomeActivity::class.java))
}
bt_to_muse.setOnClickListener {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE,
......@@ -129,7 +130,6 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
override fun reLoadData() {
mPresenter?.loadUsers()
}
......@@ -169,15 +169,17 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override fun onResume() {
super.onResume()
MobclickAgent.onResume(this)
ModularServiceManager.provide(IConsultantService::class.java).showConsultAssistantDialog(this)
}
override fun onDestroy() {
if (serviceConnection != null) {
unbindService(serviceConnection)
}
super.onDestroy()
}
// override fun onDestroy() {
// if (serviceConnection != null) {
// unbindService(serviceConnection)
// }
// super.onDestroy()
// }
private inner class PlayServiceConnection : ServiceConnection {
override fun onServiceConnected(name: ComponentName, service: IBinder) {
......
......@@ -11,6 +11,8 @@ import com.ydl.ydlcommon.utils.YdlBuryPointUtil;
import org.jetbrains.annotations.NotNull;
import io.flutter.view.FlutterMain;
/**
* Created by haorui on 2019-09-02.
* Des:
......@@ -25,6 +27,10 @@ public class DemoAppLifecycles implements IAppLifecycles {
public void onCreate(@NotNull Application application) {
//数据埋点初始化--一定要放在主进程中
YdlBuryPointUtil.init(application);
//Flutter 初始化需要在主线程中执行
FlutterMain.startInitialization(application);
Intent intent = new Intent(application, PlayService.class);
application.startService(intent);
}
......
......@@ -27,6 +27,7 @@ public final class DemoGlobalConfig implements IConfigModule {
public void applyOptions(@NotNull Context context, @NotNull GlobalConfig.Builder builder) {
builder.setFrom( "ydl".equals(BuildConfig.FLAVOR) ?YDLConstants.FROM_YDL :YDLConstants.FROM_XLZX)
.addUrl("github", APP_DOMAIN)
.setEnv(YDLConstants.ENV_TEST)
.setDebug(BuildConfig.DEBUG);
}
}
......@@ -171,21 +171,26 @@ ext {
"ydl-net" : 'com.ydl:ydl-net:0.0.1',
"ydl-user-router" : 'com.ydl:router:1.0.0-SNAPSHOT@aar',
"ydl-device" : 'com.ydl:device-id:0.0.7@aar',
"ydl-flutter" : 'com.ydl:ydl-flutter:0.0.2@aar',
//flutter功能组件升级===>发布ydl-flutter-base组件===>引用flutter相关的业务模块
"ydl-flutter" : 'com.ydl:ydl-flutter:0.0.6@aar',
"ydl-flutter-base" : 'com.ydl:ydl-flutter-base:0.0.2@aar',
//基础组件 <<--- 先发这个,发完改这里的版本号
"ydl-platform" : 'com.ydl:ydl-platform:0.0.16@aar',
"ydl-platform" : 'com.ydl:ydl-platform:0.0.18@aar',
//功能组件 <<--- 再发这些,发完改这里的版本号
"ydl-webview" : 'com.ydl:ydl-webview:0.0.16@aar',
"ydl-media" : 'com.ydl:ydl-media:0.0.5@aar',
"ydl-audioim" : 'com.ydl:m-audioim:0.0.4@aar',
"ydl-webview" : 'com.ydl:ydl-webview:0.0.18@aar',
"ydl-media" : 'com.ydl:ydl-media:0.0.7@aar',
"ydl-audioim" : 'com.ydl:m-audioim:0.0.6@aar',
"ydl-pay" : 'com.ydl:ydl-pay:0.0.2@aar',
//业务组件 <<--- 最后发这些(只发改过的)
"ydl-m-user-api" : 'com.ydl:m-user-api:0.0.5',
"ydl-m-muse-api" : 'com.ydl:m-muse-api:0.0.1',
"ydl-m-fm-api" : 'com.ydl:m-fm-api:0.0.2',
"ydl-m-fm-module-ydl" : 'com.ydl:m-fm-module-ydl:0.0.6@aar',
"ydl-m-course-module-ydl" : 'com.ydl:m-course-module-ydl:0.0.1@aar',
"ydl-m-tests-api" : 'com.ydl:m-tests-api:0.0.1',
]
......
IS_PUBLISH=true
VERSION_NAME=0.0.4
\ No newline at end of file
VERSION_NAME=0.0.6
\ No newline at end of file
......@@ -15,7 +15,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-consultant-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.14"
version = "0.0.18"
}
}
......@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-consultant-api"
//开发时注释掉版本号,发布api时打开
//version = "0.0.1"
version = "0.0.2"
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
......
......@@ -30,6 +30,7 @@ import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.GlobalInfo
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.ui.LogoLoadingView
......@@ -49,12 +50,16 @@ import com.yidianling.consultant.listener.OnCategoriesSelectedListener
import com.yidianling.consultant.listener.OnFilterConfirmListener
import com.yidianling.consultant.listener.OnSortItemSelectedListener
import com.yidianling.consultant.model.bean.*
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import com.yidianling.consultant.modular.utils.TempH5RouteUtils
import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.consultant.ui.view.AreaPopupWindow
import com.yidianling.consultant.ui.view.CategoryPopupWindow
import com.yidianling.consultant.ui.view.FilterPopupWindow
import com.yidianling.consultant.ui.view.SortPopupWindow
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_content.*
......@@ -62,6 +67,7 @@ import kotlinx.android.synthetic.main.consultant_layout_search_head_bg.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
@Route(path = "/consult/list")
class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPresenter>(), View.OnClickListener, IExpertSearchView,
......@@ -182,6 +188,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private var hasSelectedArea = false //是否选择过地区
private var hasSelectedSort = false //是否选择过排序
override fun createPresenter(): ExpertSearchPresenter = ExpertSearchPresenter()
private fun initViews() {
......@@ -990,9 +997,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
}
ConsultAssistantDialogUtils.INSTANCE.fitRequest(this, "doctor_list")
}
filterPopupWindow.isClippingEnabled = false
filterPopupWindow.showAtLocation(viewSep2.rootView, Gravity.TOP + Gravity.RIGHT, 0, 0)
ConsultAssistantDialogUtils.INSTANCE.hide()
filterPopupWindow.onFilterConfirmListener = this
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
// viewDim.visibility = View.VISIBLE
......@@ -1458,5 +1467,15 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override fun onResume() {
super.onResume()
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT)
ConsultAssistantDialogUtils.INSTANCE.fitRequest(this, "doctor_list")
}
override fun onDestroy() {
super.onDestroy()
ConsultAssistantDialogUtils.INSTANCE.hide()
ConsultAssistantDialogUtils.INSTANCE.resetStatus()
}
}
......@@ -11,6 +11,7 @@ import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.http.ExpertSearchDataManager
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.AllFilter
......@@ -25,7 +26,6 @@ import io.reactivex.schedulers.Schedulers
*/
class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
@SuppressLint("CheckResult")
fun fetchListHead() {
SearchApi.getSearchApi()
......
......@@ -38,4 +38,5 @@ interface IExpertSearchView : IView {
* 加载图片
*/
fun showImage(url : String?, imgView : ImageView, ops : SimpleImageOpConfiger)
}
\ No newline at end of file
package com.yidianling.consultant.dialog
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.WindowManager
import com.yidianling.consultant.R
import kotlinx.android.synthetic.main.consultant_expert_consult_assistant_popup_window.*
/**
* 咨询助理浮层
* Created by xj on 2019/10/30.
*/
class ConsultAssistantDialog(context: Context, val consultAssistantClickListener: OnConsultAssistantClickListener?) : Dialog(context, R.style.consultant_expert_dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.consultant_expert_consult_assistant_popup_window)
val params = window.attributes
params.width = WindowManager.LayoutParams.WRAP_CONTENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity = Gravity.RIGHT + Gravity.BOTTOM
params.verticalMargin = 0.07f
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE //不拦截外部点击事件
window.attributes = params
window.setDimAmount(0f)
window.setWindowAnimations(R.style.consultant_expert_consult_assistant_dialog_animate)
consult_assistant.setOnClickListener {
consultAssistantClickListener?.onClickAction()
}
setCanceledOnTouchOutside(false)
}
interface OnConsultAssistantClickListener {
fun onClickAction() //隐私设置
}
}
\ No newline at end of file
......@@ -60,4 +60,14 @@ interface SearchApi {
@retrofit2.http.Headers("Content-Type:application/json")
@GET
fun getFilterCount(@Url url : String?): Observable<BaseAPIResponse<Int>>
//导医
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET("consult/assistant/guide-switch")
fun getConsultAssistantRequest(@Query("switchKey") switchKey: String): Observable<BaseAPIResponse<Boolean>>
//获取咨询助理uid
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET("consult/assistant/chat-distribute")
fun getConsultAssistantUidRequest(): Observable<BaseAPIResponse<Long>>
}
\ No newline at end of file
package com.yidianling.consultant.modular
import android.app.Activity
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
/**
* Created by xj on 2019/11/14.
*/
@Route(path = "/consultant/ConsultantService")
class ConsultantServiceImp: IConsultantService {
override fun init(context: Context?) {
}
/**
* 首页咨询助理入口
*/
override fun showConsultAssistantDialog(activity: Activity) {
ConsultAssistantDialogUtils.INSTANCE.fitRequest(activity, "home_index")
}
override fun hideConsultAssistantDialog() {
ConsultAssistantDialogUtils.INSTANCE.hide()
}
}
\ No newline at end of file
package com.yidianling.consultant.modular.singlton
import android.app.Activity
import android.support.v7.app.AppCompatActivity
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.dialog.ConsultAssistantDialog
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import java.util.*
/**
* Created by xj on 2019/11/14.
*/
class ConsultAssistantDialogUtils private constructor(){
companion object {
val INSTANCE by lazy { ConsultAssistantDialogUtils() }
}
var consultAssistantDialog: ConsultAssistantDialog? = null
var expertSearchPageHasShown: Boolean = false // 专家咨询列表页面是否已经展示
var timer: Timer? = null
/**
*判断是否符合代码展示逻辑
* origin 展示请求来源 首页 home_index 咨询列表 doctor_list
*/
fun fitRequest(activity: Activity, origin: String) {
if (ConsultantIn.isLogin() &&
ConsultantIn.getUserImpl().getUserInfo()?.user_type == 1
/** WalleChannelReader.getChannel(BaseApp.Companion.getApp()) == "android_huawei" */
) {
shouldShowDialog(activity, origin)
}
}
/**
* 判断是否符合接口展示逻辑
*/
private fun shouldShowDialog(activity: Activity, origin: String, isDelay: Boolean = false) {
// 请求接口判断导医咨询助理按钮是否展示
SearchApi.getSearchApi().getConsultAssistantRequest(origin)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe{
if (it.data) {
if (origin == "home_index") {
show(activity, false)
}else if (origin == "doctor_list") {
show(activity, true)
}
}
}
}
/**
* 展示
* isDelay 是否延迟展示
*/
fun show(activity: Activity, isDelay: Boolean) {
if (isDelay && !expertSearchPageHasShown && timer == null) {
timer = Timer()
timer!!.schedule(object : TimerTask() {
override fun run() {
showDialog(activity)
expertSearchPageHasShown = true
}
}, 10000)
}else {
showDialog(activity)
}
}
/**
* 展示浮层
*/
fun showDialog(activity: Activity) {
if (consultAssistantDialog == null) {
consultAssistantDialog = ConsultAssistantDialog(activity, object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
//获取用户uid
getConsultAssistantUid(activity)
}
})
}
consultAssistantDialog!!.show()
}
/**
* 隐藏
*/
fun hide() {
consultAssistantDialog?.hide()
}
/**
* 重置本单例关于专家咨询列表页面得状态
*/
fun resetStatus() {
timer?.cancel()
timer = null
expertSearchPageHasShown = false
}
private fun getConsultAssistantUid(activity: Activity) {
// 请求接口获取咨询助理的uid
SearchApi.getSearchApi().getConsultAssistantUidRequest()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe{
if (it.code == "200" && it.data != 0.toLong()) {
ConsultantIn.startP2PSession(activity as AppCompatActivity, it.data.toString())
}else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}
}
}
\ No newline at end of file
......@@ -20,6 +20,10 @@ object ConsultantIn {
RouterManager.getImRouter().startP2PXiaoYi(context)
}
fun isLogin(): Boolean {
return ModularServiceManager.provide(IUserService::class.java).isLogin()
}
fun startP2PSession(context: AppCompatActivity, toUid: String) {
RouterManager.getImRouter().startP2PSession(context, toUid)
}
......
package com.yidianling.consultant.api
import android.app.Activity
import com.alibaba.android.arouter.facade.template.IProvider
/**
* Created by xj on 2019/11/14.
*/
interface IConsultantService: IProvider {
// 显示咨询助理弹框
fun showConsultAssistantDialog(activity: Activity)
// 隐藏咨询助理弹框
fun hideConsultAssistantDialog()
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="500"
android:fromXDelta="0"
android:toXDelta="100%p" />
</set>
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="500"
android:fromXDelta="100%p"
android:toXDelta="0" />
</set>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="60dp"
android:paddingRight="11dp">
<ImageView
android:id="@+id/consult_assistant"
android:layout_width="66dp"
android:layout_height="68dp"
android:scaleType="centerCrop"
android:src="@drawable/consultant_expert_consult_assistant_img"/>
</RelativeLayout>
\ No newline at end of file
......@@ -22,4 +22,19 @@
<item name="android:windowEnterAnimation">@anim/consultant_expert_service_popupwindow_filter_show_anim</item>
<item name="android:windowExitAnimation">@anim/consultant_expert_service_popupwindow_filter_hide_anim</item>
</style>
<style name="consultant_expert_consult_assistant_dialog_animate">
<!-- 指定显示的动画xml -->
<item name="android:windowEnterAnimation">@anim/consultant_expert_consult_assistant_dialog_animate_show_anim</item>
<item name="android:windowExitAnimation">@anim/consultant_expert_consult_assistant_dialog_animate_hide_anim</item>
</style>
<style name="consultant_expert_dialog_default_style" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
</resources>
......@@ -46,6 +46,9 @@ android {
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
res.srcDirs = [
'src/main/res'
]
}
}
......@@ -76,10 +79,18 @@ dependencies {
api project(":ydl-platform")
api project(":ydl-media")
api project(":ydl-pay")
api project(":ydl-flutter-base")
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
api rootProject.ext.dependencies["ydl-webview"]
api (rootProject.ext.dependencies["ydl-media"]){
transitive = true
}
api rootProject.ext.dependencies["ydl-pay"]
api (rootProject.ext.dependencies["ydl-flutter-base"]){
transitive = true
}
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
......
isApplicaiton = false
modular {
//模块包名
packageName "com.yidianling.course"
packageName "com.ydl.course"
// 模块发布需要的参数
publish {
modules {
......@@ -8,14 +8,14 @@ modular {
groupId = "com.ydl"
artifactId = "m-course-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.11"
version = "0.0.1"
}
ydl{
groupId = "com.ydl"
artifactId = "m-course-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.11"
version = "0.0.1"
}
}
......@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-course-api"
//开发时注释掉版本号,发布api时打开
//version = "0.0.1"
version = "0.0.1"
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
......
......@@ -6,8 +6,8 @@ import android.os.Handler
import android.text.TextUtils
import com.alibaba.android.arouter.launcher.ARouter
import com.google.gson.Gson
import com.ydl.ydl_flutter.flutter.base.BaseFlutterFragment
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.flutter.base.BaseFlutterFragment
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
......
......@@ -9,9 +9,9 @@ import com.ydl.media.view.PlayerFloatHelper
import com.ydl.media.view.PlayerFloatView
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_flutter.flutter.base.BaseFlutterFragment
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.flutter.base.BaseFlutterFragment
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.common.tools.LogUtil
......
package com.yidianling.course.flutterPlugin
import com.ydl.ydlcommon.base.flutter.io.flutter.facade.FlutterFragment
import com.ydl.ydl_flutter.flutter.io.flutter.facade.FlutterFragment
import io.flutter.plugin.common.EventChannel
import io.flutter.view.FlutterView
......
......@@ -66,9 +66,13 @@ dependencies {
//开发时使用
api project(":ydl-platform")
implementation project(':ydl-media')
api project(":ydl-flutter-base")
} else {
//发布时使用
api rootProject.ext.dependencies["ydl-media"]
api (rootProject.ext.dependencies["ydl-flutter-base"]){
transitive = true
}
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
......
......@@ -2,7 +2,7 @@ package com.yidianling.muse.activity
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.media.audio.AudioPlayer
import com.ydl.ydlcommon.base.flutter.base.BaseFlutterActivity
import com.ydl.ydl_flutter.flutter.base.BaseFlutterActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.muse.handler.MusePlugin
import org.json.JSONObject
......
include ':app',":router", ':ydl-net', ':ydl-utils', ':ydl-platform', ':ydl-webview',
include ':app', ':ydl-flutter-base',":router", ':ydl-net', ':ydl-utils', ':ydl-platform', ':ydl-webview',
':m-confide', ':m-audioim',':ydl-media',":m-user", ':m-consultant', ':m-muse',
':m-fm', ':m-tests',":m-course", ':ydl-pay'
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
flavorDimensions "versionCode"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
api rootProject.ext.dependencies["ydl-flutter"]
}
IS_PUBLISH=true
VERSION_NAME=0.0.2
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.ydl_flutter" />
package com.ydl.ydlcommon.base.flutter.base
package com.ydl.ydl_flutter.flutter.base
import android.content.Context
import android.content.Intent
......
package com.ydl.ydlcommon.base.flutter.base
package com.ydl.ydl_flutter.flutter.base
import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import com.ydl.ydlcommon.base.flutter.io.flutter.facade.Flutter
import com.ydl.ydlcommon.base.flutter.io.flutter.facade.FlutterFragment
import com.ydl.ydl_flutter.flutter.io.flutter.facade.Flutter
import com.ydl.ydl_flutter.flutter.io.flutter.facade.FlutterFragment
import io.flutter.view.FlutterView
/**
......@@ -16,7 +16,7 @@ abstract class BaseFlutterFragment : FlutterFragment() {
private var mFlutterView: FlutterView? = null
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): FlutterView {
mFlutterView=Flutter.createView(
mFlutterView= Flutter.createView(
activity!!,
lifecycle,
initialRoute())
......
package com.ydl.ydlcommon.base.flutter.io.flutter.facade;
package com.ydl.ydl_flutter.flutter.io.flutter.facade;
import android.app.Activity;
import android.arch.lifecycle.Lifecycle;
......
package com.ydl.ydlcommon.base.flutter.io.flutter.facade;
package com.ydl.ydl_flutter.flutter.io.flutter.facade;
import android.content.Context;
import android.os.Bundle;
......
<resources>
<string name="app_name">ydl_flutter</string>
</resources>
IS_PUBLISH=true
VERSION_NAME=0.0.5
\ No newline at end of file
VERSION_NAME=0.0.7
\ No newline at end of file
......@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: "../maven_push.gradle"
android {
compileSdkVersion 28
......@@ -56,7 +57,6 @@ dependencies {
api 'com.umeng.sdk:share-wechat:6.9.1'
api rootProject.ext.dependencies["ydl-hnet"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-platform')
......
IS_PUBLISH=true
VERSION_NAME=0.0.2
\ No newline at end of file
......@@ -78,7 +78,6 @@ dependencies {
api rootProject.ext.dependencies["imagepicker"]
api rootProject.ext.dependencies["ydl-utils"]
api rootProject.ext.dependencies["ydl-js"]
api rootProject.ext.dependencies["ydl-flutter"]
api rootProject.ext.dependencies["ydl-net"]
api rootProject.ext.dependencies["ydl-js"]
api(rootProject.ext.dependencies["ydl-device"]) {
......
IS_PUBLISH=true
VERSION_NAME=0.0.16
\ No newline at end of file
VERSION_NAME=0.0.18
\ No newline at end of file
package com.ydl.ydlcommon.base
import android.app.Application
import android.content.Context
import android.support.multidex.MultiDex
import com.ydl.ydlcommon.base.config.GlobalConfig
import com.ydl.ydlcommon.base.config.IApp
import com.ydl.ydlcommon.base.delegate.AppDelegate
import com.ydl.ydlcommon.base.delegate.IAppLifecycles
import com.ydl.ydlcommon.utils.YDLPreconditions
import io.flutter.view.FlutterMain
/**
* Created by haorui on 2019-08-21 .
* Des: 基础Application
*/
open class BaseApp : Application(), IApp {
private var mAppDelegate: IAppLifecycles? = null
companion object {
lateinit var instance: BaseApp
fun getApp(): Application {
return instance
}
}
/**
* 这里会在 [BaseApp.onCreate] 之前被调用,可以做一些较早的初始化
* 常用于 MultiDex 以及插件化框架的初始化
*
* @param base
*/
override fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
instance = this;
MultiDex.install(this)
if (mAppDelegate == null)
this.mAppDelegate = AppDelegate(base)
this.mAppDelegate!!.attachBaseContext(base)
}
override fun onCreate() {
super.onCreate()
if (mAppDelegate != null)
this.mAppDelegate!!.onCreate(this)
//Flutter 初始化需要在主线程中执行
FlutterMain.startInitialization(this)
}
/**
* 在模拟环境中程序终止时会被调用
*/
override fun onTerminate() {
super.onTerminate()
if (mAppDelegate != null)
this.mAppDelegate!!.onTerminate(this)
}
override fun getGlobalConfig(): GlobalConfig {
YDLPreconditions.checkNotNull(mAppDelegate, "%s cannot be null", AppDelegate::class.java.name)
YDLPreconditions.checkState(
mAppDelegate is IApp,
"%s must be implements %s",
mAppDelegate!!::class.java.name,
IApp::class.java.name
)
return (mAppDelegate as IApp).getGlobalConfig()
}
}
package com.ydl.ydlcommon.base
import android.app.Application
import android.content.Context
import android.support.multidex.MultiDex
import com.ydl.ydlcommon.base.config.GlobalConfig
import com.ydl.ydlcommon.base.config.IApp
import com.ydl.ydlcommon.base.delegate.AppDelegate
import com.ydl.ydlcommon.base.delegate.IAppLifecycles
import com.ydl.ydlcommon.utils.YDLPreconditions
/**
* Created by haorui on 2019-08-21 .
* Des: 基础Application
*/
open class BaseApp : Application(), IApp {
private var mAppDelegate: IAppLifecycles? = null
companion object {
lateinit var instance: BaseApp
fun getApp(): Application {
return instance
}
}
/**
* 这里会在 [BaseApp.onCreate] 之前被调用,可以做一些较早的初始化
* 常用于 MultiDex 以及插件化框架的初始化
*
* @param base
*/
override fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
instance = this;
MultiDex.install(this)
if (mAppDelegate == null)
this.mAppDelegate = AppDelegate(base)
this.mAppDelegate!!.attachBaseContext(base)
}
override fun onCreate() {
super.onCreate()
if (mAppDelegate != null)
this.mAppDelegate!!.onCreate(this)
}
/**
* 在模拟环境中程序终止时会被调用
*/
override fun onTerminate() {
super.onTerminate()
if (mAppDelegate != null)
this.mAppDelegate!!.onTerminate(this)
}
override fun getGlobalConfig(): GlobalConfig {
YDLPreconditions.checkNotNull(
mAppDelegate,
"%s cannot be null",
AppDelegate::class.java.name
)
YDLPreconditions.checkState(
mAppDelegate is IApp,
"%s must be implements %s",
mAppDelegate!!::class.java.name,
IApp::class.java.name
)
return (mAppDelegate as IApp).getGlobalConfig()
}
}
IS_PUBLISH=true
VERSION_NAME=0.0.16
\ No newline at end of file
VERSION_NAME=0.0.18
\ 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