Commit fc24642f by 刘鹏

Merge branch 'd/v4.4.07' into feat/lp/lp_test_vip

# Conflicts:
#	build.gradle
#	m-user/src/main/java/com/yidianling/user/mine/MineFragment.kt
parents c775534c 25924372
/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 xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.audioim.api">
</manifest>
\ No newline at end of file
package com.ydl.audioim.api
import android.app.Activity
import android.content.Context
import com.alibaba.android.arouter.facade.template.IProvider
/**
* Created by Ykai on 2022/7/26.
*/
interface IAudioImService : IProvider{
/**
* YDLavManager初始化方法
*/
fun yDLAvManagerInit(context: Context, appId: String)
/**
* 获取rtm是否在线
*/
fun getIsOnlineRtm(): Boolean
/**
* rtm登录返回并登录状态
*/
fun loginRtm(userId:String?,event: (isSuccess: Boolean, msg: String?) -> Unit)
/**
* rtm登录
*/
fun loginRtm(userId:String?)
/**
* 拨打语音电话转axb弹窗
*/
fun openAxbDialog(activity: Activity?, type:Int, phoneNumber: String?)
/**
* 事件上报
*/
fun callEventSave(status: String, res: String, session: String?, line: String)
}
\ No newline at end of file
...@@ -18,7 +18,7 @@ public class ExpertInfoBean { ...@@ -18,7 +18,7 @@ public class ExpertInfoBean {
public String listenerIsOpen; public String listenerIsOpen;
public String listenOrderStatus; public String listenOrderStatus;
public String channelId; public String channelId;
public ExpertInfoBean.ListenRemainingTime remainingTime; public ListenRemainingTime remainingTime;
public String totalDuration; public String totalDuration;
public String commentUrl; public String commentUrl;
......
package com.ydl.audioim; package com.ydl.audioim.listener;
/** /**
* @author jiucheng * @author jiucheng
......
...@@ -38,7 +38,5 @@ interface IConfideService : IProvider { ...@@ -38,7 +38,5 @@ interface IConfideService : IProvider {
uid: String uid: String
) )
fun isOnlineRtm():Boolean
fun requestConfidePermission(activity: FragmentActivity, call: ((Boolean) -> Unit)?) fun requestConfidePermission(activity: FragmentActivity, call: ((Boolean) -> Unit)?)
} }
\ No newline at end of file
package com.ydl.confide.home.event package com.ydl.confide.event
data class ChangeAnotherExpertEvent( data class ChangeAnotherExpertEvent(
var doctorID: String, var doctorID: String,
var title: String, var title: String,
var uid: String, var uid: String,
var linkUrl: String var linkUrl: String
) )
\ No newline at end of file
class ConfideDialogEvent(val show: Int)
\ No newline at end of file
package com.ydl.confide.event
class ConfideDialogEvent(val show: Int)
\ No newline at end of file
...@@ -30,4 +30,6 @@ android { ...@@ -30,4 +30,6 @@ android {
dependencies { dependencies {
implementation "com.alibaba:arouter-api:$arouter_api" implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
compileOnly(project(":ydl-webview"))
} }
\ No newline at end of file
...@@ -4,9 +4,10 @@ import android.app.Activity ...@@ -4,9 +4,10 @@ import android.app.Activity
import android.content.Context import android.content.Context
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.template.IProvider import com.alibaba.android.arouter.facade.template.IProvider
import com.ydl.webview.H5JsBean
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.bean.GuideBean import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks import com.yidianling.consultant.bean.Keyworks
import com.yidianling.consultant.OnBottomWordListener
/** /**
* Created by xj on 2019/11/14. * Created by xj on 2019/11/14.
...@@ -51,4 +52,7 @@ interface IConsultantService: IProvider { ...@@ -51,4 +52,7 @@ interface IConsultantService: IProvider {
//获取底纹词 //获取底纹词
fun getbottomWord(type: Int, listener: OnBottomWordListener) fun getbottomWord(type: Int, listener: OnBottomWordListener)
// 预览资源
fun resourceToPreview(dataList: List<H5JsBean.MediaInfo>?, params: H5JsBean.H5JsCmd.Params, activity: Activity)
} }
\ No newline at end of file
package com.yidianling.im.event package com.yidianling.im.api.event
data class CloseBottomWebviewEvent( var close:Boolean) data class CloseBottomWebviewEvent( var close:Boolean)
\ No newline at end of file
...@@ -188,4 +188,6 @@ interface IImService : IProvider { ...@@ -188,4 +188,6 @@ interface IImService : IProvider {
fun showConsultServiceDialog(activity: Activity, toUid: String, doctorId: String) fun showConsultServiceDialog(activity: Activity, toUid: String, doctorId: String)
fun dismissConsultServiceDialog(); fun dismissConsultServiceDialog();
/**群聊*/
fun startTeamSession(activity: Activity, tid: String, doctorId: String)
} }
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.google.code.gson:gson:2.8.5"
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.js.api">
</manifest>
\ No newline at end of file
package com.ydl.js.api
import com.alibaba.android.arouter.facade.template.IProvider
interface IJsService : IProvider {
fun isH5Open(): Boolean
fun isMainOpen(): Boolean
fun setH5Open(open: Boolean)
fun setMainOpen(open: Boolean)
}
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.google.code.gson:gson:2.8.5"
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.muse.api">
</manifest>
\ No newline at end of file
package com.ydl.muse.api
import android.app.Activity
import com.alibaba.android.arouter.facade.template.IProvider
interface IMuseService : IProvider {
fun switchSound(activity: Activity,
mediaId: Int, meditationId: Long, meditationType: Int, businessType: Int,
buried: String?, mediaUrl: String?, mediaCoverUrl: String?,
title: String?, desc: String?, status: Int
)
}
\ No newline at end of file
...@@ -220,6 +220,8 @@ dependencies { ...@@ -220,6 +220,8 @@ dependencies {
implementation project(':m-fm') implementation project(':m-fm')
implementation project(":api:fm") implementation project(":api:fm")
implementation project(':ydl-tuicore') implementation project(':ydl-tuicore')
implementation project(':m-js')
implementation project(':api:js')
implementation rootProject.ext.dependencies["retrofit-url-manager"] implementation rootProject.ext.dependencies["retrofit-url-manager"]
......
package com.ydl.component.service;
import android.app.Activity;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.tencent.smtt.sdk.WebView;
import com.ydl.component.service.web.WVClickAbstractListener;
import com.ydl.component.service.web.WebJavascriptHandler;
import com.ydl.webview.IJavascriptHandler;
import com.ydl.webview.IWebService;
import com.ydl.webview.TellData;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Created by haorui on 2019-10-10.
* Des:
*/
@Route(path = "/web/webservice")
public class WebServiceImpl implements IWebService {
@Override
public void init(Context context) {
}
@NotNull
@Override
public IJavascriptHandler getJavascripHandler(@NotNull Activity activity, @Nullable WebView webView, @NotNull TellData tellData) {
return new WebJavascriptHandler(webView, new WVClickAbstractListener(activity));
}
}
/build
\ No newline at end of file
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.cxzapp.yidianling"
minSdk 21
targetSdk 28
versionCode 1
versionName "1.0"
flavorDimensions "versionCode"
ndk {
abiFilters "arm64-v8a"
}
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "e4b0d0bb7ef01053c93e25ba", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
XIAOMI_APPKEY : "MI-5241743243980",//小米平台注册的appkey
XIAOMI_APPID : "MI-2882303761517432980",//小米平台注册的appid
HUAWEI_APPID : "10444675",//华为平台注册的appid
OPPO_APPKEY : "OP-afk71f35VogGw0w0wKsookksc", // OPPO平台注册的appkey
OPPO_APPID : "OP-3245516", // OPPO平台注册的appid
OPPO_APPSECRET: "OP-691184F044acA7a6851F578451f67616",//OPPO平台注册的appsecret
VIVO_APPKEY : '67d79734-c9c5-4916-a6f4-ba2ef4df09a4',
VIVO_APPID : '14298',
MEIZU_APPKEY : "MZ-00d268d7228748479036f202d45b4ef2",//魅族平台注册的appkey
MEIZU_APPID : "MZ-120344",//魅族平台注册的appid
qqappid : "1105070461",
APPLICATIONID : rootProject.ext.ydl_app["applicationId"]
]
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/proguard/coroutines.pro'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
signingConfigs {
release {
storeFile file("../app/keystore.jks")
storePassword "123456"
keyAlias "ydl"
keyPassword "123456"
}
}
buildTypes {
debug{
signingConfig signingConfigs.release
}
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
signingConfigs {
release {
storeFile file("keystore.jks")
storePassword "123456"
keyAlias "ydl"
keyPassword "123456"
}
}
productFlavors {
ydl{}
xlzx{}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
repositories {
flatDir {
dirs 'aar'
}
}
dependencies {
implementation fileTree(dir: 'aar', include: ['*.aar'])
implementation(project(":ydl-flutter-base"))
implementation(project(":ydl-media"))
implementation(project(":ydl-net"))
implementation(project(":ydl-pay"))
implementation(project(":ydl-platform"))
implementation(project(":ydl-tuicore"))
implementation(project(":ydl-utils"))
implementation(project(":ydl-webview"))
implementation(project(":m-article"))
implementation(project(":m-audioim"))
implementation(project(":m-confide"))
implementation(project(":m-consultant"))
implementation(project(":m-course"))
implementation(project(":m-dynamic"))
implementation(project(":m-fm"))
implementation(project(":m-home"))
implementation(project(":m-im"))
implementation(project(":m-js"))
implementation(project(":m-muse"))
implementation(project(":m-tests"))
implementation(project(":m-user"))
implementation('com.ydl.debugkit:debugkit:1.0.0')
implementation('com.ydl.aar:heytap:3.0.0')
implementation "com.ydl.lib:smart_spa:0.0.4"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
implementation 'com.volcengine:apm_insight_crash:1.4.5'
implementation 'com.meituan.android.walle:library:1.1.5'
implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
// 权限库
implementation 'com.hjq:xxpermissions:10.2'
// 时间选择器
implementation 'com.contrarywind:Android-PickerView:4.1.9'
// sophix hotfix
implementation 'com.aliyun.ams:alicloud-android-hotfix:3.3.5'
implementation 'com.github.feeeei:CircleSeekbar:v1.1.2'
//====================极光推送====================
implementation 'cn.jiguang.sdk:jpush:4.6.4'
implementation 'cn.jiguang.sdk:jcore:3.2.4'
implementation 'cn.jiguang.sdk.plugin:oppo:4.6.4'
implementation 'cn.jiguang.sdk.plugin:vivo:4.6.4'
implementation 'cn.jiguang.sdk.plugin:meizu:4.6.4'
implementation 'cn.jiguang.sdk.plugin:huawei:4.6.4'
implementation 'cn.jiguang.sdk.plugin:meizu:4.6.4'
implementation 'cn.jiguang.sdk.plugin:xiaomi:4.6.4'
implementation 'com.huawei.hms:push:5.3.0.304'
//====================云信基础库====================
implementation 'com.ydl:nim-base:1.1.0.7'
implementation 'com.netease.nimlib:basesdk:9.1.1'
implementation 'com.netease.nimlib:avchat:9.1.1'
implementation 'com.netease.nimlib:nrtc:9.1.1'
//OPPO推送需要单独引入
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'commons-codec:commons-codec:1.6'
implementation 'androidx.annotation:annotation:1.1.0'
//====================YDL 功能库====================
implementation "com.ydl.aar:resource:0.0.1-ydl"
}
\ 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.cxzapp.yidianling">
</manifest>
\ No newline at end of file
...@@ -14,7 +14,7 @@ buildscript { ...@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3' ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2' constrait_support_version = '1.0.2'
componentVersion = "0.3.0.12-lp" componentVersion = "0.3.0.12"
} }
repositories { repositories {
mavenCentral() mavenCentral()
......
...@@ -167,7 +167,7 @@ ext { ...@@ -167,7 +167,7 @@ ext {
"ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar", "ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar",
"ydl-device" : "com.ydl:device-id:0.0.31", "ydl-device" : "com.ydl:device-id:0.0.31",
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块 //flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.51@aar", //flutter aar "ydl-flutter" : "com.ydl:ydl-flutter:0.0.56@aar", //flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar // "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
] ]
......
...@@ -75,4 +75,5 @@ dependencies { ...@@ -75,4 +75,5 @@ dependencies {
api project(':ydl-webview') api project(':ydl-webview')
implementation project(":api:user") implementation project(":api:user")
implementation project(":api:im") implementation project(":api:im")
implementation project(":api:audioim")
} }
...@@ -32,6 +32,7 @@ import com.ydl.audioim.http.command.ConnectCommand ...@@ -32,6 +32,7 @@ import com.ydl.audioim.http.command.ConnectCommand
import com.ydl.audioim.http.command.ConnectExceptionCommand import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.http.command.NoticePushCommand import com.ydl.audioim.http.command.NoticePushCommand
import com.ydl.audioim.http.command.PayLoad import com.ydl.audioim.http.command.PayLoad
import com.ydl.audioim.listener.IntentConstants
import com.ydl.audioim.player.AudioPlayer import com.ydl.audioim.player.AudioPlayer
import com.ydl.audioim.presenter.AudioHomePresenterImpl import com.ydl.audioim.presenter.AudioHomePresenterImpl
import com.ydl.audioim.router.AudioImIn import com.ydl.audioim.router.AudioImIn
......
...@@ -398,7 +398,7 @@ class YDLavManager { ...@@ -398,7 +398,7 @@ class YDLavManager {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun login(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) { fun login(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
if (TextUtils.isEmpty(userId) || userId ?: "0" <= "0") { if (TextUtils.isEmpty(userId) || (userId ?: "0") <= "0") {
//如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录 //如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录
LogUtil.e("[agora]login-uid:$userId") LogUtil.e("[agora]login-uid:$userId")
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
......
package com.ydl.audioim.modular
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.net.Uri
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.audioim.YDLavManager
import com.ydl.audioim.api.IAudioImService
import com.ydl.audioim.widget.AxbConfirmDialog
/**
* Created by Ykai on 2022/7/26.
*/
@Route(path = "/audioim/AudioImService")
class AudioImServiceImp : IAudioImService {
override fun yDLAvManagerInit(context: Context, appId: String) {
YDLavManager.instances.init(context, appId)
}
override fun getIsOnlineRtm(): Boolean {
return YDLavManager.isOnlineRtm
}
override fun loginRtm(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
YDLavManager.instances.login(userId, event)
}
override fun loginRtm(userId: String?) {
YDLavManager.instances.login(userId)
}
override fun openAxbDialog(activity: Activity?, type: Int, phoneNumber: String?) {
val dialog = AxbConfirmDialog(activity, type, object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() {
phoneNumber?.let {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:$phoneNumber"))
activity?.startActivity(phoneIntent)
}
}
override fun onClose() {
}
})
dialog.show()
}
override fun callEventSave(status: String, res: String, session: String?, line: String) {
YDLavManager.instances.callEventSave(status, res, session, line)
}
override fun init(context: Context?) {
}
}
\ No newline at end of file
# 声网module
\ No newline at end of file
...@@ -71,10 +71,10 @@ dependencies { ...@@ -71,10 +71,10 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
api project(':ydl-media') api project(':ydl-media')
api project(':ydl-platform') api project(':ydl-platform')
api project(':m-audioim')
api project(":ydl-pay") api project(":ydl-pay")
api project(':ydl-webview') api project(':ydl-webview')
api project(':ydl-utils') api project(':ydl-utils')
implementation project(":api:audioim")
implementation project(":api:im") implementation project(":api:im")
implementation project(":api:user") implementation project(":api:user")
implementation project(":api:consultant") implementation project(":api:consultant")
......
...@@ -27,8 +27,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment ...@@ -27,8 +27,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.tencent.smtt.export.external.interfaces.JsResult import com.tencent.smtt.export.external.interfaces.JsResult
import com.tencent.smtt.sdk.* import com.tencent.smtt.sdk.*
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.event.ChangeAnotherExpertEvent import com.ydl.confide.event.ConfideDialogEvent
import com.ydl.confide.home.event.ConfideDialogEvent import com.ydl.confide.event.ChangeAnotherExpertEvent
import com.ydl.confide.home.http.ConfideHomeApi import com.ydl.confide.home.http.ConfideHomeApi
import com.ydl.confide.router.PhoneCallIn import com.ydl.confide.router.PhoneCallIn
import com.ydl.utils.WebUrlParamsUtils import com.ydl.utils.WebUrlParamsUtils
...@@ -54,7 +54,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers ...@@ -54,7 +54,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import java.io.UnsupportedEncodingException import java.io.UnsupportedEncodingException
import java.net.URLDecoder import java.net.URLDecoder
import java.util.*
import kotlin.math.roundToInt import kotlin.math.roundToInt
class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
...@@ -97,6 +96,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -97,6 +96,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
var shouldShow: Boolean? = false var shouldShow: Boolean? = false
var uid: String? = null var uid: String? = null
var listen_free: Boolean = false var listen_free: Boolean = false
private var hasOnResume = false
fun showBottomSheetDialog( fun showBottomSheetDialog(
activity: FragmentActivity, activity: FragmentActivity,
jumpUrl: String, jumpUrl: String,
...@@ -367,6 +367,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -367,6 +367,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
fun onEventMainThread(event: ConfideDialogEvent) { fun onEventMainThread(event: ConfideDialogEvent) {
if(!hasOnResume) return
// 第一位表示拨打按钮,第二位代表再换一位按钮 // 第一位表示拨打按钮,第二位代表再换一位按钮
val show = event.show val show = event.show
// if (show == 0) { // if (show == 0) {
...@@ -568,8 +569,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -568,8 +569,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
return false return false
} }
override fun onPause() {
super.onPause()
hasOnResume = false
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
hasOnResume = true
if (doctorId.isNotBlank() && layoutCall.visibility == View.VISIBLE) { if (doctorId.isNotBlank() && layoutCall.visibility == View.VISIBLE) {
onLoadDialStatus(doctorId) onLoadDialStatus(doctorId)
} }
......
...@@ -24,7 +24,7 @@ import com.facebook.drawee.backends.pipeline.Fresco ...@@ -24,7 +24,7 @@ import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController import com.facebook.drawee.interfaces.DraweeController
import com.jcodecraeer.xrecyclerview.ProgressStyle import com.jcodecraeer.xrecyclerview.ProgressStyle
import com.jcodecraeer.xrecyclerview.XRecyclerView import com.jcodecraeer.xrecyclerview.XRecyclerView
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.home.adapter.ConfideHomeAdapter import com.ydl.confide.home.adapter.ConfideHomeAdapter
...@@ -248,10 +248,8 @@ class ConfideHomeActivity : ...@@ -248,10 +248,8 @@ class ConfideHomeActivity :
} }
if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) { if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) {
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
YDLavManager.instances.login( findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { _: Boolean, _ ->
PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ ->
showPayOrDetail(confidedId, doctorId) showPayOrDetail(confidedId, doctorId)
} }
} else { } else {
......
...@@ -4,14 +4,12 @@ import android.app.Activity ...@@ -4,14 +4,12 @@ import android.app.Activity
import android.app.Application import android.app.Application
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri
import android.text.TextUtils import android.text.TextUtils
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.confide.api.IConfideService import com.ydl.confide.api.IConfideService
import com.ydl.confide.home.ConfideBottomSheetDialogFragment import com.ydl.confide.home.ConfideBottomSheetDialogFragment
import com.ydl.confide.home.ConfideHomeActivity import com.ydl.confide.home.ConfideHomeActivity
...@@ -20,6 +18,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse ...@@ -20,6 +18,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.webview.TellData import com.ydl.webview.TellData
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
/** /**
...@@ -73,7 +72,7 @@ class ConfdieServiceImpl : IConfideService { ...@@ -73,7 +72,7 @@ class ConfdieServiceImpl : IConfideService {
override fun ydlAvManagerLogin(uid: String?) { override fun ydlAvManagerLogin(uid: String?) {
YDLavManager.instances.login(uid) findRouteService(IAudioImService::class.java).loginRtm(uid)
} }
override fun startCondifeHomePage(context: Context, isSplash: Boolean) { override fun startCondifeHomePage(context: Context, isSplash: Boolean) {
...@@ -91,17 +90,17 @@ class ConfdieServiceImpl : IConfideService { ...@@ -91,17 +90,17 @@ class ConfdieServiceImpl : IConfideService {
//debug包根据url判断使用正式或者测试key //debug包根据url判断使用正式或者测试key
val cacheAppEnv = YDLCacheUtils.getCacheApi() val cacheAppEnv = YDLCacheUtils.getCacheApi()
if (!TextUtils.isEmpty(cacheAppEnv)) { avManagerKey = if (!TextUtils.isEmpty(cacheAppEnv)) {
if (YDLConstants.ENV_TEST == cacheAppEnv) { if (YDLConstants.ENV_TEST == cacheAppEnv) {
avManagerKey = "13b1536698f64905a1e7e5bb978ba821" "13b1536698f64905a1e7e5bb978ba821"
} else { } else {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" "3387e9b251f3491e9221a9877e8f7830"
} }
} else { } else {
if (YDLConstants.ENV_TEST == appEnv || YDLConstants.ENV_AUTO_TEST == appEnv) { if (YDLConstants.ENV_TEST == appEnv || YDLConstants.ENV_AUTO_TEST == appEnv) {
avManagerKey = "13b1536698f64905a1e7e5bb978ba821" "13b1536698f64905a1e7e5bb978ba821"
} else { } else {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" "3387e9b251f3491e9221a9877e8f7830"
} }
} }
} else { } else {
...@@ -109,27 +108,11 @@ class ConfdieServiceImpl : IConfideService { ...@@ -109,27 +108,11 @@ class ConfdieServiceImpl : IConfideService {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" avManagerKey = "3387e9b251f3491e9221a9877e8f7830"
} }
YDLavManager.instances.init(app, avManagerKey) findRouteService(IAudioImService::class.java).yDLAvManagerInit(app, avManagerKey)
}
override fun isOnlineRtm(): Boolean {
return YDLavManager.isOnlineRtm
} }
override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) { override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) {
val dialog = AxbConfirmDialog(activity, type, object : AxbConfirmDialog.OnClickEnsureListener { findRouteService(IAudioImService::class.java).openAxbDialog(activity, type, phoneNumber)
override fun onClickEnsure() {
phoneNumber?.let {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber!!))
activity?.startActivity(phoneIntent)
}
}
override fun onClose() {
}
})
dialog.show()
} }
override fun closePlayer() { override fun closePlayer() {
......
...@@ -3,15 +3,12 @@ package com.ydl.confide.home.modular.service ...@@ -3,15 +3,12 @@ package com.ydl.confide.home.modular.service
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent
import android.net.Uri
import android.text.TextUtils import android.text.TextUtils
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.audioim.IntentConstants import com.ydl.audioim.api.IAudioImService
import com.ydl.audioim.YDLavManager
import com.ydl.audioim.bean.ExpertInfoBean import com.ydl.audioim.bean.ExpertInfoBean
import com.ydl.audioim.widget.AxbConfirmDialog import com.ydl.audioim.listener.IntentConstants
import com.ydl.confide.home.ConfidePermissionDialog import com.ydl.confide.home.ConfidePermissionDialog
import com.ydl.confide.home.bean.ConfideConnectResponse import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.confide.home.bean.ConnectParamJava import com.ydl.confide.home.bean.ConnectParamJava
...@@ -109,7 +106,7 @@ class ConfideWebServiceImpl { ...@@ -109,7 +106,7 @@ class ConfideWebServiceImpl {
data: ConfideConnectResponse? data: ConfideConnectResponse?
) { ) {
val expertInfo = data?.dialDetail?.agoraExpertInfo ?: return val expertInfo = data?.dialDetail?.agoraExpertInfo ?: return
if (!YDLavManager.isOnlineRtm) { // 判断如果账号在其它设备登录rtm是否在线 if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) { // 判断如果账号在其它设备登录rtm是否在线
ToastUtil.toastShort("网络通话错误代码001") ToastUtil.toastShort("网络通话错误代码001")
return return
} }
...@@ -128,21 +125,9 @@ class ConfideWebServiceImpl { ...@@ -128,21 +125,9 @@ class ConfideWebServiceImpl {
* axb 通话 * axb 通话
* */ * */
fun axb(activity: Activity, phone: String?) { fun axb(activity: Activity, phone: String?) {
if (phone.isNullOrEmpty()) return if (phone.isNullOrEmpty())
val dialog = AxbConfirmDialog( return
activity, findRouteService(IAudioImService::class.java).openAxbDialog(activity,1,phone)
1,
object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:${phone}"))
activity.startActivity(phoneIntent)
}
override fun onClose() {
}
})
dialog.show()
} }
//java版axb和声网接口 //java版axb和声网接口
...@@ -154,8 +139,8 @@ class ConfideWebServiceImpl { ...@@ -154,8 +139,8 @@ class ConfideWebServiceImpl {
tellData: TellData?, tellData: TellData?,
callType: String? callType: String?
) { ) {
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
YDLavManager.instances.login(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ -> findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) { if (isSuccess) {
toDial(id, type, callType, activity, tellData) toDial(id, type, callType, activity, tellData)
} else { } else {
...@@ -340,7 +325,7 @@ class ConfideWebServiceImpl { ...@@ -340,7 +325,7 @@ class ConfideWebServiceImpl {
expertInfo.remainingTime = expertInfo.remainingTime =
ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration); ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration);
} }
YDLavManager.instances.callEventSave("10", "用户点击拨打", expertInfo.channelId, "7") findRouteService(IAudioImService::class.java).callEventSave("10", "用户点击拨打", expertInfo.channelId, "7")
Loading.close() Loading.close()
ARouter.getInstance().build("/av/AudioHomeActivity") ARouter.getInstance().build("/av/AudioHomeActivity")
.withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl) .withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl)
......
...@@ -398,8 +398,10 @@ class ConfideHomeUtils { ...@@ -398,8 +398,10 @@ class ConfideHomeUtils {
} }
} }
} else { } else {
for (bodyItem in item.body!!) { if (item.body != null) {
bodyItem.confideIsPlay = false for (bodyItem in item.body) {
bodyItem.confideIsPlay = false
}
} }
} }
} }
......
...@@ -16,7 +16,7 @@ import com.alibaba.android.arouter.launcher.ARouter ...@@ -16,7 +16,7 @@ import com.alibaba.android.arouter.launcher.ARouter
import com.dou361.ijkplayer.widget.IjkVideoView import com.dou361.ijkplayer.widget.IjkVideoView
import com.facebook.drawee.backends.pipeline.Fresco import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController import com.facebook.drawee.interfaces.DraweeController
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemExpertIntroBinding import com.ydl.confide.databinding.ItemExpertIntroBinding
...@@ -36,7 +36,6 @@ import io.reactivex.Observable ...@@ -36,7 +36,6 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.confide_home_activity.*
import tv.danmaku.ijk.media.player.IjkMediaPlayer import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.io.UnsupportedEncodingException import java.io.UnsupportedEncodingException
import java.net.URLDecoder import java.net.URLDecoder
...@@ -123,8 +122,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -123,8 +122,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
} }
else -> { else -> {
if (!item.confideId.isNullOrBlank()) { if (!item.confideId.isNullOrBlank()) {
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
YDLavManager.instances.login( findRouteService(IAudioImService::class.java).loginRtm(
PhoneCallIn.getUserService().getUserInfo()?.uid PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ -> ) { _: Boolean, _ ->
showPayOrDetail(item, it) showPayOrDetail(item, it)
......
...@@ -72,7 +72,6 @@ import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.* ...@@ -72,7 +72,6 @@ import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject import org.json.JSONObject
import java.util.concurrent.Executors import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import kotlin.collections.ArrayList
@Route(path = "/consultant/consultant") @Route(path = "/consultant/consultant")
class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(), class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(),
...@@ -1485,20 +1484,20 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1485,20 +1484,20 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
needRefresh = true needRefresh = true
} }
// val orderToPayTime = SharedPreferencesEditor.getString("orderToPayTime") val orderToPayTime = SharedPreferencesEditor.getString("orderToPayTime")
//
// var timeLimit = if (TextUtils.isEmpty(orderToPayTime)) { val timeLimit = if (TextUtils.isEmpty(orderToPayTime)) {
// 0L 0L
// } else { } else {
// orderToPayTime.toLong() orderToPayTime.toLong()
// } }
//
//
// if (isShow && !(consultSubPayDialog != null && consultSubPayDialog?.isShowing == true)) { if (isShow && !(consultSubPayDialog != null && consultSubPayDialog?.isShowing == true)) {
// if (findRouteService(IUserService::class.java).isLogin() && System.currentTimeMillis() > timeLimit) { if (findRouteService(IUserService::class.java).isLogin() && System.currentTimeMillis() > timeLimit) {
// getPresenter().fetchPromptPayment() getPresenter().fetchPromptPayment()
// } }
// } }
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT) ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT)
ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit", "6") ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit", "6")
......
...@@ -60,7 +60,8 @@ class ConsultSubPayDialog( ...@@ -60,7 +60,8 @@ class ConsultSubPayDialog(
findViewById<TextView>(R.id.priceTv).text = "¥$price" findViewById<TextView>(R.id.priceTv).text = "¥$price"
var format = SimpleDateFormat("HH:mm:ss"); var format = SimpleDateFormat("HH:mm:ss");
format.timeZone = TimeZone.getTimeZone("GMT+0"); format.timeZone = TimeZone.getTimeZone("GMT+0");
var millisInFuture = promptPaymentBean.currentTime?:0 - (promptPaymentBean.toPayTime?:0L) var millisInFuture =
promptPaymentBean.toPayTime?.minus(promptPaymentBean.currentTime ?: 0) ?: 0
mTimer = CountDownTimerSupport(millisInFuture, 1000) mTimer = CountDownTimerSupport(millisInFuture, 1000)
mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener { mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
...@@ -69,7 +70,8 @@ class ConsultSubPayDialog( ...@@ -69,7 +70,8 @@ class ConsultSubPayDialog(
} }
override fun onFinish() { override fun onFinish() {
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000 var nextShowTime =
System.currentTimeMillis() + ((promptPaymentBean.orderToPayTime ?: 1) * 1000)
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString()) SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
dismiss() dismiss()
} }
...@@ -80,7 +82,8 @@ class ConsultSubPayDialog( ...@@ -80,7 +82,8 @@ class ConsultSubPayDialog(
}) })
mTimer?.start() mTimer?.start()
findViewById<TextView>(R.id.tv_close).setOnClickListener { findViewById<TextView>(R.id.tv_close).setOnClickListener {
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000 var nextShowTime =
System.currentTimeMillis() + ((promptPaymentBean.orderToPayTime ?: 1) * 1000)
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString()) SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
mTimer?.stop() mTimer?.stop()
dismiss() dismiss()
...@@ -96,7 +99,8 @@ class ConsultSubPayDialog( ...@@ -96,7 +99,8 @@ class ConsultSubPayDialog(
ToastUtil.toastShort("跳转失败") ToastUtil.toastShort("跳转失败")
dismiss() dismiss()
} }
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000 var nextShowTime =
System.currentTimeMillis() + ((promptPaymentBean.orderToPayTime ?: 1) * 1000)
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString()) SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
} }
} }
......
...@@ -4,25 +4,30 @@ import android.annotation.SuppressLint ...@@ -4,25 +4,30 @@ import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import androidx.fragment.app.Fragment import android.graphics.Rect
import android.text.TextUtils import android.text.TextUtils
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ScreenUtils
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.ydl.webview.H5JsBean
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.consultant.ExpertSearchActivity import com.yidianling.consultant.ExpertSearchActivity
import com.yidianling.consultant.ExpertSearchFragment import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.api.IConsultantService import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.GuideBean import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks import com.yidianling.consultant.bean.Keyworks
import com.yidianling.consultant.data.ConsultantDataManager import com.yidianling.consultant.data.ConsultantDataManager
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.model.SearchApi import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
import com.yidianling.consultant.preview.GPreviewBuilder
import com.yidianling.consultant.preview.UserViewInfo
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
...@@ -149,6 +154,32 @@ class ConsultantServiceImp : IConsultantService { ...@@ -149,6 +154,32 @@ class ConsultantServiceImp : IConsultantService {
}) })
} }
override fun resourceToPreview(dataList: List<H5JsBean.MediaInfo>?, params: H5JsBean.H5JsCmd.Params, activity: Activity) {
val mThumbViewInfoList: MutableList<UserViewInfo> = ArrayList()
dataList?.let {
for (mediaInfo in it) {
val userViewInfo =
UserViewInfo(mediaInfo.cover, mediaInfo.url, mediaInfo.sourcesType)
val bounds = Rect()
bounds.left = ScreenUtils.getScreenWidth() / 2
bounds.top = ScreenUtils.getScreenHeight() / 2
bounds.right = ScreenUtils.getScreenWidth() / 2
bounds.bottom = ScreenUtils.getScreenHeight() / 2
userViewInfo.bounds = bounds
mThumbViewInfoList.add(userViewInfo)
}
GPreviewBuilder.form(activity)
.setData(mThumbViewInfoList)
.setCurrentIndex(params.preview_index)
.setFullscreen(true)
.setToUid(params.info?.toUid.toString() + "")
.setDoctorId(params.info?.doctorId)
.setType(GPreviewBuilder.IndicatorType.Dot)
.start()
}
}
override fun resetConsultAssistantDialogStatus() { override fun resetConsultAssistantDialogStatus() {
ConsultAssistantDialogUtils.INSTANCE.resetStatus() ConsultAssistantDialogUtils.INSTANCE.resetStatus()
} }
......
...@@ -150,7 +150,6 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -150,7 +150,6 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
var id: String? = "0" var id: String? = "0"
trendsDatas?.let { trendsDatas -> trendsDatas?.let { trendsDatas ->
if (trendsDatas.size > 0) { if (trendsDatas.size > 0) {
LogUtil.i("TAG get last content: " + trendsDatas[trendsDatas.size].toString())
id = trendsDatas[trendsDatas.size - 1].id id = trendsDatas[trendsDatas.size - 1].id
return if (id == null || id == "") { return if (id == null || id == "") {
0 0
......
package com.yidianling.home
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.yidianling.home.test", appContext.packageName)
}
}
...@@ -1048,6 +1048,9 @@ ...@@ -1048,6 +1048,9 @@
"type": 10004 "type": 10004
}, },
{ {
"type": 10005
},
{
"courseBean": { "courseBean": {
"pageNum": 1, "pageNum": 1,
"pageSize": 3, "pageSize": 3,
...@@ -1303,7 +1306,7 @@ ...@@ -1303,7 +1306,7 @@
} }
] ]
}, },
"type": 10005 "type": 10006
}, },
{ {
"askBean": { "askBean": {
...@@ -5568,8 +5571,9 @@ ...@@ -5568,8 +5571,9 @@
} }
] ]
}, },
"type": 10006 "type": 10007
}, },
{ "type": 1000101},
{ {
"articleBean": { "articleBean": {
"list": [ "list": [
...@@ -5740,9 +5744,9 @@ ...@@ -5740,9 +5744,9 @@
} }
] ]
}, },
"type": 10007 "type": 10008
}, },
{ {
"type": 10008 "type": 10009
} }
] ]
\ No newline at end of file
...@@ -21,7 +21,6 @@ import com.yidianling.home.R ...@@ -21,7 +21,6 @@ import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.model.bean.MeditationModuleBean import com.yidianling.home.model.bean.MeditationModuleBean
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.ydl.home_fragment.*
class MeditationTypeAdapter( class MeditationTypeAdapter(
private val context: Context, private val context: Context,
......
...@@ -102,4 +102,7 @@ class HomeBaseHttp { ...@@ -102,4 +102,7 @@ class HomeBaseHttp {
return RxUtils.mapObservable(cmd).flatMap { getHomePagerApi().askFocus(it) } return RxUtils.mapObservable(cmd).flatMap { getHomePagerApi().askFocus(it) }
} }
fun getMeditationInfo(): Observable<BaseAPIResponse<MeditationModuleBean>> {
return getHomePagerApi().getMeditation()
}
} }
\ No newline at end of file
...@@ -111,5 +111,8 @@ interface HomeBasePagerApi { ...@@ -111,5 +111,8 @@ interface HomeBasePagerApi {
@POST("sq-active/focus") @POST("sq-active/focus")
fun askFocus(@FieldMap params: Map<String, String>): Observable<BaseResponse<AskResultBean>> fun askFocus(@FieldMap params: Map<String, String>): Observable<BaseResponse<AskResultBean>>
@GET("cms/meditation/index")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getMeditation(): Observable<BaseAPIResponse<MeditationModuleBean>>
} }
\ No newline at end of file
package com.yidianling.home.ui.view package com.yidianling.home.view
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import com.yidianling.home.R import com.yidianling.home.R
import kotlinx.android.synthetic.ydl.home_common_title_view.view.* import kotlinx.android.synthetic.main.home_common_title_view.view.*
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
......
package com.yidianling.home.ui.view package com.yidianling.home.view
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
...@@ -21,10 +21,8 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils ...@@ -21,10 +21,8 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.adapter.MeditationViewPagerAdapter import com.yidianling.home.adapter.MeditationViewPagerAdapter
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.constract.HomeViewConfig
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.MeditationModuleBean import com.yidianling.home.model.bean.MeditationModuleBean
import kotlinx.android.synthetic.ydl.home_muse_view.view.* import kotlinx.android.synthetic.main.home_muse_view.view.*
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...@@ -33,7 +31,7 @@ import kotlinx.android.synthetic.ydl.home_muse_view.view.* ...@@ -33,7 +31,7 @@ import kotlinx.android.synthetic.ydl.home_muse_view.view.*
* @Company 壹点灵 * @Company 壹点灵
* @date 2019/09/10 * @date 2019/09/10
*/ */
class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEvent?) : class HomeMuseView(private val mContext: Context) :
LinearLayout(mContext) { LinearLayout(mContext) {
private val meditationTitles = mutableListOf<String>() private val meditationTitles = mutableListOf<String>()
...@@ -51,7 +49,7 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv ...@@ -51,7 +49,7 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
) )
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.home_muse_view, this) View.inflate(mContext, R.layout.home_muse_view, this)
homeModuleMuseViewHomeCommonTitleView.setTitle(HomeViewConfig.getOrder().museTitle) homeModuleMuseViewHomeCommonTitleView.setTitle("助眠·冥想")
} }
fun initData(bean: MeditationModuleBean?) { fun initData(bean: MeditationModuleBean?) {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
android:orientation="vertical" android:orientation="vertical"
tools:parentTag="android.widget.LinearLayout"> tools:parentTag="android.widget.LinearLayout">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleMuseViewHomeCommonTitleView" android:id="@+id/homeModuleMuseViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white_60">#99FFFFFF</color>
</resources>
...@@ -10,7 +10,14 @@ ...@@ -10,7 +10,14 @@
<item name="colorPrimaryDark">@color/platform_main_theme</item> <item name="colorPrimaryDark">@color/platform_main_theme</item>
<item name="colorAccent">@color/platform_main_theme</item> <item name="colorAccent">@color/platform_main_theme</item>
</style> </style>
<style name="MeditationTabLayoutStyle" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">@color/white</item>
<item name="tabIndicatorHeight">2dp</item>
<item name="tabIndicatorFullWidth">false</item>
<item name="tabSelectedTextColor">@color/white</item>
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/white_60</item>
</style>
</resources> </resources>
\ No newline at end of file
package com.yidianling.home
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
package com.yidianling.home.adapter package com.yidianling.home.adapter
import android.content.Context import android.content.Context
import android.graphics.Color
import android.media.MediaPlayer
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.constract.YdlHomeViewHolderConstract import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.home.event.HomeImpl import com.yidianling.home.event.HomeImpl
...@@ -17,6 +17,8 @@ import com.yidianling.home.model.bean.HomeConfideBean ...@@ -17,6 +17,8 @@ import com.yidianling.home.model.bean.HomeConfideBean
import com.yidianling.home.model.bean.HomeConsultBean import com.yidianling.home.model.bean.HomeConsultBean
import com.yidianling.home.model.bean.HomePagerDataBean import com.yidianling.home.model.bean.HomePagerDataBean
import com.yidianling.home.ui.view.* import com.yidianling.home.ui.view.*
import com.yidianling.home.view.HomeMuseView
import kotlinx.android.synthetic.main.home_muse_view.view.*
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...@@ -126,6 +128,11 @@ class YdlHomeAdapter( ...@@ -126,6 +128,11 @@ class YdlHomeAdapter(
YdlHomeViewHolderConstract.ASSUAGE_GRIEF_VIEW -> { YdlHomeViewHolderConstract.ASSUAGE_GRIEF_VIEW -> {
return HomeAssuageGriefViewHolder(HomeAssuageGriefView(mContext, homeEvent)) return HomeAssuageGriefViewHolder(HomeAssuageGriefView(mContext, homeEvent))
} }
//壹点*冥想模块
YdlHomeViewHolderConstract.MUSE_VIEW -> {
return HomeMuseViewHolder(HomeMuseView(mContext))
}
//文章*阅读模块 //文章*阅读模块
YdlHomeViewHolderConstract.ARTICLE_VIEW -> { YdlHomeViewHolderConstract.ARTICLE_VIEW -> {
return HomeArticleViewHolder(HomeArticleView(mContext, homeEvent)) return HomeArticleViewHolder(HomeArticleView(mContext, homeEvent))
...@@ -157,21 +164,6 @@ class YdlHomeAdapter( ...@@ -157,21 +164,6 @@ class YdlHomeAdapter(
list[position].headerBean?.askCategoryData list[position].headerBean?.askCategoryData
) )
} }
//倾诉*排解模块
// is HomeConfideViewHolder -> {
// if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
// val parm = holder.itemView.layoutParams
// parm.height = 0
// holder.itemView.layoutParams = parm
// } else {
// holder.confideViewView.setTitle(
// list[position].headerBean?.listenCategoryDate,
// confideSelectPosition
// )
// holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body)
// confidePosition = position
// }
// }
//课程*成长模块 //课程*成长模块
is HomeCourseViewHolder -> { is HomeCourseViewHolder -> {
holder.courseViewView.initData(list[position].courseBean?.list) holder.courseViewView.initData(list[position].courseBean?.list)
...@@ -202,6 +194,17 @@ class YdlHomeAdapter( ...@@ -202,6 +194,17 @@ class YdlHomeAdapter(
is HomeTestViewHolder -> { is HomeTestViewHolder -> {
holder.testView.initData(list[position].testListBean) holder.testView.initData(list[position].testListBean)
} }
is HomeMuseViewHolder -> {
holder.museViewView.video_view?.setOnInfoListener { mp, what, extra ->
if (what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {
holder.museViewView.video_view?.setBackgroundColor(Color.TRANSPARENT)
}
true
}
holder.museViewView.video_view?.start()
holder.museViewView.initData(list[position].meditationBean)
}
} }
} }
...@@ -255,6 +258,10 @@ class YdlHomeAdapter( ...@@ -255,6 +258,10 @@ class YdlHomeAdapter(
*/ */
inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) : inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) :
RecyclerView.ViewHolder(articleViewView) RecyclerView.ViewHolder(articleViewView)
/**
* 解忧*问答模块 ViewHolder
*/
inner class HomeMuseViewHolder(val museViewView: HomeMuseView) : RecyclerView.ViewHolder(museViewView)
/** /**
* 底部提示语模块 ViewHolder * 底部提示语模块 ViewHolder
......
...@@ -62,6 +62,6 @@ class IHomeContract { ...@@ -62,6 +62,6 @@ class IHomeContract {
*/ */
fun getCoupons(uid: String): Observable<BaseResponse<List<CouponBean>>> fun getCoupons(uid: String): Observable<BaseResponse<List<CouponBean>>>
fun getMeditation(): Observable<MeditationModuleBean>
} }
} }
\ No newline at end of file
...@@ -29,26 +29,32 @@ class YdlHomeViewHolderConstract { ...@@ -29,26 +29,32 @@ class YdlHomeViewHolderConstract {
* 测试模块 * 测试模块
*/ */
val TEST_VIEW = 10004 val TEST_VIEW = 10004
/**
* 冥想模块
*/
val MUSE_VIEW = 10005
/** /**
* 课程*成长模块 * 课程*成长模块
*/ */
val COURSE_VIEW = 10005 val COURSE_VIEW = 10006
/** /**
* 解忧*问答模块 * 解忧*问答模块
*/ */
val ASSUAGE_GRIEF_VIEW = 10006 val ASSUAGE_GRIEF_VIEW = 10007
/** /**
* 文章*阅读模块 * 文章*阅读模块
*/ */
val ARTICLE_VIEW = 10007 val ARTICLE_VIEW = 10008
/** /**
* 底部提示语模块 * 底部提示语模块
*/ */
val FOOTER_VIEW = 10008 val FOOTER_VIEW = 10009
/** /**
* 倾诉*排解模块 * 倾诉*排解模块
*/ */
val CONFIDE_VIEW = 1000100 val CONFIDE_VIEW = 1000100
} }
} }
\ No newline at end of file
...@@ -2,9 +2,13 @@ package com.yidianling.home.model ...@@ -2,9 +2,13 @@ package com.yidianling.home.model
import com.yidianling.home.http.HomeHttp import com.yidianling.home.http.HomeHttp
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.home.constract.IHomeContract import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.http.HomeBaseHttp
import com.yidianling.home.model.bean.* import com.yidianling.home.model.bean.*
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...@@ -26,5 +30,9 @@ class HomeModelImpl: BaseHomeModelImpl(), IHomeContract.Model { ...@@ -26,5 +30,9 @@ class HomeModelImpl: BaseHomeModelImpl(), IHomeContract.Model {
return HomeHttp.getInstance().getCoupons(uid) return HomeHttp.getInstance().getCoupons(uid)
} }
override fun getMeditation(): Observable<MeditationModuleBean> {
return HomeBaseHttp.getInstance().getMeditationInfo().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { MeditationModuleBean(true) }
}
} }
\ No newline at end of file
...@@ -145,10 +145,15 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -145,10 +145,15 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
if (dataBean.isRealEmpty || dataBean !is HomeAskBean) homeTempData.askBean else dataBean if (dataBean.isRealEmpty || dataBean !is HomeAskBean) homeTempData.askBean else dataBean
mHomeAskBean = item.askBean mHomeAskBean = item.askBean
} }
YdlHomeViewHolderConstract.MUSE_VIEW -> {
item.meditationBean =
if (dataBean.isRealEmpty || dataBean !is MeditationModuleBean) homeTempData.meditationBean else dataBean
}
YdlHomeViewHolderConstract.ARTICLE_VIEW -> { YdlHomeViewHolderConstract.ARTICLE_VIEW -> {
item.articleBean = item.articleBean =
if (dataBean.isRealEmpty || dataBean !is HomeArticleBean) homeTempData.articleBean else dataBean if (dataBean.isRealEmpty || dataBean !is HomeArticleBean) homeTempData.articleBean else dataBean
} }
} }
return item return item
} }
...@@ -220,6 +225,11 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -220,6 +225,11 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
) )
) )
}, },
mModel.getMeditation()
.compose(RxUtils.applySchedulers(mView)).map {
//首页问答数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.MUSE_VIEW))
},
mModel.askRequest() mModel.askRequest()
.compose(RxUtils.applySchedulers(mView)).map { .compose(RxUtils.applySchedulers(mView)).map {
//首页问答数据 //首页问答数据
...@@ -243,7 +253,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -243,7 +253,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
mView.homeDataFail(msg) mView.homeDataFail(msg)
} }
}, Action { }, Action {
if (homeList.size != 9){ if (homeList.size != 10){
mView.homeDataFail("") mView.homeDataFail("")
return@Action return@Action
} }
......
...@@ -346,23 +346,10 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -346,23 +346,10 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
override fun setUserVisibleHint(isVisibleToUser: Boolean) { override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser) super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser && isResumed) { if (isVisibleToUser && isResumed) {
showConsultAssistantDialog()
} else {
hideConsultAssistantDialog()
}
if (isVisibleToUser && isResumed) {
onResume() onResume()
} }
} }
private fun showConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java)
.showConsultAssistantDialog(mActivity!!)
}
private fun hideConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
}
override fun onStop() { override fun onStop() {
super.onStop() super.onStop()
endTime = System.currentTimeMillis() endTime = System.currentTimeMillis()
...@@ -381,10 +368,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -381,10 +368,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition) mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
} }
mPresenter?.prepareCoupon(mActivity!!) mPresenter?.prepareCoupon(mActivity)
//走咨询助理浮层展示逻辑,是否展示由内部条件与接口判断
showConsultAssistantDialog()
} }
} }
......
...@@ -14,7 +14,8 @@ import com.yidianling.home.constract.HomeViewConfig ...@@ -14,7 +14,8 @@ import com.yidianling.home.constract.HomeViewConfig
import com.yidianling.home.event.HomeImpl import com.yidianling.home.event.HomeImpl
import com.yidianling.home.model.bean.* import com.yidianling.home.model.bean.*
import com.yidianling.home.ui.view.* import com.yidianling.home.ui.view.*
import kotlinx.android.synthetic.ydl.home_muse_view.view.* import com.yidianling.home.view.HomeMuseView
import kotlinx.android.synthetic.main.home_muse_view.view.*
/** /**
...@@ -178,7 +179,7 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -178,7 +179,7 @@ class YdlHomeAdapter(private val mContext: Context,
} }
//壹点*冥想模块 //壹点*冥想模块
HomeViewConfig.getOrder().museIndex -> { HomeViewConfig.getOrder().museIndex -> {
return HomeMuseViewHolder(HomeMuseView(mContext, homeEvent),viewType) return HomeMuseViewHolder(HomeMuseView(mContext), viewType)
} }
//底部提示语模块 //底部提示语模块
else -> { else -> {
...@@ -301,7 +302,7 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -301,7 +302,7 @@ class YdlHomeAdapter(private val mContext: Context,
/** /**
* 文章*阅读模块 ViewHolder * 文章*阅读模块 ViewHolder
*/ */
inner class HomeMuseViewHolder(val museViewView: HomeMuseView,val viewType:Int) : RecyclerView.ViewHolder(museViewView) inner class HomeMuseViewHolder(val museViewView: HomeMuseView, val viewType:Int) : RecyclerView.ViewHolder(museViewView)
/** /**
* 文章*阅读模块 ViewHolder * 文章*阅读模块 ViewHolder
......
...@@ -22,6 +22,6 @@ class IHomeContract { ...@@ -22,6 +22,6 @@ class IHomeContract {
*/ */
fun museRequest(): Observable<MuseModuleBean> fun museRequest(): Observable<MuseModuleBean>
fun getMeditation():Observable<MeditationModuleBean> fun getMeditation(): Observable<MeditationModuleBean>
} }
} }
\ No newline at end of file
...@@ -39,8 +39,5 @@ class HomeHttp { ...@@ -39,8 +39,5 @@ class HomeHttp {
return getHomePagerApi().getMuseData() return getHomePagerApi().getMuseData()
} }
fun getMeditationInfo():Observable<BaseAPIResponse<MeditationModuleBean>>{
return getHomePagerApi().getMeditation()
}
} }
\ No newline at end of file
...@@ -23,8 +23,5 @@ interface HomePagerApi { ...@@ -23,8 +23,5 @@ interface HomePagerApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getMuseData(): Observable<BaseAPIResponse<MuseModuleBean>> fun getMuseData(): Observable<BaseAPIResponse<MuseModuleBean>>
@GET("cms/meditation/index")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getMeditation(): Observable<BaseAPIResponse<MeditationModuleBean>>
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yidianling.home.model ...@@ -2,6 +2,7 @@ package com.yidianling.home.model
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.home.constract.IHomeContract import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.http.HomeBaseHttp
import com.yidianling.home.http.HomeHttp import com.yidianling.home.http.HomeHttp
import com.yidianling.home.model.bean.MeditationModuleBean import com.yidianling.home.model.bean.MeditationModuleBean
import com.yidianling.home.model.bean.MuseModuleBean import com.yidianling.home.model.bean.MuseModuleBean
...@@ -28,7 +29,7 @@ class HomeModelImpl : BaseHomeModelImpl(), IHomeContract.Model { ...@@ -28,7 +29,7 @@ class HomeModelImpl : BaseHomeModelImpl(), IHomeContract.Model {
} }
override fun getMeditation(): Observable<MeditationModuleBean> { override fun getMeditation(): Observable<MeditationModuleBean> {
return HomeHttp.getInstance().getMeditationInfo().compose(RxUtils.resultJavaData()) return HomeBaseHttp.getInstance().getMeditationInfo().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { MeditationModuleBean(true) } .onErrorReturn { MeditationModuleBean(true) }
} }
......
...@@ -47,10 +47,9 @@ import io.reactivex.Observable ...@@ -47,10 +47,9 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.home_muse_view.*
import kotlinx.android.synthetic.ydl.home_fragment.* import kotlinx.android.synthetic.ydl.home_fragment.*
import kotlinx.android.synthetic.ydl.home_fragment.tab_layout import kotlinx.android.synthetic.ydl.home_fragment.tab_layout
import kotlinx.android.synthetic.ydl.home_muse_view.*
import kotlinx.android.synthetic.ydl.home_muse_view.view.*
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleArticleViewHomeCommonTitleView" android:id="@+id/homeModuleArticleViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleAssuageGriefViewHomeCommonTitleView" android:id="@+id/homeModuleAssuageGriefViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleConfideViewHomeCommonTitleView" android:id="@+id/homeModuleConfideViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleCourseViewHomeCommonTitleView" android:id="@+id/homeModuleCourseViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
> >
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView" android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
> >
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView" android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="white_60">#99FFFFFF</color>
<color name="white">#FFFFFF</color> <color name="white">#FFFFFF</color>
<color name="home_confide_61CEAC">#61CEAC</color> <color name="home_confide_61CEAC">#61CEAC</color>
......
...@@ -11,13 +11,5 @@ ...@@ -11,13 +11,5 @@
<item name="android:windowIsTranslucent">true</item> <item name="android:windowIsTranslucent">true</item>
</style> </style>
<style name="MeditationTabLayoutStyle" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">@color/white</item>
<item name="tabIndicatorHeight">2dp</item>
<item name="tabIndicatorFullWidth">false</item>
<item name="tabSelectedTextColor">@color/white</item>
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/white_60</item>
</style>
</resources> </resources>
\ No newline at end of file
...@@ -431,4 +431,13 @@ class IMServiceImpl : IImService { ...@@ -431,4 +431,13 @@ class IMServiceImpl : IImService {
override fun dismissConsultServiceDialog() { override fun dismissConsultServiceDialog() {
expertConsultServiceListDialog2?.changeItem() expertConsultServiceListDialog2?.changeItem()
} }
override fun startTeamSession(activity: Activity, tid: String, doctorId: String) {
SessionHelper.startTeamSession(
activity,
tid + "",
null,
P2PCustomActionHandlerImpl(doctorId + "")
)
}
} }
\ No newline at end of file
...@@ -71,7 +71,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -71,7 +71,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
if (ActionHandlerStorage.getL(contactId) != null) { if (ActionHandlerStorage.getL(contactId) != null) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
} else if (contactId.equals(ImConstants.KEFUXIAOYI)) { } else if (contactId.equals(ImConstants.KEFUXIAOYI)) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} }
ActionHandlerStorage.setL(contactId, l); ActionHandlerStorage.setL(contactId, l);
......
...@@ -61,7 +61,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog; ...@@ -61,7 +61,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.config.constants.ImConstants; import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.event.CloseBottomWebviewEvent; import com.yidianling.im.api.event.CloseBottomWebviewEvent;
import com.yidianling.im.event.MultipleAnswerBean; import com.yidianling.im.event.MultipleAnswerBean;
import com.yidianling.im.event.MultipleSelectedEvent; import com.yidianling.im.event.MultipleSelectedEvent;
import com.yidianling.im.helper.IMChatUtil; import com.yidianling.im.helper.IMChatUtil;
......
...@@ -168,7 +168,7 @@ class ExpertConsultServiceItemView : LinearLayout { ...@@ -168,7 +168,7 @@ class ExpertConsultServiceItemView : LinearLayout {
NewH5Activity.start( NewH5Activity.start(
mContext, mContext,
H5Params( H5Params(
HttpConfig.MH5_URL + "consult/#/pages/jieyou/DownOrder?product_id=" + bean.productDto.id, HttpConfig.MH5_URL + "consult/#/pages/jieyou/DownOrder?product_id=${bean.productDto.id}&hideNavBar=1",
null null
) )
) )
......
...@@ -14,6 +14,7 @@ import com.ydl.webview.ProgressWebView ...@@ -14,6 +14,7 @@ import com.ydl.webview.ProgressWebView
import com.ydl.webview.TellData import com.ydl.webview.TellData
import com.ydl.webview.WebModularServiceUtils import com.ydl.webview.WebModularServiceUtils
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R import com.yidianling.im.R
...@@ -54,6 +55,7 @@ class ExpertConsultWebview : RelativeLayout { ...@@ -54,6 +55,7 @@ class ExpertConsultWebview : RelativeLayout {
val jtoJHandle = WebModularServiceUtils.getWebService() val jtoJHandle = WebModularServiceUtils.getWebService()
.getJavascripHandler(mContext as Activity, wv_content, tellData = TellData()) .getJavascripHandler(mContext as Activity, wv_content, tellData = TellData())
val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix()) val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix())
LogUtil.e(url)
wv_content.loadUrl(url) wv_content.loadUrl(url)
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
...@@ -28,6 +27,7 @@ ...@@ -28,6 +27,7 @@
android:id="@+id/lv_content" android:id="@+id/lv_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="30dp"
android:background="#f3f3f3" android:background="#f3f3f3"
android:divider="@null" /> android:divider="@null" />
......
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="74dp" android:layout_width="74dp"
android:layout_height="@dimen/platform_dp_32"> android:layout_height="@dimen/platform_dp_32">
<TextView <TextView
android:id="@+id/im_expert_service_list_btn" android:id="@+id/im_expert_service_list_btn"
android:layout_width="74dp" android:layout_width="74dp"
...@@ -172,32 +173,32 @@ ...@@ -172,32 +173,32 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="1dp"
android:text="¥" android:text="¥"
android:textFontWeight="800"
android:textColor="#EB892C" android:textColor="#EB892C"
android:textSize="12sp" android:textFontWeight="800"
android:layout_marginBottom="1dp"/> android:textSize="12sp" />
<TextView <TextView
android:id="@+id/service_item_price" android:id="@+id/service_item_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="bottom" android:gravity="bottom"
android:textStyle="normal"
android:textFontWeight="1500"
android:text="0" android:text="0"
android:textColor="#EB892C" android:textColor="#EB892C"
android:textSize="@dimen/im_text_size_18" /> android:textFontWeight="1500"
android:textSize="@dimen/im_text_size_18"
android:textStyle="normal" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/platform_dp_3" android:layout_marginLeft="@dimen/platform_dp_3"
android:layout_marginBottom="@dimen/platform_dp_1"
android:gravity="bottom" android:gravity="bottom"
android:layout_gravity="bottom"
android:text="起" android:text="起"
android:textColor="#9D9EA7" android:textColor="#9D9EA7"
android:layout_marginBottom="@dimen/platform_dp_1"
android:textSize="12sp" /> android:textSize="12sp" />
...@@ -205,12 +206,12 @@ ...@@ -205,12 +206,12 @@
android:id="@+id/service_item_low_buy_time" android:id="@+id/service_item_low_buy_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="#9D9EA7"
android:textSize="@dimen/sp_12"
android:visibility="gone"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/platform_dp_1" android:layout_marginBottom="@dimen/platform_dp_1"
android:text="(8次起售)" /> android:text="(8次起售)"
android:textColor="#9D9EA7"
android:textSize="@dimen/sp_12"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply from: "../publish.gradle"
kapt {
arguments {
arg("AROUTER_MODULE_NAME", "js")
}
}
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: "js"]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled true
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.alibaba:arouter-api:$arouter_api"
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
// 时间选择器
implementation 'com.contrarywind:Android-PickerView:4.1.9'
api rootProject.ext.dependencies["ydl-user-router"]
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-media')
implementation project(":ydl-pay")
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:consultant")
implementation project(":api:confide")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:fm")
implementation project(":api:course")
implementation project(':api:muse')
implementation project(':api:js')
implementation project(':api:audioim')
}
\ 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
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