Commit 4a55b7de by upwork.021

Merge remote-tracking branch 'origin/最新Dev' into dev_mdt_av

parents f63843d3 0884d82f
......@@ -7,6 +7,7 @@ import android.os.Process;
import androidx.multidex.MultiDex;
import android.webkit.WebView;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.meituan.android.walle.WalleChannelReader;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;
......@@ -58,6 +59,8 @@ public class ComponentTestApp extends BaseApp {
initUmeng();
registerActivityLifecycleCallbacks(new CoursePlayLifecycle());
Fresco.initialize(this);
}
private void initUmeng() {
......
......@@ -5,12 +5,12 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.38",
"m-consultant" : "0.0.60.04",
"m-confide" : "0.0.49.64",
"m-consultant" : "0.0.60.11",
"m-fm" : "0.0.30.04",
"m-user" : "0.0.61.94",
"m-home" : "0.0.22.92",
"m-im" : "0.0.21.15",
"m-user" : "0.0.62.02",
"m-home" : "0.0.23.16",
"m-im" : "0.0.21.21",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.10",
......@@ -26,7 +26,7 @@ ext {
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.17",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23",
"m-dynamic-api" : "0.0.3.71",
......@@ -36,13 +36,13 @@ ext {
"ydl-tuicore" : "0.0.1",
"ydl-tuicalling": "0.0.6",
//第一步
"ydl-platform" : "0.0.40.79",
"ydl-platform" : "0.0.40.89",
//第二步 若干
"ydl-webview" : "0.0.38.58",
"ydl-media" : "0.0.21.42",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.59",
"m-audioim" : "0.0.49.29.84",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
......@@ -79,6 +79,7 @@ ext {
retrofitSdkVersion : "2.6.0",
dagger2SdkVersion : "2.23.2",
glideSdkVersion : "4.12.0",
frescoSdkVersion : "2.1.0",
butterknifeSdkVersion : "9.0.0-rc1",
rxlifecycleSdkVersion : "1.0",
rxlifecycle2SdkVersion : "2.2.2",
......@@ -91,12 +92,12 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.38",
"m-consultant" : "0.0.60.04",
"m-confide" : "0.0.49.64",
"m-consultant" : "0.0.60.11",
"m-fm" : "0.0.30.07",
"m-user" : "0.0.61.94",
"m-home" : "0.0.22.92",
"m-im" : "0.0.21.15",
"m-user" : "0.0.62.02",
"m-home" : "0.0.22.98",
"m-im" : "0.0.21.21",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.8",
......@@ -111,7 +112,7 @@ ext {
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.17",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23",
"m-dynamic-api" : "0.0.3.71",
......@@ -120,13 +121,13 @@ ext {
"ydl-tuicore" : "0.0.1",
"ydl-tuicalling": "0.0.6",
//第一步
"ydl-platform" : "0.0.40.79",
"ydl-platform" : "0.0.40.89",
//第二步 若干
"ydl-webview" : "0.0.38.58",
"ydl-media" : "0.0.21.42",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.59",
"m-audioim" : "0.0.49.29.84",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
......@@ -160,7 +161,11 @@ ext {
"glide-loader-okhttp3" : "com.github.bumptech.glide:okhttp3-integration:${version["glideSdkVersion"]}",
"glide-annotations" : "com.github.bumptech.glide:annotations:${version["glideSdkVersion"]}",
"glide-transformations" : "jp.wasabeef:glide-transformations:4.3.0",
"picasso" : "com.squareup.picasso:picasso:2.5.2",
// "picasso" : "com.squareup.picasso:picasso:2.5.2",
"fresco" : "com.facebook.fresco:fresco:${version["frescoSdkVersion"]}",
// 支持 WebP (静态图+动图),需要添加
"fresco-animated-webp" : "com.facebook.fresco:animated-webp:${version["frescoSdkVersion"]}",
"fresco-webpsupport" : "com.facebook.fresco:webpsupport:${version["frescoSdkVersion"]}",
//view
"autolayout" : "com.zhy:autolayout:1.4.5",
......
......@@ -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.3.2@aar'){
api ('com.ydl:ydl-av:1.3.8@aar'){
transitive = true
}
......
......@@ -35,6 +35,7 @@ import com.ydl.audioim.presenter.AudioHomePresenterImpl
import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.audioim.utils.DateUtils
import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.audioim.widget.ZDialog
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.webview.RefreshWebEvent
......@@ -201,6 +202,7 @@ class AudioHomeActivity :
*/
private var dialStatus: String? = null
private var mStorageDialog: ZDialog? = null
/**
* 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
......@@ -225,7 +227,9 @@ class AudioHomeActivity :
// 声网发出警告错误码,不应该直接离开房间
}
/**
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_error_code.html
* */
override fun onError(err: Int) {
super.onError(err)
uploadException("mRtcEventHandler-onError:errorCode--%${err}", callback = null)
......@@ -234,6 +238,7 @@ class AudioHomeActivity :
.sendRichLog(AliYunLogConfig.AGORA, "声网错误回调errorCode--%${err}")
//3:SDK 初始化失败。Agora 建议尝试以下处理方法
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
//9:没有操作权限。请检查用户是否授予 app 音视频设备使用权限。
//10:API 调用超时。有些 API 调用需要 SDK 返回结果,如果 SDK 处理时间过长,超过 10 秒没有返回,会出现此错误
//17:加入频道被拒绝。一般有以下原因:
//用户已进入频道,再次调用加入频道的 API,例如 joinChannel,会返回此错误。停止调用该方法即可。
......@@ -306,7 +311,9 @@ class AudioHomeActivity :
// leaveChannel()
// }
}
/**
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e
* */
override fun onConnectionStateChanged(state: Int, reason: Int) {
super.onConnectionStateChanged(state, reason)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
......@@ -656,13 +663,8 @@ class AudioHomeActivity :
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "拒绝请求音频权限")
uploadLog()
ToastHelper.show(getString(R.string.audioim_need_storage_permission_hint))
showStorageDialog()
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
val uri = Uri.fromParts("package", packageName, null)
intent.data = uri
startActivity(intent)
finish()
}
})
......@@ -675,7 +677,28 @@ class AudioHomeActivity :
}
}
private fun showStorageDialog() {
if (mStorageDialog == null) {
mStorageDialog = ZDialog.Builder(this)
.setContentView(R.layout.audioim_activity_permission_dialog)
.setOnClickListener(R.id.cancel_dialog) {
mStorageDialog?.dismiss()
mStorageDialog=null
finish()
}
.setAnimation(0)//取消动画
.setOnClickListener(R.id.dial_right_now) {
mStorageDialog?.dismiss()
mStorageDialog=null
finish()
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
val uri = Uri.fromParts("package", packageName, null)
intent.data = uri
startActivity(intent)
}
.show()
}
}
@SuppressLint("CheckResult", "SetTextI18n")
private fun init() {
wave_view.start()
......@@ -710,10 +733,17 @@ class AudioHomeActivity :
waittingStatus()
} else {
tv_change_time_counter.text = "${remainTime}s"
}
if (remainTime<=20){
audio_hangup_text.text="挂断"
}else{
audio_hangup_text.text="挂断(${remainTime-20}s)"
}
var result = it.toFloat() / 2.5f
var result = it.toFloat()/3f
progress_view.setProgress(result)
if (result >= 100f && !iv_hang_up.isEnabled) {
audio_hangup_text.text="挂断"
//挂断按钮可点击
iv_hang_up.isEnabled = true
iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
......@@ -754,7 +784,7 @@ class AudioHomeActivity :
//通话结束或挂断时,上传日志文件
uploadLog()
showToast("对方手机暂时不在身边,请稍后再试")
showToast("暂时无法接通,建议稍后尝试")
userCloseCalling()
}
}
......@@ -777,7 +807,7 @@ class AudioHomeActivity :
* param mRtcEventHandler 事件回调(SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
*/
voiceManage = YDLVoiceManager(this, BuildConfig.AGORA_APPID, mRtcEventHandler)
voiceManage!!.init()
voiceManage?.init()
}
/**
......@@ -1150,6 +1180,8 @@ class AudioHomeActivity :
} else {
cmd.status = "CALL_OFF"
}
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "用户加入频道后,通知服务端发送推送")
mPresenter.noticeServerPush(cmd)
}
......@@ -1176,8 +1208,6 @@ class AudioHomeActivity :
sensorManager!!.getDefaultSensor(Sensor.TYPE_PROXIMITY),
SensorManager.SENSOR_DELAY_NORMAL
)
ActionCountUtils.count(
"shengwang_popup_layer_page|shengwang_popup_layer_page_visit",
"",
......@@ -1321,7 +1351,6 @@ class AudioHomeActivity :
override fun onDestroy() {
super.onDestroy()
uploadLog()
ToastUtil.toastShort("拨打电话界面销毁")
if (isConnectSuccess) {
uploadException("", "zhu", "108", callback = null)
}
......
......@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.os.Handler
import android.text.TextUtils
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.google.gson.Gson
import com.ydl.audioim.bean.AgoraInvitationBean
......@@ -66,6 +67,9 @@ class YDLavManager {
fun init(context: Context, appId: String) {
YDLRTMClient.instances.init(context, appId, listener)
if (EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().unregister(this)
}
EventBus.getDefault().register(this)
//设置回调
setCallback()
......@@ -693,7 +697,9 @@ class YDLavManager {
"onMessageReceived:${message.text} -->uid:$userId"
)
}
/**
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e
* */
override fun onConnectionStateChanged(state: Int, reason: Int) {
sdkStatus = state
writeAgoraLog(
......
......@@ -2,14 +2,17 @@ package com.ydl.audioim.presenter
import android.annotation.SuppressLint
import com.ydl.audioim.BuildConfig
import com.ydl.ydl_av.chat.config.YDLChatParam
import com.ydl.audioim.contract.IAudioHomeActivityContract
import com.ydl.audioim.http.command.*
import com.ydl.audioim.http.command.ConnectCommand
import com.ydl.audioim.http.command.NoticePushCommand
import com.ydl.audioim.model.AudioHomeModelImpl
import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.ydl_av.chat.config.YDLChatParam
import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper
import io.reactivex.android.schedulers.AndroidSchedulers
......@@ -113,30 +116,55 @@ class AudioHomePresenterImpl :
if (it.data?.dialDetail?.callConnectType ?: -1 == 1) {
//axb
mView.switchAXBResponse(it.data?.dialDetail?.phoneNu ?: "")
AudioLogUtils.writeAgoraLog("连接成功,连接状态:${it.data?.dialDetail?.dialStatus}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time
)}", "confide.log", true)
AudioLogUtils.writeAgoraLog(
"连接成功,连接状态:${it.data?.dialDetail?.dialStatus}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
} else {
ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败")
AudioLogUtils.writeAgoraLog("连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time
)}", "confide.log", true)
AudioLogUtils.writeAgoraLog(
"连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
LogHelper.getInstance().uploadLog(false)
}
} else {
ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败")
AudioLogUtils.writeAgoraLog("连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time
)}", "confide.log", true)
AudioLogUtils.writeAgoraLog(
"连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
LogHelper.getInstance().uploadLog(false)
}
} else {
ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败")
AudioLogUtils.writeAgoraLog("连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time
)}", "confide.log", true)
AudioLogUtils.writeAgoraLog(
"连接状态:${it.data?.dialDetail?.dialStatus}失败原因:${it.data?.dialDetail?.dialReason}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
LogHelper.getInstance().uploadLog(false)
}
}, { e ->
LogUtil.d(e.message)
AudioLogUtils.writeAgoraLog("连接状态:${e.message}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time
)}", "confide.log", true)
AudioLogUtils.writeAgoraLog(
"连接状态:${e.message}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
LogHelper.getInstance().uploadLog(false)
})
}
......@@ -152,25 +180,46 @@ class AudioHomePresenterImpl :
.subscribe({
if (it.code == 200) {
AudioLogUtils.writeAgoraLog(
"通知服务端发送推送成功-------Time:${AudioLogUtils.format.format(
Calendar.getInstance().time
)}", "confide.log", true
"通知服务端发送推送成功-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
AliYunRichLogsHelper.getInstance()
.sendRichLog(
AliYunLogConfig.AGORA,
"通知服务端发送推送成功----接口:push/notify/doctor ---Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
)
} else {
LogUtil.e(it.msg)
AudioLogUtils.writeAgoraLog(
"通知服务端发送推送失败${it.msg}-------Time:${AudioLogUtils.format.format(
Calendar.getInstance().time
)}", "confide.log", true
"通知服务端发送推送失败${it.msg}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
AliYunRichLogsHelper.getInstance()
.sendRichLog(
AliYunLogConfig.AGORA,
"通知服务端发送推送失败${it.msg}--接口:push/notify/doctor -----Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
)
LogHelper.getInstance().uploadLog(false)
}
}, { e ->
AudioLogUtils.writeAgoraLog(
"通知服务端发送推送失败${e.message}-------Time:${AudioLogUtils.format.format(
Calendar.getInstance().time
)}", "confide.log", true
"通知服务端发送推送失败${e.message}-------Time:${
AudioLogUtils.format.format(
Calendar.getInstance().time
)
}", "confide.log", true
)
AliYunRichLogsHelper.getInstance()
.sendRichLog(
AliYunLogConfig.AGORA,
"通知服务端发送推送失败${e.message}--接口:push/notify/doctor -----Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
)
LogHelper.getInstance().uploadLog(false)
LogUtil.e(e.message)
})
......
package com.ydl.audioim.widget;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import androidx.annotation.NonNull;
import com.ydl.audioim.R;
/**
* Created on 2018/1/18 11:24
*
* @author Z
* @version : 1.0.0
* 利用Builder模式构建一个通用的Dialog,现在暂时不支持在ZDialog中自定义加载图片
* use like this:
* new ZDialog.Builder(this)
* .setContentView(R.layout.zdialog_normal)
* .setFullScreen()
* .setCancelAble(true)
* .setGravity(ZDialogDirection.FROM_BOTTOM)
* .setText(R.id.tv_normal_test,"哈哈哈哈")
* .setOnClickListener(R.id.btn_normal, ...)
*
*/
public class ZDialog extends Dialog {
private ZDialogController mDialogController;
public ZDialog( Context context) {
super(context, R.style.audioim_ZDialogDefaultStyle);
init();
}
private void init() {
mDialogController = new ZDialogController(this, getWindow());
}
public ZDialog(@NonNull Context context, int themeResId) {
super(context, themeResId);
init();
}
public void setOnClickListener(int viewId, View.OnClickListener listener) {
mDialogController.setOnClickListener(viewId, listener);
}
public EditText getEditText(int viewId) {
return mDialogController.getEditText(viewId);
}
public View findDialogView(int viewId) {
return mDialogController.findView(viewId);
}
public static class Builder {
private ZDialogController.ZDialogParams mDialogParams;
public Builder(Context context) {
this(context, R.style.audioim_ZDialogDefaultStyle);
}
public Builder(Context context, int themeResId) {
mDialogParams = new ZDialogController.ZDialogParams(context, themeResId);
//设置一个默认的动画
mDialogParams.animation = R.style.audioim_ZDialogDefaultAnimation;
}
public Builder setContentView(View contentView) {
mDialogParams.contentView = contentView;
mDialogParams.contentResId = 0;
return this;
}
public Builder setContentView(int contentViewResId) {
mDialogParams.contentResId = contentViewResId;
mDialogParams.contentView = null;
return this;
}
public Builder setText(int viewId, CharSequence charSequence) {
mDialogParams.textArray.put(viewId, charSequence);
return this;
}
public Builder setText(int viewId, int strId) {
mDialogParams.textArray.put(viewId, mDialogParams.context.get().getResources().getString(strId));
return this;
}
public Builder setOnClickListener(int viewId, View.OnClickListener onClickListener) {
mDialogParams.clickViewArray.put(viewId, onClickListener);
return this;
}
public Builder setOnDismissListener(OnDismissListener onDismissListener) {
mDialogParams.onDismissListener = onDismissListener;
return this;
}
public Builder setOnCancelListener(OnCancelListener onCancelListener) {
mDialogParams.onCancelListener = onCancelListener;
return this;
}
public Builder setOnKeyListener(OnKeyListener onKeyListener) {
mDialogParams.onKeyListener = onKeyListener;
return this;
}
public Builder setFullScreen() {
mDialogParams.defaultWidth = ViewGroup.LayoutParams.MATCH_PARENT;
return this;
}
public Builder setGravity(@ZDialogDirection.ZGravity int direction) {
switch (direction) {
case ZDialogDirection.FROM_TOP:
mDialogParams.direction = Gravity.TOP;
break;
case ZDialogDirection.FROM_BOTTOM:
mDialogParams.direction = Gravity.BOTTOM;
default:
break;
}
return this;
}
public Builder setAnimation(int animationRes) {
mDialogParams.animation = animationRes;
return this;
}
public Builder setCancelAble(boolean cancelAble) {
mDialogParams.cancelable = cancelAble;
return this;
}
public ZDialog show() {
ZDialog zDialog = create();
zDialog.show();
return zDialog;
}
private ZDialog create() {
ZDialog dialog = new ZDialog(mDialogParams.context.get(), mDialogParams.themeResId);
mDialogParams.apply(dialog.mDialogController);
dialog.setCancelable(mDialogParams.cancelable);
dialog.setOnCancelListener(mDialogParams.onCancelListener);
dialog.setOnDismissListener(mDialogParams.onDismissListener);
return dialog;
}
}
}
package com.ydl.audioim.widget;
import android.content.Context;
import android.content.DialogInterface;
import android.util.SparseArray;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import java.lang.ref.WeakReference;
/**
* Created on 2018/1/18 11:32
*
* @author Z
* @version : 1.0.0
*/
public class ZDialogController {
private ZDialog mZDialog;
private Window mWindow;
private ZDialogViewHelper mZDialogViewHelper;
public ZDialogController(ZDialog ZDialog, Window window) {
mZDialog = ZDialog;
mWindow = window;
}
public ZDialog getZDialog() {
return mZDialog;
}
public Window getWindow() {
return mWindow;
}
public void setZDialogViewHelper(ZDialogViewHelper ZDialogViewHelper) {
mZDialogViewHelper = ZDialogViewHelper;
}
public void setText(int viewId, CharSequence charSequence) {
mZDialogViewHelper.setText(viewId, charSequence);
}
public EditText getEditText(int viewId) {
return mZDialogViewHelper.getEditText(viewId);
}
public View findView(int viewId) {
return mZDialogViewHelper.findView(viewId);
}
public void setOnClickListener(int viewId, View.OnClickListener onClickListener) {
mZDialogViewHelper.setOnClickListener(viewId, onClickListener);
}
/**
* ZDialog 显示出来可能需要的一些参数
*/
public static class ZDialogParams {
public WeakReference<Context> context;
public int themeResId;// dialog 的style
public boolean cancelable;
public View contentView;
public int contentResId;
public int defaultWidth = ViewGroup.LayoutParams.WRAP_CONTENT;
public int defaultHeight = ViewGroup.LayoutParams.WRAP_CONTENT;
public int direction = Gravity.CENTER;
public int animation = 0;
public SparseArray<CharSequence> textArray = new SparseArray<>();
public SparseArray<View.OnClickListener> clickViewArray = new SparseArray<>();
public DialogInterface.OnCancelListener onCancelListener;
public DialogInterface.OnDismissListener onDismissListener;
public DialogInterface.OnKeyListener onKeyListener;
public ZDialogParams(Context context, int themeResId) {
this.context = new WeakReference<>(context);
this.themeResId = themeResId;
}
public void apply(ZDialogController controller) {
//创建ZDialogViewHelper
ZDialogViewHelper viewHelper = null;
if (contentResId != 0) {
viewHelper = new ZDialogViewHelper(context.get(), contentResId);
}
if (contentView != null) {
viewHelper = new ZDialogViewHelper();
viewHelper.setContentView(contentView);
}
if (viewHelper == null) {
throw new IllegalArgumentException("please do setContentView() first");
}
//添加布局到dialog
if (viewHelper.getContentView() != null) {
controller.getZDialog().setContentView(viewHelper.getContentView());
}
controller.setZDialogViewHelper(viewHelper);
for (int i = 0; i < textArray.size(); i++) {
controller.setText(textArray.keyAt(i), textArray.valueAt(i));
}
for (int i = 0; i < clickViewArray.size(); i++) {
controller.setOnClickListener(clickViewArray.keyAt(i), clickViewArray.valueAt(i));
}
Window window = controller.getWindow();
window.setGravity(direction);
if (animation != 0) {
window.setWindowAnimations(animation);
}
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.width = defaultWidth;
attributes.height = defaultHeight;
window.setAttributes(attributes);
}
}
}
package com.ydl.audioim.widget;
import androidx.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Created on 2018/1/18 16:34
*
* @author Z
* @version : 1.0.0
* ZDialog的方向
*/
public class ZDialogDirection {
@IntDef({FROM_TOP, FROM_BOTTOM})
@Retention(RetentionPolicy.SOURCE)
public @interface ZGravity {
}
public static final int FROM_TOP = 0;
public static final int FROM_BOTTOM = 1;
}
package com.ydl.audioim.widget;
import android.content.Context;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import java.lang.ref.WeakReference;
/**
* Created on 2018/1/18 13:02
*
* @author Z
* @version : 1.0.0
* 辅助给ZDialog的布局文件设置属性
*/
public class ZDialogViewHelper {
private View mContentView;
private SparseArray<WeakReference<View>> mViews;
private Context mContext;
public ZDialogViewHelper(Context context, int contentResId) {
this();
mContext = context;
mContentView = LayoutInflater.from(mContext).inflate(contentResId, null);
}
public ZDialogViewHelper() {
mViews = new SparseArray<>();
}
public View getContentView() {
return mContentView;
}
public void setContentView(View contentView) {
this.mContentView = contentView;
}
/**
* @param viewId viewId
* @param strId strId
*/
public void setText(int viewId, int strId) {
setText(viewId, mContext.getResources().getString(strId));
}
/**
* 通过id 给控件设置文本
*
* @param viewId viewId
* @param charSequence 文本类容
*/
public void setText(int viewId, CharSequence charSequence) {
TextView view = getView(viewId);
if (charSequence != null && charSequence.length() > 0) {
view.setText(charSequence);
}
}
/**
* 通过id 找到相应的控件
*
* @param viewId viewId
* @param <T> 具体的类型
* @return view
*/
@SuppressWarnings("unchecked")
private <T extends View> T getView(int viewId) {
WeakReference<View> weakReference = mViews.get(viewId);
View view = null;
if (weakReference != null) {
view = weakReference.get();
}
if (view == null) {
view = mContentView.findViewById(viewId);
if (view != null) {
mViews.put(viewId, new WeakReference<>(view));
}
}
return (T) view;
}
public EditText getEditText(int viewId) {
return getView(viewId);
}
public View findView(int viewId) {
return getView(viewId);
}
/**
* 设置点击事件
*
* @param viewId viewId
* @param onClickListener onClickListener
*/
public void setOnClickListener(int viewId, View.OnClickListener onClickListener) {
View view = getView(viewId);
if (view != null) {
view.setOnClickListener(onClickListener);
}
}
}
......@@ -211,6 +211,33 @@ class ConsultantAudioHomeActivity :
override fun onRtcStats(stats: IRtcEngineEventHandler.RtcStats?) {
}
/**
* * 该回调在网络连接状态发生改变的时候触发,并告知用户当前的网络连接状态,和引起网络状态改变的原因。
* @param state 当前的网络连接状态:
* CONNECTION_STATE_DISCONNECTED(1):网络连接断开
* CONNECTION_STATE_CONNECTING(2):建立网络连接中
* CONNECTION_STATE_CONNECTED(3):网络已连接
* CONNECTION_STATE_RECONNECTING(4):重新建立网络连接中
* CONNECTION_STATE_FAILED(5):网络连接失败
* @param reason 引起当前网络连接状态发生改变的原因:
* CONNECTION_CHANGED_CONNECTING(0):建立网络连接中
* CONNECTION_CHANGED_JOIN_SUCCESS(1):成功加入频道
* CONNECTION_CHANGED_INTERRUPTED(2):网络连接中断
* CONNECTION_CHANGED_BANNED_BY_SERVER(3):网络连接被服务器禁止
* CONNECTION_CHANGED_JOIN_FAILED(4):加入频道失败
* CONNECTION_CHANGED_LEAVE_CHANNEL(5):离开频道
* CONNECTION_CHANGED_INVALID_APP_ID(6):不是有效的 APP ID。请更换有效的 APP ID 重新加入频道
* CONNECTION_CHANGED_INVALID_CHANNEL_NAME(7):不是有效的频道名。请更换有效的频道名重新加入频道
* CONNECTION_CHANGED_INVALID_TOKEN(8):生成的 Token 无效。一般有以下原因:
* 在控制台上启用了 App Certificate,但加入频道未使用 Token。当启用了 App Certificate,必须使用 Token
* 在调用 joinChannel 加入频道时指定的 uid 与生成 Token 时传入的 uid 不一致
* CONNECTION_CHANGED_TOKEN_EXPIRED(9):当前使用的 Token 过期,不再有效,需要重新在你的服务端申请生成 Token
* CONNECTION_CHANGED_REJECTED_BY_SERVER(10):此用户被服务器禁止
* CONNECTION_CHANGED_SETTING_PROXY_SERVER(11):由于设置了代理服务器,SDK 尝试重连
* CONNECTION_CHANGED_RENEW_TOKEN(12):更新 Token 引起网络连接状态改变
* CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED(13):客户端 IP 地址变更,可能是由于网络类型,或网络运营商的 IP 或端口发生改变引起
* CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT(14):SDK 和服务器连接保活超时,进入自动重连状态
* */
override fun onConnectionStateChanged(state: Int, reason: Int) {
super.onConnectionStateChanged(state, reason)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="8dp" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
......@@ -177,7 +177,8 @@
android:id="@+id/progress_view"
android:layout_width="70dp"
android:layout_height="70dp"
app:pa_progressWidth="2dp" />
app:pa_progressBackColor="#45E6AB"
app:pa_progressWidth="4dp" />
<ImageView
android:id="@+id/iv_hang_up"
......@@ -195,6 +196,7 @@
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:text="挂断"
android:id="@+id/audio_hangup_text"
android:textColor="@color/white"
android:textSize="12sp" />
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:layout_marginStart="@dimen/platform_dp_38"
android:layout_marginEnd="@dimen/platform_dp_38"
android:background="@drawable/shape_bg_white_fillet8"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:id="@+id/third_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="App正常工作需要录音权限,请开启"
android:textColor="@color/platform_color_242424"
android:textSize="15sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/platform_dp_20"
tools:layout_editor_absoluteY="85dp" />
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/platform_color_D8D8D8"
app:layout_constraintTop_toBottomOf="@id/third_title"
android:layout_marginTop="@dimen/platform_dp_28"
android:id="@+id/line"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/line"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
>
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="稍后"
android:textSize="17sp"
android:paddingTop="@dimen/platform_dp_15"
android:paddingBottom="@dimen/platform_dp_15"
android:gravity="center"
android:textColor="@color/platform_color_666666"
android:id="@+id/cancel_dialog"
/>
<View
android:layout_width="0.5dp"
android:background="@color/platform_color_D8D8D8"
android:layout_height="match_parent"
/>
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="立即去设置"
android:textSize="17sp"
android:gravity="center"
android:textColor="@color/platform_color_1DA1F2"
android:id="@+id/dial_right_now"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<resources>
<style name="user_new_divide_color_style">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">0.5dp</item>
<item name="android:background">@color/platform_color_F0F0F0</item>
</style>
<!-- 仿ios普通对话框 -->
<style name="user_normaldialog_style" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
<style name="audioim_ZDialogDefaultStyle" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<!--显示区域以外是否使用黑色半透明-->
<item name="android:backgroundDimEnabled">true</item>
<!--用来控制dialog显示区域以外的灰度值,默认是0.5,值为1是,完全看不到dialog以外的内容-->
<item name="android:backgroundDimAmount">0.6</item>
</style>
<!--ZDialog的默认动画效果-->
<style name="audioim_ZDialogDefaultAnimation">
<item name="android:windowEnterAnimation">@anim/common_dialog_default_in</item>
<item name="android:windowExitAnimation">@anim/common_dialog_default_out</item>
</style>
</resources>
......@@ -25,9 +25,13 @@ import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener
import com.ydl.confide.home.presenter.ConfideHomePresenterImpl
import com.ydl.confide.home.util.ConfideHomeUtils
import com.ydl.confide.router.PhoneCallIn
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydlcommon.base.config.HttpConfig.Companion.YDL_H5
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
......@@ -236,7 +240,15 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
finish()
}
img_mine.setOnClickListener {
mConfideEvent!!.jumpMine()
//跳转倾诉列表
if (!PhoneCallIn.loginByOneKeyLogin(this,true)) {
return@setOnClickListener
}
BuryPointUtils.getInstance().createMap()
.put("mine_name", "倾诉记录")
.burryPoint("mine")
val h5Paramsqing = H5Params(YDL_H5 + "confideOrderList", null)
NewH5Activity.start(this, h5Paramsqing)
}
ll_bar_root.setOnClickListener {
......
......@@ -233,7 +233,12 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
tv_confide.setBackgroundResource(R.drawable.confide_line_1)
}
2 -> {
tv_confide.setBackgroundResource(R.drawable.confide_line_2)
//男他女她
if (bodyBean.confideSex == 1) {
tv_confide.setBackgroundResource(R.drawable.confide_line_sex_boy)
} else {
tv_confide.setBackgroundResource(R.drawable.confide_line_sex_girl)
}
}
3 -> {
tv_confide.setBackgroundResource(R.drawable.confide_line_3)
......
......@@ -58,5 +58,5 @@
android:layout_centerVertical="true"
android:gravity="center"
android:background="@drawable/confide_recent_btn_on_bg"
android:text="再倾诉一次"/>
android:text="继续倾诉"/>
</RelativeLayout>
......@@ -5,17 +5,25 @@ import android.animation.Animator
import android.animation.ObjectAnimator
import android.app.Dialog
import android.content.Context
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
import com.facebook.imagepipeline.common.ResizeOptions
import com.facebook.imagepipeline.common.RotationOptions
import com.facebook.imagepipeline.postprocessors.IterativeBoxBlurPostProcessor
import com.facebook.imagepipeline.request.ImageRequest
import com.facebook.imagepipeline.request.ImageRequestBuilder
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import kotlinx.android.synthetic.main.consultant_expert_consult_assistant_popup_window.*
/**
* 咨询助理浮层
* Created by xj on 2019/10/30.
......@@ -92,6 +100,16 @@ class ConsultAssistantDialog(
})
}
val controller: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/"+R.drawable.consultant_assistant_dialog_img))
.setOldController(consultant_assistant.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
consultant_assistant.controller = controller
consultant_assistant.setOnClickListener {
consultAssistantClickListener?.onClickAction()
}
......
......@@ -5,6 +5,7 @@ import android.app.Activity
import androidx.appcompat.app.AppCompatActivity
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
......@@ -16,6 +17,7 @@ import com.yidianling.consultant.dialog.ConsultAssistantDialog
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.home.api.event.HomeModuleTabEvent
import com.yidianling.user.api.listener.LoginCallBackListener
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
......@@ -114,11 +116,22 @@ class ConsultAssistantDialogUtils private constructor() {
if (Utils.isFastClick()) {
return onClickAction()
}
if (ConsultantIn.getUserImpl().loginByOneKeyLogin(activity,true)){
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid("", activity, 1)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid("", activity, 1)
}
override fun notLogin() {
}
})
}
}
......@@ -150,10 +163,20 @@ class ConsultAssistantDialogUtils private constructor() {
if (Utils.isFastClick()) {
return onClickAction()
}
if (!ConsultantIn.getUserImpl().loginByOneKeyLogin(activity, true)) {
return
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
getConsultAssistantUid("", activity, 17)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
getConsultAssistantUid("", activity, 17)
}
override fun notLogin() {
}
})
}
getConsultAssistantUid("", activity, 17)
}
})
......@@ -243,10 +266,19 @@ class ConsultAssistantDialogUtils private constructor() {
}
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
// 咨询师列表页面且未登录情况下,跳转登录页面
if (ConsultantIn.loginByOneKeyLogin(activity, true)) {
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
getConsultAssistantUid(origin, activity, 6)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
getConsultAssistantUid(origin, activity, 6)
}
override fun notLogin() {
}
})
}
}
......
......@@ -10,17 +10,17 @@
android:layout_height="84dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="25dp"
android:layout_marginRight="22dp"
android:clipChildren="true"
android:gravity="center"
android:orientation="horizontal"
android:paddingRight="25dp"
android:paddingBottom="40dp">
>
<LinearLayout
android:id="@+id/consultant_assistant_dialog_desc_ll"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="47dp"
android:layout_marginTop="5dp"
android:background="@drawable/consultant_assistant_dialog_text_bg"
android:gravity="center">
......@@ -39,7 +39,7 @@
android:layout_width="0.5dp"
android:layout_height="26dp"
android:layout_marginRight="8dp"
android:background="#ffffff" />
android:background="#59ffffff" />
<LinearLayout
android:id="@+id/ll_desc_assistant"
......@@ -64,13 +64,15 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="为你精准匹配咨询师 "
android:text="为你精准匹配咨询师"
android:textColor="#ffffff"
android:textStyle="bold"
android:textSize="12dp" />
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginStart="3dp"
android:src="@drawable/consultant_assistant_dialog_go_icon" />
</LinearLayout>
</LinearLayout>
......@@ -78,14 +80,13 @@
</LinearLayout>
<ImageView
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/consultant_assistant"
android:layout_width="61dp"
android:layout_height="101dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
android:src="@drawable/consultant_assistant_dialog_img"
android:paddingBottom="40dp" />
</RelativeLayout>
\ No newline at end of file
......@@ -2,11 +2,11 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="8dp"
android:bottomLeftRadius="8dp"/>
<corners android:topLeftRadius="22dp"
android:bottomLeftRadius="22dp"/>
<gradient
android:angle="0"
android:startColor="#CC1DA1F2"
android:endColor="#CC1DA1F2"/>
android:startColor="#DDFF7A5C"
android:endColor="#DDFF406C"/>
</shape>
\ No newline at end of file
......@@ -8,6 +8,7 @@
"linkUrl": "ydl-user://h5/course?params=%7b%22url%22%3a%22https%3a%2f%2fm.ydl.com%2fcourse%2fDetail%2fv2%2f6194%22%7d",
"title": ""
},
"listenFree": false,
"askCategoryData": [
{
"cateId": 0,
......
......@@ -257,7 +257,8 @@
"imageUrl": "",
"btnLinkurl": "",
"imageBanner": "https://pic.ydlcdn.com/HFfHKt6tNj.png"
}
},
"listenFree": false
},
"type": 10001
},
......@@ -523,7 +524,8 @@
"imageUrl": "",
"btnLinkurl": "",
"imageBanner": "https://pic.ydlcdn.com/HFfHKt6tNj.png"
}
},
"listenFree": false
},
"type": 10002
},
......@@ -990,7 +992,8 @@
"imageUrl": "",
"btnLinkurl": "",
"imageBanner": "https://pic.ydlcdn.com/HFfHKt6tNj.png"
}
},
"listenFree": false
},
"type": 10003
},
......
......@@ -43,6 +43,10 @@ class HomeHeaderBean : HomeItemBaseBean {
* 专家名称
*/
var doctorName : String? = null
/*
* 倾诉免费标识
* */
var listenFree : Boolean? = null
class AskCategoryDataBean {
/**
......
......@@ -22,6 +22,7 @@ import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.home.R
import com.yidianling.home.adapter.YdlHomeAdapter
......@@ -248,11 +249,10 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
}
}
if (!ModularServiceManager.provide(IUserService::class.java).isLogin()||!ModularServiceManager.provide(IUserService::class.java).isFirstLogin()) {
//未登录/首次登录 不显示
if (!ModularServiceManager.provide(IUserService::class.java).isLogin()) {
//未登录不显示
return
}
if (!TextUtils.isEmpty(act.imageBanner)) {
//展示弹窗
if (aa == null) {
......
......@@ -7,11 +7,13 @@ import android.view.ViewGroup
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.LogUtil
import com.yidianling.home.R
import com.yidianling.home.constract.HomeViewConfig
import com.yidianling.home.event.HomeImpl
import com.yidianling.home.model.bean.*
import com.yidianling.home.ui.view.*
import kotlin.properties.Delegates
/**
......@@ -57,13 +59,16 @@ class YdlHomeAdapter(private val mContext: Context,
*/
var consultCategoryData: List<HomeHeaderBean.ConsultCategoryDateBean>? = null
/*
倾诉免费标识
* */
var listenFree :Boolean?=false
fun updateItems(list: MutableList<HomePagerDataBean>) {
if (null == this.list || this.list!!.isEmpty()) {
this.list = ArrayList()
} else {
this.list.clear()
}
this.list.clear()
this.list.addAll(list)
this.listenFree= list[0]?.headerBean?.listenFree!!
//重置标记位
confidePosition = -1
consultPosition = -1
......@@ -81,6 +86,16 @@ class YdlHomeAdapter(private val mContext: Context,
this.confideSelectPosition = selectPosition
notifyItemChanged(confidePosition)
}
/**
* 更新倾诉免费标识
*/
fun updateConfideFreeData(data: HomeHeaderBean?) {
if (data!=null){
list[1].headerBean = data
}
notifyItemChanged(1)
}
/**
* 更新咨询模块数据
......@@ -100,6 +115,7 @@ class YdlHomeAdapter(private val mContext: Context,
fun updateAskData(data: HomeAskBean, position: Int) {
list[position].askBean = data
// notifyItemChanged(position)
}
override fun getItemViewType(position: Int): Int {
......@@ -131,7 +147,9 @@ class YdlHomeAdapter(private val mContext: Context,
}
//顶部预约专家,即时倾诉,心理测试按钮模块
HomeViewConfig.getOrder().buttonIndex -> {
return HomeButtonBannerViewHolder(HomeButtonBannerView(mContext, homeEvent),viewType)
return HomeButtonBannerViewHolder(HomeButtonBannerView(mContext, homeEvent,
listenFree!!
),viewType)
}
//倾诉*排解模块
HomeViewConfig.getOrder().confideIndex -> {
......@@ -185,6 +203,8 @@ class YdlHomeAdapter(private val mContext: Context,
}
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> {
// listenFree?.let { holder.buttonBannerView.setVisibilityFree(it) }
list[1].headerBean?.listenFree?.let { holder.buttonBannerView.setVisibilityFree(it) }
}
//咨询模块
is HomeConsultViewHolder -> {
......
......@@ -307,6 +307,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
}
override fun homeHeadResponse(homeHeaderBean: HomeHeaderBean) {
//更新倾述列表数据
adapter?.updateConfideFreeData(homeHeaderBean)
//展示活动数据
val act = homeHeaderBean.activityResponse
......@@ -363,7 +365,6 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
home_swipe_refresh_layout.isRefreshing = false
//更新首页数据
adapter?.updateItems(list)
if (!TextUtils.isEmpty(list[0].headerBean?.doctorName)) {
doctorName = list[0].headerBean?.doctorName!!
initSearchBar()
......
......@@ -3,8 +3,12 @@ package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.yidianling.common.tools.LogUtil
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.common.tools.RxDeviceTool
......@@ -17,19 +21,30 @@ import kotlinx.android.synthetic.ydl.home_button_banner_view.view.*
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeButtonBannerView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?) : LinearLayout(mContext) {
class HomeButtonBannerView(private val mContext: Context, private var homeEvent: IHomeBaseEvent?,var listenFree:Boolean) : LinearLayout(mContext) {
private var buttonParams: LinearLayout.LayoutParams? = null
private var buttonParamsFrame: FrameLayout.LayoutParams? = null
private var buttonParamsFrame2: FrameLayout.LayoutParams? = null
init {
initView()
}
fun setVisibilityFree(boolean: Boolean){
if (boolean){
qingsuGif.visibility=View.VISIBLE
}else{
qingsuGif.visibility=View.GONE
}
}
private fun initView() {
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this)
Glide.with(context)
.load(R.drawable.qingsu_new_free_dynamic)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(qingsuGif)
initButtonView()
homeModuleButtonBannerFirst.setOnClickListener {
......@@ -55,10 +70,16 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
var viewWidth = ((screenWidth - 2 * 9 * RxDeviceTool.getScreenDensity(mContext)) / 4).toInt()
var viewHeight = viewWidth * 78 / 80
buttonParams = LinearLayout.LayoutParams(viewWidth, viewHeight)
buttonParamsFrame = FrameLayout.LayoutParams(viewWidth, viewHeight)
buttonParamsFrame2= FrameLayout.LayoutParams((viewWidth/2.0).toInt(), (viewHeight/2.3).toInt())
buttonParamsFrame2!!.setMargins((((viewWidth/12f).toInt())),0,0,0)
qingsuGif.layoutParams=buttonParamsFrame2
homeModuleButtonBannerFirst.layoutParams = buttonParams
homeModuleButtonBannerSecond.layoutParams = buttonParams
homeModuleButtonBannerThird.layoutParams = buttonParams
homeModuleButtonBannerFourth.layoutParams = buttonParams
homeModuleButtonBannerSecondFrame.layoutParams=buttonParamsFrame
}
}
}
\ No newline at end of file
......@@ -79,28 +79,40 @@
android:textSize="@dimen/platform_dp_12"
android:text="学习与成长"/>
</RelativeLayout>
<FrameLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="80dp"
android:layout_height="78dp"
android:background="@drawable/home_button_banner_fourth_img_new"
>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerSecondFrame"
android:layout_width="80dp"
android:layout_height="78dp"
android:gravity="center">
<TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16"
android:text="即时倾诉"/>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="80dp"
android:layout_height="78dp"
android:background="@drawable/home_button_banner_fourth_img_new"
android:gravity="center">
<TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16"
android:text="即时倾诉"/>
<TextView
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12"
android:text="24小时在线"/>
</RelativeLayout>
<TextView
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12"
android:text="24小时在线"/>
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/qingsuGif"
android:visibility="gone"
>
</ImageView>
</FrameLayout>
</LinearLayout>
......@@ -630,9 +630,9 @@ object IMChatUtil {
if (!(promptRule == 4 || promptRule == 5)) {
val showExpertList = !(promptRule == 1 || promptRule == 3)
if (actionHandler.userType == USER_TYPE_EXPERT && status == 2) { //当该专家离线时
sendRecommendExpertListMessage(1, showExpertList, toUid, actionHandler)
// sendRecommendExpertListMessage(1, showExpertList, toUid, actionHandler)
} else if (actionHandler.userType == USER_TYPE_EXPERT && status >= 3) { //当该专家忙碌时
sendRecommendExpertListMessage(2, showExpertList, toUid, actionHandler)
// sendRecommendExpertListMessage(2, showExpertList, toUid, actionHandler)
}
}
}
......
......@@ -348,8 +348,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
} else {
addType71Request(et_input_problem.text.toString(), "")
}
//最后一题答玩展示立即前往按钮,隐藏跳过按钮
tv_finish.visibility = View.VISIBLE
tv_skip.visibility = View.GONE
mackType2(lastAnswer, "")
setFirstAndLatQuestion(mQuestionBean!!.questions[2].question)
......@@ -359,6 +358,9 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
mData.forEachIndexed { index, _ ->
mData[index].type5CanClick = false
}
//最后一题答玩展示立即前往按钮,隐藏跳过按钮
// tv_finish.visibility = View.VISIBLE
skipToIm()//最后一题答完直接进入私聊页面。
}
/**
......@@ -432,7 +434,8 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
} else {
//没有下一题了,跳转按钮展示
setFirstAndLatQuestion(mQuestionBean!!.questions[2].question)
tv_finish.visibility = View.VISIBLE
// tv_finish.visibility = View.VISIBLE
skipToIm()
tv_skip.visibility = View.GONE
}
mQuestionAdapter.notifyDataSetChanged()
......@@ -756,88 +759,90 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
@SuppressLint("CheckResult")
private fun skipToIm() {
showProgressDialog()
SharedPreferencesEditor.putString("skip_time_", System.currentTimeMillis().toString())
recycle.postDelayed(Runnable {
SharedPreferencesEditor.putString("skip_time_", System.currentTimeMillis().toString())
if (toUid != null) {
//代表是聊天列表进来的
instance.batchSendCustomizeMessage(JSON.toJSONString(mType70RequestList))
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe()
Handler().postDelayed({
instance.batchSendCustomizeMessage(JSON.toJSONString(mType71RequestList))
if (toUid != null) {
//代表是聊天列表进来的
instance.batchSendCustomizeMessage(JSON.toJSONString(mType70RequestList))
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe()
}, 100L)
Handler().postDelayed({
IMChatUtil.startChatSessionByCms(
toUid!!,
expertInfo,
isFromQingShu,
this@CmsExamQuestionPaperActivity
)
}, 200L)
Handler().postDelayed({
instance.batchSendCustomizeMessage(JSON.toJSONString(mType71RequestList))
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe()
}, 100L)
Handler().postDelayed({
finish()
}, 1000L)
} else {
//代表是导医进来的 导医进来的需要获取导医后再发送消息
var questionPaperId = ""
mQuestionBean?.questionPaper?.id?.let { questionPaperId = it }
ImRetrofitApi.getImJavaApi()
.getConsultAssistantUidRequest(location, ffrom2, answerQuestionId, questionPaperId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ uidBean ->
if (uidBean.code == "200" && uidBean.data != 0.toLong()) {
mType70RequestList.forEachIndexed { index, answerQuestionType70RequestBean ->
mType70RequestList[index].toUid = uidBean.data.toString()
}
instance.batchSendCustomizeMessage(JSON.toJSONString(mType70RequestList))
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe()
Handler().postDelayed({
IMChatUtil.startChatSessionByCms(
toUid!!,
expertInfo,
isFromQingShu,
this@CmsExamQuestionPaperActivity
)
}, 200L)
mType71RequestList.forEachIndexed { index, answerQuestionType71RequestBean ->
mType71RequestList[index].toUid = uidBean.data.toString()
}
Handler().postDelayed({
finish()
}, 1000L)
} else {
//代表是导医进来的 导医进来的需要获取导医后再发送消息
var questionPaperId = ""
mQuestionBean?.questionPaper?.id?.let { questionPaperId = it }
Handler().postDelayed({
instance.batchSendCustomizeMessage(JSON.toJSONString(mType71RequestList))
ImRetrofitApi.getImJavaApi()
.getConsultAssistantUidRequest(location, ffrom2, answerQuestionId, questionPaperId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ uidBean ->
if (uidBean.code == "200" && uidBean.data != 0.toLong()) {
mType70RequestList.forEachIndexed { index, answerQuestionType70RequestBean ->
mType70RequestList[index].toUid = uidBean.data.toString()
}
instance.batchSendCustomizeMessage(JSON.toJSONString(mType70RequestList))
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe()
}, 100L)
Handler().postDelayed({
IMChatUtil.startChat(
this@CmsExamQuestionPaperActivity,
uidBean.data.toString(),
0
)
}, 200L)
Handler().postDelayed({
finish()
}, 1000L)
} else {
mType71RequestList.forEachIndexed { index, answerQuestionType71RequestBean ->
mType71RequestList[index].toUid = uidBean.data.toString()
}
Handler().postDelayed({
instance.batchSendCustomizeMessage(JSON.toJSONString(mType71RequestList))
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe()
}, 100L)
Handler().postDelayed({
IMChatUtil.startChat(
this@CmsExamQuestionPaperActivity,
uidBean.data.toString(),
0
)
}, 200L)
Handler().postDelayed({
finish()
}, 1000L)
} else {
dismissProgressDialog()
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}, {
dismissProgressDialog()
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}, {
dismissProgressDialog()
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
})
})
}
},1000)
}
}
/**
......
......@@ -120,6 +120,11 @@
android:name=".mine.NotificationsSettingActivity"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
<!--个性化开关-->
<activity
android:name=".mine.PersionalizeSettingActivity"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
<activity
android:name=".mine.PersonalDesActivity"
android:screenOrientation="portrait"
......
......@@ -14,6 +14,7 @@ import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.event.UserLoginEvent
import com.yidianling.user.api.event.UserLogoutEvent
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.http.UserHttpImpl
import com.yidianling.user.http.request.Logout
import com.yidianling.user.route.UserIn
......@@ -35,7 +36,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers
* time : 2018/05/09
*/
object LoginUtils {
var logingCallBackListener: LoginCallBackListener? = null
fun setLoginCallBack(listener: LoginCallBackListener?) {
logingCallBackListener = listener
}
@JvmStatic
fun saveData(userInfo: UserResponseBean?) {
UserHelper.setUserinfo(userInfo)
......@@ -98,6 +102,7 @@ object LoginUtils {
@JvmStatic
fun logoutClearLocal() {
logingCallBackListener=null
AliYunRichLogsHelper.getInstance().sendRichLog(AliYunLogConfig.LOGIN, "退出登录")
UserIn.imLogout()
UserIn.closePlayer()
......@@ -107,6 +112,9 @@ object LoginUtils {
@JvmStatic
fun loginSuccessOperate(activity: Activity) {
if (logingCallBackListener!=null){
logingCallBackListener?.loginSuccess()
}
// 登录成功后,如果一键登录界面没有关闭,则关闭掉
OneKeyLoginHelp.quitLoginPage()
val size = ActivityManager.getActivitySize()
......
......@@ -69,6 +69,7 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
JumpTextView jtv_qq;
RoundCornerButton rcb_exit;
JumpTextView tvAccountUnRegister;
JumpTextView personalize_setting;
@NotNull
@Override
......@@ -94,6 +95,7 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
jtv_qq = findViewById(R.id.jtv_qq);
rcb_exit = findViewById(R.id.rcb_exit);
tvAccountUnRegister = findViewById(R.id.tv_account_unregister);
personalize_setting = findViewById(R.id.personalize_setting);
jtv_phone.setOnClickListener(this);
jtv_change_password.setOnClickListener(this);
......@@ -103,6 +105,7 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
person_notify_setting.setOnClickListener(this);
person_black_setting.setOnClickListener(this);
tvAccountUnRegister.setOnClickListener(this);
personalize_setting.setOnClickListener(this);
init();
EventBus.getDefault().register(this);
......@@ -277,6 +280,8 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
startActivity(new Intent(this, NotificationsSettingActivity.class));
} else if (id == R.id.tv_account_unregister) {
startActivity(new Intent(this, AccountUnRegisterActivity.class));
}else if(id == R.id.personalize_setting){
startActivity(new Intent(this, PersionalizeSettingActivity.class));
}
}
......
package com.yidianling.user.mine
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.user.R
import kotlinx.android.synthetic.main.user_mine_activity_persionalize_setting.*
/**
* 个性化开关,隐私政策需要
*/
@Route(path = "/user/persionalizesetting")
class PersionalizeSettingActivity : BaseActivity() {
private val PERSIONNALIZE_KEY = "persionalize"
override fun layoutResId(): Int {
return R.layout.user_mine_activity_persionalize_setting
}
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(true, true)
}
override fun initDataAndEvent() {
val key = SharedPreferencesEditor.getString(PERSIONNALIZE_KEY)
tb_check.isChecked = !(key != null && key == "1")
tb_check.setOnClickListener {
if (tb_check.isChecked) {
SharedPreferencesEditor.putString(PERSIONNALIZE_KEY, "0")
} else {
SharedPreferencesEditor.putString(PERSIONNALIZE_KEY, "1")
}
}
}
}
\ No newline at end of file
......@@ -20,6 +20,7 @@ import com.yidianling.user.UserConstants
import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.bean.UserSettingBean
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.api.listener.SecretDataListener
import com.yidianling.user.api.listener.UserInfoFromApiListener
import com.yidianling.user.api.listener.VersionUpdateStatusListener
......@@ -321,4 +322,12 @@ public class UserServiceImp : IUserService {
override fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean):Boolean {
return OneKeyLoginHelp.startLoginByStatus(context,isOpenDialog)
}
override fun loginByOneKeyLoginCallBack(
context: Context,
isOpenDialog: Boolean,
listener: LoginCallBackListener
) {
OneKeyLoginHelp.startLoginByStatusLoginCallBack(context,isOpenDialog,listener)
}
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.LoginApiRequestUtil
import com.yidianling.user.http.request.PhoneLoginAutoParam
......@@ -166,6 +167,7 @@ object OneKeyLoginHelp {
*/
fun quitLoginPage() {
mPhoneNumberAuthHelper?.quitLoginPage()
LoginUtils.setLoginCallBack(null)
}
......@@ -436,7 +438,7 @@ object OneKeyLoginHelp {
.subscribe({
if (it.code == 200) {
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.LOGIN, "一键登录成功")
.sendRichLog(AliYunLogConfig.LOGIN, "一键登录成功uid:"+it.data.uid+"firstLogin:"+it.data.firstLogin)
ToastUtil.toastShort("登录成功")
saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册
......@@ -495,7 +497,7 @@ object OneKeyLoginHelp {
}
override fun onTokenFailed(s: String) {
LogUtil.e(s)
LogUtil.e("onTokenFailed"+s)
mIsGetTokenSuccess = false
val tokenRet = TokenRet.fromJson(s)
if (mAuthType == PhoneNumberAuthHelper.SERVICE_TYPE_AUTH) { // 本机号码校验
......@@ -526,6 +528,7 @@ object OneKeyLoginHelp {
// 号码验证监听
private lateinit var verifyTokenResultListener: VerifyTokenResultListener
interface VerifyTokenResultListener {
fun onTokenSuccess(result: String)
......@@ -591,7 +594,23 @@ object OneKeyLoginHelp {
}
return UserHelper.isLogin()
}
/**
* @param isOpenDialog true: 使用弹窗展示一键登录
* false: 使用全页面展示一键登录
* @return true:登录。false:未登录
* */
fun startLoginByStatusLoginCallBack(context: Context, isOpenDialog: Boolean,listener: LoginCallBackListener) {
if (!UserHelper.isLogin()) {
LoginUtils.setLoginCallBack(listener)
if (this::mActivity.isInitialized) {
//如果mActivity有初始化,代表项目使用了一键登录
startLogin(context as Activity, isOpenDialog)
} else {
//如果mActivity未初始化,使用正常登录
RegisterAndLoginActivity.start(context)
}
}
}
/**
* @param isOpenDialog true 使用弹窗
* */
......
......@@ -712,6 +712,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
override fun onBackPressed() {
if (isFromGuide) {
LoginUtils.setLoginCallBack(null)
ActivityManager.finishOtherActivity(this)
UserIn.mainIntent(this, 4)
finish()
......@@ -731,6 +732,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
super.onBackPressed()
}
} else {
LoginUtils.setLoginCallBack(null)
super.onBackPressed()
}
}
......
package com.yidianling.user.api.listener
interface LoginCallBackListener {
fun loginSuccess()
fun notLogin()
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.template.IProvider
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.bean.UserSettingBean
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.api.listener.SecretDataListener
import com.yidianling.user.api.listener.UserInfoFromApiListener
import com.yidianling.user.api.listener.VersionUpdateStatusListener
......@@ -114,4 +115,11 @@ interface IUserService : IProvider {
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean) :Boolean
/**
* 调用优先使用一键登录,并返回调用时的登录状态,
* @param isOpenDialog true:一键登录使用弹窗展示 false:一键登录使用全屏模式
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun loginByOneKeyLoginCallBack(context: Context, isOpenDialog: Boolean,listener: LoginCallBackListener)
}
\ No newline at end of file
......@@ -77,6 +77,14 @@
app:pa_jump_tv_left_text="黑名单管理"
app:pa_jump_tv_right_color="#333333" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/personalize_setting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="个性化选项"
app:pa_jump_tv_right_color="#333333" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@color/platform_white"
app:pa_left_end_icon="@drawable/platform_common_back"
app:pa_title_text="个性化设置" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="#ffffff">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="开启个性化推荐"
android:textColor="#000000"
android:textSize="17sp" />
<ToggleButton
android:id="@+id/tb_check"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:background="@drawable/user_mine_notify_bg"
android:checked="true"
android:textOff=" "
android:textOn=" " />
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="关闭后,将不会使用你的偏好特征进行内容推荐,你可能会看不到感兴趣的内容"
android:textColor="@color/platform_color_666666" />
</LinearLayout>
\ No newline at end of file
......@@ -57,7 +57,9 @@ public class DefaultFormatPrinter {
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, requestBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE);
if (!request.url().toString().contains("writemaidiandata")){
NetLogUtils.debugInfo(tag, END_LINE);
}
}
/**
......
......@@ -136,6 +136,9 @@ dependencies {
kapt rootProject.ext.dependencies["glide-compiler"]
api rootProject.ext.dependencies["glide"]
api rootProject.ext.dependencies["glide-transformations"]
api rootProject.ext.dependencies["fresco"]
api rootProject.ext.dependencies["fresco-animated-webp"]
api rootProject.ext.dependencies["fresco-webpsupport"]
api rootProject.ext.dependencies["constraint-layout"]
api rootProject.ext.dependencies["cube"]
api rootProject.ext.dependencies["support-multidex"]
......
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