Commit b4bed120 by konghaorui

Merge branch 'dev' into feature/组件化_ending

# Conflicts:
#	app/src/main/java/com/ydl/component/base/DemoAppLifecycles.java
#	config.gradle
#	m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
#	m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
#	m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
#	m-consultant/src/main/res/layout/consultant_expert_search_item_view.xml
#	m-im/src/main/java/com/yidianling/uikit/business/session/activity/YDLBaseMessageActivity.java
#	m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
#	m-im/src/main/res_uikit/layout/im_nim_chat_confide_order_info_view.xml
#	m-im/src/main/res_uikit/layout/im_nim_ui_title_bar_bottom.xml
#	ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/plugin/YDLCommonPlugin.kt
parents f17008fd 1ed4124c
......@@ -4,6 +4,7 @@ import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentPagerAdapter
import android.support.v7.app.AppCompatActivity
import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import com.yidianling.home.ui.fragment.YdlHomeFragment
import com.yidianling.user.mine.MineFragment
......@@ -26,6 +27,7 @@ class TestAppActivity : AppCompatActivity() {
setContentView(R.layout.activity_test_app)
fragments.add(YdlHomeFragment())
fragments.add(ExpertSearchFragment())
fragments.add(TrendsHomeFragment().setTab("trend_tap"))
fragments.add(MineFragment())
val adapter: FragmentPagerAdapter =
......
package com.ydl.component.base;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Process;
import android.support.annotation.RequiresApi;
import com.facebook.stetho.Stetho;
import com.meituan.android.walle.WalleChannelReader;
import com.netease.nimlib.sdk.util.NIMUtil;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.smtt.sdk.QbSdk;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.UMShareAPI;
import com.ydl.audioim.YDLavManager;
import com.ydl.component.BuildConfig;
import com.ydl.component.MainActivity;
import com.ydl.media.audio.PlayService;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.base.delegate.IAppLifecycles;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.YdlBuryPointUtil;
import com.yidianling.course.lifeCallback.CoursePlayLifecycle;
import com.yidianling.im.config.NimApplication;
import org.jetbrains.annotations.NotNull;
import io.flutter.view.FlutterMain;
/**
* Created by haorui on 2019-09-02.
* Des:
*/
public class DemoAppLifecycles implements IAppLifecycles {
@Override
public void attachBaseContext(@NotNull Context base) {
}
@RequiresApi(api = Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@Override
public void onCreate(@NotNull Application application) {
//模块初始化
moduleInit(application);
if (NIMUtil.isMainProcess(application)) {
YDLavManager.Companion.getInstances().init(application, "13b1536698f64905a1e7e5bb978ba821");
//第三方SDK初始化
initThirdServiceSDK(application);
//Flutter 初始化需要在主线程中执行
FlutterMain.startInitialization(application);
// FlutterMain.ensureInitializationComplete(application, null);
//
// FlutterEngine flutterEngine = new FlutterEngine(application);
// flutterEngine.getDartExecutor().executeDartEntrypoint(DartExecutor.DartEntrypoint.createDefault());
// YDLCommonPlugin plugin = new YDLCommonPlugin();
// flutterEngine.getLocalizationChannel().channel.setMethodCallHandler(plugin);
Intent intent = new Intent(application, PlayService.class);
application.startService(intent);
application.registerActivityLifecycleCallbacks(new CoursePlayLifecycle());
Stetho.initializeWithDefaults(application);
}
}
@Override
public void onTerminate(@NotNull Application application) {
}
private void moduleInit(Application application) {
NimApplication.getInstance().initIm(application, MainActivity.class);
}
private void initThirdServiceSDK(Application application) {
new Thread() {
@Override
public void run() {
super.run();
//设置线程优先级,不与主线程抢资源
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
//子线程中初始化X5内核,防止ANR问题
initX5(application);
if (DemoGlobalConfig.appEnv.equals(YDLConstants.ENV_PROD)) {
// YDLavManager.Companion.getInstances().init(application, "3387e9b251f3491e9221a9877e8f7830");
} else {
// YDLavManager.Companion.getInstances().init(application, "13b1536698f64905a1e7e5bb978ba821");
}
//bugly
String packageName = application.getPackageName();
String channel = WalleChannelReader.getChannel(application);
if (channel == null || channel.equals("null")) {
channel = "test";
}
CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(application);
strategy.setAppChannel(channel);
String appkey = BuildConfig.DEBUG ? "630a3a5cea" : "3939e71afa";
CrashReport.initCrashReport(application, appkey, BuildConfig.DEBUG, strategy);
//umeng
String umAppkey = null;
if (BuildConfig.FLAVOR.endsWith("ydl")) {
umAppkey = "56970affe0f55a9cda001e24";
channel = "android_" + channel;
initUM(umAppkey, channel, application);
PlatformConfig.setWeixin("wx57a9d930270498c7", "17c031f02500ded3457a80e69d8e5e45");
PlatformConfig.setQQZone("1105070461", "6BvkUnk6wXJekcgR");
} else if (BuildConfig.FLAVOR.endsWith("xlzx")) {
umAppkey = "5859e1656e27a42fa400021f";
channel = "ATK_7_android_" + channel;
initUM(umAppkey, channel, application);
PlatformConfig.setWeixin("wx1c6af5a11b5f531f", "1ddb93abbb2d81e604657d38e94a5720");
PlatformConfig.setQQZone("1107931541", "8dCvxUpi525uPGTJ");
}
// 选用AUTO页面采集模式
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
MobclickAgent.setCatchUncaughtExceptions(!BuildConfig.DEBUG);
//开启友盟集成测试
UMConfigure.setLogEnabled(BuildConfig.DEBUG);
HttpConfig.Companion.getInstance().initSocketConfig(() -> {
//数据埋点初始化 (一定要放在主进程中/因为用到了umeng统计,需要放在umeng初始化后)
YdlBuryPointUtil.init(application, true);
});
//安全检测
//YDLAppProtector.init();
}
}.start();
}
private void initUM(String umAppKey, String channel, Application application) {
/**
* 初始化common库
* 参数1:上下文,不能为空
* 参数2:友盟 app key
* 参数3:友盟 channel
* 参数4:设备类型,UMConfigure.DEVICE_TYPE_PHONE为手机、UMConfigure.DEVICE_TYPE_BOX为盒子,默认为手机
* 参数5:Push推送业务的secret
*/
UMConfigure.init(application, umAppKey, channel, UMConfigure.DEVICE_TYPE_PHONE, null);
UMShareAPI.init(application, umAppKey);
}
/**
* 初始化X5内核
*
* @param application
*/
private void initX5(Application application) {
// 在调用TBS初始化、创建WebView之前进行如下配置,以开启优化方案
// HashMap map = new HashMap();
// map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
// QbSdk.initTbsSettings(map);
// if (!QbSdk.isTbsCoreInited()) {//// preinit只需要调用一次,如果已经完成了初始化,那么就直接构造view
// QbSdk.preInit(application, null);// 设置X5初始化完成的回调接口
// }
QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {
@Override
public void onViewInitFinished(boolean arg0) {
//初始化完成回调
LogUtil.i("QbSdk onViewInitFinished:" + arg0);
}
@Override
public void onCoreInitFinished() {
LogUtil.i("QbSdk onCoreInitFinished");
}
};
QbSdk.initX5Environment(application, cb);
}
}
\ No newline at end of file
......@@ -5,8 +5,8 @@ ext {
ydl_app = [
appName : "心理咨询壹点灵",
applicationId: "com.cxzapp.yidianling",
versionName : "4.0.81",
versionCode : 4081,
versionName : "4.0.99",
versionCode : 4099,
]
xlzx_app = [
......@@ -42,12 +42,12 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.10",
"m-consultant" : "0.0.58.7",
"m-fm" : "0.0.29.8",
"m-user" : "0.0.60.2",
"m-home" : "0.0.20.8",
"m-im" : "0.0.17.6",
"m-confide" : "0.0.48.22",
"m-consultant" : "0.0.59.8",
"m-fm" : "0.0.29.3",
"m-user" : "0.0.60.3",
"m-home" : "0.0.22.2",
"m-im" : "0.0.18.1",
"m-dynamic" : "0.0.7.6",
"m-muse" : "0.0.28.11",
......@@ -69,14 +69,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.39.23",
"ydl-platform" : "0.0.39.16",
//第二步 若干
"ydl-webview" : "0.0.38.25",
"ydl-webview" : "0.0.38.29",
"ydl-media" : "0.0.21.4",
"ydl-pay" : "0.0.18.7",
"m-audioim" : "0.0.48.2.9",
"ydl-flutter-base": "0.0.14.10",
"m-audioim" : "0.0.49.0",
"ydl-flutter-base": "0.0.14.12",
//以下 几乎不会动
"router" : "0.0.1",
......@@ -115,13 +115,13 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.39.23",
"ydl-platform" : "0.0.39.24",
//第二步 若干
"ydl-webview" : "0.0.38.25",
"ydl-webview" : "0.0.38.29",
"ydl-media" : "0.0.21.4",
"ydl-pay" : "0.0.18.7",
"m-audioim" : "0.0.48.2.9",
"m-audioim" : "0.0.49.0",
"ydl-flutter-base": "0.0.14.7",
//以下 几乎不会动
......@@ -270,7 +270,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydlCompileVersion["ydl-flutter-base"]}", //组件化项目中的flutter base模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.18.6@aar", //flutter aar
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.18.9@aar", //flutter aar
"ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号
......
......@@ -75,7 +75,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
api ('com.ydl:ydl-av:1.2.1@aar'){
api ('com.ydl:ydl-av:1.2.4@aar'){
transitive = true
}
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.audioim">
package="com.ydl.audioim">
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application>
<activity
android:name=".AudioHomeActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:screenOrientation="portrait"/>
android:name=".AudioHomeActivity"
android:launchMode="singleTask"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:screenOrientation="portrait" />
<activity
android:name="com.ydl.consultantim.ConsultantAudioHomeActivity"
android:launchMode="singleTask"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:screenOrientation="portrait" />
</application>
</manifest>
......@@ -71,11 +71,6 @@ interface IAudioHomeActivityContract {
*/
// fun connectFinish(param: ConnectFinishCommand)
/**
* 通话异常
*/
fun connectException(param: ConnectExceptionCommand)
/**
* 通知服务端发送推送
......
......@@ -4,9 +4,12 @@ import com.google.gson.Gson
import com.ydl.audioim.bean.AgoraTokenResponse
import com.ydl.audioim.bean.ConnectBean
import com.ydl.audioim.http.command.*
import com.ydl.consultantim.bean.ListenTokenBean
import com.ydl.consultantim.command.ListenTokenCmd
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlnet.YDLHttpUtils
import io.reactivex.Observable
import okhttp3.MediaType
......@@ -85,5 +88,12 @@ class AudioApiRequestUtil {
fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>>{
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).getAgoraToken()
}
/**
* 获取声网登录token
*/
fun listenToken(cmd: ListenTokenCmd): Observable<BaseResponse<ListenTokenBean>>{
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).listenToken(NetworkParamsUtils.getMaps(cmd))
}
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.ydl.audioim.http
import com.ydl.audioim.bean.AgoraTokenResponse
import com.ydl.audioim.bean.ConnectBean
import com.ydl.consultantim.bean.ListenTokenBean
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
......@@ -61,4 +62,11 @@ interface AudioNetAPi {
@GET("im/getAgoraToken")
fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>>
//获取token
@FormUrlEncoded
@POST("listen/token")
fun listenToken(@FieldMap map: Map<String, String>): Observable<BaseResponse<ListenTokenBean>>
}
\ No newline at end of file
......@@ -10,7 +10,8 @@ data class ConnectExceptionCommand(
var noticeId: String, // 秒级
var productId: String, // 2
var eventType: String, // 99
var payload: PayLoad
var payload: PayLoad,
var callStatus: Int=-1//用于判断咨询声网时是哪方取消的:1 主叫取消 2被叫拒绝 (超时未接听算主叫取消)
) : BaseCommand()
data class PayLoad(
......
......@@ -66,20 +66,6 @@ class AudioHomePresenterImpl : BasePresenter<IAudioHomeActivityContract.View, IA
// })
// }
@SuppressLint("CheckResult")
override fun connectException(param: ConnectExceptionCommand) {
mModel.connectException(param)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe {
}
.doAfterTerminate {
}
.subscribe({
}, { e ->
LogUtil.e(e.message)
})
}
/**
* 登录声网
......
......@@ -29,10 +29,10 @@ class AudioLogUtils {
@SuppressLint("SimpleDateFormat")
private val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
fun writeAgoraLog(content: String) {
fun writeAgoraLog(content: String, fileName: String, isAppend: Boolean = true) {
Observable.create<Any> {
try {
writeLog(content)
writeLog(content, fileName, isAppend)
if (BuildConfig.DEBUG) {
LogUtil.d("writeLog_complete")
}
......@@ -42,28 +42,30 @@ class AudioLogUtils {
.subscribe()
}
private fun writeLog(content: String) {
private fun writeLog(content: String, fileName: String, isAppend: Boolean) {
try {
val folder = getLogFolder()
val file = File(folder, "AgoraInfoLog")
val file = File(folder, fileName)
if (!file.exists() || !file.isFile) {
file.createNewFile()
}
val fileWriter = FileWriter(file, true)
val writer = BufferedWriter(fileWriter)
writer.write("""Time:${format.format(Calendar.getInstance().time)}""")
writer.newLine()
writer.write("UserUid = ${ModularServiceManager.getPlatformUserService()?.getUser()?.userId}")
writer.newLine()
writer.write("""Network:${RxNetTool.getNetWorkTypeName(BaseApp.getApp())}""")
writer.newLine()
writer.write("""DevicesInfo:${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()}""")
writer.newLine()
writer.write("""VersionInfo:${RxAppTool.getAppVersionName(BaseApp.getApp())}""")
writer.newLine()
writer.write("AgoraLog:$content")
writer.newLine()
writer.write("--------")
if (!isAppend) {
writer.write("----------------")
writer.newLine()
writer.write("""Time:${format.format(Calendar.getInstance().time)}""")
writer.newLine()
writer.write("ExpertUid = ${ModularServiceManager.getPlatformUserService()?.getUser()?.userId}")
writer.newLine()
writer.write("""Network:${RxNetTool.getNetWorkTypeName(BaseApp.getApp())}""")
writer.newLine()
writer.write("""DevicesInfo:${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()}""")
writer.newLine()
writer.write("""VersionInfo:${RxAppTool.getAppVersionName(BaseApp.getApp())}""")
writer.newLine()
}
writer.write(content)
writer.newLine()
writer.flush()
writer.close()
......
package com.ydl.consultantim.bean
/**
* @author yuanWai
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/11/9
*/
data class ListenTokenBean(val token : String?,
val expired : String?,
val type : String?)
\ No newline at end of file
package com.ydl.consultantim.command;
import com.ydl.ydlcommon.data.http.BaseCommand;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/3/30
*/
public class ListenTokenCmd extends BaseCommand {
/**
* 类别 TOKEN|SIGNAL_TOKEN
*/
public String type;
/**
* 账号(就是uid)
* 如果是SIGNAL_TOKEN 则需要传递该参数
*/
public String account;
/**
* 频道ID
*/
public String channelId;
/**
* 过期时间
*/
public String expired;
}
package com.ydl.consultantim.contract
import com.ydl.ydl_av.chat.bean.AudioMessageBean
import com.ydl.ydlcommon.mvp.base.IModel
import com.ydl.ydlcommon.mvp.base.IPresenter
import com.ydl.ydlcommon.mvp.base.IView
/**
* @author jiucheng
* @描述:声网倾诉首页约束类
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/10/30
*/
interface IConsultantAudioHomeActivityContract {
interface View : IView {
fun listenStatusPushResponse()
fun channelTokenResponse(token: String?,needJoinChannel: Boolean)
// 执行接听操作
// canExcute是否执行
fun executeCall(canExcute: Boolean)
// 关闭当前页面,并提示用户已挂断
fun executeFinish()
}
interface Presenter : IPresenter<View> {
/**
* 通话开始(更新专家状态)
* @param param 请求参数
* @param isSwitchAxb 是否切换axb
*/
// fun connectStart(param: ConnectStartCommand)
/**
* 通话结束(更新专家状态)
* @param param 请求参数
* @param isSwitchAxb 是否切换axb
*/
// fun connectFinish(param: ConnectFinishCommand)
/**
* 获取频道token
*
*/
fun getChannelToken(mAudioMessageBean: AudioMessageBean?, needJoinChannel: Boolean = true)
/**
* 判断用户是否在频道中
*/
fun userIsInChannel(channelName: String, agoraUid: String)
}
interface Model : IModel {
/**
* 通话开始回调(更新专家状态)
*/
// fun connectStart(param: ConnectStartCommand)
/**
* 通话结束(更新专家状态)
*/
// fun connectFinish(param: ConnectFinishCommand)
}
}
package com.ydl.consultantim.event;
/**
* @author yuanWai
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/11/19
*/
public class AudioHomeEvent {
//1.发送停止播放电话铃声和震动
public int type;
public AudioHomeEvent(int type){
this.type = type;
}
}
package com.ydl.consultantim.model
import com.ydl.consultantim.contract.IConsultantAudioHomeActivityContract
/**
* @author jiucheng
* @描述:声网通话页面数据实现类
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/10/30
*/
class ConsultantAudioHomeModelImpl : IConsultantAudioHomeActivityContract.Model {
}
package com.ydl.consultantim.presenter
import android.annotation.SuppressLint
import com.ydl.audioim.http.AudioApiRequestUtil
import com.ydl.consultantim.command.ListenTokenCmd
import com.ydl.consultantim.contract.IConsultantAudioHomeActivityContract
import com.ydl.consultantim.model.ConsultantAudioHomeModelImpl
import com.ydl.ydl_av.chat.bean.AudioMessageBean
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.yidianling.user.api.service.IUserService
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
/**
* @author jiucheng
* @描述:声网通话页面逻辑实现类
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/10/30
*/
class ConsultantAudioHomePresenterImpl :
BasePresenter<IConsultantAudioHomeActivityContract.View, IConsultantAudioHomeActivityContract.Model>(),
IConsultantAudioHomeActivityContract.Presenter {
override fun userIsInChannel(channelName: String, agoraUid: String) {
// RetrofitUtils.userIsInChannel(channelName, agoraUid)
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe({
// view.executeCall(it.data)
// }, {
// LogUtil.e("agora", "专家进入前判断用户是否在频道内接口异常:" + it.message)
// })
}
@SuppressLint("CheckResult")
override fun getChannelToken(msgBean: AudioMessageBean?, needJoinChannel: Boolean) {
if (ModularServiceManager.provide(IUserService::class.java).isLogin()) {
if (null != ModularServiceManager.provide(IUserService::class.java).getUserInfo()) {
val acount =
ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid
val tokenParam = ListenTokenCmd()
tokenParam.type = "TOKEN"
tokenParam.account = acount.toString()
tokenParam.uid = acount.toString()
tokenParam.channelId = msgBean?.channelId
AudioApiRequestUtil.listenToken(tokenParam)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
mView.channelTokenResponse(it.data.token, needJoinChannel)
}, {
})
}
}
}
override fun createModel(): IConsultantAudioHomeActivityContract.Model {
return ConsultantAudioHomeModelImpl()
}
}
package com.ydl.consultantim.utils
import android.annotation.SuppressLint
import android.app.KeyguardManager
import android.content.Context
import android.os.PowerManager
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/3/19
*/
class ConsultantAudioUtils {
companion object{
/**
* 唤醒手机屏幕并解锁
*/
@SuppressLint("InvalidWakeLockTag")
fun wakeUpAndUnlock(context: Context) { // 获取电源管理器对象
val pm = context.applicationContext
.getSystemService(Context.POWER_SERVICE) as PowerManager
val screenOn = pm.isScreenOn
if (!screenOn) { // 获取PowerManager.WakeLock对象,后面的参数|表示同时传入两个值,最后的是LogCat里用的Tag
val wl = pm.newWakeLock(
PowerManager.ACQUIRE_CAUSES_WAKEUP or
PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "bright"
)
wl.acquire(10000) // 点亮屏幕
wl.release() // 释放
}
// 屏幕解锁
val keyguardManager =context.applicationContext
.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
val keyguardLock = keyguardManager.newKeyguardLock("unLock")
// 屏幕锁定
keyguardLock.reenableKeyguard()
keyguardLock.disableKeyguard() // 解锁
}
}
}
\ No newline at end of file
package com.ydl.consultantim.utils;
import android.app.Activity;
import android.app.Service;
import android.os.Vibrator;
/**
* @author yuanWai
* @描述:震动工具类
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/11/16
*/
public class VibratorUtil {
/**
* final Activity activity :调用该方法的Activity实例 long milliseconds :震动的时长,单位是毫秒
* long[] pattern :自定义震动模式 。数组中数字的含义依次是[静止时长,震动时长,静止时长,震动时长。。。]时长的单位是毫秒
* boolean isRepeat : 是否反复震动,如果是true,反复震动,如果是false,只震动一次
*/
// 一直震动多少秒
public static void vibrate(final Activity activity, long milliseconds) {
Vibrator vib = (Vibrator) activity
.getSystemService(Service.VIBRATOR_SERVICE);
assert vib != null;
vib.vibrate(milliseconds);
}
// 按照我们传进去的数组进行间歇性的震动
public static void vibrate(final Activity activity, long[] pattern,
boolean isRepeat) {
Vibrator vib = (Vibrator) activity
.getSystemService(Service.VIBRATOR_SERVICE);
assert vib != null;
vib.vibrate(pattern, isRepeat ? 1 : -1);
}
// 停止震动
public static void StopVibrate(final Activity activity) {
Vibrator vib = (Vibrator) activity
.getSystemService(Service.VIBRATOR_SERVICE);
assert vib != null;
vib.cancel();
}
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/platform_color_80353535">
<RelativeLayout
android:id="@+id/rl_head"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="74dp">
<com.ydl.ydlcommon.view.WaveView
android:id="@+id/wave_view"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_centerInParent="true" />
<ImageView
android:layout_width="126dp"
android:layout_height="126dp"
android:layout_centerInParent="true"
android:background="@drawable/audioim_head_background" />
<ImageView
android:id="@+id/iv_head"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_centerInParent="true"
android:scaleType="centerCrop"
android:src="@drawable/audioim_head_place_hold_pic" />
</RelativeLayout>
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rl_head"
android:layout_centerHorizontal="true"
android:layout_marginTop="-20dp"
android:textColor="@color/white"
android:textSize="26sp"
tools:text="用户" />
<TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_name"
android:layout_centerHorizontal="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="6dp"
android:layout_marginRight="25dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:textColor="@color/white"
android:textSize="15sp"
android:text="向您发起语音通话请求" />
<!--自定义弹窗-->
<TextView
android:id="@+id/tv_toast"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_tips"
android:layout_centerHorizontal="true"
android:layout_marginTop="34dp"
android:background="@drawable/audioim_toast_view_background"
android:elevation="6dp"
android:paddingLeft="11dp"
android:paddingTop="4dp"
android:paddingRight="11dp"
android:paddingBottom="4dp"
android:textColor="@color/white"
android:visibility="gone"
tools:text="连接中..."
tools:visibility="visible" />
<!-- 倾诉剩余时间-->
<RelativeLayout
android:id="@+id/rl_remain_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/rl_hang_up"
android:layout_marginBottom="20dp"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/tv_notes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="通话时长"
android:textColor="@color/platform_color_30FFFFFF"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_remain_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_notes"
android:layout_centerHorizontal="true"
android:text="00:00"
android:textColor="@color/white"
android:textSize="20sp" />
</RelativeLayout>
<!--挂断按钮-->
<RelativeLayout
android:id="@+id/rl_hang_up"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="72dp"
android:layout_marginBottom="18dp"
android:onClick="hangUpClick">
<ImageView
android:id="@+id/iv_hang_up"
android:layout_width="66dp"
android:layout_height="66dp"
android:layout_centerHorizontal="true"
android:src="@drawable/audioim_img_hang_up"
android:visibility="visible" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_hang_up"
android:layout_centerHorizontal="true"
android:layout_marginTop="9dp"
android:text="挂断"
android:textColor="@color/white"
android:textSize="12sp" />
</RelativeLayout>
<!-- 接听按钮-->
<RelativeLayout
android:id="@+id/rl_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="72dp"
android:layout_marginBottom="18dp"
android:onClick="onCall">
<ImageView
android:id="@+id/iv_hands_call"
android:layout_width="66dp"
android:layout_height="66dp"
android:src="@drawable/audioim_audio_home_img_answer" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_hands_call"
android:layout_centerHorizontal="true"
android:layout_marginTop="9dp"
android:text="接听"
android:textColor="@color/white"
android:textSize="12sp" />
</RelativeLayout>
<!-- 免提按钮-->
<RelativeLayout
android:id="@+id/rl_hands_free"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="72dp"
android:layout_marginBottom="18dp"
android:onClick="onSwitchSpeakerphoneClicked"
android:visibility="gone">
<ImageView
android:id="@+id/iv_hands_free"
android:layout_width="66dp"
android:layout_height="66dp"
android:src="@drawable/audioim_img_hands_free_unuse" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_hands_free"
android:layout_centerHorizontal="true"
android:layout_marginTop="9dp"
android:text="免提"
android:textColor="@color/white"
android:textSize="12sp" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -86,7 +86,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE or WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
initViews()
initData(intent)
}
override fun getStatusViewOptions(): StatusBarOptions {
......@@ -172,8 +171,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private var headData: HeadData? = null //筛选数据
private var isFromSplash = false
private val props1 = JSONObject() //筛选标题埋点参数
private var fromPageType: Int = 0 //从哪个页面跳转过来的
private val fromPages = arrayOf("首页搜索", "找专家", "在线专家")
private var fromPageType: Int = 1 //从哪个页面跳转过来的
private val fromPages = arrayOf("首页", "搜索页面", "在线专家")
private var isRecommend = false //埋点数据
private var keyWord: String? = null //埋点数据
private var isDoSearch: Boolean = false //埋点判断是否通过搜索进入埋点的
......@@ -380,7 +379,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
v_loading.setViewType(LogoLoadingView.TYPE_LOADING, null)
if (fromPageType != -1) {
doctorAdapter.setEntrance(fromPages[fromPageType])
doctorAdapter.setEntrance(fromPages[fromPageType],1)
}
}
......@@ -1454,7 +1453,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override fun onResume() {
super.onResume()
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT)
ActionCountUtils.count(ConsultBIConstants.ConsultSearchListEvent.APP_CONSULT_SEARCH_LIST_PAGE_VISIT)
}
......
......@@ -32,6 +32,19 @@ class ConsultBIConstants {
const val APP_CONSULT_LIST_CHAT_CLICK: String = APP_CONSULT_LIST_PAGE + "app_consult_list_chat_click"//每个咨询师私聊
}
}
class ConsultSearchListEvent {
companion object {
private const val CONSULT_SEARCH_LIST_PAGE: String = "consul_search_list_page|"//APP咨询搜索列表页 partId
const val APP_CONSULT_SEARCH_LIST_PAGE_VISIT: String = CONSULT_SEARCH_LIST_PAGE + "consul_search_list_page_visit"//列表页浏览事件
const val APP_CONSULT_SEARCH_LIST_CONSULT_ITEM_CLICK: String = CONSULT_SEARCH_LIST_PAGE + "consult_search_list_doctor_click "//每个咨询师页面点击
const val APP_CONSULT_SEARCH_LIST_CHAT_CLICK: String = CONSULT_SEARCH_LIST_PAGE + "consult__search_list_chat_click"//每个咨询师私聊
}
}
class UserMainEvent {
companion object {
......
......@@ -8,6 +8,7 @@ import android.text.TextUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ConsultAssistantCenterActivity
......@@ -104,6 +105,7 @@ class ConsultAssistantDialogUtils private constructor() {
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid(activity)
}
......@@ -157,6 +159,7 @@ class ConsultAssistantDialogUtils private constructor() {
activity,
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
// 咨询师列表页面且未登录情况下,跳转登录页面
if (!ConsultantIn.isLogin()) {
......@@ -178,6 +181,7 @@ class ConsultAssistantDialogUtils private constructor() {
activity,
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
// 咨询师列表页面且未登录情况下,跳转登录页面
if (!ConsultantIn.isLogin()) {
......@@ -200,14 +204,14 @@ class ConsultAssistantDialogUtils private constructor() {
* 咨询师列表页Fragment隐藏
*/
fun hide() {
consultAssistantFragmentDialog?.hide()
consultAssistantFragmentDialog?.dismiss()
}
/**
* 咨询师列表页Fragment隐藏
*/
fun hideAssistantActivity() {
consultAssistantActivityDialog?.hide()
consultAssistantActivityDialog?.dismiss()
}
/**
......
......@@ -11,57 +11,67 @@
layout="@layout/consultant_layout_search_toolbar"
android:layout_width="match_parent"
android:layout_height="48dp" />
<com.yidianling.consultant.ui.view.ExpertSearchSwipeRefreshLayout
android:id="@+id/srlContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/consultant_colorBg"
tools:ignore="InefficientWeight">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
<android.support.design.widget.CoordinatorLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:background="@color/consultant_colorBg"
android:clipChildren="false"
android:clipToPadding="false"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
tools:ignore="InefficientWeight">
<android.support.design.widget.CollapsingToolbarLayout
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:background="@color/consultant_colorBg"
android:clipChildren="false"
android:clipToPadding="false"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
<com.yidianling.consultant.ui.view.topView.RecommendListView
android:id="@+id/recommendListView"
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.yidianling.consultant.ui.view.topView.RecommendListView>
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/consultant_layout_search_content" />
<!-- 心理咨询app华为渠道紧急处理,咨询师列表页先简单粗暴的隐藏顶部推荐模块-->
<RelativeLayout
android:id="@+id/rl_hot_fix_for_huawei"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<!--<include layout="@layout/layout_search_head_input"/>-->
<com.yidianling.consultant.ui.view.topView.RecommendListView
android:id="@+id/recommendListView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
<!--筛选弹窗半透明背景-->
<View
android:id="@+id/viewDim_filter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#40000000"
android:visibility="gone" />
</android.support.design.widget.CoordinatorLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/consultant_layout_search_content" />
<!--<include layout="@layout/layout_search_head_input"/>-->
<!--筛选弹窗半透明背景-->
<View
android:id="@+id/viewDim_filter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#40000000"
android:visibility="gone" />
</android.support.design.widget.CoordinatorLayout>
</com.yidianling.consultant.ui.view.ExpertSearchSwipeRefreshLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="8dp"
android:bottomLeftRadius="8dp"/>
<gradient
android:angle="0"
android:startColor="#CC1DA1F2"
android:endColor="#CC1DA1F2"/>
</shape>
\ No newline at end of file
......@@ -2,13 +2,14 @@ package com.yidianling.home.adapter
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.home.R
import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.home.event.HomeImpl
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeAskBean
import com.yidianling.home.model.bean.HomeConfideBean
import com.yidianling.home.model.bean.HomeConsultBean
......@@ -22,10 +23,13 @@ import com.yidianling.home.ui.view.*
* @Company 壹点灵
* @date 2019/02/13
*/
class YdlHomeAdapter(private val mContext: Context,
private var homeEvent: HomeImpl,
private var list: ArrayList<HomePagerDataBean>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
class YdlHomeAdapter(
private val mContext: Context,
private var homeEvent: HomeImpl,
private var list: ArrayList<HomePagerDataBean>
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private val ffrom = PlatformDataManager.getRam().getChannelName()
private val mInflater: LayoutInflater = LayoutInflater.from(mContext)
/**
* 倾述item的position
......@@ -141,21 +145,45 @@ class YdlHomeAdapter(private val mContext: Context,
when (holder) {
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> {
holder.buttonBannerView.initData(list[position].headerBean?.homeSaleData,list[position].headerBean?.askCategoryData)
holder.buttonBannerView.initData(
list[position].headerBean?.homeSaleData,
list[position].headerBean?.askCategoryData
)
}
//倾诉*排解模块
is HomeConfideViewHolder -> {
holder.confideViewView.setTitle(list[position].headerBean?.listenCategoryDate, confideSelectPosition)
holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body)
confidePosition = position
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 -> {
holder.courseViewView.initData(list[position].courseBean?.list)
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
val parm = holder.itemView.layoutParams
parm.height = 0
holder.itemView.layoutParams = parm
} else {
holder.courseViewView.initData(list[position].courseBean?.list)
}
}
//解忧*问答模块
is HomeAssuageGriefViewHolder -> {
holder.assuageGriefViewView.initData(position, list[position].askBean?.data)
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
val parm = holder.itemView.layoutParams
parm.height = 0
holder.itemView.layoutParams = parm
} else {
holder.assuageGriefViewView.initData(position, list[position].askBean?.data)
}
}
//文章*阅读模块
is HomeArticleViewHolder -> {
......@@ -163,9 +191,22 @@ class YdlHomeAdapter(private val mContext: Context,
}
//咨询模块
is HomeConsultViewHolder -> {
holder.consultView.setTitle(list[position].headerBean?.consultCategoryData, consultSelectPosition)
holder.consultView.setConsultInfoView(list[position].consultBean?.list,list[position].headerBean?.consultCategoryData?.get(consultSelectPosition))
consultPosition = position
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
val parm = holder.itemView.layoutParams
parm.height = 0
holder.itemView.layoutParams = parm
} else {
holder.consultView.setTitle(
list[position].headerBean?.consultCategoryData,
consultSelectPosition
)
holder.consultView.setConsultInfoView(
list[position].consultBean?.list,
list[position].headerBean?.consultCategoryData?.get(consultSelectPosition)
)
consultPosition = position
}
}
//测试模块
is HomeTestViewHolder -> {
......@@ -177,25 +218,30 @@ class YdlHomeAdapter(private val mContext: Context,
override fun getItemCount(): Int {
return list.size
}
/**
* 顶部预约专家,即时倾诉,心理测试按钮模块 ViewHolder
*/
inner class HomeButtonBannerViewHolder(val buttonBannerView: HomeButtonBannerView) : RecyclerView.ViewHolder(buttonBannerView)
inner class HomeButtonBannerViewHolder(val buttonBannerView: HomeButtonBannerView) :
RecyclerView.ViewHolder(buttonBannerView)
/**
* 咨询模块 ViewHolder
*/
inner class HomeConsultViewHolder(val consultView: HomeConsultView) : RecyclerView.ViewHolder(consultView)
inner class HomeConsultViewHolder(val consultView: HomeConsultView) :
RecyclerView.ViewHolder(consultView)
/**
* 倾诉*排解模块 ViewHolder
*/
inner class HomeConfideViewHolder(val confideViewView: HomeConfideView) : RecyclerView.ViewHolder(confideViewView)
inner class HomeConfideViewHolder(val confideViewView: HomeConfideView) :
RecyclerView.ViewHolder(confideViewView)
/**
* 课程*成长模块 ViewHolder
*/
inner class HomeCourseViewHolder(val courseViewView: HomeCourseView) : RecyclerView.ViewHolder(courseViewView)
inner class HomeCourseViewHolder(val courseViewView: HomeCourseView) :
RecyclerView.ViewHolder(courseViewView)
/**
* 测试模块 ViewHolder
......@@ -205,11 +251,14 @@ class YdlHomeAdapter(private val mContext: Context,
/**
* 解忧*问答模块 ViewHolder
*/
inner class HomeAssuageGriefViewHolder(val assuageGriefViewView: HomeAssuageGriefView) : RecyclerView.ViewHolder(assuageGriefViewView)
inner class HomeAssuageGriefViewHolder(val assuageGriefViewView: HomeAssuageGriefView) :
RecyclerView.ViewHolder(assuageGriefViewView)
/**
* 文章*阅读模块 ViewHolder
*/
inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) : RecyclerView.ViewHolder(articleViewView)
inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) :
RecyclerView.ViewHolder(articleViewView)
/**
* 底部提示语模块 ViewHolder
......
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Color
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
......@@ -42,6 +43,7 @@ class HomeAssuageGriefView(private val mContext: Context, private var homeEvent:
fun initData(position: Int, list: List<HomeAskBean.DataBean>?) {
//添加View
if (list == null) {
visibility = View.GONE
return
}
if (cacheList.size != list?.size) {
......
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Color
import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout
import android.widget.RelativeLayout
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
......@@ -56,6 +60,36 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
// initButtonView()
val ffrom = PlatformDataManager.getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
homeModuleButtonBannerThird.visibility = View.GONE
homeModuleButtonBannerSecond.visibility = View.GONE
homeModuleButtonBannerFirst.background =
resources.getDrawable(R.drawable.home_dcotor_bt_bg_huawei)
homeModuleButtonBannerSecond.background =
resources.getDrawable(R.drawable.home_test_bt_bg_hauwei)
homeModuleButtonBannerThird.background =
resources.getDrawable(R.drawable.home_course_bt_bg_huawei)
homeModuleButtonBannerFourth.background =
resources.getDrawable(R.drawable.home_listen_bt_bg_huawei)
homeModuleButtonBannerFirstTitle.setTextColor(Color.WHITE)
tv_first_text.setTextColor(Color.WHITE)
homeModuleButtonBannerFourthTitle.setTextColor(Color.WHITE)
tv_second_text.setTextColor(Color.WHITE)
homeModuleButtonBannerThirdTitle.setTextColor(Color.WHITE)
tv_third_text.setTextColor(Color.WHITE)
homeModuleButtonBannerSecondTitle.setTextColor(Color.WHITE)
tv_fourth_text.setTextColor(Color.WHITE)
homeModuleButtonBannerFirstTitle.textSize = 18f
tv_first_text.textSize = 13f
homeModuleButtonBannerFourthTitle.textSize = 18f
tv_second_text.textSize = 13f
}
homeModuleButtonBannerFirst.setOnClickListener {
homeEvent?.reservationExpertsClick()
}
......@@ -76,8 +110,15 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
homeCategory: List<HomeHeaderBean.AskCategoryDataBean>?
) {
setRealTextView(homeSaleData)
homeEvent?.let { home_category_view.setEvent(it) };
home_category_view.initData(homeCategory)
val ffrom = PlatformDataManager.getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
home_category_view.visibility = View.GONE
} else {
homeEvent?.let { home_category_view.setEvent(it) }
home_category_view.initData(homeCategory)
}
}
/**
......
......@@ -2,8 +2,10 @@ package com.yidianling.home.ui.view
import android.content.Context
import android.support.constraint.ConstraintLayout
import android.text.TextUtils
import android.util.AttributeSet
import android.view.View
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.home.R
import kotlinx.android.synthetic.xlzx.home_common_title_view.view.*
......@@ -14,7 +16,9 @@ import kotlinx.android.synthetic.xlzx.home_common_title_view.view.*
* @Company 壹点灵
* @date 2019/02/14
*/
class HomeCommonTitleView(private val mContext: Context, private val attributeSet: AttributeSet) : ConstraintLayout(mContext, attributeSet) {
class HomeCommonTitleView(private val mContext: Context, private val attributeSet: AttributeSet) :
ConstraintLayout(mContext, attributeSet) {
private val ffrom = PlatformDataManager.getRam().getChannelName()
init {
initView()
......@@ -26,5 +30,13 @@ class HomeCommonTitleView(private val mContext: Context, private val attributeSe
fun setTitle(title: String) {
homeModuleCommonTitleViewTitle.text = title
val isFromXinliZiXunHuawei =
!TextUtils.isEmpty(ffrom) && ffrom.startsWith("ATK_7") && ffrom.endsWith("huawei")
if (isFromXinliZiXunHuawei) {
view_line.visibility = View.GONE
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
......@@ -20,7 +22,7 @@ import kotlinx.android.synthetic.xlzx.home_test_item_view.view.*
*/
class HomeTestItemView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?) :
LinearLayout(mContext) {
private val ffrom = PlatformDataManager.getRam().getChannelName()
private var params: LinearLayout.LayoutParams? = null
init {
......@@ -35,6 +37,11 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
)
layoutParams = params
View.inflate(mContext, R.layout.home_test_item_view, this)
val isFromXinliZiXunHuawei =
!TextUtils.isEmpty(ffrom) && ffrom.startsWith("ATK_7") && ffrom.endsWith("huawei")
if (isFromXinliZiXunHuawei) {
tv_go.visibility = View.GONE
}
}
......
package com.yidianling.home.ui.view
import android.content.Context
import android.text.TextUtils
import android.view.View
import android.widget.LinearLayout
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
......@@ -22,6 +24,7 @@ import kotlinx.android.synthetic.xlzx.home_test_top_item_view.view.*
*/
class HomeTestTopItemView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?) :
LinearLayout(mContext) {
private val ffrom = PlatformDataManager.getRam().getChannelName()
init {
initView()
......@@ -37,6 +40,11 @@ class HomeTestTopItemView(private val mContext: Context, private var homeEvent:
layoutParams = params
View.inflate(mContext, R.layout.home_test_top_item_view, this)
val isFromXinliZiXunHuawei =
!TextUtils.isEmpty(ffrom) && ffrom.startsWith("ATK_7") && ffrom.endsWith("huawei")
if (isFromXinliZiXunHuawei) {
ll_day_test.visibility = View.GONE
}
}
/**
......
......@@ -14,19 +14,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="8dp"
android:layout_marginRight="15dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingBottom="20dp">
android:paddingBottom="12dp">
<RelativeLayout
android:id="@+id/homeModuleButtonBannerFirst"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:background="@drawable/home_dcotor_bt_bg"
android:gravity="center">
......@@ -35,16 +32,17 @@
android:id="@+id/homeModuleButtonBannerFirstTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="预约咨询"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_first_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerFirstTitle"
android:layout_marginTop="2dp"
android:text="1W+师资"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
......@@ -54,8 +52,7 @@
android:id="@+id/homeModuleButtonBannerFourth"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:background="@drawable/home_listen_bt_bg"
android:gravity="center">
......@@ -64,16 +61,17 @@
android:id="@+id/homeModuleButtonBannerFourthTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="心理测试"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_second_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerFourthTitle"
android:layout_marginTop="2dp"
android:text="专业权威"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
......@@ -83,27 +81,27 @@
android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:background="@drawable/home_course_bt_bg"
android:gravity="center"
android:orientation="vertical">
>
<TextView
android:id="@+id/homeModuleButtonBannerThirdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="心理课堂"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_third_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerThirdTitle"
android:layout_marginTop="2dp"
android:text="学习与成长"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
......@@ -113,60 +111,35 @@
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:background="@drawable/home_test_bt_bg">
android:background="@drawable/home_test_bt_bg"
android:gravity="center">
<TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="7dp"
android:text="即时倾诉"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<RelativeLayout
<TextView
android:id="@+id/tv_fourth_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/home_button_first_free_bg"
android:paddingLeft="5dp"
android:paddingTop="1dp"
android:paddingRight="5dp"
android:paddingBottom="1dp"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_centerVertical="true"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="即时倾诉"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_centerVertical="true"
android:layout_marginTop="2dp"
android:text="专业解忧"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</LinearLayout>
</LinearLayout>
android:text="专业解忧"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_home_module_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="8dp"
android:layout_marginRight="15dp"
android:gravity="center_horizontal"
android:paddingBottom="12dp"
android:orientation="horizontal">
<RelativeLayout
android:id="@+id/homeModuleButtonBannerFirst"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:background="@drawable/home_dcotor_bt_bg"
android:gravity="center_horizontal">
<TextView
android:id="@+id/homeModuleButtonBannerFirstTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="预约咨询"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_first_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerFirstTitle"
android:text="1W+师资"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerFourth"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:background="@drawable/home_listen_bt_bg"
android:gravity="center_horizontal">
<TextView
android:id="@+id/homeModuleButtonBannerFourthTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="心理测试"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_second_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerFourthTitle"
android:text="专业权威"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:background="@drawable/home_course_bt_bg"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/homeModuleButtonBannerThirdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="心理课堂"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_third_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerThirdTitle"
android:text="学习与成长"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_weight="1"
android:background="@drawable/home_test_bt_bg"
android:gravity="center_horizontal">
<TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="7dp"
android:text="即时倾诉"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_fourth_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_centerVertical="true"
android:text="专业解忧"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_11" />
</RelativeLayout>
</LinearLayout>
<com.yidianling.home.ui.widget.HomeModuleCategoryView
android:id="@+id/home_category_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:paddingTop="@dimen/platform_dp_24"
android:paddingBottom="@dimen/platform_dp_14">
<View
android:layout_width="0dp"
android:layout_height="5dp"
android:background="@drawable/home_common_title_gradient_back"
app:layout_constraintLeft_toLeftOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintRight_toRightOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintBottom_toBottomOf="@+id/homeModuleCommonTitleViewTitle"
android:layout_marginBottom="2dp"/>
<TextView
android:id="@+id/homeModuleCommonTitleViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="@dimen/platform_dp_1"
tools:text="通用.标题"
android:textSize="24dp"
android:textStyle="bold"
android:textColor="@color/platform_color_333333"
android:layout_marginLeft="@dimen/platform_dp_15"
app:layout_constraintLeft_toLeftOf="parent"/>
<LinearLayout
android:layout_width="66dp"
android:layout_height="@dimen/platform_dp_24"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="@dimen/platform_dp_3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="@dimen/platform_dp_15"
android:background="@drawable/home_show_more_line">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="更多"
android:layout_marginLeft="@dimen/platform_dp_2"
android:textColor="@color/platform_color_444444"
android:textSize="13sp"/>
<ImageView
android:layout_height="8dp"
android:layout_width="4dp"
android:src="@drawable/home_sale_arrow"
android:layout_marginLeft="3dp"/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:paddingTop="@dimen/platform_dp_24"
android:paddingBottom="@dimen/platform_dp_14">
<View
android:id="@+id/view_line"
android:layout_width="0dp"
android:layout_height="5dp"
android:background="@drawable/home_common_title_gradient_back"
app:layout_constraintLeft_toLeftOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintRight_toRightOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintBottom_toBottomOf="@+id/homeModuleCommonTitleViewTitle"
android:layout_marginBottom="2dp"/>
<TextView
android:id="@+id/homeModuleCommonTitleViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="@dimen/platform_dp_1"
tools:text="通用.标题"
android:textSize="24dp"
android:textStyle="bold"
android:textColor="@color/platform_color_333333"
android:layout_marginLeft="@dimen/platform_dp_15"
app:layout_constraintLeft_toLeftOf="parent"/>
<LinearLayout
android:layout_width="66dp"
android:layout_height="@dimen/platform_dp_24"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="@dimen/platform_dp_3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="@dimen/platform_dp_15"
android:background="@drawable/home_show_more_line">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="更多"
android:layout_marginLeft="@dimen/platform_dp_2"
android:textColor="@color/platform_color_444444"
android:textSize="13sp"/>
<ImageView
android:layout_height="8dp"
android:layout_width="4dp"
android:src="@drawable/home_sale_arrow"
android:layout_marginLeft="3dp"/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
......@@ -81,6 +81,7 @@
</LinearLayout>
<TextView
android:id="@+id/tv_go"
android:layout_width="@dimen/platform_dp_32"
android:layout_height="@dimen/platform_dp_32"
android:background="@drawable/home_test_item_go_bg"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
......@@ -22,7 +22,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/home_image_default_back"
android:scaleType="centerCrop"/>
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="match_parent"
......@@ -32,13 +32,13 @@
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="45"/>
android:layout_weight="45" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="55"
android:background="@drawable/home_intelligent_gradient_back"/>
android:background="@drawable/home_intelligent_gradient_back" />
</LinearLayout>
</RelativeLayout>
......@@ -59,8 +59,7 @@
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_24"
android:textStyle="bold"
tools:text="先结婚还是先买先结婚还是先买房"
/>
tools:text="先结婚还是先买先结婚还是先买房" />
<LinearLayout
android:id="@+id/homeModuleIntelligentTopViewDescLayout"
......@@ -82,19 +81,18 @@
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:text="2486"
/>
tools:text="2486" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="已测"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12"
/>
android:textSize="@dimen/platform_dp_12" />
</LinearLayout>
<RelativeLayout
android:id="@+id/ll_day_test"
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_20"
android:layout_alignParentRight="true"
......@@ -107,7 +105,7 @@
android:text="每日一测"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"/>
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
......@@ -43,7 +43,7 @@ interface ImRetrofitApi {
fun getUserType(@Query("targetUid") uid: String): Observable<BaseResponse<UserTypeBean>>
//根据专家uid获取私聊的目标uid(有可能是专家uid,有可能是助理uid)
@GET("doctor/chat-user")
@GET("consult/assistant/chat-user")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun getChatUid(@Query("doctorUid") uid: String): Observable<BaseAPIResponse<DoctorAssistantRespDtoBean>>
......
......@@ -36,6 +36,7 @@ import com.yidianling.im.session.action.SendCardAction;
import com.yidianling.im.session.action.TeamAVChatAction;
import com.yidianling.im.session.extension.CustomAttachChatTipMsg;
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.CustomAttachModifyTime;
......@@ -64,6 +65,7 @@ import com.yidianling.im.session.extension.StickerAttachment;
import com.yidianling.im.session.viewholder.MsgViewHolderAVChat;
import com.yidianling.im.session.viewholder.MsgViewHolderChatTip;
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.MsgViewHolderCustomTip;
import com.yidianling.im.session.viewholder.MsgViewHolderCustomerServiceCard;
......@@ -412,6 +414,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachPleaseSubscribeConsultDate.class, MsgViewHolderPleaseSubscribeConsultDate.class);//请预约咨询时间
NimUIKit.registerMsgItemViewHolder(CustomCustomerServiceCardAttachment.class, MsgViewHolderCustomerServiceCard.class);//客服小壹名片
NimUIKit.registerMsgItemViewHolder(CustomAttachmentShareMsg.class, MsgViewHolderShareMsg.class);//分享推送
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultCallStatus.class, MsgViewHolderConsultCallStatus.class);//咨询声网的拨打状态
}
private static void setSessionListener() {
......
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* Created by Wi1ls on 2016/11/28;
*/
public class CustomAttachConsultCallStatus extends CustomAttachment{
private final String KEY_STATUS="status";
private final String KEY_CALLER="caller";
private final String KEY_CALLEE="callee";
private final String KEY_DURATION="duration";
private String status;
private String caller;
private String callee;
private String duration;
public CustomAttachConsultCallStatus() {
super(CustomAttachmentType.TYPE_CUSTOMER_CONSULT_CALL_STATUS);
}
@Override
protected void parseData(JSONObject data) {
this.status=data.getString(KEY_STATUS);
this.caller=data.getString(KEY_CALLER);
this.callee=data.getString(KEY_CALLEE);
this.duration=data.getString(KEY_DURATION);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(KEY_STATUS,status);
data.put(KEY_CALLER, caller);
data.put(KEY_CALLEE, callee);
data.put(KEY_DURATION, duration);
return data;
}
public String getStatus() {
return status;
}
public String getCaller() {
return caller;
}
public String getCallee() {
return callee;
}
public String getDuration() {
return duration;
}
}
......@@ -111,6 +111,10 @@ public class CustomAttachParser implements MsgAttachmentParser {
//分享消息,倾诉推荐,课程,测评,文章
attachment = new CustomAttachmentShareMsg();
break;
case CustomAttachmentType.TYPE_CUSTOMER_CONSULT_CALL_STATUS:
//咨询的声网拨打状态的自定义消息
attachment = new CustomAttachConsultCallStatus();
break;
default:
attachment = new DefaultCustomAttachment();
break;
......
......@@ -33,4 +33,5 @@ public interface CustomAttachmentType {
int TYPE_PLEASE_SUBSCRIBE_CONSULT_DATE = 29;//请预约咨询时间
int TYPE_PUSH_SHARE = 30;// 分享,倾诉推荐,课程,测评,文章
int TYPE_CUSTOMER_SERVICE = 31; //客服名片
int TYPE_CUSTOMER_CONSULT_CALL_STATUS = 32; //咨询的声网拨打状态的自定义消息
}
package com.yidianling.im.session.viewholder;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomAttachConsultCallStatus;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
/**
* Created by zhoujianghua on 2015/8/6.
*/
public class MsgViewHolderConsultCallStatus extends MsgViewHolderBase {
private ImageView typeImage;
private TextView statusLabel;
public MsgViewHolderConsultCallStatus(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
}
@Override
protected int getContentResId() {
return R.layout.im_ui_message_custom_consult_call_status;
}
@Override
protected void inflateContentView() {
typeImage = findViewById(R.id.type_img);
statusLabel = findViewById(R.id.tv_state);
}
@Override
protected void bindContentView() {
CustomAttachConsultCallStatus customAttachTipMsg = (CustomAttachConsultCallStatus) message.getAttachment();
layoutByDirection(customAttachTipMsg);
}
private void layoutByDirection(CustomAttachConsultCallStatus customAttachTipMsg) {
if (isReceivedMessage()) {
typeImage.setImageResource(R.drawable.im_avchat_left_type_audio);
statusLabel.setTextColor(context.getResources().getColor(R.color.platform_color_grey_999999));
} else {
typeImage.setImageResource(R.drawable.im_avchat_right_type_audio);
statusLabel.setTextColor(Color.WHITE);
}
if (TextUtils.equals("1", customAttachTipMsg.getStatus())) {
typeImage.setVisibility(View.VISIBLE);
statusLabel.setText(customAttachTipMsg.getDuration());
} else {
typeImage.setVisibility(View.GONE);
if (isReceivedMessage()) {
statusLabel.setText(customAttachTipMsg.getCallee());
} else {
statusLabel.setText(customAttachTipMsg.getCaller());
}
}
}
}
......@@ -11,6 +11,9 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.nimbase.api.model.session.SessionCustomization;
import com.yidianling.nimbase.business.preference.UserPreferences;
......@@ -20,10 +23,16 @@ import com.yidianling.nimbase.common.util.sys.ScreenUtil;
import com.yidianling.uikit.business.session.fragment.YDLMessageFragment;
import com.yidianling.uikit.custom.bridge.ActionHandlerStorage;
import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler;
import com.yidianling.uikit.custom.http.ServiceImpl;
import com.yidianling.uikit.custom.widget.TitleBarBottom;
import java.net.URLEncoder;
import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* Created by zhoujianghua on 2015/9/10.
*/
......
package com.yidianling.uikit.business.session.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
import com.yidianling.im.R;
public class MaxHeightScrollView extends ScrollView {
private int mMaxHeight;
public MaxHeightScrollView(Context context) {
super(context);
}
public MaxHeightScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
initialize(context, attrs);
}
public MaxHeightScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initialize(context, attrs);
}
private void initialize(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MaxHeightScrollView);
mMaxHeight = typedArray.getLayoutDimension(R.styleable.MaxHeightScrollView_maxHeight, mMaxHeight);
typedArray.recycle();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mMaxHeight > 0) {
heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(mMaxHeight, View.MeasureSpec.AT_MOST);
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
......@@ -52,7 +52,12 @@ interface ServiceApi {
//获取新用户收集的信息
@POST("user/getNewUserMes")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getNewUserMes(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>>
fun getNewUserMes(@Body body: RequestBody): Observable<BaseAPIResponse<List<UserQuestInfoBean>>>
//获取用户来源的信息
@GET("user/getExChannel")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getUserSource(@Query("uid") uid: String): Observable<BaseAPIResponse<String>>
//信息采集的问题
@POST("user/collect/submit")
......
package com.yidianling.uikit.custom.http
import com.alibaba.fastjson.JSON
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.uikit.custom.http.response.*
......@@ -66,8 +67,20 @@ class ServiceImpl private constructor() {
/**
* 获取新用户收集的信息
*/
fun getNewUserMes(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getNewUserMes()
fun getNewUserMes(bean: NewUserMesBean): Observable<BaseAPIResponse<List<UserQuestInfoBean>>> {
val beanStr = JSON.toJSONString(bean)
val body = RequestBody.create(
MediaType.parse("application/json; charset=utf-8"),
beanStr
) as RequestBody
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getNewUserMes(body)
}
/**
* 获取用户来源
*/
fun getUserSourceFrom(uid: String): Observable<BaseAPIResponse<String>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getUserSource(uid)
}
/**
......
package com.yidianling.uikit.custom.http.response
class NewUserMesBean(val targetUid: String)
\ No newline at end of file
......@@ -36,7 +36,6 @@ public class ConfideOrderInfoView extends RelativeLayout {
private String mSessionId;
private IP2PCustomActionHandler.DocInfo info = null;
private TextView tv_status = null;
private TextView tv_tips = null;
private TextView tv_action = null;
private TextView tv_order_info = null;
private ImageView iv_call = null;
......@@ -61,7 +60,6 @@ public class ConfideOrderInfoView extends RelativeLayout {
View.inflate(mContext, R.layout.im_nim_chat_confide_order_info_view, this);
setBackground(getResources().getDrawable(R.drawable.im_bg_im_confide_action));
tv_status = findViewById(R.id.tv_status);
tv_tips = findViewById(R.id.tv_tips);
tv_action = findViewById(R.id.tv_action);
iv_call = findViewById(R.id.iv_call);
tv_order_info = findViewById(R.id.tv_order_info);
......@@ -78,7 +76,6 @@ public class ConfideOrderInfoView extends RelativeLayout {
//有未完成订单
if (info.hasAvailableListenOrder == 2) {
tv_status.setText("剩余时间:" + coverTime(Integer.valueOf(info.listenOrderRemainTime)));
tv_tips.setVisibility(View.GONE);
if (info.is_online == 3) { //通话中
......@@ -98,7 +95,6 @@ public class ConfideOrderInfoView extends RelativeLayout {
tv_action.setBackground(getResources().getDrawable(R.drawable.im_background_chat_confide_order_action));
tv_action.setTextColor(getResources().getColor(R.color.platform_but_text_color));
tv_action.setText("去评价");
tv_tips.setVisibility(View.VISIBLE);
}
tv_order_info.setText(info.listenOrderDesc);
}
......
......@@ -21,7 +21,7 @@ import com.yidianling.im.R;
public class TitleBarBottom extends RelativeLayout {
TextView tv_left_text, tv_center_title, tv_bottom_title, tv_right_text;
ImageView iv_title_divide, image, rightImage;
ImageView iv_title_divide, image, rightImage, title_tv_right_btn;
private View root;
......@@ -59,10 +59,20 @@ public class TitleBarBottom extends RelativeLayout {
iv_title_divide = (ImageView) root.findViewById(R.id.iv_title_divide);
image = (ImageView) root.findViewById(R.id.image);
rightImage = (ImageView) root.findViewById(R.id.iv_right);
title_tv_right_btn = (ImageView) root.findViewById(R.id.title_tv_right_btn);
setupView();
}
/**
* 设置标题文本右侧icon
*/
public void setTitleTextRightIcon(int resId, OnClickListener onClickListener) {
title_tv_right_btn.setImageResource(resId);
title_tv_right_btn.setVisibility(View.VISIBLE);
title_tv_right_btn.setOnClickListener(onClickListener);
}
/**
* 左侧文字点击事件
*/
public void setOnLeftTextClick(OnTitleBarTextClick leftTextClick) {
......
package com.yidianling.uikit.custom.widget
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 com.yidianling.im.R
import kotlinx.android.synthetic.main.im_user_info_dialog_layout.*
/**
* 用户信息弹窗
* Created by xj on 2020/3/25.
*/
class UserInfoDialog(
private val mContext: Context,
private val sourceFrom: String, //来源
private val age: String, //年龄
private val sex: String, //性别
private val consultType: String, //咨询类型
private val questionDes: String //问题描述
) : Dialog(mContext, R.style.dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.im_user_info_dialog_layout)
val params = window.attributes
params.width = WindowManager.LayoutParams.MATCH_PARENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
window.setGravity(Gravity.CENTER)
window.attributes = params
if (!TextUtils.isEmpty(sourceFrom)) {
user_info_dialog_sourceFrom.visibility = View.VISIBLE
user_info_dialog_sourceFrom_tv.text = sourceFrom
}
user_info_dialog_age_tv.text = age
user_info_dialog_sex_tv.text = sex
user_info_dialog_consultType_tv.text = consultType
user_info_dialog_questionDes_tv.text = questionDes
user_info_dialog_close.setOnClickListener {
if (null != mContext) {
dismiss()
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="6dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/type_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="3dp"
android:layout_marginRight="8dp"
android:contentDescription="@string/im_empty"
android:src="@drawable/im_avchat_left_type_audio"/>
<TextView
android:id="@+id/tv_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:text="无人接听"
android:textColor="@color/im_color_grey_999999"
android:textSize="14sp"/>
</LinearLayout>
......@@ -134,5 +134,9 @@
<!-- 指定消失的动画xml -->
</style>
<declare-styleable name="MaxHeightScrollView">
<attr name="maxHeight" format="dimension" />
</declare-styleable>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp" />
<solid android:color="@color/platform_white"/>
</shape>
\ No newline at end of file
......@@ -70,20 +70,4 @@
tools:background="@drawable/im_background_chat_confide_order_action"
tools:text="去评价" />
<TextView
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@drawable/im_background_chat_confide_order_tpis"
android:paddingLeft="5dp"
android:paddingTop="1dp"
android:paddingRight="5dp"
android:paddingBottom="1dp"
android:text="最高返30元红包"
android:textColor="@color/im_white"
android:textSize="9sp"
android:visibility="gone" />
</merge>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null"
android:gravity="center_vertical" />
<TextView
android:id="@+id/tv_left_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toEndOf="@id/image"
android:layout_toRightOf="@id/image"
android:background="?android:attr/selectableItemBackground"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColor="@android:color/white"
android:textSize="@dimen/platform_default_text_size_big"
tools:text="关闭"
tools:textColor="@color/platform_black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_marginTop="4dp"
android:layout_marginBottom="3dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_center_title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="2"
android:ellipsize="end"
android:gravity="center"
android:maxEms="12"
android:maxLength="12"
android:textColor="@color/im_color_242424"
android:textSize="17dp"
tools:text="现现现现现现在在现在在在在现在在" />
<TextView
android:id="@+id/tv_bottom_title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:drawablePadding="4dp"
android:ellipsize="end"
android:gravity="center"
android:maxEms="12"
android:maxLength="8"
android:textColor="@color/platform_color_666666"
android:textSize="10dp"
tools:drawableLeft="@drawable/im_background_chat_top_status_online"
tools:text="现在" />
</LinearLayout>
<ImageView
android:id="@+id/iv_right"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null"
android:gravity="center_vertical"
tools:src="@drawable/platform_more_green"/>
<TextView
android:id="@+id/tv_right_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/iv_right"
android:layout_toStartOf="@id/iv_right"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textColor="@color/platform_main_theme"
android:textSize="@dimen/platform_default_text_size_big"
android:drawablePadding="5dp"
tools:drawableLeft="@drawable/platform_share"
tools:ignore="RelativeOverlap" />
<ImageView
android:id="@+id/iv_title_divide"
android:layout_width="match_parent"
android:layout_height="@dimen/im_divide_line_stroke_width"
android:layout_alignParentBottom="true"
android:background="@color/im_divide_color" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null"
android:gravity="center_vertical" />
<TextView
android:id="@+id/tv_left_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toEndOf="@id/image"
android:layout_toRightOf="@id/image"
android:background="?android:attr/selectableItemBackground"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColor="@android:color/white"
android:textSize="@dimen/platform_default_text_size_big"
tools:text="关闭"
tools:textColor="@color/platform_black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_centerHorizontal="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:layout_marginBottom="3dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_center_title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="2"
android:ellipsize="end"
android:gravity="center"
android:maxEms="12"
android:maxLength="12"
android:textColor="@color/im_color_242424"
android:textSize="17dp"
tools:text="现现现现现现在在现在在在在现在在" />
<TextView
android:id="@+id/tv_bottom_title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:drawablePadding="4dp"
android:ellipsize="end"
android:gravity="center"
android:maxEms="12"
android:maxLength="8"
android:textColor="@color/platform_color_666666"
android:textSize="10dp"
tools:drawableLeft="@drawable/im_background_chat_top_status_online"
tools:text="现在" />
</LinearLayout>
<ImageView
android:id="@+id/title_tv_right_btn"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="3dp"
android:src="@drawable/im_star_red"
android:layout_marginLeft="4dp"
android:layout_gravity="center"
android:visibility="gone"/>
</LinearLayout>
<ImageView
android:id="@+id/iv_right"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null"
android:gravity="center_vertical"
tools:src="@drawable/platform_more_green" />
<TextView
android:id="@+id/tv_right_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_toStartOf="@id/iv_right"
android:layout_toLeftOf="@id/iv_right"
android:background="?android:attr/selectableItemBackground"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:textColor="@color/platform_main_theme"
android:textSize="@dimen/platform_default_text_size_big"
tools:drawableLeft="@drawable/platform_share"
tools:ignore="RelativeOverlap" />
<ImageView
android:id="@+id/iv_title_divide"
android:layout_width="match_parent"
android:layout_height="@dimen/im_divide_line_stroke_width"
android:layout_alignParentBottom="true"
android:background="@color/im_divide_color" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp">
<LinearLayout
android:id="@+id/dialog_user_detail_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/im_user_info_dialog_bg"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingTop="30dp"
android:paddingRight="20dp"
android:paddingBottom="21dp">
<RelativeLayout
android:id="@+id/user_info_dialog_sourceFrom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="31dp"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="推广来源"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<TextView
android:id="@+id/user_info_dialog_sourceFrom_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="SEM"
android:layout_alignParentRight="true"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="31dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="年龄"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<TextView
android:id="@+id/user_info_dialog_age_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="18"
android:layout_alignParentRight="true"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="31dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="性别"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<TextView
android:id="@+id/user_info_dialog_sex_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="男"
android:layout_alignParentRight="true"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="31dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="咨询类型"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<TextView
android:id="@+id/user_info_dialog_consultType_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="恋爱情感"
android:layout_alignParentRight="true"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</RelativeLayout>
<RelativeLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp">
<TextView
android:id="@+id/user_info_dialog_questionDes_left_tv"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:text="问题描述"
android:maxLines="1"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<com.yidianling.uikit.business.session.view.MaxHeightScrollView
android:layout_marginLeft="80dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
app:maxHeight="150dp">
<TextView
android:gravity="left"
android:id="@+id/user_info_dialog_questionDes_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="我是描述"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</com.yidianling.uikit.business.session.view.MaxHeightScrollView>
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/im_main_theme"
android:text="*涉及用户隐私,请谨慎使用上述信息*"
android:textSize="12dp"/>
</LinearLayout>
<ImageView
android:id="@+id/user_info_dialog_close"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_below="@+id/dialog_user_detail_bg"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:src="@drawable/im_expert_info_dialog_close_icon" />
</RelativeLayout>
......@@ -198,7 +198,8 @@ interface UserApi {
fun getFocusData(@Query("parentId") parentId: String = "0"): Observable<BaseAPIResponse<List<CollectFocusItemBean>>>
//获取新用户引导页面url
@FormUrlEncoded
@POST("user/getNewUserJumpUrl")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>>
fun getNewUserJumpUrl(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<String>>
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import com.google.gson.internal.LinkedTreeMap
import com.umeng.socialize.bean.SHARE_MEDIA
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseCommand
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.router.YdlCommonOut
......@@ -215,7 +216,8 @@ class UserHttpImpl private constructor() : UserHttp {
}
override fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>> {
return getUserApi().getNewUserJumpUrl()
return RxUtils.mapObservable(BaseCommand())
.flatMap { getUserApi().getNewUserJumpUrl(it) }
}
private object Holder {
......
......@@ -11,7 +11,6 @@ import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.data.http.GsonProvider
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
......@@ -45,6 +44,7 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
var pluginDelegate:CommonPluginDelegate?=null
const val CHANNEL: String = "lib/common/channel"
const val GETPUBLICPARAMAS: String = "getPublicParamas"
const val GET_PACKAGE_AND_FFROM: String = "get_package_and_ffrom" // 获取包名和渠道名,中间用,分割
const val ACTION_PUSH_EVENT_TRACKING_TAP: String = "action_push_event_tracking_tap"// 点击事件埋点
const val ACTION_PUSH_EVENT_TRACKING_PV: String = "action_push_event_tracking_pv"//pv埋点
const val ACTION_ORIGIN_THEME: String = "platform_origin_theme"//马甲包获取应用各个主题色的action
......@@ -175,6 +175,11 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
)
)
}
GET_PACKAGE_AND_FFROM -> {
val packageName = YdlCommonOut.getApp().packageName
val ffrom = PlatformDataManager.getRam().getChannelName()
result.success("$packageName,$ffrom")
}
}
}
......
......@@ -102,6 +102,32 @@ abstract class BaseActivity : AppCompatActivity(), IActivityLifecycleable {
}
}
/**
* 设置底部抬高的布局的颜色
*/
open fun setBottomColor(color: String) {
try {
if (getStatusViewOptions()?.isAddStatusView) {
if (StatusBarUtils.hasBottomNavigatorLine(this)) {
findViewById<View>(R.id.ll_bottom_v).setBackgroundColor(
Color.parseColor(
color
)
)
}
} else {
if (StatusBarUtils.hasBottomNavigatorLine(this)) {
findViewById<View>(R.id.ll_bottom_fit_v).setBackgroundColor(
Color.parseColor(
color
)
)
}
}
} catch (e: Exception) {
}
}
open fun getDefaultBottomColor(): Int {
return Color.parseColor("#00000000")
}
......
......@@ -154,6 +154,8 @@ class LogHelper private constructor() {
val yunxinLog = getYunXinLog(BaseApp.getApp())
//声网日志
val agoraLog = getAgoraLog(BaseApp.getApp())
val agoraRtmLog = getAgoraRTMLog(BaseApp.getApp())
val agoraRtmBackLog = getAgoraRtmBackLog(BaseApp.getApp())
if (zipFile.exists()) zipFile.delete()
zipFile.createNewFile()
......@@ -167,6 +169,12 @@ class LogHelper private constructor() {
if (agoraLog.exists()) {
files.add(agoraLog)
}
if (agoraRtmLog.exists()) {
files.add(agoraRtmLog)
}
if (agoraRtmBackLog.exists()) {
files.add(agoraRtmBackLog)
}
// ZipUtils.toZip(getLogFolder().absolutePath, FileOutputStream(zipFile), true)
ZipUtils.toZip(files, FileOutputStream(zipFile))
......@@ -226,10 +234,27 @@ class LogHelper private constructor() {
//获取声网日志
private fun getAgoraLog(context: Context): File {
val agora = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorasdk.log"
return File(agora)
// val agora = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorasdk.log"
val filePath = context.getExternalFilesDir(null).path + "/agorasdk.log"
return File(filePath)
}
//获取RTM日志
private fun getAgoraRTMLog(context: Context): File {
val agoraRTMLog = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorartm.log"
return File(agoraRTMLog)
}
//获取RTM备份日志
private fun getAgoraRtmBackLog(context: Context): File {
val agoraRTMLog = FileUtils.getSDDirectory() + "/" + context.packageName + "/agorartm_1.log"
return File(agoraRTMLog)
}
private object Holder {
val INSTANCE = LogHelper()
}
......
......@@ -44,6 +44,8 @@ class H5JsBean {
var orderStatus: Int = 0
var orderStatusDesc: String? = null
var bottomfitViewColor: String? = null //底部适配布局的颜色
var orderContent: String? = null//默认发送的第一天聊天
var action_name: String? = null
......
......@@ -17,7 +17,6 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.ValueCallback;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
......@@ -28,6 +27,7 @@ import com.tencent.smtt.export.external.interfaces.JsResult;
import com.tencent.smtt.export.external.interfaces.SslError;
import com.tencent.smtt.export.external.interfaces.SslErrorHandler;
import com.tencent.smtt.sdk.CookieSyncManager;
import com.tencent.smtt.sdk.ValueCallback;
import com.tencent.smtt.sdk.WebChromeClient;
import com.tencent.smtt.sdk.WebSettings;
import com.tencent.smtt.sdk.WebView;
......@@ -557,6 +557,12 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
});
}
public void setBottomViewColor(String color) {
runOnUiThread(() -> {
setBottomColor(color);
});
}
public void showTitleBar() {
runOnUiThread(() -> {
tb_title.setVisibility(VISIBLE);
......@@ -1280,6 +1286,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
* 新用户侧滑按钮限制
*/
if (h5Params.getBackLimit() != null && h5Params.getBackLimit() == H5Params.BackLimit.NEW_USER_PAGE) {
ModularServiceManager.INSTANCE.provide(IAppService.class).mainIntent(this);
return true;
}
......
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