Commit acc98832 by 万齐军

Merge branch 'feat/qj/confide_optimize' into 'd/v_confide_optimized'

Feat/qj/confide optimize

See merge request app_android_lib/YDL-Component!196
parents 60a45ede f65fca61
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
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.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 package="com.ydl.consultant.api">
</manifest>
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
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.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 package="com.ydl.course.api">
</manifest>
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
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.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 package="com.ydl.dynamic.api">
</manifest>
\ No newline at end of file
package com.yidianling.dynamic.api package com.yidianling.dynamic.api
import android.app.Activity import android.app.Activity
import android.content.Context
import android.content.Intent import android.content.Intent
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
......
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
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.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 package="com.ydl.fm.api">
</manifest>
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.2'
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.alibaba:arouter-api:$arouter_api"
implementation "com.google.code.gson:gson:2.8.5"
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 package="com.ydl.im.api">
</manifest>
\ No newline at end of file
package com.yidianling.im.api.bean; package com.yidianling.im.api.bean;
import androidx.annotation.DrawableRes;
/** /**
* Created by haorui on 2020/3/6. * Created by haorui on 2020/3/6.
* Des: * Des:
*/ */
public class IMInitConfigBean { public class IMInitConfigBean {
@DrawableRes public int notificationIconRes;
/** /**
* 测试环境AppKey * 测试环境AppKey
*/ */
......
...@@ -110,6 +110,8 @@ interface IImService : IProvider { ...@@ -110,6 +110,8 @@ interface IImService : IProvider {
*/ */
fun registerObserveCustomNotification(callback: IMRegisterObserverCustomNotificationCallBack) fun registerObserveCustomNotification(callback: IMRegisterObserverCustomNotificationCallBack)
fun unregisterObserveCustomNotification(callback: IMRegisterObserverCustomNotificationCallBack)
fun getMultiMessageFragment(): Fragment fun getMultiMessageFragment(): Fragment
...@@ -178,8 +180,6 @@ interface IImService : IProvider { ...@@ -178,8 +180,6 @@ interface IImService : IProvider {
toUid: Int toUid: Int
) )
fun initIm(app: Application, activity: Class<out Activity>)
fun initIm(app: Application, activity: Class<out Activity>, imInitBean: IMInitConfigBean) fun initIm(app: Application, activity: Class<out Activity>, imInitBean: IMInitConfigBean)
fun isWifiOr3G(activity: Activity): Boolean fun isWifiOr3G(activity: Activity): Boolean
......
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
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.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 package="com.ydl.tests.api">
</manifest>
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
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 package="com.ydl.user.api">
</manifest>
\ No newline at end of file
...@@ -182,6 +182,7 @@ dependencies { ...@@ -182,6 +182,7 @@ dependencies {
implementation(rootProject.ext.dependencies["appcompat-v7"]) implementation(rootProject.ext.dependencies["appcompat-v7"])
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2'
implementation "com.ydl.aar:resource:0.0.1-ydl"
// kapt rootProject.ext.dependencies["dagger2-compiler"] // kapt rootProject.ext.dependencies["dagger2-compiler"]
implementation(rootProject.ext.dependencies["design"]) implementation(rootProject.ext.dependencies["design"])
...@@ -192,12 +193,14 @@ dependencies { ...@@ -192,12 +193,14 @@ dependencies {
implementation fileTree(dir: 'aars', include: ['*.aar']) implementation fileTree(dir: 'aars', include: ['*.aar'])
implementation project(':m-user') implementation(project(':m-user')){
implementation modularPublication('com.ydl:m-user-api') exclude group: "com.ydl.aar", module: 'resource'
}
implementation project(":api:user")
implementation project(':m-confide') implementation project(':m-confide')
implementation project(':api:confide') implementation project(':api:confide')
api project(':m-consultant') api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api') implementation project(":api:consultant")
api project(':m-tests') api project(':m-tests')
api project(':m-home') api project(':m-home')
api project(':m-confide') api project(':m-confide')
...@@ -209,14 +212,13 @@ dependencies { ...@@ -209,14 +212,13 @@ dependencies {
implementation project(':ydl-media') implementation project(':ydl-media')
implementation project(':m-muse') implementation project(':m-muse')
implementation project(':m-im') implementation project(':m-im')
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
implementation project(':m-dynamic') implementation project(':m-dynamic')
implementation project(':m-course') implementation project(':m-course')
implementation project(':m-article') implementation project(':m-article')
implementation project(':m-audioim') implementation project(':m-audioim')
implementation modularPublication('com.ydl:m-audioim-api')
implementation project(':m-fm') implementation project(':m-fm')
implementation modularPublication('com.ydl:m-fm-api') implementation project(":api:fm")
implementation project(':ydl-tuicore') implementation project(':ydl-tuicore')
......
...@@ -7,8 +7,8 @@ import android.content.Intent ...@@ -7,8 +7,8 @@ import android.content.Intent
import android.os.Build import android.os.Build
import android.os.Looper import android.os.Looper
import android.os.Process import android.os.Process
import androidx.annotation.RequiresApi
import android.util.Log import android.util.Log
import androidx.annotation.RequiresApi
import com.channel.ydl_flutter_base.plugin.YDLCommonPlugin import com.channel.ydl_flutter_base.plugin.YDLCommonPlugin
import com.facebook.stetho.Stetho import com.facebook.stetho.Stetho
import com.meituan.android.walle.WalleChannelReader import com.meituan.android.walle.WalleChannelReader
...@@ -20,6 +20,7 @@ import com.umeng.socialize.PlatformConfig ...@@ -20,6 +20,7 @@ import com.umeng.socialize.PlatformConfig
import com.umeng.socialize.UMShareAPI import com.umeng.socialize.UMShareAPI
import com.ydl.component.BuildConfig import com.ydl.component.BuildConfig
import com.ydl.component.MainActivity import com.ydl.component.MainActivity
import com.ydl.component.R
import com.ydl.media.audio.PlayService import com.ydl.media.audio.PlayService
import com.ydl.ydlcommon.actions.crash.Cockroach import com.ydl.ydlcommon.actions.crash.Cockroach
import com.ydl.ydlcommon.actions.crash.ExceptionHandler import com.ydl.ydlcommon.actions.crash.ExceptionHandler
...@@ -31,6 +32,7 @@ import com.ydl.ydlcommon.utils.LogUtil ...@@ -31,6 +32,7 @@ import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.YdlBuryPointUtil import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.bean.IMInitConfigBean
import com.yidianling.im.config.NimApplication import com.yidianling.im.config.NimApplication
import io.flutter.view.FlutterMain import io.flutter.view.FlutterMain
import io.reactivex.functions.Action import io.reactivex.functions.Action
...@@ -93,7 +95,9 @@ class DemoAppLifecycles : IAppLifecycles { ...@@ -93,7 +95,9 @@ class DemoAppLifecycles : IAppLifecycles {
override fun onTerminate(application: Application) {} override fun onTerminate(application: Application) {}
private fun moduleInit(application: Application) { private fun moduleInit(application: Application) {
NimApplication.getInstance().initIm(application, MainActivity::class.java) val imInitConfigBean = IMInitConfigBean()
imInitConfigBean.notificationIconRes = R.drawable.im_ic_launcher
NimApplication.getInstance().initIm(application, MainActivity::class.java, imInitConfigBean)
} }
......
...@@ -2,13 +2,17 @@ package com.ydl.component.service; ...@@ -2,13 +2,17 @@ package com.ydl.component.service;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route; import com.alibaba.android.arouter.facade.annotation.Route;
import com.ydl.component.service.web.WebJavascriptHandler; import com.tencent.smtt.sdk.WebView;
import com.ydl.component.service.web.WVClickAbstractListener; import com.ydl.component.service.web.WVClickAbstractListener;
import com.ydl.component.service.web.WebJavascriptHandler;
import com.ydl.webview.IJavascriptHandler; import com.ydl.webview.IJavascriptHandler;
import com.ydl.webview.IWebService; import com.ydl.webview.IWebService;
import com.ydl.webview.TellData; import com.ydl.webview.TellData;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/** /**
* Created by haorui on 2019-10-10. * Created by haorui on 2019-10-10.
...@@ -24,7 +28,7 @@ public class WebServiceImpl implements IWebService { ...@@ -24,7 +28,7 @@ public class WebServiceImpl implements IWebService {
@NotNull @NotNull
@Override @Override
public IJavascriptHandler getJavascripHandler(@NotNull Activity activity, @NotNull TellData tellData) { public IJavascriptHandler getJavascripHandler(@NotNull Activity activity, @Nullable WebView webView, @NotNull TellData tellData) {
return new WebJavascriptHandler(new WVClickAbstractListener(activity)); return new WebJavascriptHandler(webView, new WVClickAbstractListener(activity));
} }
} }
...@@ -2,6 +2,9 @@ package com.ydl.component.service.web ...@@ -2,6 +2,9 @@ package com.ydl.component.service.web
import com.google.gson.JsonObject import com.google.gson.JsonObject
import com.google.gson.JsonParser import com.google.gson.JsonParser
import com.hjq.permissions.Permission
import com.hjq.permissions.XXPermissions
import com.tencent.smtt.sdk.WebView
import com.ydl.confide.home.event.ConfideDialogEvent import com.ydl.confide.home.event.ConfideDialogEvent
import com.ydl.webview.H5Params import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
...@@ -11,7 +14,7 @@ import com.yidianling.common.tools.ToastUtil ...@@ -11,7 +14,7 @@ import com.yidianling.common.tools.ToastUtil
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
class JsMethod { class JsMethod(private val webView: WebView?) {
fun handle(param: String): Boolean { fun handle(param: String): Boolean {
...@@ -57,6 +60,14 @@ class JsMethod { ...@@ -57,6 +60,14 @@ class JsMethod {
} }
return true return true
} }
"has_audio_permission" -> {
val callback = param.getAsJsonPrimitive("callback").asString
if (callback.isNullOrBlank()) return true
val topActivity = BaseActivityMgr.INST.getTopActivity()
val grantedPermission = XXPermissions.isGrantedPermission(topActivity, Permission.RECORD_AUDIO)
webView?.loadUrl("javascript:$callback(${if (grantedPermission) 1 else 0})")
return true
}
else -> { else -> {
return false return false
} }
......
...@@ -3,6 +3,7 @@ package com.ydl.component.service.web ...@@ -3,6 +3,7 @@ package com.ydl.component.service.web
import android.webkit.JavascriptInterface import android.webkit.JavascriptInterface
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.google.gson.Gson import com.google.gson.Gson
import com.tencent.smtt.sdk.WebView
import com.ydl.confide.api.ConfideRoute import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.api.IConfideService import com.ydl.confide.api.IConfideService
import com.ydl.js_module.manager.WebViewRouterManager import com.ydl.js_module.manager.WebViewRouterManager
...@@ -21,18 +22,13 @@ import com.yidianling.user.UserHelper ...@@ -21,18 +22,13 @@ import com.yidianling.user.UserHelper
* update by harvie on 2017/7/04 * update by harvie on 2017/7/04
*/ */
class WebJavascriptHandler : IJavascriptHandler{ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPro: WebViewClientClickListener?) : IJavascriptHandler() {
private val js = JsMethod() private val js = JsMethod(webView)
override fun getUriAppendSuffix(): String { override fun getUriAppendSuffix(): String {
return "platform_main_theme=00C9E2&platform_main_theme_light=00D4DF&platform_main_theme_bright=EAFAFC" return "platform_main_theme=00C9E2&platform_main_theme_light=00D4DF&platform_main_theme_bright=EAFAFC"
} }
var wvEnventPro: WebViewClientClickListener? = null
constructor(listener: WebViewClientClickListener) : super() {
this.wvEnventPro = listener
}
@JavascriptInterface @JavascriptInterface
fun sendDataToOC(params: String) { fun sendDataToOC(params: String) {
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"> <resources>
<color name="text_user" tools:ignore="MissingDefaultResource">#5195cb</color>
<color name="black" tools:ignore="MissingDefaultResource">#FF000000</color>
<color name="white">@android:color/white</color>
<color name="white_24p">#3DFFFFFF</color> <color name="white_24p">#3DFFFFFF</color>
<color name="white_50p">#80FFFFFF</color> <color name="white_50p">#80FFFFFF</color>
<color name="black_50p">#80000000</color> <color name="black_50p">#80000000</color>
<color name="red">#F44336</color>
<color name="red_30p">#4CF44336</color> <color name="red_30p">#4CF44336</color>
<color name="blue">#2196F3</color>
<color name="grey">#9E9E9E</color> <color name="grey">#9E9E9E</color>
<color name="color_white">#ffffff</color> <color name="color_white">#ffffff</color>
...@@ -24,42 +18,4 @@ ...@@ -24,42 +18,4 @@
<color name="color_main_bg">#F1F3F8</color> <color name="color_main_bg">#F1F3F8</color>
<color name="color_main_text">#333333</color> <color name="color_main_text">#333333</color>
<!-- ============ 标准颜色 ============ -->
<!--主题色 - 用于TabBar、突出文字、按钮和icon-->
<color name="platform_main_theme">#fdbd00</color>
<!--辅助色 1 - 主色系浅色-->
<color name="platform_main_theme_light">#FFEC8C</color>
<!--辅助色 2 - 主色系亮色-->
<color name="platform_main_theme_bright">#fffae0</color>
<!-- ============ 背景颜色 ============ -->
<!-- 标签背景色-->
<color name="platform_tag_bg_color">#F7F7F7</color>
<!-- 大面积背景颜色-->
<color name="platform_big_bg_color">#F0F0F0</color>
<!-- 分割线颜色-->
<color name="platform_dividing_line_color">#EBEBEB</color>
<!-- 主题色渐变背景颜色 -->
<color name="platform_main_gradient_start_color">#fdbd00</color>
<color name="platform_main_gradient_end_color">#FFD814</color>
<!-- 主题色渐变未选中背景颜色 -->
<color name="platform_main_gradient_start_color_un">#66fdbd00</color>
<color name="platform_main_gradient_end_color_un">#66FFD814</color>
<!-- ============ 文字颜色 ============ -->
<!-- 一级类目,标题、点缀文字颜色-->
<color name="platform_text_dark_color">#242424</color>
<!-- 二级类目文字颜色-->
<color name="platform_text_light_color">#666666</color>
<!-- 三级次要文字颜色-->
<color name="platform_text_bright_color">#999999</color>
<!-- 四级编辑框提示文字颜色-->
<color name="platform_text_hint_color">#BFBFBF</color>
<!-- ============ 按钮颜色 ============ -->
<!--确认文字按钮颜色 - 亮色模式下与深色模式相反-->
<color name="platform_but_text_color">#242424</color>
<!--按钮字体颜色 - 亮色模式下与深色模式近似-->
<color name="platform_but_text_color_unselected">#555555</color>
<color name="platform_but_text_color_selected">#242424</color>
</resources> </resources>
<resources> <resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="text_size_common">16sp</dimen> <dimen name="text_size_common">16sp</dimen>
</resources> </resources>
...@@ -57,7 +57,26 @@ allprojects { ...@@ -57,7 +57,26 @@ allprojects {
task clean(type: Delete) { task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }
task packYdl1 {
doLast {
println("doLast packYdl1!!!!")
}
}
task packYdl2 {
doLast {
println("doLast packYdl2!!!!")
}
}
task packYdl {
doLast {
println("doLast packYdl!!!!")
}
}
task packM{
doLast {
println("doLast packM!!!!")
}
}
subprojects { subprojects {
project.configurations.all { project.configurations.all {
......
ext { ext {
kotlin_version = "1.3.21"
dev_mode = false dev_mode = false
ydl2PublishVersion = "0.0.2-a"
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
...@@ -17,14 +16,11 @@ ext { ...@@ -17,14 +16,11 @@ ext {
"m-tests" : "0.0.24.18", "m-tests" : "0.0.24.18",
"m-course" : "0.0.43.39", "m-course" : "0.0.43.39",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.25", "ydl-tuicore" : "0.0.25",
//第一步 //第一步
"ydl-platform" : "0.0.41.44", "ydl-platform" : "0.0.41.44",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.94", "ydl-webview" : "0.0.38.94",
"ydl-media" : "0.0.21.52", "ydl-media" : "0.0.21.52",
...@@ -32,24 +28,12 @@ ext { ...@@ -32,24 +28,12 @@ ext {
"m-audioim" : "0.0.49.30.23", "m-audioim" : "0.0.49.30.23",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.3.94", "ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.12", "ydl-utils" : "0.0.3.12",
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.24",
"m-home-api" : "0.0.4.4", "m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
] ]
ydl_app = [ ydl_app = [
appName : "壹点灵心理咨询", appName : "壹点灵心理咨询",
...@@ -87,57 +71,6 @@ ext { ...@@ -87,57 +71,6 @@ ext {
canarySdkVersion : "1.5.4" canarySdkVersion : "1.5.4"
] ]
ydlCompileVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.42",
"m-consultant" : "0.0.60.70",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.55",
"m-home" : "0.0.23.95",
"m-im" : "0.0.21.63",
"m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10",
"m-muse" : "0.0.28.81",
"m-tests" : "0.0.24.18",
"m-course" : "0.0.43.39",
//-------------- 功能组件 --------------
//mdt 组件
"ydl-tuicore" : "0.0.25",
//第一步
"ydl-platform" : "0.0.41.44",
//第二步 若干
"ydl-webview" : "0.0.38.94",
"ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.21",
"m-audioim" : "0.0.49.30.23",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.12",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "1.0.0",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.24",
"m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
]
dependencies = [ dependencies = [
//support //support
"appcompat-v7" : 'androidx.appcompat:appcompat:1.2.0', "appcompat-v7" : 'androidx.appcompat:appcompat:1.2.0',
...@@ -278,35 +211,33 @@ ext { ...@@ -278,35 +211,33 @@ ext {
"ydl-hnet" : "com.ydl:h-net:0.0.8", "ydl-hnet" : "com.ydl:h-net:0.0.8",
"ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar", "ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar",
"ydl-device" : "com.ydl:device-id:0.0.30@aar", "ydl-device" : "com.ydl:device-id:0.0.30@aar",
"ydl-net" : "com.ydl:ydl-net:${ydlCompileVersion["ydl-net"]}", "ydl-net" : "com.ydl:ydl-net:${ydl2PublishVersion}",
"ydl-utils" : "com.ydl:ydl-utils:${ydlCompileVersion["ydl-utils"]}", "ydl-utils" : "com.ydl:ydl-utils:${ydl2PublishVersion}",
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块 //flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydlCompileVersion["ydl-flutter-base"]}", //组件化项目中的flutter base模块 "ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydl2PublishVersion}", //组件化项目中的flutter base模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.44@aar", //flutter aar "ydl-flutter" : "com.ydl:ydl-flutter:0.0.44@aar", //flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar // "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号 //基础组件 <<--- 先发这个,发完改这里的版本号
"ydl-platform" : "com.ydl:ydl-platform:${ydlCompileVersion["ydl-platform"]}@aar", "ydl-platform" : "com.ydl:ydl-platform:${ydl2PublishVersion}",
"ydl-tuicore" : "com.ydl:ydl-tuicore:${ydlCompileVersion["ydl-tuicore"]}@aar", "ydl-tuicore" : "com.ydl:ydl-tuicore:${ydlPublishVersion["ydl-tuicore"]}",
//功能组件 <<--- 再发这些,发完改这里的版本号 //功能组件 <<--- 再发这些,发完改这里的版本号
"ydl-webview" : "com.ydl:ydl-webview:${ydlCompileVersion["ydl-webview"]}@aar", "ydl-webview" : "com.ydl:ydl-webview:${ydl2PublishVersion}",
"ydl-media" : "com.ydl:ydl-media:${ydlCompileVersion["ydl-media"]}@aar", "ydl-media" : "com.ydl:ydl-media:${ydl2PublishVersion}",
"ydl-pay" : "com.ydl:ydl-pay:${ydlCompileVersion["ydl-pay"]}@aar", "ydl-pay" : "com.ydl:ydl-pay:${ydl2PublishVersion}",
"m-audioim" : "com.ydl:m-audioim:${ydlCompileVersion["m-audioim"]}@aar", "m-audioim" : "com.ydl:m-audioim:${ydl2PublishVersion}",
//业务组件 <<--- 最后发这些(只发改过的) //业务组件 <<--- 最后发这些(只发改过的)
"ydl-m-user-api" : "com.ydl:m-user-api:${ydlCompileVersion["m-user-api"]}", "ydl-m-user-api" : "com.ydl:m-user-api:1.0.0",
"ydl-m-muse-api" : "com.ydl:m-muse-api:${ydlCompileVersion["m-muse-api"]}", "ydl-m-fm-api" : "com.ydl:m-fm-api:1.0.0",
"ydl-m-fm-api" : "com.ydl:m-fm-api:${ydlCompileVersion["m-fm-api"]}", "ydl-m-tests-api" : "com.ydl:m-tests-api:1.0.0",
"ydl-m-tests-api" : "com.ydl:m-tests-api:${ydlCompileVersion["m-tests-api"]}", "ydl-m-im-api" : "com.ydl:m-im-api:1.0.2",
"ydl-m-audioim-api" : "com.ydl:m-audioim-api:${ydlCompileVersion["m-audioim-api"]}", "ydl-m-home-api" : "com.ydl:m-home-api:${ydlPublishVersion["m-home-api"]}",
"ydl-m-im-api" : "com.ydl:m-im-api:${ydlCompileVersion["m-im-api"]}", "ydl-m-consultant-api" : "com.ydl:m-consultant-api:1.0.0",
"ydl-m-home-api" : "com.ydl:m-home-api:${ydlCompileVersion["m-home-api"]}", "ydl-m-dynamic-api" : "com.ydl:m-dynamic-api:1.0.0",
"ydl-m-consultant-api" : "com.ydl:m-consultant-api:${ydlCompileVersion["m-consultant-api"]}", "ydl-m-confide-api" : "com.ydl:m-confide-api:1.0.0",
"ydl-m-dynamic-api" : "com.ydl:m-dynamic-api:${ydlCompileVersion["m-dynamic-api"]}", "ydl-m-course-api" : "com.ydl:m-course-api:1.0.0",
"ydl-m-confide-api" : "com.ydl:m-confide-api:${ydlCompileVersion["m-confide-api"]}",
"ydl-m-course-api" : "com.ydl:m-course-api:${ydlCompileVersion["m-course-api"]}",
] ]
} }
...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件 apply from : '../maven_push.gradle'
// 配置资源重命名插件
resConfig {
new_prefix = 'article_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt { kapt {
arguments { arguments {
...@@ -34,9 +28,6 @@ android { ...@@ -34,9 +28,6 @@ android {
arguments = [AROUTER_MODULE_NAME: "article"] arguments = [AROUTER_MODULE_NAME: "article"]
} }
} }
flavorDimensions "versionCode"//Flavor 维度信息
} }
buildTypes { buildTypes {
...@@ -46,25 +37,6 @@ android { ...@@ -46,25 +37,6 @@ android {
} }
} }
//前缀的名字
// resourcePrefix "article_"
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
res.srcDirs = [
'src/main/res'
]
}
}
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
......
modular {
//模块包名
packageName "com.yidianling.article"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-article-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-article-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
//壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-article-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
implementation 'de.greenrobot:eventbus:2.4.0'
}
}
}
}
\ No newline at end of file
...@@ -3,13 +3,6 @@ apply plugin: 'kotlin-android' ...@@ -3,13 +3,6 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle" apply from: "../maven_push.gradle"
apply plugin: 'resTools' // 资源重命名插件
// 配置资源重命名插件
resConfig {
new_prefix = 'audioim_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt { kapt {
arguments { arguments {
...@@ -82,14 +75,12 @@ dependencies { ...@@ -82,14 +75,12 @@ dependencies {
//开发时使用 //开发时使用
api project(':ydl-platform') api project(':ydl-platform')
api project(':ydl-webview') api project(':ydl-webview')
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-audioim-api') implementation project(":api:im")
implementation modularPublication('com.ydl:m-im-api')
}else { }else {
//发布时使用 //发布时使用
api rootProject.ext.dependencies["ydl-webview"] api rootProject.ext.dependencies["ydl-webview"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-audioim-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"] compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
api(rootProject.ext.dependencies["ydl-platform"]) { api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
......
...@@ -25,6 +25,7 @@ import com.alibaba.android.arouter.launcher.ARouter ...@@ -25,6 +25,7 @@ import com.alibaba.android.arouter.launcher.ARouter
import com.google.gson.Gson import com.google.gson.Gson
import com.hjq.permissions.OnPermissionCallback import com.hjq.permissions.OnPermissionCallback
import com.hjq.permissions.XXPermissions import com.hjq.permissions.XXPermissions
import com.ydl.audioim.bean.AgoraInvitationBean
import com.ydl.audioim.bean.AgoraLogInfoBean import com.ydl.audioim.bean.AgoraLogInfoBean
import com.ydl.audioim.contract.IAudioHomeActivityContract import com.ydl.audioim.contract.IAudioHomeActivityContract
import com.ydl.audioim.http.command.ConnectCommand import com.ydl.audioim.http.command.ConnectCommand
...@@ -49,6 +50,7 @@ import com.ydl.ydl_image.config.SimpleImageOpConfiger ...@@ -49,6 +50,7 @@ import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.base.BaseMvpActivity import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.router.YdlCommonRouterManager import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
...@@ -58,6 +60,8 @@ import com.ydl.ydlcommon.utils.log.AliYunLogConfig ...@@ -58,6 +60,8 @@ import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack
import com.yidianling.im.api.service.IImService import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
...@@ -227,6 +231,36 @@ class AudioHomeActivity : ...@@ -227,6 +231,36 @@ class AudioHomeActivity :
private var canChangeRoute: Boolean = false private var canChangeRoute: Boolean = false
private val notificationCallback = object : IMRegisterObserverCustomNotificationCallBack {
override fun onObserverCustomNotification(fromUid: String, toUid: String, content: String) {
if (fromUid == listenerUid) {
try {
val bean = Gson().fromJson(content, AgoraInvitationBean::class.java)
when (bean.callType) {
"2" -> {//接受
runOnUiThread {
joinChannel()
onPeerAccepted()
}
}
"4" -> {//拒绝
runOnUiThread {
ToastUtil.toastShort("对方已挂断")
writeAgoraLog("被叫(专家)拒绝了通话邀请")
//通话结束或挂断时,上传日志文件
uploadLog()
leaveChannel()
uploadExceptionStatus("对方已拒绝", 2)
}
}
}
} catch (throwable: Throwable) {
LogUtil.e(throwable.message)
}
}
}
}
/** /**
* 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等) * 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
*/ */
...@@ -484,6 +518,7 @@ class AudioHomeActivity : ...@@ -484,6 +518,7 @@ class AudioHomeActivity :
setClickEvent() setClickEvent()
//权限申请 //权限申请
requestPermission() requestPermission()
findRouteService(IImService::class.java).registerObserveCustomNotification(notificationCallback)
ActionCountUtils.record("call_phone_page", "call_phone_page_visit", listenerUid ?: "0", "1") ActionCountUtils.record("call_phone_page", "call_phone_page_visit", listenerUid ?: "0", "1")
} }
...@@ -1545,6 +1580,7 @@ class AudioHomeActivity : ...@@ -1545,6 +1580,7 @@ class AudioHomeActivity :
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
findRouteService(IImService::class.java).unregisterObserveCustomNotification(notificationCallback)
uploadLog() uploadLog()
phoneHandler?.removeCallbacksAndMessages(null) phoneHandler?.removeCallbacksAndMessages(null)
if (isConnectSuccess) { if (isConnectSuccess) {
......
...@@ -76,9 +76,9 @@ dependencies { ...@@ -76,9 +76,9 @@ dependencies {
api project(":ydl-pay") api project(":ydl-pay")
api project(':ydl-webview') api project(':ydl-webview')
api project(':ydl-utils') api project(':ydl-utils')
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-consultant-api') implementation project(":api:consultant")
implementation project(':api:confide') implementation project(':api:confide')
}else { }else {
//发布时使用 //发布时使用
......
package com.ydl.confide
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.m_confide.test", appContext.packageName)
}
}
...@@ -416,7 +416,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -416,7 +416,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
wv_content?.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上 wv_content?.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
mJtoJHandle = WebModularServiceUtils.getWebService() mJtoJHandle = WebModularServiceUtils.getWebService()
.getJavascripHandler(requireActivity(), tellData = TellData()) .getJavascripHandler(requireActivity(), wv_content, tellData = TellData())
wv_content?.addJavascriptInterface(mJtoJHandle, "javascriptHandler") wv_content?.addJavascriptInterface(mJtoJHandle, "javascriptHandler")
// var jumpurl = "http://192.168.210.152/jy/listenMask?listenerId=257&isFromApp=1" // var jumpurl = "http://192.168.210.152/jy/listenMask?listenerId=257&isFromApp=1"
......
package com.ydl.confide
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件 apply from: "../maven_push.gradle"
// 配置资源重命名插件
resConfig {
new_prefix = 'consultant_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt { kapt {
arguments { arguments {
...@@ -33,7 +27,6 @@ android { ...@@ -33,7 +27,6 @@ android {
} }
} }
flavorDimensions "versionCode"
} }
buildTypes { buildTypes {
...@@ -42,23 +35,6 @@ android { ...@@ -42,23 +35,6 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
//前缀的名字
resourcePrefix "consultant_"
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
}
}
} }
dependencies { dependencies {
...@@ -72,9 +48,10 @@ dependencies { ...@@ -72,9 +48,10 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
implementation modularPublication('com.ydl:m-home-api') implementation modularPublication('com.ydl:m-home-api')
implementation project(":api:consultant")
api project(":ydl-webview") api project(":ydl-webview")
api project(":ydl-platform") api project(":ydl-platform")
} else { } else {
...@@ -82,6 +59,7 @@ dependencies { ...@@ -82,6 +59,7 @@ dependencies {
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"] compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-home-api"] compileOnly rootProject.ext.dependencies["ydl-m-home-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
api rootProject.ext.dependencies["ydl-webview"] api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) { api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
......
modular {
//模块包名
packageName "com.yidianling.consultant"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-consultant-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-consultant-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-consultant-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation 'androidx.annotation:annotation:1.1.0'
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.yidianling.consultant;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.yidianling.consultant;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.yidianling.consultant;
/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="22dp"
android:bottomLeftRadius="22dp"/>
<gradient
android:angle="0"
android:startColor="#DDFF7A5C"
android:endColor="#DDFF406C"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
...@@ -2,6 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
android { android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"] compileSdkVersion rootProject.ext.android["compileSdkVersion"]
...@@ -23,7 +24,6 @@ android { ...@@ -23,7 +24,6 @@ android {
} }
} }
flavorDimensions "versionCode"
} }
buildTypes { buildTypes {
...@@ -32,26 +32,10 @@ android { ...@@ -32,26 +32,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
res.srcDirs = [
'src/main/res'
]
}
}
} }
dependencies { dependencies {
...@@ -66,11 +50,13 @@ dependencies { ...@@ -66,11 +50,13 @@ dependencies {
api 'com.github.princekin-f:EasyFloat:1.3.2' api 'com.github.princekin-f:EasyFloat:1.3.2'
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
compileOnly "com.ydl.aar:resource:0.0.1-ydl"
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
implementation modularPublication('com.ydl:m-consultant-api') implementation project(":api:consultant")
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-dynamic-api') implementation project(":api:dynamic")
implementation project(":api:course")
api project(":ydl-webview") api project(":ydl-webview")
api project(":ydl-platform") api project(":ydl-platform")
api project(":ydl-media") api project(":ydl-media")
...@@ -82,6 +68,7 @@ dependencies { ...@@ -82,6 +68,7 @@ dependencies {
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"] compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies['ydl-m-consultant-api'] compileOnly rootProject.ext.dependencies['ydl-m-consultant-api']
compileOnly rootProject.ext.dependencies['ydl-m-course-api']
// compileOnlyrootProject.ext.dependencies['com.ydl:m-consultant-api'] // compileOnlyrootProject.ext.dependencies['com.ydl:m-consultant-api']
api rootProject.ext.dependencies["ydl-webview"] api rootProject.ext.dependencies["ydl-webview"]
api (rootProject.ext.dependencies["ydl-media"]){ api (rootProject.ext.dependencies["ydl-media"]){
......
modular {
//模块包名
packageName "com.ydl.course"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-course-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-course-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-course-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件 apply from : '../maven_push.gradle'
// 配置资源重命名插件
resConfig {
new_prefix = 'dynamic_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt { kapt {
arguments { arguments {
...@@ -35,7 +29,6 @@ android { ...@@ -35,7 +29,6 @@ android {
} }
} }
flavorDimensions "versionCode"//Flavor 维度信息
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
...@@ -46,16 +39,6 @@ android { ...@@ -46,16 +39,6 @@ android {
} }
} }
//前缀的名字
//resourcePrefix "dynamic_"
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
sourceSets { sourceSets {
main { main {
manifest.srcFile 'src/main/AndroidManifest.xml' manifest.srcFile 'src/main/AndroidManifest.xml'
...@@ -94,13 +77,13 @@ dependencies { ...@@ -94,13 +77,13 @@ dependencies {
api project(':ydl-webview') api project(':ydl-webview')
api project(':ydl-platform') api project(':ydl-platform')
api project(":ydl-pay") api project(":ydl-pay")
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-dynamic-api') implementation project(":api:dynamic")
implementation modularPublication('com.ydl:m-tests-api') implementation project(":api:tests")
implementation modularPublication('com.ydl:m-course-api') implementation project(":api:course")
implementation modularPublication('com.ydl:m-fm-api') implementation project(":api:fm")
implementation modularPublication('com.ydl:m-consultant-api') implementation project(":api:consultant")
implementation project(':api:confide') implementation project(':api:confide')
}else { }else {
//发布时使用 //发布时使用
......
modular {
//模块包名
packageName "com.yidianling.dynamic"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-dynamic-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-dynamic-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
//壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-dynamic-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
package com.yidianling.dynamic
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("com.yidianling.dynamic", appContext.packageName)
}
}
package com.yidianling.dynamic
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'resTools' // 资源重命名插件 apply from : '../maven_push.gradle'
// 配置资源重命名插件
resConfig {
new_prefix = 'fm_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt { kapt {
arguments { arguments {
...@@ -26,14 +20,8 @@ android { ...@@ -26,14 +20,8 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
multiDexEnabled true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
flavorDimensions "versionCode"
}
lintOptions {
abortOnError false
} }
buildTypes { buildTypes {
...@@ -43,13 +31,6 @@ android { ...@@ -43,13 +31,6 @@ android {
} }
} }
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
compileOptions { compileOptions {
sourceCompatibility 1.8 sourceCompatibility 1.8
targetCompatibility 1.8 targetCompatibility 1.8
...@@ -73,14 +54,16 @@ dependencies { ...@@ -73,14 +54,16 @@ dependencies {
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
api project(":ydl-platform") api project(":ydl-platform")
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-dynamic-api') implementation project(":api:dynamic")
implementation project(":api:fm")
implementation project(':ydl-media') implementation project(':ydl-media')
} else { } else {
//发布时使用 //发布时使用
implementation rootProject.ext.dependencies["ydl-media"] implementation rootProject.ext.dependencies["ydl-media"]
implementation rootProject.ext.dependencies["ydl-m-user-api"] implementation rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"] compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
implementation (rootProject.ext.dependencies["ydl-platform"]) { implementation (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
} }
......
modular {
//模块包名
packageName "com.yidianling.fm"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-fm-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-fm-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-fm-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
package com.ydl.ydl_fm;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.ydl.ydl_fm.test", appContext.getPackageName());
}
}
package com.ydl.ydl_fm;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
...@@ -77,11 +77,11 @@ dependencies { ...@@ -77,11 +77,11 @@ dependencies {
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
implementation modularPublication('com.ydl:m-consultant-api') implementation project(":api:consultant")
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-tests-api') implementation project(":api:tests")
implementation modularPublication('com.ydl:m-home-api') implementation modularPublication('com.ydl:m-home-api')
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
implementation project(':api:confide') implementation project(':api:confide')
implementation project(':ydl-webview') implementation project(':ydl-webview')
implementation project(':ydl-media') implementation project(':ydl-media')
......
...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件 apply from: "../maven_push.gradle"
// 配置资源重命名插件
resConfig {
new_prefix = 'im_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt { kapt {
arguments { arguments {
...@@ -24,22 +18,12 @@ android { ...@@ -24,22 +18,12 @@ android {
defaultConfig { defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"] minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: "im"] arguments = [AROUTER_MODULE_NAME: "im"]
} }
} }
flavorDimensions "versionCode"//Flavor 维度信息
ndk {
abiFilters "arm64-v8a"
}
} }
buildTypes { buildTypes {
...@@ -49,19 +33,9 @@ android { ...@@ -49,19 +33,9 @@ android {
} }
} }
//前缀的名字
//resourcePrefix "im_"
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
sourceSets { sourceSets {
main { main {
manifest.srcFile 'src/main/AndroidManifest.xml'
res.srcDirs = [ res.srcDirs = [
'src/main/res', 'src/main/res',
'src/main/res_avchat', 'src/main/res_avchat',
...@@ -79,9 +53,6 @@ android { ...@@ -79,9 +53,6 @@ android {
dependencies { dependencies {
api fileTree(dir: 'libs', include: ['*.aar','*.jar']) api fileTree(dir: 'libs', include: ['*.aar','*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0' implementation 'androidx.appcompat:appcompat:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
kapt 'com.alibaba:arouter-compiler:1.2.2' kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation 'com.ydl:nim-base:1.1.0.7' implementation 'com.ydl:nim-base:1.1.0.7'
...@@ -96,13 +67,13 @@ dependencies { ...@@ -96,13 +67,13 @@ dependencies {
//开发时使用 //开发时使用
api project(':ydl-webview') api project(':ydl-webview')
api project(':ydl-platform') api project(':ydl-platform')
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-dynamic-api') implementation project(":api:dynamic")
implementation modularPublication('com.ydl:m-tests-api') implementation project(":api:tests")
implementation modularPublication('com.ydl:m-course-api') implementation project(":api:course")
implementation modularPublication('com.ydl:m-fm-api') implementation project(":api:fm")
implementation modularPublication('com.ydl:m-consultant-api') implementation project(":api:consultant")
implementation project(':api:confide') implementation project(':api:confide')
}else { }else {
//发布时使用 //发布时使用
......
modular {
//模块包名
packageName "com.yidianling.im"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-im-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-im-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
//壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-im-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
...@@ -6,6 +6,8 @@ import android.content.Intent; ...@@ -6,6 +6,8 @@ import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.util.Log; import android.util.Log;
import androidx.annotation.DrawableRes;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.auth.LoginInfo; import com.netease.nimlib.sdk.auth.LoginInfo;
...@@ -52,10 +54,6 @@ public class NimApplication { ...@@ -52,10 +54,6 @@ public class NimApplication {
return InstanceHolder.nimApplication; return InstanceHolder.nimApplication;
} }
public void initIm(Application app,Class activity) {
initIm(app,activity,null);
}
public void initIm(Application app, Class activity, IMInitConfigBean configBean) { public void initIm(Application app, Class activity, IMInitConfigBean configBean) {
IMCache.setContext(app); IMCache.setContext(app);
// 初始化云信SDK // 初始化云信SDK
...@@ -70,7 +68,7 @@ public class NimApplication { ...@@ -70,7 +68,7 @@ public class NimApplication {
// 云信sdk相关业务初始化 // 云信sdk相关业务初始化
NIMInitManager.getInstance().init(true); NIMInitManager.getInstance().init(true);
// 初始化音视频模块 // 初始化音视频模块
initAVChatKit(activity); initAVChatKit(activity, configBean.notificationIconRes);
//注册状态观察者 //注册状态观察者
ImObserversHelper.Companion.getInstance().registerObserver(true); ImObserversHelper.Companion.getInstance().registerObserver(true);
// 初始化听筒模式 // 初始化听筒模式
...@@ -134,7 +132,7 @@ public class NimApplication { ...@@ -134,7 +132,7 @@ public class NimApplication {
return options; return options;
} }
private void initAVChatKit(Class activity) { private void initAVChatKit(Class activity, @DrawableRes int notificationIconRes) {
AVChatOptions avChatOptions = new AVChatOptions() { AVChatOptions avChatOptions = new AVChatOptions() {
@Override @Override
public void logout(Context context) { public void logout(Context context) {
...@@ -142,7 +140,7 @@ public class NimApplication { ...@@ -142,7 +140,7 @@ public class NimApplication {
} }
}; };
avChatOptions.entranceActivity = activity; avChatOptions.entranceActivity = activity;
avChatOptions.notificationIconRes = R.mipmap.im_ic_launcher; avChatOptions.notificationIconRes = notificationIconRes;
AVChatKit.init(avChatOptions); AVChatKit.init(avChatOptions);
// 设置用户相关资料提供者 // 设置用户相关资料提供者
......
...@@ -5,6 +5,8 @@ import android.graphics.Color; ...@@ -5,6 +5,8 @@ import android.graphics.Color;
import android.os.Environment; import android.os.Environment;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.DrawableRes;
import com.netease.nimlib.sdk.SDKOptions; import com.netease.nimlib.sdk.SDKOptions;
import com.netease.nimlib.sdk.StatusBarNotificationConfig; import com.netease.nimlib.sdk.StatusBarNotificationConfig;
import com.netease.nimlib.sdk.mixpush.MixPushConfig; import com.netease.nimlib.sdk.mixpush.MixPushConfig;
...@@ -41,7 +43,7 @@ class NimSDKOptionConfig { ...@@ -41,7 +43,7 @@ class NimSDKOptionConfig {
options.appKey = getIMAppKey(configBean); options.appKey = getIMAppKey(configBean);
// 如果将新消息通知提醒托管给SDK完成,需要添加以下配置。 // 如果将新消息通知提醒托管给SDK完成,需要添加以下配置。
initStatusBarNotificationConfig(context, options, activity); initStatusBarNotificationConfig(context, options, activity, configBean.notificationIconRes);
// 配置 APP 保存图片/语音/文件/log等数据的目录 // 配置 APP 保存图片/语音/文件/log等数据的目录
options.sdkStorageRootPath = getAppCacheDir(context) + "/yidianling"; // 可以不设置,那么将采用默认路径 options.sdkStorageRootPath = getAppCacheDir(context) + "/yidianling"; // 可以不设置,那么将采用默认路径
...@@ -108,9 +110,9 @@ class NimSDKOptionConfig { ...@@ -108,9 +110,9 @@ class NimSDKOptionConfig {
return storageRootPath; return storageRootPath;
} }
private static void initStatusBarNotificationConfig(Context context, SDKOptions options, Class activity) { private static void initStatusBarNotificationConfig(Context context, SDKOptions options, Class activity,@DrawableRes int notificationIconRes) {
// load 应用的状态栏配置 // load 应用的状态栏配置
StatusBarNotificationConfig config = loadStatusBarNotificationConfig(context, activity); StatusBarNotificationConfig config = loadStatusBarNotificationConfig(context, activity, notificationIconRes);
// load 用户的 StatusBarNotificationConfig 设置项 // load 用户的 StatusBarNotificationConfig 设置项
StatusBarNotificationConfig userConfig = UserPreferences.getStatusConfig(); StatusBarNotificationConfig userConfig = UserPreferences.getStatusConfig();
...@@ -131,11 +133,11 @@ class NimSDKOptionConfig { ...@@ -131,11 +133,11 @@ class NimSDKOptionConfig {
} }
// 这里开发者可以自定义该应用初始的 StatusBarNotificationConfig // 这里开发者可以自定义该应用初始的 StatusBarNotificationConfig
private static StatusBarNotificationConfig loadStatusBarNotificationConfig(Context context, Class activity) { private static StatusBarNotificationConfig loadStatusBarNotificationConfig(Context context, Class activity, @DrawableRes int notificationIconRes) {
StatusBarNotificationConfig config = new StatusBarNotificationConfig(); StatusBarNotificationConfig config = new StatusBarNotificationConfig();
// 点击通知需要跳转到的界面 // 点击通知需要跳转到的界面
config.notificationEntrance = activity; config.notificationEntrance = activity;
config.notificationSmallIconId = R.mipmap.im_ic_launcher; config.notificationSmallIconId = notificationIconRes;
config.notificationColor = IMCache.getContext().getResources().getColor(R.color.platform_color_blue_3a9efb); config.notificationColor = IMCache.getContext().getResources().getColor(R.color.platform_color_blue_3a9efb);
// 通知铃声的uri字符串 // 通知铃声的uri字符串
// config.notificationSound = "android.resource://com.yidianling.im/raw/msg"; // config.notificationSound = "android.resource://com.yidianling.im/raw/msg";
......
...@@ -41,10 +41,7 @@ import java.util.concurrent.Executors ...@@ -41,10 +41,7 @@ import java.util.concurrent.Executors
* Des: * Des:
*/ */
class ImObserversHelper { class ImObserversHelper {
var imCustomNotificationCallBack: IMRegisterObserverCustomNotificationCallBack? = null internal val imCustomNotificationCallBack: MutableList<IMRegisterObserverCustomNotificationCallBack> = arrayListOf()
set(value) {
field = value
}
companion object { companion object {
fun getInstance(): ImObserversHelper { fun getInstance(): ImObserversHelper {
...@@ -172,9 +169,9 @@ class ImObserversHelper { ...@@ -172,9 +169,9 @@ class ImObserversHelper {
false false
} }
private var receiveSystemMessageObserver: Observer<CustomNotification> = Observer<CustomNotification> { private var receiveSystemMessageObserver: Observer<CustomNotification> = Observer<CustomNotification> { notification ->
LogUtil.e(it.content) LogUtil.e(notification.content)
imCustomNotificationCallBack?.onObserverCustomNotification(it.fromAccount, it.sessionId, it.content) imCustomNotificationCallBack.forEach { it.onObserverCustomNotification(notification.fromAccount, notification.sessionId, notification.content) }
} }
private var msgRevokeFilter = MsgRevokeFilter { message -> private var msgRevokeFilter = MsgRevokeFilter { message ->
......
...@@ -39,7 +39,6 @@ import com.yidianling.im.session.SessionHelper ...@@ -39,7 +39,6 @@ import com.yidianling.im.session.SessionHelper
import com.yidianling.im.session.extension.CustomAttachModifyTime import com.yidianling.im.session.extension.CustomAttachModifyTime
import com.yidianling.im.session.extension.CustomAttachSubScriptTime import com.yidianling.im.session.extension.CustomAttachSubScriptTime
import com.yidianling.im.session.extension.CustomAttachmentTest import com.yidianling.im.session.extension.CustomAttachmentTest
import com.yidianling.im.ui.activity.CmsExamQuestionPaperActivity
import com.yidianling.im.ui.page.NewMultiMessageFragment import com.yidianling.im.ui.page.NewMultiMessageFragment
import com.yidianling.nimbase.common.media.picker.PickImageHelper import com.yidianling.nimbase.common.media.picker.PickImageHelper
import com.yidianling.uikit.api.NimUIKit import com.yidianling.uikit.api.NimUIKit
...@@ -257,7 +256,11 @@ class IMServiceImpl : IImService { ...@@ -257,7 +256,11 @@ class IMServiceImpl : IImService {
} }
override fun registerObserveCustomNotification(callback: IMRegisterObserverCustomNotificationCallBack) { override fun registerObserveCustomNotification(callback: IMRegisterObserverCustomNotificationCallBack) {
ImObserversHelper.getInstance().imCustomNotificationCallBack=callback ImObserversHelper.getInstance().imCustomNotificationCallBack.add(callback)
}
override fun unregisterObserveCustomNotification(callback: IMRegisterObserverCustomNotificationCallBack) {
ImObserversHelper.getInstance().imCustomNotificationCallBack.remove(callback)
} }
override fun getMultiMessageFragment(): Fragment { override fun getMultiMessageFragment(): Fragment {
...@@ -397,16 +400,12 @@ class IMServiceImpl : IImService { ...@@ -397,16 +400,12 @@ class IMServiceImpl : IImService {
} }
override fun initIm(app: Application, activity: Class<out Activity>) {
NimApplication.getInstance().initIm(app, activity)
}
override fun initIm( override fun initIm(
app: Application, app: Application,
activity: Class<out Activity>, activity: Class<out Activity>,
imInitBean: IMInitConfigBean imInitBean: IMInitConfigBean
) { ) {
NimApplication.getInstance().initIm(app, activity,imInitBean) NimApplication.getInstance().initIm(app, activity, imInitBean)
} }
override fun isWifiOr3G(activity: Activity): Boolean { override fun isWifiOr3G(activity: Activity): Boolean {
......
...@@ -16,15 +16,15 @@ import com.netease.nimlib.sdk.msg.MsgServiceObserve; ...@@ -16,15 +16,15 @@ import com.netease.nimlib.sdk.msg.MsgServiceObserve;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum; import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.CustomNotification; import com.netease.nimlib.sdk.msg.model.CustomNotification;
import com.netease.nimlib.sdk.msg.model.IMMessage; import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.ydlcommon.modular.ModularServiceManagerKt;
import com.ydl.ydlcommon.utils.log.AliYunLogConfig; import com.ydl.ydlcommon.utils.log.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper; import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack; import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack;
import com.yidianling.im.api.service.IImService;
import com.yidianling.im.bean.ServiceBean; import com.yidianling.im.bean.ServiceBean;
import com.yidianling.im.bridge.P2PCustomActionHandlerImpl; import com.yidianling.im.bridge.P2PCustomActionHandlerImpl;
import com.yidianling.im.config.constants.ImConstants; import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.helper.ImObserversHelper;
import com.yidianling.im.session.SessionHelper; import com.yidianling.im.session.SessionHelper;
import com.yidianling.nimbase.api.model.session.SessionCustomization; import com.yidianling.nimbase.api.model.session.SessionCustomization;
import com.yidianling.nimbase.api.model.user.UserInfoObserver; import com.yidianling.nimbase.api.model.user.UserInfoObserver;
...@@ -54,6 +54,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -54,6 +54,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
protected YDLMessageFragment messageFragment; protected YDLMessageFragment messageFragment;
private boolean isChangeDoctor = false; private boolean isChangeDoctor = false;
String oldName=""; String oldName="";
private IMRegisterObserverCustomNotificationCallBack notificationCallBack;
/** /**
* @param context * @param context
...@@ -129,23 +130,24 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -129,23 +130,24 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
NIMClient.getService(MsgService.class).clearUnreadCount(sessionId, SessionTypeEnum.P2P); NIMClient.getService(MsgService.class).clearUnreadCount(sessionId, SessionTypeEnum.P2P);
// 转客服通知监听 // 转客服通知监听
ImObserversHelper.Companion.getInstance().setImCustomNotificationCallBack(new IMRegisterObserverCustomNotificationCallBack() { notificationCallBack = new IMRegisterObserverCustomNotificationCallBack() {
@Override @Override
public void onObserverCustomNotification(@NotNull String fromUid, @NotNull String toUid, @NotNull String content) { public void onObserverCustomNotification(@NotNull String fromUid, @NotNull String toUid, @NotNull String content) {
try { try {
ServiceBean serviceBean = new Gson().fromJson(content, ServiceBean.class); ServiceBean serviceBean = new Gson().fromJson(content, ServiceBean.class);
// 切换到客服 // 切换到客服
if (serviceBean != null && serviceBean.getData() != null&&serviceBean.getBusiness()!=null && serviceBean.getBusiness().equals("change_doctor")) { if (serviceBean != null && serviceBean.getData() != null && serviceBean.getBusiness() != null && serviceBean.getBusiness().equals("change_doctor")) {
isChangeDoctor = true; isChangeDoctor = true;
String serviceUid = String.valueOf(serviceBean.getData().getToUid()); String serviceUid = String.valueOf(serviceBean.getData().getToUid());
tb.setTitle(serviceBean.getData().getName()); tb.setTitle(serviceBean.getData().getName());
YDLP2PMessageActivity.startChangeDoctor(YDLP2PMessageActivity.this, serviceUid, SessionHelper.getP2pCustomization(-1), null, new P2PCustomActionHandlerImpl(serviceUid, serviceBean.getData().getName(), serviceUid)); YDLP2PMessageActivity.startChangeDoctor(YDLP2PMessageActivity.this, serviceUid, SessionHelper.getP2pCustomization(-1), null, new P2PCustomActionHandlerImpl(serviceUid, serviceBean.getData().getName(), serviceUid));
} }
}catch (Exception e){ } catch (Exception e) {
com.ydl.ydlcommon.utils.LogUtil.e("exception:"+e.getMessage()); com.ydl.ydlcommon.utils.LogUtil.e("exception:" + e.getMessage());
} }
} }
}); };
ModularServiceManagerKt.findRouteService(IImService.class).registerObserveCustomNotification(notificationCallBack);
} }
@Override @Override
...@@ -156,6 +158,10 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -156,6 +158,10 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
registerObservers(false); registerObservers(false);
super.onDestroy(); super.onDestroy();
if (notificationCallBack != null) {
ModularServiceManagerKt.findRouteService(IImService.class).registerObserveCustomNotification(notificationCallBack);
}
AliYunRichLogsHelper.Companion.getInstance().sendRichLog(AliYunLogConfig.YUNXIN,"退出聊天页面"); AliYunRichLogsHelper.Companion.getInstance().sendRichLog(AliYunLogConfig.YUNXIN,"退出聊天页面");
} }
......
...@@ -18,7 +18,6 @@ import com.yidianling.common.tools.RxDeviceTool ...@@ -18,7 +18,6 @@ import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R import com.yidianling.im.R
import com.yidianling.uikit.custom.http.response.ServiceItemBean import com.yidianling.uikit.custom.http.response.ServiceItemBean
import com.yidianling.uikit.custom.widget.expertConsultService.callback.ConsultServiceViewCallback
class ExpertConsultWebview : RelativeLayout { class ExpertConsultWebview : RelativeLayout {
private var doctorID: String private var doctorID: String
...@@ -53,7 +52,7 @@ class ExpertConsultWebview : RelativeLayout { ...@@ -53,7 +52,7 @@ class ExpertConsultWebview : RelativeLayout {
jumpUrl = jumpUrl =
HttpConfig.MH5_URL + "wb/product/chat/template?doctorId=${doctorID}&cateId=${productBean.getcatenewId()}&productId=${productBean.productDto.id}" HttpConfig.MH5_URL + "wb/product/chat/template?doctorId=${doctorID}&cateId=${productBean.getcatenewId()}&productId=${productBean.productDto.id}"
val jtoJHandle = WebModularServiceUtils.getWebService() val jtoJHandle = WebModularServiceUtils.getWebService()
.getJavascripHandler(mContext as Activity, tellData = TellData()) .getJavascripHandler(mContext as Activity, wv_content, tellData = TellData())
val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix()) val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix())
wv_content.loadUrl(url) wv_content.loadUrl(url)
} }
...@@ -134,7 +133,7 @@ class ExpertConsultWebview : RelativeLayout { ...@@ -134,7 +133,7 @@ class ExpertConsultWebview : RelativeLayout {
wv_content!!.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上 wv_content!!.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
val jtoJHandle = WebModularServiceUtils.getWebService() val jtoJHandle = WebModularServiceUtils.getWebService()
.getJavascripHandler(mContext as Activity, tellData = TellData()) .getJavascripHandler(mContext as Activity, wv_content, tellData = TellData())
wv_content!!.addJavascriptInterface(jtoJHandle, "javascriptHandler") wv_content!!.addJavascriptInterface(jtoJHandle, "javascriptHandler")
val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix()) val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix())
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
...@@ -2,6 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply from : '../maven_push.gradle'
kapt { kapt {
arguments { arguments {
...@@ -19,18 +20,10 @@ android { ...@@ -19,18 +20,10 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
multiDexEnabled true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
flavorDimensions "versionCode"
renderscriptTargetApi 19 renderscriptTargetApi 19
renderscriptSupportModeEnabled true renderscriptSupportModeEnabled true
} }
lintOptions {
abortOnError false
}
buildTypes { buildTypes {
release { release {
...@@ -39,13 +32,6 @@ android { ...@@ -39,13 +32,6 @@ android {
} }
} }
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
compileOptions { compileOptions {
sourceCompatibility 1.8 sourceCompatibility 1.8
targetCompatibility 1.8 targetCompatibility 1.8
...@@ -57,9 +43,6 @@ dependencies { ...@@ -57,9 +43,6 @@ dependencies {
api fileTree(dir: 'libs', include: ['*.jar', '*.aar']) api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.weidongjian:androidWheelView:1.0.0' implementation 'com.github.weidongjian:androidWheelView:1.0.0'
implementation 'com.github.feeeei:CircleSeekbar:v1.1.2' implementation 'com.github.feeeei:CircleSeekbar:v1.1.2'
...@@ -77,7 +60,7 @@ dependencies { ...@@ -77,7 +60,7 @@ dependencies {
//开发时使用 //开发时使用
api project(":ydl-platform") api project(":ydl-platform")
implementation project(':ydl-media') implementation project(':ydl-media')
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation project(':ydl-flutter-base') implementation project(':ydl-flutter-base')
implementation project(':ydl-webview') implementation project(':ydl-webview')
......
modular {
//模块包名
packageName "com.yidianling.muse"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-muse-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-muse-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-muse-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
package com.ydl.ydl_fm;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.ydl.ydl_muse.test", appContext.getPackageName());
}
}
...@@ -62,7 +62,7 @@ class ChooseMusicActivity : BaseActivity() { ...@@ -62,7 +62,7 @@ class ChooseMusicActivity : BaseActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
getParam() getParam()
var tellData = TellData() var tellData = TellData()
jtoJHandle = getWebService().getJavascripHandler(this, tellData.also { tellData = it }) jtoJHandle = getWebService().getJavascripHandler(this, null, tellData.also { tellData = it })
initView() initView()
} }
......
package com.ydl.ydl_fm;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
...@@ -2,14 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,14 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply plugin: 'resTools' // 资源重命名插件
// 配置资源重命名插件
resConfig {
new_prefix = 'tests_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt { kapt {
arguments { arguments {
...@@ -26,15 +19,6 @@ android { ...@@ -26,15 +19,6 @@ android {
targetSdkVersion rootProject.ext.android["targetSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
multiDexEnabled true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
flavorDimensions "versionCode"
}
lintOptions {
abortOnError false
} }
buildTypes { buildTypes {
...@@ -43,24 +27,10 @@ android { ...@@ -43,24 +27,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
//前缀的名字
resourcePrefix "tests_"
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
} }
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
...@@ -70,16 +40,17 @@ dependencies { ...@@ -70,16 +40,17 @@ dependencies {
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同 // 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler" kapt "com.alibaba:arouter-compiler:$arouter_compiler"
compileOnly "com.ydl.aar:resource:0.0.1-ydl"
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
api project(':ydl-webview') api project(':ydl-webview')
api project(':ydl-platform') api project(':ydl-platform')
implementation project(':ydl-flutter-base') implementation project(':ydl-flutter-base')
implementation modularPublication('com.ydl:m-test-api') implementation project(":api:tests")
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-dynamic-api') implementation project(":api:dynamic")
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
}else { }else {
//发布时使用 //发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"] compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
......
modular {
//模块包名
packageName "com.yidianling.tests"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-tests-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-tests-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
//壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-tests-api"
//开发时注释掉版本号,发布api时打开
//version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
package com.yidianling.tests;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.yidianling.tests.test", appContext.getPackageName());
}
}
package com.yidianling.tests;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
String[] list1 = {"17826875951", "1782687595", "178268759", "17826875", "1782687", "178268", "17826", "1782", "178", "17", "1", "17826efdg465154",
"165e2244", "111e12345", "我的123是121223423", "我的123456789", "符合规范357545655分好尴尬", "符合规范3555分好尴尬", "订单1234", "订单12345",
"我的QQ号是3386218996", "178 2687 5951", "1q1q1q11q", "123456789a"};
String[] list2 = {"178****5951", "178****595", "178****59", "17****75", "17****7", "17****", "1****", "1782", "178", "17", "1", "1****efdg46****",
"165e2244", "111e1****", "我的123是121****23", "我的123****89", "符合规范357****55分好尴尬", "符合规范3555分好尴尬", "订单1234", "订单1****",
"我的QQ号是338****996", "178 2687 5951", "1q1q1q11q", "123****89a"};
/**
* 用于测试数字替换*的功能,功能与ios一样
*/
@Test
public void set() {
for (int tt = 0; tt < list1.length; tt++) {
String text = list1[tt];
String assertString = list2[tt];
String lastText = "";
int numberIndex = -1;
int numberCount = 0;
for (int i = 0; i < text.length(); i++) {
if (text.charAt(i) >= 48 && text.charAt(i) <= 57) {
numberIndex = i;
for (int j = i; j < text.length(); j++) {
if (text.charAt(j) >= 48 && text.charAt(j) <= 57) {
numberCount++;
if (j == text.length() - 1) {
if (numberCount >= 5) {
while (i < numberIndex + numberCount / 3) {
lastText += text.charAt(i++);
}
while (i < numberIndex + numberCount / 3 + 4) {
lastText += "*";
i++;
}
while (i <= j) {
lastText += text.charAt(i++);
}
} else {
while (i <= j) {
lastText += text.charAt(i++);
}
}
i = j;
break;
}
} else {
if (numberCount >= 5) {
while (i < numberIndex + numberCount / 3) {
lastText += text.charAt(i++);
}
while (i < numberIndex + numberCount / 3 + 4) {
lastText += "*";
i++;
}
while (i < j) {
lastText += text.charAt(i++);
}
} else {
while (i < j) {
lastText += text.charAt(i++);
}
}
i = j - 1;
numberIndex = -1;
numberCount = 0;
break;
}
}
} else {
lastText += text.charAt(i);
}
}
assertEquals(lastText, assertString);
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,13 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件 apply from: "../maven_push.gradle"
// 配置资源重命名插件
resConfig {
new_prefix = 'user_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
kapt { kapt {
arguments { arguments {
...@@ -33,9 +27,6 @@ android { ...@@ -33,9 +27,6 @@ android {
arguments = [AROUTER_MODULE_NAME: "user"] arguments = [AROUTER_MODULE_NAME: "user"]
} }
} }
flavorDimensions "versionCode"//Flavor 维度信息
} }
buildTypes { buildTypes {
...@@ -45,26 +36,6 @@ android { ...@@ -45,26 +36,6 @@ android {
} }
} }
//前缀的名字
resourcePrefix "user_"
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
res.srcDirs = [
'src/main/res'
]
}
}
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
...@@ -81,6 +52,7 @@ dependencies { ...@@ -81,6 +52,7 @@ dependencies {
kapt 'com.alibaba:arouter-compiler:1.2.2' kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.ydl.aar:resource:0.0.1-ydl"
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
...@@ -88,12 +60,12 @@ dependencies { ...@@ -88,12 +60,12 @@ dependencies {
api project(':ydl-platform') api project(':ydl-platform')
api project(":ydl-pay") api project(":ydl-pay")
// implementation project(":ydl-tuicore") // implementation project(":ydl-tuicore")
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-course-api') implementation project(":api:course")
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
implementation modularPublication('com.ydl:m-fm-api') implementation project(":api:fm")
implementation modularPublication('com.ydl:m-dynamic-api') implementation project(":api:dynamic")
implementation modularPublication('com.ydl:m-consultant-api') implementation project(":api:consultant")
}else { }else {
//发布时使用 //发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
......
modular {
//模块包名
packageName "com.yidianling.user"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-user-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-user-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
//壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-user-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
implementation 'de.greenrobot:eventbus:2.4.0'
}
}
}
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.yidianling.user;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.yidianling.user;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.yidianling.user;
/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
...@@ -3,7 +3,14 @@ apply plugin: 'maven' ...@@ -3,7 +3,14 @@ apply plugin: 'maven'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/" def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def getVersionName() { def getVersionName() {
return hasProperty('VERSION_NAME') ? VERSION_NAME : rootProject.ext.ydlPublishVersion[project.getName()] return rootProject.ext.ydl2PublishVersion
}
def isLocal(){
Properties properties = new Properties()
InputStream inputStream = project.rootProject.file('local.properties').newDataInputStream()
properties.load(inputStream)
def local = properties.getProperty("packageLocal")
return local
} }
task sourceJar(type:Jar){ task sourceJar(type:Jar){
classifier = 'source' classifier = 'source'
...@@ -19,11 +26,17 @@ afterEvaluate { project -> ...@@ -19,11 +26,17 @@ afterEvaluate { project ->
mavenDeployer { mavenDeployer {
pom.artifactId = project.getName().replace('_', "-") pom.artifactId = project.getName().replace('_', "-")
pom.groupId = "com.ydl" pom.groupId = "com.ydl"
pom.version = getVersionName() pom.version = getVersionName()
repository(url: mavenRepositoryUrl) { def local = isLocal()
authentication(userName: "admin", password: "fjoi#1+#@") if (local == "true") {
repository(url: mavenLocal().url)
} else if (local == "false") {
repository(url: mavenRepositoryUrl) {
authentication(userName: "admin", password: "fjoi#1+#@")
}
} else {
println("请在local.properties中指定packageLocal的值[true|false]")
} }
// repository(url:mavenLocal().url)
} }
} }
} }
...@@ -37,4 +50,20 @@ afterEvaluate { project -> ...@@ -37,4 +50,20 @@ afterEvaluate { project ->
, "release" , "release"
) )
} }
// rootProject.getTasksByName("aa",false).forEach{println(it)}
//pay依赖platform,platform依赖utils和net
//confide依赖audioim
if (project.name.startsWith("ydl")) {
if (project.name == "ydl-utils" || project.name == "ydl-net") {
rootProject.getTasksByName("packYdl1", false).forEach { it.dependsOn(uploadArchives) }
}
if (project.name == "ydl-platform") {
rootProject.getTasksByName("packYdl2", false).forEach { it.dependsOn(uploadArchives) }
}
rootProject.getTasksByName("packYdl", false).forEach { it.dependsOn(uploadArchives) }
} else {
if (project.name != "m-audioim") {
rootProject.getTasksByName("packM", false).forEach { it.dependsOn(uploadArchives) }
}
}
} }
\ No newline at end of file
...@@ -32,7 +32,7 @@ afterEvaluate { project -> ...@@ -32,7 +32,7 @@ afterEvaluate { project ->
// log // log
println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
, project.getName() , project.getName()
, getVersionName() , project.version
, "aar" , "aar"
, "release" , "release"
) )
......
include ':app', include ':app',
':ydl-flutter-base', ':ydl-net', ':ydl-utils', ':ydl-media', ':ydl-flutter-base', ':ydl-net', ':ydl-utils', ':ydl-media',
':ydl-platform', ':ydl-webview', ':ydl-pay', ':m-home', ':ydl-platform', ':ydl-webview', ':ydl-pay', ':m-home', 'ydl-resource',
':m-home', ':m-home',
':m-consultant', ':m-muse', ':m-fm', ':m-tests', ":m-course", ':m-consultant', ':m-muse', ':m-fm', ':m-tests', ":m-course",
":m-im",":m-dynamic","m-article","m-audioim","m-user","m-confide" ":m-im",":m-dynamic","m-article","m-audioim","m-user", "m-confide"
include ':ydl-tuicore',':api:confide' include ':ydl-tuicore', ':api:confide', ':api:dynamic', ':api:fm', ':api:consultant',
':api:course', ':api:user', ':api:tests', ':api:im'
...@@ -44,7 +44,7 @@ dependencies { ...@@ -44,7 +44,7 @@ dependencies {
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
api project(':ydl-platform') api project(':ydl-platform')
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
}else { }else {
compileOnly rootProject.ext.dependencies["ydl-m-im-api"] compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
//发布时使用 //发布时使用
......
...@@ -18,19 +18,6 @@ android { ...@@ -18,19 +18,6 @@ android {
targetSdkVersion rootProject.ext.android["targetSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
flavorDimensions "versionCode"
ndk {
abiFilters "arm64-v8a"
}
vectorDrawables.useSupportLibrary = true
}
lintOptions {
abortOnError false
disable 'MissingTranslation'
} }
buildTypes { buildTypes {
...@@ -75,6 +62,7 @@ dependencies { ...@@ -75,6 +62,7 @@ dependencies {
//====================YDL Repository==================== //====================YDL Repository====================
// api rootProject.ext.dependencies["ydl-pushagent"] // api rootProject.ext.dependencies["ydl-pushagent"]
// api rootProject.ext.dependencies["ydl-hnet"] // api rootProject.ext.dependencies["ydl-hnet"]
api "androidx.lifecycle:lifecycle-viewmodel:2.2.0"
implementation 'com.volcengine:apm_insight:1.4.6.cn' implementation 'com.volcengine:apm_insight:1.4.6.cn'
api(rootProject.ext.dependencies["ydl-notracepoint"]) { api(rootProject.ext.dependencies["ydl-notracepoint"]) {
transitive = true transitive = true
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<resources> <resources>
<color name="platform_main_theme">#1da1f2</color>
<color name="platform_color_1DA1F2">#1DA1F2</color> <color name="platform_color_1DA1F2">#1DA1F2</color>
<color name="platform_new_divide_color">#f0f0f0</color> <color name="platform_new_divide_color">#f0f0f0</color>
<color name="platform_white">#ffffff</color> <color name="platform_white">#ffffff</color>
...@@ -87,8 +88,6 @@ ...@@ -87,8 +88,6 @@
<!-- ============================ 业务组件统一主题颜色 ============================ --> <!-- ============================ 业务组件统一主题颜色 ============================ -->
<!-- ============ 标准颜色 ============ --> <!-- ============ 标准颜色 ============ -->
<!--主题色 - 用于TabBar、突出文字、按钮和icon-->
<color name="platform_main_theme">#1da1f2</color>
<!--辅助色 1 - 主色系浅色--> <!--辅助色 1 - 主色系浅色-->
<color name="platform_main_theme_light">#60BDF5</color> <color name="platform_main_theme_light">#60BDF5</color>
<!--辅助色 2 - 主色系亮色--> <!--辅助色 2 - 主色系亮色-->
...@@ -101,12 +100,6 @@ ...@@ -101,12 +100,6 @@
<color name="platform_big_bg_color">#F0F0F0</color> <color name="platform_big_bg_color">#F0F0F0</color>
<!-- 分割线颜色--> <!-- 分割线颜色-->
<color name="platform_dividing_line_color">#EBEBEB</color> <color name="platform_dividing_line_color">#EBEBEB</color>
<!-- 主题色渐变背景颜色 -->
<color name="platform_main_gradient_start_color">#159CEF</color>
<color name="platform_main_gradient_end_color">#22BFFF</color>
<!-- 主题色渐变未选中背景颜色 -->
<color name="platform_main_gradient_start_color_un">#66159CEF</color>
<color name="platform_main_gradient_end_color_un">#6622BFFF</color>
<!--次级按钮背景,和背景冲突时使用,黄色基本不变--> <!--次级按钮背景,和背景冲突时使用,黄色基本不变-->
<color name="platform_specific_bg_color">#FFDD33</color> <color name="platform_specific_bg_color">#FFDD33</color>
......
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
flavorDimensions "versionCode"//Flavor 维度信息
}
productFlavors {
ydl {}
xlzx {}
}
// sourceSets {
// main {
// res.srcDirs = [
// 'src/main/res',
// 'src/ydl/res'
// ]
// }
// }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
}
\ 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 package="com.ydl.resource" />
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 主题色渐变背景颜色 -->
<color name="platform_main_gradient_start_color">#159CEF</color>
<color name="platform_main_gradient_end_color">#22BFFF</color>
<!-- 主题色渐变未选中背景颜色 -->
<color name="platform_main_gradient_start_color_un">#66159CEF</color>
<color name="platform_main_gradient_end_color_un">#6622BFFF</color>
<!--主题色 - 用于TabBar、突出文字、按钮和icon-->
<color name="platform_main_theme">#1da1f2</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
</resources> </resources>
...@@ -24,11 +24,6 @@ android { ...@@ -24,11 +24,6 @@ android {
arguments = [AROUTER_MODULE_NAME: "webview"] arguments = [AROUTER_MODULE_NAME: "webview"]
} }
} }
ndk {
abiFilters "arm64-v8a"
}
} }
buildTypes { buildTypes {
...@@ -58,9 +53,9 @@ dependencies { ...@@ -58,9 +53,9 @@ dependencies {
if (rootProject.ext.dev_mode) { if (rootProject.ext.dev_mode) {
//开发时使用 //开发时使用
api project(':ydl-platform') api project(':ydl-platform')
implementation modularPublication('com.ydl:m-user-api') implementation project(":api:user")
implementation modularPublication('com.ydl:m-dynamic-api') implementation project(":api:dynamic")
implementation modularPublication('com.ydl:m-im-api') implementation project(":api:im")
} else { } else {
//发布时使用 //发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
......
/*___Generated_by_IDEA___*/
package com.ydl.webview;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.ydl.webview;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.ydl.webview;
/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
}
\ No newline at end of file
...@@ -2,11 +2,12 @@ package com.ydl.webview ...@@ -2,11 +2,12 @@ package com.ydl.webview
import android.app.Activity import android.app.Activity
import com.alibaba.android.arouter.facade.template.IProvider import com.alibaba.android.arouter.facade.template.IProvider
import com.tencent.smtt.sdk.WebView
/** /**
* Created by haorui on 2019-10-10. * Created by haorui on 2019-10-10.
* Des: * Des:
*/ */
interface IWebService : IProvider { interface IWebService : IProvider {
fun getJavascripHandler(activity: Activity, tellData: TellData): IJavascriptHandler fun getJavascripHandler(activity: Activity, webView: WebView?, tellData: TellData): IJavascriptHandler
} }
...@@ -394,7 +394,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -394,7 +394,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
setUrlHeightParams(); setUrlHeightParams();
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
jtoJHandle = WebModularServiceUtils.Companion.getWebService().getJavascripHandler(this, tellData = tellData); jtoJHandle = WebModularServiceUtils.Companion.getWebService().getJavascripHandler(this, wv_content, tellData);
init(); init();
if (startType == 1) { if (startType == 1) {
......
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