Commit 5ce59e7f by 万齐军

代码合并

parent d8365292
......@@ -38,9 +38,5 @@ interface IConfideService : IProvider {
uid: String
)
fun isOnlineRtm():Boolean
fun requestConfidePermission(activity: FragmentActivity, call: ((Boolean) -> Unit)?)
fun login(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit)
}
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.google.code.gson:gson:2.8.5"
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ 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
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.media.api">
</manifest>
\ No newline at end of file
package com.ydl.media.api
import android.app.Activity
import com.alibaba.android.arouter.facade.template.IProvider
interface IMediaService : IProvider {
fun closeFloatView(activity: Activity);
}
\ No newline at end of file
......@@ -220,6 +220,8 @@ dependencies {
implementation project(':m-fm')
implementation project(":api:fm")
implementation project(':ydl-tuicore')
implementation project(':m-js')
implementation project(':api:js')
implementation rootProject.ext.dependencies["retrofit-url-manager"]
......
......@@ -111,10 +111,6 @@ class ConfdieServiceImpl : IConfideService {
findRouteService(IAudioImService::class.java).yDLAvManagerInit(app, avManagerKey)
}
override fun isOnlineRtm(): Boolean {
return findRouteService(IAudioImService::class.java).getIsOnlineRtm()
}
override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) {
findRouteService(IAudioImService::class.java).openAxbDialog(activity, type, phoneNumber)
}
......@@ -131,8 +127,4 @@ class ConfdieServiceImpl : IConfideService {
ConfidePermissionDialog().apply { callback = call }.show(activity.supportFragmentManager, "ConfidePermissionDialog")
}
override fun login(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
YDLavManager.instances.login(userId,event)
}
}
\ No newline at end of file
......@@ -46,9 +46,7 @@ android {
}
dependencies {
api fileTree(dir: 'libs', include: ['*.aar','*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.alibaba:arouter-api:$arouter_api"
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
......@@ -69,9 +67,9 @@ dependencies {
implementation project(":api:tests")
implementation project(":api:fm")
implementation project(":api:course")
implementation project(':api:media')
implementation project(':api:muse')
implementation project(':api:js')
implementation project(':api:audioim')
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.blankj.utilcode.util.PermissionUtils
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import com.tencent.smtt.sdk.WebView
import com.ydl.audioim.api.IAudioImService
import com.ydl.confide.api.IConfideService
import com.ydl.confide.event.ConfideDialogEvent
import com.ydl.webview.H5Params
......@@ -90,9 +91,9 @@ class JsMethod(private val webView: WebView?) {
val data = param.getAsJsonObject("data").toString()
val topActivity = BaseActivityMgr.INST.topActivity
if (!JsModularService.getIConfideService().isOnlineRtm()) {
if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
//异常退出或者账号被顶掉,重新登录并拨打
JsModularService.getIConfideService().login(JsModularService.getIUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
findRouteService(IAudioImService::class.java).loginRtm(JsModularService.getIUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) {
findRouteService(IConfideService::class.java).confideDial(id,
data,
......
......@@ -2,7 +2,6 @@ package com.ydl.js
import com.ydl.confide.api.IConfideService
import com.ydl.course.api.ICourseService
import com.ydl.media.api.IMediaService
import com.ydl.muse.api.IMuseService
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.dynamic.api.IDynamicService
......@@ -44,10 +43,6 @@ class JsModularService {
return ModularServiceManager.provide(ICourseService::class.java)
}
fun getIMediaService(): IMediaService {
return ModularServiceManager.provide(IMediaService::class.java)
}
fun getIMuseService(): IMuseService {
return ModularServiceManager.provide(IMuseService::class.java)
}
......
......@@ -21,6 +21,8 @@ import com.ydl.confide.event.ChangeAnotherExpertEvent;
import com.ydl.js.bean.TimeDataBean;
import com.ydl.js.http.JsHttpImpl;
import com.ydl.js.moduler.service.JsImpl;
import com.ydl.media.audio.AudioPlayer;
import com.ydl.media.view.PlayerFloatHelper;
import com.ydl.webview.H5JsBean;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
......@@ -59,8 +61,6 @@ import de.greenrobot.event.EventBus;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import static com.ydl.ydlcommon.router.IYDLRouterConstant.ROUTER_MUSE_PLAY;
/**
* webview 点击事件监听 抽象类
* Created by harvie on 2017/7/4 0004.
......@@ -645,11 +645,16 @@ public class NewH5_WVClickAbstractListener implements NewH5_WebViewClientClickLi
@Override
public void closeFloatView() {
try {
JsModularService.Companion.getIMediaService().closeFloatView(mActivity);
} catch (Exception e) {
e.printStackTrace();
}
mActivity.runOnUiThread(() -> {
try {
if (PlayerFloatHelper.Companion.isShow(mActivity)) {
PlayerFloatHelper.Companion.removeView(mActivity);
AudioPlayer.Companion.get().stopPlayer();
}
} catch (Exception e) {
e.printStackTrace();
}
});
}
@Override
......
......@@ -7,9 +7,9 @@ import android.text.TextUtils
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.tencent.smtt.sdk.WebView
import com.ydl.confide.api.IConfideService
import com.ydl.audioim.api.IAudioImService
import com.ydl.webview.*
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.Utils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.ydl_pay.pay.payDialog.CallBack
......@@ -39,9 +39,9 @@ class WebServiceImpl : IWebService {
//防止连击
return
}
if (!JsModularService.getIConfideService().isOnlineRtm()) {
if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
//异常退出或者账号被顶掉,重新登录并拨打
JsModularService.getIConfideService().login(JsModularService.getIUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
findRouteService(IAudioImService::class.java).loginRtm(JsModularService.getIUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) {
connectionJava(jsData?.id ?: 0, jsData?.confideType ?: 1, activity, tellData, jsData?.callType)
} else {
......
......@@ -5,5 +5,5 @@ include ':app',
':m-consultant', ':m-muse', ':m-fm', ':m-tests', ":m-course",
":m-im",":m-dynamic",":m-article",":m-audioim",":m-user", ":m-confide"
include ':ydl-tuicore', ':api:confide', ':api:dynamic', ':api:fm', ':api:consultant',
':api:course', ':api:user', ':api:tests', ':api:im',':api:home',':api:media',':api:muse',':api:js'
':api:course', ':api:user', ':api:tests', ':api:im',':api:home',':api:muse',':api:js',':api:audioim'
include ':m-js'
......@@ -52,7 +52,6 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api project(':ydl-platform')
implementation project(':api:media')
}
package com.ydl.media.moduler.service
import android.app.Activity
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.media.api.IMediaService
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.view.PlayerFloatHelper
@Route(path = "/media/MediaService")
class MediaImpl :IMediaService {
override fun init(context: Context?) {
}
override fun closeFloatView(activity: Activity) {
activity.runOnUiThread(Runnable {
try {
if (PlayerFloatHelper.isShow(activity)) {
PlayerFloatHelper.removeView(activity)
AudioPlayer.get().stopPlayer()
}
} catch (e: Exception) {
e.printStackTrace()
}
})
}
}
\ No newline at end of file
......@@ -76,10 +76,16 @@ object ModularServiceManager {
private val routerMap: HashMap<String, IProvider> = HashMap()
@Deprecated("使用findRouteService代替",
ReplaceWith("findRouteService(IPlatformUserModuleService::class.java)", "import com.ydl.ydlcommon.modular.findRouteService")
)
fun getPlatformUserService(): IPlatformUserModuleService? {
return provide(IPlatformUserModuleService::class.java)
}
@Deprecated("使用findRouteService代替",
ReplaceWith("findRouteService(clz)", "import com.ydl.ydlcommon.modular.findRouteService")
)
fun <T : IProvider> provide(clz: Class<T>, path: String): T {
var provider: IProvider? = null
......@@ -106,6 +112,9 @@ object ModularServiceManager {
return provider as T
}
@Deprecated("使用findRouteService代替",
ReplaceWith("findRouteService(clz)", "import com.ydl.ydlcommon.modular.findRouteService")
)
fun <T : IProvider> provide(clz: Class<T>): T {
var provider: IProvider? = null
......
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