Commit 0f98c221 by 刘鹏

Merge branch 'd/v4.4.05' into 'release'

D/v4.4.05

See merge request app_android_lib/YDL-Component!276
parents a7efead0 7566d01c
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.4'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.3'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.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.home.api">
</manifest>
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.3'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......
......@@ -116,6 +116,8 @@ interface IUserService : IProvider {
* */
fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean) :Boolean
fun checkOneLoginEnvAvailable(): Boolean
/**
* 调用优先使用一键登录,并返回调用时的登录状态,
* @param isOpenDialog true:一键登录使用弹窗展示 false:一键登录使用全屏模式
......
......@@ -31,7 +31,6 @@ android {
flavorDimensions "versionCode"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"]
}
}
......@@ -178,6 +177,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.github.feeeei:CircleSeekbar:v1.1.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation(rootProject.ext.dependencies["appcompat-v7"])
testImplementation 'junit:junit:4.13.2'
......
......@@ -20,7 +20,6 @@ import com.umeng.socialize.UMShareAPI
import com.ydl.component.BuildConfig
import com.ydl.component.MainActivity
import com.ydl.component.R
import com.ydl.media.audio.PlayService
import com.ydl.ydlcommon.actions.crash.Cockroach
import com.ydl.ydlcommon.actions.crash.ExceptionHandler
import com.ydl.ydlcommon.base.config.HttpConfig
......@@ -78,15 +77,6 @@ class DemoAppLifecycles : IAppLifecycles {
// YDLCommonPlugin plugin = new YDLCommonPlugin();
// flutterEngine.getLocalizationChannel().channel.setMethodCallHandler(plugin);
val intent = Intent(application, PlayService::class.java)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
application.startForegroundService(intent)
}else{
application.startService(intent)
}
// application.registerActivityLifecycleCallbacks(new CoursePlayLifecycle());
}
}
......
......@@ -20,8 +20,8 @@ import java.util.List;
*/
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_PROD;
public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_PROD;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
@Override
......
package com.ydl.component.service.web;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.Rect;
......@@ -11,20 +12,13 @@ import com.ydl.confide.home.event.ChangeAnotherExpertEvent;
import com.ydl.webview.H5JsBean;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydl_router.manager.YDLRouterManager;
import com.ydl.ydl_router.manager.YDLRouterParams;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.consultant.preview.GPreviewBuilder;
import com.yidianling.consultant.preview.UserViewInfo;
import com.yidianling.im.api.service.IImService;
import com.yidianling.muse.activity.ChooseMusicActivity;
//import static com.ydl.ydlcommon.router.IYDLRouterConstant.ROUTER_MUSE_PLAY;
import de.greenrobot.event.EventBus;
import com.yidianling.im.event.CloseBottomWebviewEvent;
import com.yidianling.muse.activity.ChooseMusicActivity;
import java.util.ArrayList;
import java.util.List;
......@@ -571,6 +565,15 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
}
}
/**
* 打开时间选择器
*/
@SuppressLint("CheckResult")
@Override
public void openTimePicker(String jsCallBackName, String day, String doctorId, String orderId) {
}
@Override
public void showCommentArticleDialog(H5JsBean.H5JsCmd.Params params) {
......
......@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.base.BaseActivityMgr
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.LogUtil
import com.yidianling.user.UserHelper
......@@ -459,6 +460,13 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
"switch_push_status" -> {
wvEnventPro?.switchPushStatus(jsData.cmd?.params)
}
// 打开时间选择器
"requestSelectTime"->{
if (Utils.isFastClick()){
return
}
wvEnventPro?.openTimePicker(jsData.cmd?.params?.callBack,jsData.cmd?.params?.day,jsData.cmd?.params?.doctorId.toString(),jsData.cmd?.params?.orderId)
}
"open_article_comment_dialog" -> {
wvEnventPro?.showCommentArticleDialog(jsData.cmd?.params)
......
......@@ -211,4 +211,8 @@ public interface WebViewClientClickListener {
void resourceToPreview(H5JsBean.H5JsCmd.Params params);
void showDocBooking(H5JsBean.H5JsCmd.Params params);
// 打开时间选择器
void openTimePicker(String jsCallBackName,String day,String doctorId,String orderId);
}
......@@ -3,7 +3,7 @@ apply from: "config.gradle"
buildscript {
ext {
kotlin_version = '1.3.50'
kotlin_version = '1.6.10'
support_version = '26.1.0'
minSdkVersion = 21
targetSdkVersion = 28
......@@ -13,42 +13,45 @@ buildscript {
arouter_compiler = '1.2.2'
ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2'
componentVersion = "0.3.0.8-SNAPSHOT"
}
repositories {
maven {
url 'http://nexus.yidianling.com/repository/android/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
google()
mavenLocal()
// maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.ydl.plugins:modular:1.0.3'
classpath 'com.ydl:notracepoint-gradle-plugin:0.0.3'
}
}
allprojects {
allprojects { p ->
if (p.path.startsWith(":ydl-")) {
p.version = componentVersion
}
if (p.path.startsWith(":m-")) {
p.version = componentVersion
}
if (p.path.startsWith(":api:")) {
p.version = componentVersion
}
repositories {
//壹点灵android maven私服 开发版
maven {
url 'http://nexus.yidianling.com/repository/android/'
allowInsecureProtocol true
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
google()
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
allowInsecureProtocol true
}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
mavenLocal()
}
}
......@@ -56,26 +59,6 @@ allprojects {
task clean(type: Delete) {
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 {
project.configurations.all {
......@@ -88,27 +71,3 @@ subprojects {
}
}
}
apply plugin: 'modular-plugin'
modular {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
repositories {
maven {
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
}
}
ext {
dev_mode = false//组件发布的时候需要设置为false
ydl2PublishVersion = "0.2.0.17"
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.50",
"m-consultant" : "0.0.60.78",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.72",
"m-home" : "0.0.24.09",
"m-im" : "0.0.21.69",
"m-dynamic" : "0.0.7.80",
"m-article" : "0.0.0.11",
"m-muse" : "0.0.28.87",
"m-tests" : "0.0.24.24",
"m-course" : "0.0.43.39",
//-------------- 功能组件 --------------
//mdt 组件
"ydl-tuicore" : "0.0.25",
//第一步
"ydl-platform" : "0.0.41.54",
//第二步 若干
"ydl-webview" : "0.2.0.7",
"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.44",
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.12",
//-------------- 业务模块 API 层 --------------
"m-home-api" : "0.0.4.4",
]
ydl_app = [
appName : "壹点灵心理咨询",
applicationId: "com.cxzapp.yidianling",
......@@ -134,12 +98,6 @@ ext {
"xxpermission" : "com.hjq:xxpermissions:10.2",
"rxerrorhandler2" : "me.jessyan:rxerrorhandler:2.1.1",
//tools
// "dagger2" : "com.google.dagger:dagger:${version["dagger2SdkVersion"]}",
// "dagger2-android" : "com.google.dagger:dagger-android:${version["dagger2SdkVersion"]}",
// "dagger2-android-support" : "com.google.dagger:dagger-android-support:${version["dagger2SdkVersion"]}",
// "dagger2-compiler" : "com.google.dagger:dagger-compiler:${version["dagger2SdkVersion"]}",
// "dagger2-android-processor" : "com.google.dagger:dagger-android-processor:${version["dagger2SdkVersion"]}",
"androideventbus" : "org.simple:androideventbus:1.0.5.1",
"otto" : "com.squareup:otto:1.3.8",
"gson" : "com.google.code.gson:gson:2.8.5",
......@@ -208,33 +166,9 @@ ext {
"ydl-hnet" : "com.ydl:h-net:0.0.8",
"ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar",
"ydl-device" : "com.ydl:device-id:0.0.31",
"ydl-net" : "com.ydl:ydl-net:${ydl2PublishVersion}",
"ydl-utils" : "com.ydl:ydl-utils:${ydl2PublishVersion}",
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydl2PublishVersion}", //组件化项目中的flutter base模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.51@aar", //flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号
"ydl-platform" : "com.ydl:ydl-platform:${ydl2PublishVersion}",
"ydl-tuicore" : "com.ydl:ydl-tuicore:${ydlPublishVersion["ydl-tuicore"]}",
//功能组件 <<--- 再发这些,发完改这里的版本号
"ydl-webview" : "com.ydl:ydl-webview:${ydl2PublishVersion}",
"ydl-media" : "com.ydl:ydl-media:${ydl2PublishVersion}",
"ydl-pay" : "com.ydl:ydl-pay:${ydl2PublishVersion}",
"m-audioim" : "com.ydl:m-audioim:${ydl2PublishVersion}",
//业务组件 <<--- 最后发这些(只发改过的)
"ydl-m-user-api" : "com.ydl:m-user-api:1.0.0",
"ydl-m-fm-api" : "com.ydl:m-fm-api:1.0.0",
"ydl-m-tests-api" : "com.ydl:m-tests-api:1.0.0",
"ydl-m-im-api" : "com.ydl:m-im-api:1.0.3",
"ydl-m-home-api" : "com.ydl:m-home-api:${ydlPublishVersion["m-home-api"]}",
"ydl-m-consultant-api" : "com.ydl:m-consultant-api:1.0.3",
"ydl-m-dynamic-api" : "com.ydl:m-dynamic-api:1.0.0",
"ydl-m-confide-api" : "com.ydl:m-confide-api:1.0.4",
"ydl-m-course-api" : "com.ydl:m-course-api:1.0.0",
]
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -44,7 +44,7 @@ android {
}
dependencies {
api fileTree(dir: 'libs', include: ['*.aar','*.jar'])
api fileTree(dir: 'libs', include: ['*.aar', '*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
......@@ -59,17 +59,7 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-flutter-base')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation rootProject.ext.dependencies["ydl-flutter-base"]
}
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-flutter-base')
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -71,19 +71,8 @@ dependencies {
api "com.ydl:ydl-av:1.4.4"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-platform')
api project(':ydl-webview')
implementation project(":api:user")
implementation project(":api:im")
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-webview"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(':ydl-platform')
api project(':ydl-webview')
implementation project(":api:user")
implementation project(":api:im")
}
......@@ -48,6 +48,7 @@ import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler
import com.ydl.ydl_av.voice.manager.YDLVoiceManager
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.app.Apm
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
......@@ -318,6 +319,7 @@ class AudioHomeActivity :
if (err == 0 || err == 18) {
return
}
Apm.reportEvent("agora_android", "occur_error", "$err")
channelId?.let { YDLavManager.instances.callEndStatusUpdate(it, 4, "频道的错误回调信息$err") }
}
......@@ -369,8 +371,8 @@ class AudioHomeActivity :
override fun onRtcStats(stats: IRtcEngineEventHandler.RtcStats?) {
super.onRtcStats(stats)
writeAgoraLog("声网onRtcStats:users:${stats?.users}")
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "声网onRtcStats:users:${stats?.users} channelId:${channelId}")
// AliYunRichLogsHelper.getInstance()
// .sendRichLog(AliYunLogConfig.AGORA, "声网onRtcStats:users:${stats?.users} channelId:${channelId}")
// 不需要移动端做离开房间逻辑,服务端会判断进行踢人逻辑
//因为用户端直接加入了频道,防止该回调执行时,专家还未加入频道,因此在连接成功之后,才进行频道人数判断
// if (isConnectSuccess && null != stats?.users && stats.users == 1) {
......@@ -388,6 +390,7 @@ class AudioHomeActivity :
override fun onConnectionStateChanged(state: Int, reason: Int) {
super.onConnectionStateChanged(state, reason)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
Apm.reportEvent("agora_android", "rtc_connection_failure", "$state,$reason")
if (reason == 3) {
callEventSave("50", "通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason}")
writeAgoraLog("通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})")
......
......@@ -166,7 +166,7 @@ class YDLavManager {
LogUtil.e("[agora]呼叫${response?.calleeId}用户失败:${response?.response}")
AliYunRichLogsHelper.getInstance().sendRichLog(
AliYunLogConfig.AGORA,
"呼叫${response?.calleeId}用户失败:${response?.response}"
"呼叫${response?.calleeId}用户失败:${response?.response},${errorCode}"
)
val dimension = hashMapOf(
"call" to "call_fail",
......@@ -432,7 +432,7 @@ class YDLavManager {
override fun onFailure(msg: String?) {
if (msg != "LOGIN_ERR_ALREADY_LOGGED_IN") {
Apm.reportCustom("agora_login_error", msg ?: "", Exception(msg))
Apm.reportEvent("rtm_android", "connectionstate_error", msg ?: "")
}
LogUtil.e("[agora]实时消息登录失败:$msg")
writeAgoraLog(
......@@ -449,6 +449,7 @@ class YDLavManager {
}
})
} else {
Apm.reportEvent("rtm_android", "login_failure", "${it.code},${it.msg}")
LogUtil.e("声网token获取失败uid:" + userId + " error:" + it.msg)
LogHelper.getInstance()
.writeLogSync("声网token获取失败uid:" + userId + " error:" + it.msg)
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -69,30 +69,14 @@ dependencies {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-media')
api project(':ydl-platform')
api project(':m-audioim')
api project(":ydl-pay")
api project(':ydl-webview')
api project(':ydl-utils')
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:consultant")
implementation project(':api:confide')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-media"]
api rootProject.ext.dependencies["m-audioim"]
api rootProject.ext.dependencies["ydl-pay"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
}
api project(':ydl-media')
api project(':ydl-platform')
api project(':m-audioim')
api project(":ydl-pay")
api project(':ydl-webview')
api project(':ydl-utils')
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:consultant")
implementation project(':api:confide')
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -43,29 +43,18 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'in.xiandan:count-down-timer:1.0.3'
kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
api rootProject.ext.dependencies["ydl-user-router"]
implementation(rootProject.ext.dependencies["ydl-ijkplayer-jjdxm"]) {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
if (rootProject.ext.dev_mode){
//开发时使用
implementation project(":api:user")
implementation project(":api:im")
implementation modularPublication('com.ydl:m-home-api')
implementation project(":api:consultant")
api project(":ydl-webview")
api project(":ydl-platform")
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-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-platform"]) {
transitive = true
}
}
implementation project(":api:user")
implementation project(":api:im")
implementation project(":api:home")
implementation project(":api:consultant")
api project(":ydl-webview")
api project(":ydl-platform")
}
......@@ -82,6 +82,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
YDLImageCacheManager.showImage(this, url, imgView, ops)
}
override fun showPromptPayment(promptPaymentBean: PromptPaymentBean) {
}
override fun showImage(
url: String?,
imgView: ImageView,
......
......@@ -31,9 +31,11 @@ import com.ydl.ydlcommon.base.BaseMvpFragment
import com.ydl.ydlcommon.base.config.ChannelConfig
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.ui.LogoLoadingView
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.DisplayUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
......@@ -42,8 +44,8 @@ import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.adapter.ExpertSearchAdapter
import com.yidianling.consultant.bean.FunctionWordConsultBean
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.dialog.ConsultSubPayDialog
import com.yidianling.consultant.listener.OnCategoriesSelectedListener
import com.yidianling.consultant.listener.OnExpertClickListener
import com.yidianling.consultant.listener.OnFilterConfirmListener
......@@ -57,6 +59,7 @@ import com.yidianling.consultant.ui.view.FilterPopupWindow
import com.yidianling.consultant.ui.view.SortPopupWindow
import com.yidianling.consultant.ui.view.topView.RecommendListView
import com.yidianling.home.api.event.HomeModuleTabEvent
import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
......@@ -69,6 +72,7 @@ import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import kotlin.collections.ArrayList
@Route(path = "/consultant/consultant")
class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(),
......@@ -81,6 +85,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
var endTime = 0L
private var mIdssign1: String = "" // 列表埋点咨询师列表id拼接参数
var bottomWordDisposable: Disposable? = null
var isShow: Boolean = false
private lateinit var bottomWordlist: List<FunctionWordBean>
override fun layoutResId(): Int {
return R.layout.consultant_activity_expert_search_list
......@@ -125,6 +130,19 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
var consultSubPayDialog: ConsultSubPayDialog? = null
override fun showPromptPayment(promptPaymentBean: PromptPaymentBean) {
if (promptPaymentBean.toPayTime != 0L) {
//有订单
consultSubPayDialog = activity?.let { ConsultSubPayDialog(it, promptPaymentBean) }
consultSubPayDialog?.show()
consultSubPayDialog?.setOnDismissListener {
consultSubPayDialog = null
}
}
}
override fun showImage(
url: String?,
imgView: ImageView,
......@@ -306,6 +324,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser)
isShow = isVisibleToUser
if (isVisibleToUser && isResumed) {
startTime = System.currentTimeMillis()
} else {
......@@ -1465,6 +1484,22 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//
needRefresh = true
}
// val orderToPayTime = SharedPreferencesEditor.getString("orderToPayTime")
//
// var timeLimit = if (TextUtils.isEmpty(orderToPayTime)) {
// 0L
// } else {
// orderToPayTime.toLong()
// }
//
//
// if (isShow && !(consultSubPayDialog != null && consultSubPayDialog?.isShowing == true)) {
// if (findRouteService(IUserService::class.java).isLogin() && System.currentTimeMillis() > timeLimit) {
// getPresenter().fetchPromptPayment()
// }
// }
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT)
ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit", "6")
}
......
......@@ -278,4 +278,18 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
})
}
@SuppressLint("CheckResult")
fun fetchPromptPayment() {
SearchApi.getSearchApi()
.promptPayment()
.compose(RxLifecycleUtils.bindToLifecycle(mView))//使用 Rxlifecycle,使 Disposable 和 Activity 一起销毁
.compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe { resp ->
mView.showPromptPayment(resp)
}
}
}
\ No newline at end of file
......@@ -4,10 +4,7 @@ import android.widget.ImageView
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.consultant.bean.FunctionWordConsultBean
import com.yidianling.consultant.model.bean.ExpertServiceItem
import com.yidianling.consultant.model.bean.Extras
import com.yidianling.consultant.model.bean.FunctionWordBean
import com.yidianling.consultant.model.bean.HeadData
import com.yidianling.consultant.model.bean.*
/**
* Created by zqk on 17-9-19.
......@@ -38,4 +35,6 @@ interface IExpertSearchView : IView {
*/
fun showImage(url : String?, imgView : ImageView, ops : SimpleImageOpConfiger)
fun showPromptPayment(promptPaymentBean: PromptPaymentBean)
}
\ No newline at end of file
package com.yidianling.consultant.dialog
import `in`.xiandan.countdowntimer.CountDownTimerSupport
import `in`.xiandan.countdowntimer.OnCountDownTimerListener
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.text.TextUtils
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.R
import com.yidianling.consultant.model.bean.PromptPaymentBean
import java.text.DecimalFormat
import java.text.SimpleDateFormat
import java.util.*
/**
* 咨询助理浮层
* Created by xj on 2019/10/30.
*/
class ConsultSubPayDialog(
private val mContext: Context,
private val promptPaymentBean: PromptPaymentBean
) : Dialog(mContext, R.style.dialog_default_style) {
var mTimer: CountDownTimerSupport? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.consultant_expert_consult_sub_pay_dialog)
val params = window.attributes
params.width = WindowManager.LayoutParams.WRAP_CONTENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity = Gravity.CENTER
window.attributes = params
setCanceledOnTouchOutside(false)
initView();
}
private fun initView() {
var titleTv = findViewById<TextView>(R.id.tv_title)
var timeTv = findViewById<TextView>(R.id.tv_time)
titleTv.paint.isFakeBoldText = true
Glide.with(mContext)
.load(promptPaymentBean.smallImage).into(findViewById<ImageView>(R.id.avaterIv))
findViewById<TextView>(R.id.nameTv).text = promptPaymentBean.name
findViewById<TextView>(R.id.desTv).text = promptPaymentBean.productName
val decimalFormat = DecimalFormat("###.##")
val price = decimalFormat.format(promptPaymentBean.price)
findViewById<TextView>(R.id.priceTv).text = "¥$price"
var format = SimpleDateFormat("HH:mm:ss");
format.timeZone = TimeZone.getTimeZone("GMT+0");
var millisInFuture = promptPaymentBean.currentTime?:0 - (promptPaymentBean.toPayTime?:0L)
mTimer = CountDownTimerSupport(millisInFuture, 1000)
mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener {
override fun onTick(millisUntilFinished: Long) {
val time = format.format(millisUntilFinished)
timeTv.text = time
}
override fun onFinish() {
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
dismiss()
}
override fun onCancel() {
// 倒计时手动停止
}
})
mTimer?.start()
findViewById<TextView>(R.id.tv_close).setOnClickListener {
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
mTimer?.stop()
dismiss()
}
findViewById<View>(R.id.pay).setOnClickListener {
if (!TextUtils.isEmpty(promptPaymentBean.orderDetailUrl)) {
val h5Params = H5Params(promptPaymentBean.orderDetailUrl!!, null)
NewH5Activity.start(context, h5Params)
dismiss()
} else {
ToastUtil.toastShort("跳转失败")
dismiss()
}
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
if (mTimer != null) {
mTimer?.stop()
mTimer = null
}
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import com.yidianling.consultant.bean.*
import com.yidianling.consultant.model.bean.ExpertBean
import com.yidianling.consultant.model.bean.FunctionWordBean
import com.yidianling.consultant.model.bean.HeadData
import com.yidianling.consultant.model.bean.PromptPaymentBean
import io.reactivex.Observable
import retrofit2.http.*
......@@ -112,4 +113,10 @@ interface SearchApi {
): Observable<BaseAPIResponse<Long>>
//搜索条件
@GET("consult/user/order/promptPayment")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun promptPayment(): Observable<BaseAPIResponse<PromptPaymentBean>>
}
\ No newline at end of file
package com.yidianling.consultant.model.bean
data class PromptPaymentBean(
var uid: String? = "",
var orderId: String? = "",
var toPayTime: Long? = 0,
var smallImage: String? = "",
var name: String? = "",
var price: Float? = 0.00f,
var productName: String? = "",
var doctorId: String? = "",
var productId: String? = "",
var createTime: String? = "",
var orderToPayTime: Long? = 0,
var orderDetailUrl: String? = "",
var currentTime: Long? = 0
)
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/platform_dp_20" />
<solid android:color="#FF6B5D" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp"/>
<solid android:color="#F6F6F7" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="12dp"/>
<solid android:color="#ffffff" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="307dp"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/white"
app:cardCornerRadius="12dp"
android:layout_centerInParent="true">
<RelativeLayout
android:layout_width="307dp"
android:layout_height="wrap_content"
android:background="@color/white"
android:layout_centerInParent="true">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/platform_dp_16"
android:text="你还有订单等待付款"
android:textColor="#1C1F28"
android:textSize="18sp" />
<LinearLayout
android:id="@+id/ll_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:layout_below="@+id/tv_title"
android:layout_centerHorizontal="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="还剩"
android:textColor="#1C1F28"
android:textSize="@dimen/platform_sp_14" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="00:12:21"
android:layout_marginLeft="@dimen/platform_dp_2"
android:layout_marginRight="@dimen/platform_dp_2"
android:textColor="#FF9534"
android:textSize="@dimen/platform_sp_14" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单将关闭"
android:textColor="#1C1F28"
android:textSize="@dimen/platform_sp_14" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_content"
android:layout_below="@+id/ll_time"
android:layout_width="match_parent"
android:layout_height="66dp"
android:background="@drawable/consultant_bg_sub_pay"
android:layout_marginTop="@dimen/platform_dp_16"
android:layout_marginLeft="@dimen/platform_dp_16"
android:layout_marginRight="@dimen/platform_dp_16"
android:orientation="horizontal">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginRight="@dimen/platform_dp_8"
app:cardCornerRadius="4dp">
<ImageView
android:id="@+id/avaterIv"
android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="centerCrop" />
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/nameTv"
android:layout_marginTop="@dimen/platform_dp_11"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14"
android:textColor="#1C1F28"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginRight="@dimen/platform_dp_12"
/>
<TextView
android:id="@+id/desTv"
android:layout_marginTop="@dimen/platform_dp_6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14"
android:textColor="#62636F"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginBottom="@dimen/platform_dp_11"
android:layout_marginRight="@dimen/platform_dp_12"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/pay"
android:layout_below="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_40"
android:padding="@dimen/platform_dp_9"
android:layout_marginLeft="@dimen/platform_dp_16"
android:layout_marginRight="@dimen/platform_dp_16"
android:gravity="center"
android:background="@drawable/consultant_bg_radius_red_20"
android:layout_marginTop="@dimen/platform_dp_28">
<TextView
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="@dimen/sp_16"
android:text="去付款"
/>
<TextView
android:id="@+id/priceTv"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="@dimen/sp_16"
android:layout_marginLeft="@dimen/platform_dp_5"
android:text="¥200"
/>
</LinearLayout>
<TextView
android:id="@+id/tv_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="稍后再说"
android:layout_below="@+id/pay"
android:layout_centerHorizontal="true"
android:textSize="@dimen/platform_sp_14"
android:paddingLeft="@dimen/platform_dp_5"
android:paddingRight="@dimen/platform_dp_5"
android:paddingBottom="@dimen/platform_dp_3"
android:paddingTop="@dimen/platform_dp_3"
android:textColor="#62636F"
android:layout_marginTop="@dimen/platform_dp_16"
android:layout_marginBottom="@dimen/platform_dp_16"/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
......@@ -45,4 +45,12 @@
</style>
<style name="dialog_default_style" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/consultant_bg_sub_pay_dialog</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
</resources>
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......@@ -51,35 +51,15 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"]
compileOnly "com.ydl.aar:resource:0.0.1-ydl"
if (rootProject.ext.dev_mode){
//开发时使用
implementation project(":api:consultant")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:course")
api project(":ydl-webview")
api project(":ydl-platform")
api project(":ydl-media")
api project(":ydl-pay")
implementation project(':ydl-flutter-base')
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-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']
api rootProject.ext.dependencies["ydl-webview"]
api (rootProject.ext.dependencies["ydl-media"]){
transitive = true
}
api rootProject.ext.dependencies["ydl-pay"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation project(":api:consultant")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:course")
api project(":ydl-webview")
api project(":ydl-platform")
api project(":ydl-media")
api project(":ydl-pay")
implementation project(':ydl-flutter-base')
implementation rootProject.ext.dependencies["ydl-flutter-base"]
}
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -72,33 +72,16 @@ dependencies {
implementation 'com.daimajia.numberprogressbar:library:1.4@aar'
implementation 'me.toptas.fancyshowcase:fancyshowcaseview:1.1.5'
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
api project(":ydl-pay")
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:course")
implementation project(":api:fm")
implementation project(":api:consultant")
implementation project(':api:confide')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-pay"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-course-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(':ydl-webview')
api project(':ydl-platform')
api project(":ydl-pay")
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:course")
implementation project(":api:fm")
implementation project(":api:consultant")
implementation project(':api:confide')
}
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -51,22 +51,11 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(":ydl-platform")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:fm")
implementation project(':ydl-media')
} else {
//发布时使用
implementation rootProject.ext.dependencies["ydl-media"]
implementation rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
implementation (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(":ydl-platform")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:fm")
implementation project(':ydl-media')
}
......@@ -3,6 +3,8 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: "../publish.gradle"
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
......@@ -62,37 +64,20 @@ dependencies {
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api "com.airbnb.android:lottie:3.4.0"
api(rootProject.ext.dependencies["ydl-device"])
implementation "com.alibaba:arouter-api:$arouter_api"
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
implementation rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
implementation project(":api:consultant")
implementation project(":api:user")
implementation project(":api:tests")
implementation modularPublication('com.ydl:m-home-api')
implementation project(":api:im")
implementation project(':api:confide')
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(":ydl-platform")
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-home-api"]
compileOnly rootProject.ext.dependencies['ydl-m-tests-api']
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
api rootProject.ext.dependencies["ydl-webview"]
api rootProject.ext.dependencies["ydl-media"]
api rootProject.ext.dependencies["ydl-media"]
}
implementation project(":api:consultant")
implementation project(":api:user")
implementation project(":api:tests")
implementation project(":api:home")
implementation project(":api:im")
implementation project(':api:confide')
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(":ydl-platform")
}
modular {
//模块包名
packageName "com.yidianling.home"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-home-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-home-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-home-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
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
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -63,31 +63,20 @@ dependencies {
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
api 'com.tencent.tbs.tbssdk:sdk:43903'
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:course")
implementation project(":api:fm")
implementation project(":api:consultant")
implementation project(':api:confide')
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-course-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation('com.netease.yunxin.kit:call-ui:1.5.9-SNAPSHOT') {
exclude group: "com.netease.nimlib", module: "avsignalling"
exclude group: "com.netease.nimlib", module: "basesdk"
}
implementation "com.netease.nimlib:avsignalling:9.1.1"
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:course")
implementation project(":api:fm")
implementation project(":api:consultant")
implementation project(':api:confide')
}
......@@ -10,6 +10,7 @@ import androidx.annotation.DrawableRes;
import com.alibaba.fastjson.JSON;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.SDKOptions;
import com.netease.nimlib.sdk.auth.LoginInfo;
import com.netease.nimlib.sdk.mixpush.MixPushMessageHandler;
import com.netease.nimlib.sdk.mixpush.NIMPushClient;
......@@ -42,6 +43,7 @@ import de.greenrobot.event.EventBus;
public class NimApplication {
private String appKey;
private NimApplication() {
}
......@@ -54,10 +56,16 @@ public class NimApplication {
return InstanceHolder.nimApplication;
}
public String getAppKey() {
return appKey;
}
public void initIm(Application app, Class activity, IMInitConfigBean configBean) {
IMCache.setContext(app);
// 初始化云信SDK
NIMClient.init(app, loginInfo(), NimSDKOptionConfig.prepareSDKOptions(app,activity,configBean));
SDKOptions sdkOptions = NimSDKOptionConfig.prepareSDKOptions(app, activity, configBean);
appKey = sdkOptions.appKey;
NIMClient.init(app, loginInfo(), sdkOptions);
// 以下逻辑只在主进程初始化时执行
if (NIMUtil.isMainProcess(app)) {
......
......@@ -31,7 +31,7 @@ import java.io.IOException;
* 云信sdk 自定义的SDK选项设置
*/
class NimSDKOptionConfig {
public class NimSDKOptionConfig {
static SDKOptions prepareSDKOptions(Context context, Class activity, IMInitConfigBean configBean) {
SDKOptions options = new SDKOptions();
......@@ -93,7 +93,7 @@ class NimSDKOptionConfig {
* 配置 APP 保存图片/语音/文件/log等数据的目录
* 这里示例用SD卡的应用扩展存储目录
*/
static String getAppCacheDir(Context context) {
public static String getAppCacheDir(Context context) {
String storageRootPath = null;
try {
// SD卡应用扩展存储区(APP卸载后,该目录下被清除,用户也可以在设置界面中手动清除),请根据APP对数据缓存的重要性及生命周期来决定是否采用此缓存目录.
......
......@@ -17,6 +17,7 @@ import com.netease.nimlib.sdk.msg.model.IMMessage
import com.netease.nimlib.sdk.msg.model.RevokeMsgNotification
import com.netease.nimlib.sdk.team.TeamServiceObserver
import com.netease.nimlib.sdk.team.model.Team
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.utils.LogUtil
import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack
import com.yidianling.im.api.event.AccountChangeEvent
......@@ -91,6 +92,9 @@ class ImObserversHelper {
if (code.wontAutoLoginForever()) {
EventBus.getDefault().post(AccountChangeEvent(1))
}
if (code == StatusCode.LOGINED) {
NimUICallInit.initNim2(BaseApp.getApp())
}
}
private var messageRevokeObserver: Observer<RevokeMsgNotification> = NimMessageRevokeObserver()
......
......@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
import com.yidianling.im.session.extension.CustomAttachmentFilter;
import com.yidianling.nimbase.common.ToastHelper;
import com.netease.nimlib.sdk.NIMClient;
......@@ -120,6 +121,9 @@ public class NIMInitManager{
return true;
}
}
if(message.getMsgType() == MsgTypeEnum.nrtc_netcall){
return true;
}
return false;
}
});
......
package com.yidianling.im.helper;
import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import com.netease.lava.nertc.sdk.NERtcEx;
import com.netease.lava.nertc.sdk.NERtcOption;
import com.netease.lava.nertc.sdk.video.NERtcEncodeConfig;
import com.netease.lava.nertc.sdk.video.NERtcVideoConfig;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.yunxin.nertc.nertcvideocall.bean.InvitedInfo;
import com.netease.yunxin.nertc.ui.CallKitNotificationConfig;
import com.netease.yunxin.nertc.ui.CallKitUI;
import com.netease.yunxin.nertc.ui.CallKitUIOptions;
import com.netease.yunxin.nertc.ui.extension.SelfConfigExtension;
import com.netease.yunxin.nertc.ui.service.DefaultIncomingCallEx;
import com.ydl.ydlcommon.modular.ModularServiceManagerKt;
import com.ydl.ydlcommon.utils.log.XLog;
import com.yidianling.im.R;
import com.yidianling.im.config.NimApplication;
import com.yidianling.im.config.NimSDKOptionConfig;
import com.yidianling.im.http.ImHttpImpl;
import com.yidianling.user.api.bean.UserResponseBean;
import com.yidianling.user.api.service.IUserService;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Map;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
public class NimUICallInit {
private static boolean hasReportSupportLine = false;
private static String curChannelName;
public static void initNim2(Context context) {
UserResponseBean.UserInfo userInfo = ModularServiceManagerKt.findRouteService(IUserService.class).getUserInfo();
if (userInfo == null) return;
String userId = userInfo.getUid();
android.util.Log.e("qwert", userId);
String appKey = NimApplication.getInstance().getAppKey();
CallKitUIOptions options = new CallKitUIOptions.Builder()
// 必要:音视频通话 sdk appKey,用于通话中使用
.rtcAppKey(appKey)
.logRootPath(NimSDKOptionConfig.getAppCacheDir(context) + "/yidianling")
// 必要:当前用户 AccId
.currentUserAccId(userId)
.currentUserRtcUId(Long.parseLong(userId))
// 通话接听成功的超时时间单位 毫秒,默认30s
.timeOutMillisecond(30 * 1000L)
.rtcCallExtension(new SelfConfigExtension(){
@Override
public void configVideoConfig() {
NERtcVideoConfig videoConfig = new NERtcVideoConfig();
videoConfig.frameRate = NERtcEncodeConfig.NERtcVideoFrameRate.FRAME_RATE_FPS_15;
videoConfig.bitrate = 600;
videoConfig.width = 640;
videoConfig.height = 480;
NERtcEx.getInstance().setLocalVideoConfig(videoConfig);
}
})
// 此处为 收到来电时展示的 notification 相关配置,如图标,提示语等。
.notificationConfigFetcher(invitedInfo -> new CallKitNotificationConfig(R.drawable.avchat_imcoming_call))
// 收到被叫时若 app 在后台,在恢复到前台时是否自动唤起被叫页面,默认为 true
.resumeBGInvitation(true)
.incomingCallEx(new DefaultIncomingCallEx() {
@Override
public boolean onIncomingCall(@NotNull InvitedInfo invitedInfo) {
XLog.INSTANCE.i("incomingCallEx", invitedInfo.toString());
curChannelName = invitedInfo.channelName;
return super.onIncomingCall(invitedInfo);
}
})
.enableOrder(false)
// .p2pAudioActivity(TestActivity.class)
// .p2pVideoActivity(TestActivity.class)
// 请求 rtc token 服务,若非安全模式则不需设置
.rtcTokenService((uid, callback) -> requestRtcToken(uid, callback)) // 自己实现的 token 请求方法
// 设置初始化 rtc sdk 相关配置,按照所需进行配置
.rtcSdkOption(new NERtcOption())
// 呼叫组件初始化 rtc 范围,true-全局初始化,false-每次通话进行初始化以及销毁
// 全局初始化有助于更快进入首帧页面,当结合其他组件使用时存在rtc初始化冲突可设置false
.rtcInitScope(true)
.build();
// 若重复初始化会销毁之前的初始化实例,重新初始化
CallKitUI.init(context.getApplicationContext(), options);
}
@SuppressLint("CheckResult")
private static void requestRtcToken(long uid, RequestCallback<String> callback) {
Map<String, String> body = new HashMap<>();
if (curChannelName != null) {
body.put("channelName", curChannelName);
}
body.put("uid", String.valueOf(uid));
ImHttpImpl.Companion.getInstance().getImApi().nim2Token(body)
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe(resp -> {
curChannelName = null;
if (resp.code == 200) {
callback.onSuccess(resp.data);
} else {
XLog.INSTANCE.i("requestRtcToken", resp.msg);
callback.onFailed(resp.code);
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
curChannelName = null;
callback.onException(throwable);
}
});
}
@SuppressLint("CheckResult")
public static void reportSupportLine() {
if (hasReportSupportLine) return;
Map<String, Object> report = new HashMap<>();
report.put("callKeys", new String[]{"netease_app2"});//支持云信2.0呼叫通话
ImHttpImpl.Companion.getInstance().getImApi()
.reportSupportLine(report)
.subscribeOn(Schedulers.io())
.subscribe(resp -> {
if (TextUtils.equals(resp.code, "200")) {
hasReportSupportLine = true;
}
});
}
}
......@@ -5,8 +5,12 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.im.api.bean.*
import com.yidianling.im.bean.*
import com.yidianling.im.api.bean.IMExpertBuild
import com.yidianling.im.api.bean.MsgDetail
import com.yidianling.im.api.bean.UpdateStatusBean
import com.yidianling.im.bean.MsgData
import com.yidianling.im.bean.MsgHome
import com.yidianling.im.bean.SystemMsgBean
import com.yidianling.im.ui.page.fragment.bean.ChatModelBean
import com.yidianling.im.ui.page.fragment.bean.InteractBean
import com.yidianling.im.ui.page.fragment.bean.NoticeItemBean
......@@ -21,6 +25,14 @@ import retrofit2.http.*
*/
interface ImApi {
@POST("call/v2/dial/yunxin")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun nim2Token(@Body body: Map<String, String>): Observable<BaseResponse<String?>>
@POST("counselor/device/callline")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun reportSupportLine(@Body body: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<Any?>>
//获得消息列表
@FormUrlEncoded
@POST("sms/list")
......
......@@ -41,7 +41,7 @@ class ImHttpImpl private constructor() : ImHttp {
private var imApi: ImApi? = null
private var imJavaApi: ImApi? = null
private fun getImApi(): ImApi {
fun getImApi(): ImApi {
if (imApi == null) {
imApi = YDLHttpUtils.obtainApi(ImApi::class.java)
}
......
......@@ -27,6 +27,7 @@ import com.yidianling.fm.api.service.IFMService
import com.yidianling.im.api.bean.ReceiveRedPacketParam
import com.yidianling.im.api.service.IImService
import com.yidianling.im.config.constants.UserPreferences
import com.yidianling.im.helper.NimUICallInit
import com.yidianling.im.preference.IMCache
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.uikit.api.NimUIKit
......@@ -202,6 +203,8 @@ object ImIn {
IMCache.setAccount(uid)
//此代码进行登录,并且会进行回调
NimUIKit.login(info, callback);
NimUICallInit.reportSupportLine()//登录nim时上报支持的线路
}
fun loginIm(uid : String,pwd : String,callback: RequestCallback<LoginInfo>){
......
......@@ -44,6 +44,7 @@ import com.yidianling.im.session.extension.CustomAttachConsult;
import com.yidianling.im.session.extension.CustomAttachConsultCallStatus;
import com.yidianling.im.session.extension.CustomAttachConsultPerfectData;
import com.yidianling.im.session.extension.CustomAttachConsultSubScript;
import com.yidianling.im.session.extension.CustomAttachConsultSubScriptPayment;
import com.yidianling.im.session.extension.CustomAttachLingXiJumpConfideList;
import com.yidianling.im.session.extension.CustomAttachLingxiAnswerQuestion;
import com.yidianling.im.session.extension.CustomAttachLingxiFirstQuestion;
......@@ -85,6 +86,7 @@ import com.yidianling.im.session.viewholder.MsgViewHolderConfirmOrder;
import com.yidianling.im.session.viewholder.MsgViewHolderConsult;
import com.yidianling.im.session.viewholder.MsgViewHolderConsultCallStatus;
import com.yidianling.im.session.viewholder.MsgViewHolderConsultSubScribe;
import com.yidianling.im.session.viewholder.MsgViewHolderConsultSubScribePayment;
import com.yidianling.im.session.viewholder.MsgViewHolderCustomTip;
import com.yidianling.im.session.viewholder.MsgViewHolderCustomerServiceCard;
import com.yidianling.im.session.viewholder.MsgViewHolderDefCustom;
......@@ -479,6 +481,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachLingxiAnswerQuestion.class, MsgViewHolderLingxiAnswerQuestion.class);//灵犀2.0-回答问题
NimUIKit.registerMsgItemViewHolder(CustomAttachLingxiFirstQuestion.class, MsgViewHolderLingxiFirstQuestion.class);//灵犀2.0-首问语
NimUIKit.registerMsgItemViewHolder(CustomAttachLingXiJumpConfideList.class, MsgViewHolderLingXiJumpConfideList.class);//灵犀2.0-倾诉列表
// NimUIKit.registerMsgItemViewHolder(CustomAttachConsultSubScriptPayment.class, MsgViewHolderConsultSubScribePayment.class);//咨询预约支付
}
......
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* 确认预约时间
* Created by harvie on 2017/1/10.
*/
public class CustomAttachConsultSubScriptPayment extends CustomAttachment {
private String TITLE = "title";
private String PRODUCT_NAME = "productName";
private String CONSULT_DATE = "bookingTime";
private String CONSULT_TIME = "consultDuration";
private String CONSULT_TYPE = "serviceType";
private String FLAG = "flag";
private String URL = "url";
private String IS_PACKAGE = "isPackage";
private static final String NEWSORDERID = "newOrderId";//用于跳转新版订单详情
private static final String STATUS = "status";//状态,1代表已确认,0代表待确认
private String FROM_CONTENT = "from_content";
private String TO_CONTENT = "to_content";
public String title; //自定义消息标题
public String productName;//商品名称
public String consultDate;//咨询时间
public String consultTime;//咨询时长
public String consultType;//咨询方式
public String url;//跳转url
public int flag;//0 未确认 1已确认
public byte isPackage = 0; //是否套餐 1单次 2套餐
/***新订单*/
public String newOrderId;
public String from_content;
public String to_content;
public CustomAttachConsultSubScriptPayment() {
super(CustomAttachmentType.TYPE_CONSULT_SUBSCRIBE_PAY);
}
@Override
protected void parseData(JSONObject data) {
title = data.getString(TITLE);
productName = data.getString(PRODUCT_NAME);
consultDate = data.getString(CONSULT_DATE);
consultTime = data.getString(CONSULT_TIME);
consultType = data.getString(CONSULT_TYPE);
url = data.getString(URL);
flag = data.getInteger(FLAG);
isPackage = data.getByte(IS_PACKAGE);
this.newOrderId = data.getString(NEWSORDERID);
from_content = data.getString(FROM_CONTENT);
to_content = data.getString(TO_CONTENT);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(TITLE,title);
data.put(PRODUCT_NAME,productName);
data.put(CONSULT_DATE,consultDate);
data.put(CONSULT_TIME,consultTime);
data.put(CONSULT_TYPE,consultType);
data.put(URL,url);
data.put(FLAG,flag);
data.put(IS_PACKAGE,isPackage);
data.put(NEWSORDERID, newOrderId);
data.put(FROM_CONTENT, from_content);
data.put(TO_CONTENT, to_content);
return data;
}
}
......@@ -158,6 +158,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
case CustomAttachmentType.TYPE_LINGXI_FIRST_QUESTION: //首问语
attachment = new CustomAttachLingxiFirstQuestion();
break;
// case CustomAttachmentType.TYPE_CONSULT_SUBSCRIBE_PAY:
// attachment = new CustomAttachConsultSubScriptPayment();
// break;
default:
attachment = new DefaultCustomAttachment();
break;
......
......@@ -55,6 +55,9 @@ public interface CustomAttachmentType {
int TYPE_LINGXI_ANSWER_QUESTION=56;//回答消息
int TYPE_LINGXI_TEST_QUESTION=60;//测评结果
int TYPE_LINGXI_JUMP_CONFIDE_LIST = 73; // 跳转倾诉列表
int TYPE_CONSULT_SUBSCRIBE_PAY = 74; // 预约支付
}
......@@ -103,10 +103,8 @@ public class MsgViewHolderConsultSubScribe extends MsgViewHolderBase {
if (flag==1){
img_icon.setVisibility(View.VISIBLE);
tv_title.setTextColor(ContextCompat.getColor(context,R.color.im_color_00CC88));
}else {
img_icon.setVisibility(View.GONE);
tv_title.setTextColor(ContextCompat.getColor(context,R.color.platform_color_242424));
}
hideItemBg();
......
package com.yidianling.im.session.viewholder;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.yidianling.im.R;
import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.session.extension.CustomAttachConsultSubScriptPayment;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
/**
* author : harvie
* 确认咨询预约消息
*/
public class MsgViewHolderConsultSubScribePayment extends MsgViewHolderBase {
private TextView tv_title,tv_content,tv_date,tv_time_long,tv_type,tv_package;
private ImageView img_icon;
private View lin_root;
public String title; //自定义消息标题
public String productName;//商品名称
public String consultDate;//咨询时间
public String consultTime;//咨询时长
public String consultType;//咨询方式
public String url;//跳转url
public int flag;//0 未确认 1已确认
public byte isPackage;
/***新订单id*/
public String newOrderId;
public String from_content;
public String to_content;
public MsgViewHolderConsultSubScribePayment(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
}
@Override
protected int getContentResId() {
return R.layout.im_ui_message_custom_consult_subscribe;
}
@Override
protected void inflateContentView() {
lin_root = view.findViewById(R.id.lin_root);
tv_title = view.findViewById(R.id.tv_title);
tv_content = view.findViewById(R.id.tv_content);
tv_date = view.findViewById(R.id.tv_date);
tv_time_long = view.findViewById(R.id.tv_time_long);
tv_type = view.findViewById(R.id.tv_type);
img_icon = view.findViewById(R.id.img_icon);
tv_package = view.findViewById(R.id.tv_package);
if (isReceivedMessage()){
setAvatarRightInVisibity();
lin_root.setBackgroundResource(R.drawable.im_bg_radius_no_topleft_white_8);
}else {
setAvatarLeftInVisibity();
lin_root.setBackgroundResource(R.drawable.im_bg_radius_no_topright_white_8);
}
}
@Override
protected void bindContentView() {
if (isReceivedMessage()){
setAvatarRightInVisibity();
}else {
setAvatarLeftInVisibity();
}
MsgAttachment attachment = message.getAttachment();
if (attachment instanceof CustomAttachConsultSubScriptPayment) {
title = ((CustomAttachConsultSubScriptPayment) attachment).title;
productName = ((CustomAttachConsultSubScriptPayment) attachment).productName;
consultDate = ((CustomAttachConsultSubScriptPayment) attachment).consultDate;
consultTime = ((CustomAttachConsultSubScriptPayment) attachment).consultTime;
consultType = ((CustomAttachConsultSubScriptPayment) attachment).consultType;
url = ((CustomAttachConsultSubScriptPayment) attachment).url;
flag = ((CustomAttachConsultSubScriptPayment) attachment).flag;
isPackage = ((CustomAttachConsultSubScriptPayment) attachment).isPackage;
newOrderId = ((CustomAttachConsultSubScriptPayment) attachment).newOrderId;
from_content = ((CustomAttachConsultSubScriptPayment) attachment).from_content;
to_content = ((CustomAttachConsultSubScriptPayment) attachment).to_content;
}
tv_title.setText(to_content);
tv_date.setText(consultDate);
tv_time_long.setText(consultTime);
tv_type.setText(consultType);
if (isPackage == 2){
tv_package.setVisibility(View.VISIBLE);
tv_content.setText("\u3000\u3000"+productName);
}else {
tv_package.setVisibility(View.GONE);
tv_content.setText(productName);
}
if (flag==1){
img_icon.setVisibility(View.VISIBLE);
}else {
img_icon.setVisibility(View.GONE);
}
hideItemBg();
}
@Override
protected void onItemClick() {
if (TextUtils.isEmpty(url)&& newOrderId == null){
return;
}
if (newOrderId == null || newOrderId.isEmpty()) {
NewH5Activity.start(context, new H5Params(url, null));
} else {
//跳转新订单详情页
H5Params orderParams = new H5Params(
ImConstants.Companion.getORDER_DETAIL() + (newOrderId.isEmpty() ? "" : newOrderId), null);
NewH5Activity.start(context, orderParams);
}
}
}
......@@ -345,12 +345,12 @@ public class WatchMessagePictureActivity extends UI {
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());
}
});
}
......
......@@ -509,12 +509,12 @@ public class WatchVideoActivity extends UI implements Callback {
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());
}
});
downloading = true;
......
......@@ -1367,7 +1367,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
public void onFailed(int code) {
if (msg != null) {
sendFailWithBlackList(code, msg);
Apm.INSTANCE.reportCustom("yx_sendmessage_error", "sessionId:" + msg.getSessionId(), new Exception(String.valueOf(code)));
Apm.INSTANCE.reportEvent("yxim_android", "sendmessage_error", " 云信IM发送消息失败" + code + msg);
}
}
......
......@@ -849,12 +849,12 @@ public class MessageListPanelEx {
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());;
}
});
}
......@@ -1163,8 +1163,7 @@ public class MessageListPanelEx {
@Override
public void onFailed(int code) {
String sessionId = item.getSessionId();
Apm.INSTANCE.reportCustom("yx_revoke_error", "sessionId:" + sessionId, new Exception(String.valueOf(code)));
Apm.INSTANCE.reportEvent("yxim_android", "revoke_error", "云信IM回撤消息失败" + code);
if (code == ResponseCode.RES_OVERDUE) {
ToastHelper.showToast(container.activity, R.string.im_revoke_failed);
} else {
......
......@@ -82,12 +82,12 @@ public class MsgViewHolderAudio extends MsgViewHolderBase {
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());
}
});
......
......@@ -151,12 +151,12 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + i);
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
Apm.INSTANCE.reportEvent("yxim_android", "attchment_error", "云信IM收取消息" + throwable.getMessage());
}
});
}
......
......@@ -18,7 +18,7 @@
android:layout_marginRight="4dp"
android:layout_alignTop="@+id/tv_title"
android:layout_alignBottom="@+id/tv_title"
android:src="@mipmap/im_consult_data_sure"
android:src="@mipmap/im_cunsult_data_sure_gary"
android:visibility="gone"
tools:visibility="gone"/>
......@@ -27,6 +27,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dp"
android:textStyle="bold"
android:textColor="@color/im_color_242424"
android:layout_toRightOf="@+id/img_icon"
tools:text="请确认我的预约消息"/>
......@@ -47,7 +48,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14dp"
android:textStyle="bold"
android:textColor="@color/im_color_242424"
tools:text="\u3000\u3000幸福宝典fghrt ertyherthhtrht"/>
......@@ -68,7 +68,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_666666"
android:textSize="10dp"
android:textSize="12dp"
android:layout_marginTop="5.8dp"
android:layout_below="@+id/tv_content"
tools:text="咨询时间:2019-12-55 12:00:00"/>
......@@ -78,7 +78,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_999999"
android:textSize="10dp"
android:textSize="12dp"
android:layout_marginTop="2dp"
android:layout_below="@+id/tv_date"
tools:text="咨询时长:30分钟"/>
......@@ -88,7 +88,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_999999"
android:textSize="10dp"
android:textSize="12dp"
android:layout_marginTop="2dp"
android:layout_below="@+id/tv_time_long"
tools:text="咨询方式:电话"/>
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from : '../maven_push.gradle'
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -56,25 +56,10 @@ dependencies {
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
if (rootProject.ext.dev_mode){
//开发时使用
api project(":ydl-platform")
implementation project(':ydl-media')
implementation project(":api:user")
implementation project(':ydl-flutter-base')
implementation project(':ydl-webview')
api project(":ydl-platform")
implementation project(':ydl-media')
implementation project(":api:user")
implementation project(':ydl-flutter-base')
implementation project(':ydl-webview')
} else {
//发布时使用
api rootProject.ext.dependencies["ydl-media"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
api (rootProject.ext.dependencies["ydl-webview"]){
transitive = true
}
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation rootProject.ext.dependencies["ydl-flutter-base"]
}
}
......@@ -26,7 +26,5 @@
android:screenOrientation="portrait"
android:theme="@style/un_full_screen_activity"/>
<service android:name=".service.MeditationWindowService"/>
</application>
</manifest>
......@@ -453,7 +453,7 @@ class PlayMeditationActivity : BaseActivity() {
meditation = currentMeditation?.copy(
meditationType = mMeditationType, meditationId =
mMeditationId ?: 0
)
),meditations = meditations
)
EventBus.getDefault().post(event)
......@@ -1070,7 +1070,7 @@ class PlayMeditationActivity : BaseActivity() {
}
override fun onBackPressed() {
val event = MeditationFloatEvent(true, meditation = currentMeditation)
val event = MeditationFloatEvent(true, meditation = currentMeditation,meditations = meditations)
EventBus.getDefault().post(event)
super.onBackPressed()
}
......
......@@ -7,6 +7,6 @@ class MeditationFloatEvent(
val stop: Boolean? = null,
val time: Long? = null,
val meditation: MeditationPlayModuleBean.MeditationDetail? = null,
val meditations: ArrayList<MeditationPlayModuleBean.MeditationDetail>? = null
val meditations: MutableList<MeditationPlayModuleBean.MeditationDetail>? = null
)
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -42,27 +42,12 @@ dependencies {
compileOnly "com.ydl.aar:resource:0.0.1-ydl"
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-flutter-base')
implementation project(":api:tests")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:im")
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation rootProject.ext.dependencies["ydl-flutter-base"]
}
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-flutter-base')
implementation project(":api:tests")
implementation project(":api:user")
implementation project(":api:dynamic")
implementation project(":api:im")
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -45,42 +45,23 @@ android {
}
dependencies {
api fileTree(dir: 'libs', include: ['*.aar','*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.annotation:annotation:1.1.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.ydl.aar:phonenumber-authsdk:2.11.1.1'
kapt 'com.alibaba:arouter-compiler:1.2.2'
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"]
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
api project(":ydl-pay")
api project(':ydl-webview')
api project(':ydl-platform')
api project(":ydl-pay")
// implementation project(":ydl-tuicore")
implementation project(":api:user")
implementation project(":api:course")
implementation project(":api:im")
implementation project(":api:fm")
implementation project(":api:dynamic")
implementation project(":api:consultant")
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies['ydl-m-course-api']
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies['ydl-m-consultant-api']
api rootProject.ext.dependencies["ydl-webview"]
api rootProject.ext.dependencies["ydl-pay"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
// implementation rootProject.ext.dependencies["ydl-tuicore"]
}
implementation project(":api:user")
implementation project(":api:course")
implementation project(":api:im")
implementation project(":api:fm")
implementation project(":api:dynamic")
implementation project(":api:consultant")
}
......@@ -20,5 +20,6 @@ object UserConstants {
//黑名单
val My_BLACK = HttpConfig.H5_URL + "mine/black-list/"
//百科
val MY_BAIKE = HttpConfig.MH5_URL + "newConsult/baike"
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ import com.yidianling.im.api.service.IImService
import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.BuildConfig
import com.yidianling.user.R
import com.yidianling.user.UserConstants.MY_BAIKE
import com.yidianling.user.UserHelper.getUserInfo
import com.yidianling.user.UserHelper.getUsetSetting
import com.yidianling.user.UserHelper.isLogin
......@@ -118,6 +119,8 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
rootView.findViewById<View>(R.id.ll_service).setOnClickListener(this)
//冥想
rootView.findViewById<View>(R.id.ll_meditation).setOnClickListener(this)
//心理百科
rootView.findViewById<View>(R.id.ll_wiki).setOnClickListener(this)
init()
GlideApp.with(this).load("https://static.yidianling.com/banner/bottombanner@2x.png")
......@@ -193,6 +196,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
refreshCouponData()
}
@SuppressLint("CheckResult")
private fun getConfideOrder(uid: String) {
MineHttpImpl.getInstance().getHasConfideOrder(uid)
.subscribeOn(Schedulers.io())
......@@ -546,6 +550,13 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
NewH5Activity.start(it, h5Params3)
}
} else if (id == R.id.ll_wiki) { //心理百科
count(UserMyPageEvent.YDL_USER_MY_MIDDLE_TYPE_CLICK, "百科")
mActivity?.let {
val h5Params3 = H5Params(MY_BAIKE, null)
NewH5Activity.start(it, h5Params3)
}
}
}
......
......@@ -4,8 +4,8 @@ import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.Intent
import androidx.fragment.app.Fragment
import android.text.TextUtils
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.bean.VersionData
......@@ -319,6 +319,10 @@ public class UserServiceImp : IUserService {
return OneKeyLoginHelp.startLoginByStatus(context,isOpenDialog)
}
override fun checkOneLoginEnvAvailable(): Boolean {
return OneKeyLoginHelp.mPhoneNumberAuthHelper!!.checkEnvAvailable()
}
override fun loginByOneKeyLoginCallBack(
context: Context,
isOpenDialog: Boolean,
......
......@@ -73,7 +73,7 @@ class LoginObservable(val activity: Activity, private val media: SHARE_MEDIA): O
}
override fun onError(p0: SHARE_MEDIA?, p1: Int, p2: Throwable?) {
Apm.reportCustom("login", "third_auth_error", p2 ?: Exception("${p0},$p1"))
Apm.reportEvent("login_android", "third_auth_error", "三方授权失败${p2?.message ?: p1}")
observer?.onError(p2?:Throwable("未知异常"))
}
......
......@@ -507,7 +507,7 @@ object OneKeyLoginHelp {
"一键登录失败 msg:${it.msg}"
)
ToastUtil.toastShort(it.msg)
Apm.reportCustom("login", "oneKey_error", Exception("${it.code},${it.msg}"))
Apm.reportEvent("login_android", "oneKey_error", "一键登录失败报错${it.code},${it.msg}")
mPhoneNumberAuthHelper?.hideLoginLoading()
}
}, {
......@@ -515,7 +515,7 @@ object OneKeyLoginHelp {
AliYunLogConfig.LOGIN,
"一键登录Error msg:${it.message}"
)
Apm.reportCustom("login", "oneKey_error", it)
Apm.reportEvent("login_android", "oneKey_error", "一键登录失败报错${it.message}")
ToastUtil.toastShort(it.message)
mPhoneNumberAuthHelper?.hideLoginLoading()
})
......@@ -527,7 +527,7 @@ object OneKeyLoginHelp {
}
override fun onTokenFailed(s: String) {
Apm.reportCustom("login", "oneKey_error", Exception("TokenFailed:${s}"))
Apm.reportEvent("login_android", "oneKey_error", "一键登录失败TokenFailed:${s}")
LogUtil.e("onTokenFailed"+s)
mIsGetTokenSuccess = false
val tokenRet = TokenRet.fromJson(s)
......
......@@ -115,12 +115,12 @@ class InputPassWordPresenterImpl :
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.LOGIN, "手机号密码 登录失败 msg: ${it.msg}")
ToastUtil.toastShort(it.msg)
Apm.reportCustom("login", "password_error", Exception("密码登录失败,$phoneCountryCode-$phone"))
Apm.reportEvent("login_android", "password_error", "密码登录失败,$phoneCountryCode-$phone")
mView.startAnim()
} else {
if (it.data.userInfo?.user_type == 2) {
mView.showNormalDialog()
Apm.reportCustom("login", "isexpert", Exception("登录—专家帐号,$phoneCountryCode-$phone"))
Apm.reportEvent("login_android", "isexpert", "登录—专家帐号,$phoneCountryCode-$phone")
} else {
saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册
......@@ -140,7 +140,7 @@ class InputPassWordPresenterImpl :
}
}, {
YdlCommonOut.showToast(it.message!!)
Apm.reportCustom("login", "password_error", it)
Apm.reportEvent("login_android", "password_error", "密码登录失败${it.message}")
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.LOGIN, "手机号密码 Error msg: ${it.message}")
......
......@@ -168,7 +168,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
if (it.data.isRegistered == 1) {
mView.showLoading(false)
mView.showHasBindedDialog()
Apm.reportCustom("login", "mobile_isbind", Exception("登录-手机被绑定,$countryCode-$phone"))
Apm.reportEvent("login_android", "mobile_isbind", "登录-手机被绑定,$countryCode-$phone")
} else {
mView.checkPhoneStatusSuccess(it.data, phone)
}
......@@ -176,7 +176,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
if (it.data.isDoctor == 1) {//是专家账号
mView.showLoading(false)
mView.showNormalDialog()
Apm.reportCustom("login", "isexpert", Exception("登录—专家帐号,$countryCode-$phone"))
Apm.reportEvent("login_android", "isexpert", "登录—专家帐号,$countryCode-$phone")
} else {
mView.checkPhoneStatusSuccess(it.data, phone)
}
......@@ -214,7 +214,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
.subscribe({
mView.dismissProgressView()
if (it?.data == null) {
Apm.reportCustom("login", "third_login_error", Exception("${it.code},${it.msg}"))
Apm.reportEvent("login_android", "third_login_error", "三方登录失败${it.code},${it.msg}")
ToastUtil.toastShort(it.msg)
return@subscribe
}
......@@ -268,7 +268,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
}, {
mView.dismissProgressView()
Apm.reportCustom("login", "third_login_error", it)
Apm.reportEvent("login", "third_login_error", it.message ?: "")
YdlCommonOut.showToast(it.message!!)
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.LOGIN, media.getName() + "登录失败")
......
......@@ -47,12 +47,12 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
mView.startCountdown(60)
} else {
mView.startAnim()
Apm.reportCustom("login", "getcode_error", Exception("${phone},${it.code},${it.msg}"))
Apm.reportEvent("login_android", "getcode_error", "获取验证码失败${phone},${it.code},${it.msg}")
ToastUtil.toastShort(it.msg)
}
}, {
mView.startAnim()
Apm.reportCustom("login", "getcode_error", it)
Apm.reportEvent("login", "getcode_error", "获取验证码失败${it.message}")
ToastUtil.toastShort(it.message)
})
}
......@@ -115,13 +115,13 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
} else {
ToastUtil.toastShort(it.msg)//服务端返回{验证码错误&异常}信息
// mView.startAnim()
Apm.reportCustom("login", "bind_mobile_error", Exception("${param.countryCode}-${param.phoneNumber},${it.code},${it.msg}"))
Apm.reportEvent("login_android", "bind_mobile_error", " 手机号绑定失败${param.countryCode}-${param.phoneNumber},${it.code},${it.msg}")
mView.verificationErrorCode()
}
}, {
// mView.startAnim()
mView.verificationErrorCode()
Apm.reportCustom("login", "bind_mobile_error", it)
Apm.reportEvent("login_android", "bind_mobile_error", " 手机号绑定失败${param.countryCode}-${param.phoneNumber},${it.message}")
ToastUtil.toastShort(it.message)
})
......@@ -193,12 +193,12 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
} else {
ToastUtil.toastShort(it.msg)//服务端返回{验证码错误&异常}信息
// mView.startAnim()
Apm.reportCustom("login", "code_error", Exception("${phoneCountryCode}-${phone},${it.code},${it.msg}"))
Apm.reportEvent("login_android", "code_error", "验证码登录失败${phoneCountryCode}-${phone},${it.code},${it.msg}")
mView.verificationErrorCode()
}
}, {
mView.startAnim()
Apm.reportCustom("login", "code_error", it)
Apm.reportEvent("login", "code_error", it.message ?: "")
ToastUtil.toastShort(it.message)
})
}
......
......@@ -495,7 +495,6 @@
</LinearLayout>
<!--meditation start-->
<LinearLayout
android:id="@+id/ll_meditation"
android:layout_width="0dp"
......@@ -519,13 +518,30 @@
android:textSize="12sp" />
</LinearLayout>
<!--meditation end-->
<View
<LinearLayout
android:id="@+id/ll_wiki"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/user_mine_ic_my_wiki" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="心理百科"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
......
apply plugin: 'maven'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def mavenRepositoryUrl2 = "http://nexus.yidianling.com/repository/AndroidSnapshots/"
def getVersionName() {
def publishVersion = rootProject.ext.ydl2PublishVersion
return publishVersion
}
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){
classifier = 'source'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives sourceJar
}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.artifactId = project.getName().replace('_', "-")
pom.groupId = "com.ydl"
pom.version = getVersionName()
def local = isLocal()
if (local == "true") {
repository(url: mavenLocal().url)
} else if (local == "false") {
def snapshot = getVersionName().endsWith("-SNAPSHOT")
repository(url: snapshot ? mavenRepositoryUrl2 : mavenRepositoryUrl) {
authentication(userName: "admin", password: "fjoi#1+#@")
}
} else {
println("请在local.properties中指定packageLocal的值[true|false]")
}
}
}
}
uploadArchives.doFirst {
// log
println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
, project.getName()
, getVersionName()
, "aar"
, "packageLocal:" + isLocal()
)
}
// 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
apply plugin: 'maven'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def getVersionName() {
return hasProperty('VERSION_NAME') ? VERSION_NAME : rootProject.ext.ydlPublishVersion[project.getName()]
}
task sourceJar(type:Jar){
classifier = 'source'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives sourceJar
}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.artifactId = "m-" + project.name + "-api"
pom.groupId = "com.ydl"
pom.version = project.version
repository(url: mavenRepositoryUrl) {
authentication(userName: "admin", password: "fjoi#1+#@")
}
// repository(url:mavenLocal().url)
}
}
}
uploadArchives.doFirst {
// log
println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
, project.getName()
, project.version
, "aar"
, "release"
)
}
}
\ No newline at end of file
apply plugin: 'maven-publish'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def mavenRepositoryUrl2 = "http://nexus.yidianling.com/repository/AndroidSnapshots/"
def sourceJar(String name, String path, String ext) {
return project.tasks.create("source${name.capitalize()}Jar", Jar) {
group = "publishing"
description = "package ${name} source to jar"
from "$path/src/main/java"
from "$path/src/main/kotlin"
if (!ext.isEmpty()) {
from "$path/src/${ext}/java"
}
destinationDir = file("$path/build/libs/")
classifier = 'sources'
}
}
def setScm(scm) {
// scm.appendNode('connection', "https://github.com/${System.getenv("GITHUB_ACTOR")}/Shadow.git")
//
// def commit
// if ("${System.env.CI}".equalsIgnoreCase("true")) {
// commit = System.getenv("GITHUB_SHA")
// } else {
// commit = gitShortRev()
// }
// scm.appendNode('url', "https://github.com/${System.getenv("GITHUB_ACTOR")}/Shadow/commit/$commit")
}
def checkPomVersion = {
def root = asNode()
def dependencyNodes = root.get('dependencies')
for (def dependency : dependencyNodes) {
def children = dependency.children()
for (def child : children) {
def versionNode = child.get("version").first()
def version = versionNode.value().first()
def groupId = child.get("groupId").first().value().first()
def artifactId = child.get("artifactId").first().value().first()
def scope = child.get("scope").first().value().first()
println "$scope $groupId:$artifactId:$version"
if (version == "unspecified") {
throw new IllegalStateException("版本检查出错了!")
}
}
}
}
def multiComponent = [':m-home', ':ydl-resource']
afterEvaluate {
def pVersion = ''
if (project.version == "unspecified") {
throw new IllegalStateException("请指定${project.name}的Version")
} else {
pVersion = project.version
}
def isApiModule = project.path.startsWith(":api:")
publishing {
publications {
if (multiComponent.contains(project.path)) {
ydlComponent(MavenPublication) {
group 'com.ydl'
version "ydl-" + pVersion
from components.ydlRelease
artifact sourceJar(getName(), "${project.projectDir}", "ydl")
pom.withXml(checkPomVersion)
}
xlzxComponent(MavenPublication) {
group 'com.ydl'
version "xlzx-" + pVersion
from components.xlzxRelease
artifact sourceJar(getName(), "${project.projectDir}", "xlzx")
pom.withXml(checkPomVersion)
}
} else {
component(MavenPublication) {
group isApiModule ? 'com.ydl.api' : 'com.ydl'
version pVersion
from components.release
artifact sourceJar(getName(), "${project.projectDir}", "")
pom.withXml(checkPomVersion)
}
}
}
repositories {
def snapshot = pVersion.endsWith("-SNAPSHOT")
maven {
url snapshot ? mavenRepositoryUrl2 : mavenRepositoryUrl
allowInsecureProtocol true
credentials {
username "admin"
password "fjoi#1+#@"
}
}
}
}
}
\ No newline at end of file
......@@ -3,6 +3,6 @@ include ':app',
':ydl-platform', ':ydl-webview', ':ydl-pay', ':m-home', 'ydl-resource',
':m-home',
':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', ':api:dynamic', ':api:fm', ':api:consultant',
':api:course', ':api:user', ':api:tests', ':api:im'
':api:course', ':api:user', ':api:tests', ':api:im',':api:home'
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
kapt {
arguments {
......@@ -56,25 +56,8 @@ dependencies {
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
if (rootProject.ext.dev_mode){
//开发时使用
implementation project(":ydl-platform")
// api fileTree(include: ['*.aar'], dir: 'aars')
api rootProject.ext.dependencies["ydl-flutter"]
// api rootProject.ext.dependencies["ydl-flutter-sp"]
} else {
//发布时使用
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
//以下为flutter端的所有aar
api rootProject.ext.dependencies["ydl-flutter"]
// api rootProject.ext.dependencies["ydl-flutter-sp"]
}
implementation project(":ydl-platform")
api rootProject.ext.dependencies["ydl-flutter"]
}
repositories {
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
apply from: "../publish.gradle"
android {
compileSdkVersion 28
......@@ -43,15 +43,7 @@ dependencies {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
if (rootProject.ext.dev_mode){
//开发时使用
api project(':ydl-platform')
}else {
//发布时使用
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
api project(':ydl-platform')
}
......@@ -4,8 +4,6 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application>
<service android:name=".audio.PlayService" />
<receiver android:name=".audio.receiver.RemoteControlReceiver">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
......
package com.ydl.media.audio
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.Service
import android.content.Context
import android.content.Intent
import android.os.Binder
import android.os.Build
import android.os.IBinder
import android.util.Log
import androidx.core.app.NotificationCompat
import com.ydl.media.audio.constants.Extras
import com.ydl.media.audio.manager.MediaSessionManager
import com.ydl.media.audio.manager.NotifyManager
/**
* Created by haorui on 2019-10-27 .
* Des: 音乐播放后台服务
*/
class PlayService : Service() {
inner class PlayBinder : Binder() {
val service: PlayService
get() = this@PlayService
}
override fun onCreate() {
super.onCreate()
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){
var nm = getSystemService(NOTIFICATION_SERVICE) as NotificationManager;
//数字是随便写的“40”,
nm.createNotificationChannel( NotificationChannel("40", "App Service", NotificationManager.IMPORTANCE_DEFAULT));
var builder = NotificationCompat.Builder(this, "40");
//其中的2,是也随便写的,正式项目也是随便写
startForeground(2 ,builder.build());
}
Log.i(TAG, "onCreate: " + javaClass.simpleName)
AudioPlayer.get().init(this)
MediaSessionManager.get().init(this)
NotifyManager.get().init(this)
}
override fun onBind(intent: Intent): IBinder? {
return PlayBinder()
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
if (intent != null && intent.action != null) {
when (intent.action) {
Extras.ACTION_STOP -> stop()
}
}
return Service.START_NOT_STICKY
}
private fun stop() {
AudioPlayer.get().stopPlayer()
NotifyManager.get().cancelAll()
}
companion object {
private val TAG = "Service"
fun startCommand(context: Context, action: String) {
val intent = Intent(context, PlayService::class.java)
intent.action = action
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(intent)
}else{
context.startService(intent)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
}
}
package com.ydl.media.audio.manager
import android.content.Context
import android.graphics.Bitmap
import android.os.Build
import android.support.v4.media.MediaMetadataCompat
import android.support.v4.media.session.MediaSessionCompat
import android.support.v4.media.session.PlaybackStateCompat
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.PlayService
import com.ydl.media.audio.model.Music
import com.ydl.media.audio.utils.CoverImageUtils
......@@ -17,7 +17,7 @@ import com.ydl.media.audio.utils.CoverImageUtils
*/
class MediaSessionManager private constructor() {
private var playService: PlayService? = null
private var mContext: Context? = null
private var mediaSession: MediaSessionCompat? = null
private val callback = object : MediaSessionCompat.Callback() {
......@@ -50,22 +50,22 @@ class MediaSessionManager private constructor() {
val instance = MediaSessionManager()
}
fun init(playService: PlayService) {
this.playService = playService
fun init(context: Context) {
this.mContext = context
setupMediaSession()
}
private fun setupMediaSession() {
mediaSession = MediaSessionCompat(playService!!, TAG)
mediaSession!!.setFlags(MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS or MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS)
mediaSession!!.setCallback(callback)
mediaSession!!.isActive = true
mediaSession = MediaSessionCompat(mContext, TAG)
mediaSession?.setFlags(MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS or MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS)
mediaSession?.setCallback(callback)
mediaSession?.isActive = true
}
fun updatePlaybackState() {
val state =
if (AudioPlayer.get().isPlaying || AudioPlayer.get().isPreparing) PlaybackStateCompat.STATE_PLAYING else PlaybackStateCompat.STATE_PAUSED
mediaSession!!.setPlaybackState(
mediaSession?.setPlaybackState(
PlaybackStateCompat.Builder()
.setActions(MEDIA_SESSION_ACTIONS)
.setState(state, AudioPlayer.get().audioPosition, 1f)
......@@ -75,7 +75,7 @@ class MediaSessionManager private constructor() {
fun updateMetaData(music: Music?) {
if (music == null) {
mediaSession!!.setMetadata(null)
mediaSession?.setMetadata(null)
return
}
......@@ -95,7 +95,7 @@ class MediaSessionManager private constructor() {
// TODO: 2019-10-26 by:HaoRui
// metaData.putLong(MediaMetadataCompat.METADATA_KEY_NUM_TRACKS, AppCache.get().getLocalMusicList().size());
}
mediaSession!!.setMetadata(metaData.build())
mediaSession?.setMetadata(metaData.build())
}
})
}
......
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