Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
72e6eea2
Commit
72e6eea2
authored
Jun 15, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/d/v4.3.97' into feat/lp/lp_4.3.97
parents
a82fca8b
fe7fc7d7
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
245 additions
and
37 deletions
+245
-37
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+1
-2
YDLavManager.kt
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
+4
-3
ExpertIntroActivity.kt
m-confide/src/main/java/com/ydl/confide/intro/ExpertIntroActivity.kt
+1
-1
IntroAdapter.kt
m-confide/src/main/java/com/ydl/confide/intro/IntroAdapter.kt
+10
-1
WatchMessagePictureActivity.java
m-im/src/main/java/com/yidianling/uikit/business/session/activity/WatchMessagePictureActivity.java
+20
-2
WatchVideoActivity.java
m-im/src/main/java/com/yidianling/uikit/business/session/activity/WatchVideoActivity.java
+20
-2
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+2
-15
MessageListPanelEx.java
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MessageListPanelEx.java
+23
-3
MsgViewHolderAudio.java
m-im/src/main/java/com/yidianling/uikit/business/session/viewholder/MsgViewHolderAudio.java
+21
-2
MsgViewHolderBase.java
m-im/src/main/java/com/yidianling/uikit/business/session/viewholder/MsgViewHolderBase.java
+19
-1
OneKeyLoginHelp.kt
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
+2
-0
ApmInit.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/app/ApmInit.kt
+68
-0
HttpConfig.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
+54
-2
NewH5Activity.java
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
+0
-3
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
72e6eea2
...
@@ -50,7 +50,6 @@ import com.ydl.ydlcommon.base.BaseMvpActivity
...
@@ -50,7 +50,6 @@ import com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.ScreenUtil
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
...
@@ -485,7 +484,7 @@ class AudioHomeActivity :
...
@@ -485,7 +484,7 @@ class AudioHomeActivity :
//权限申请
//权限申请
requestPermission
()
requestPermission
()
ActionCountUtils
.
record
(
"call_phone_page"
,
"call_phone_page_visit"
,
"0"
,
"1"
)
ActionCountUtils
.
record
(
"call_phone_page"
,
"call_phone_page_visit"
,
listenerUid
?:
"0"
,
"1"
)
}
}
...
...
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
View file @
72e6eea2
...
@@ -4,9 +4,7 @@ import android.annotation.SuppressLint
...
@@ -4,9 +4,7 @@ import android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.os.Handler
import
android.os.Handler
import
android.text.TextUtils
import
android.text.TextUtils
import
android.util.Log
import
com.alibaba.android.arouter.launcher.ARouter
import
com.alibaba.android.arouter.launcher.ARouter
import
com.bytedance.apm.insight.ApmInsightAgent
import
com.google.gson.Gson
import
com.google.gson.Gson
import
com.ydl.audioim.bean.AgoraInvitationBean
import
com.ydl.audioim.bean.AgoraInvitationBean
import
com.ydl.audioim.http.AudioApiRequestUtil
import
com.ydl.audioim.http.AudioApiRequestUtil
...
@@ -25,6 +23,7 @@ import com.ydl.ydl_av.messge_service.callback.LoginCallback
...
@@ -25,6 +23,7 @@ import com.ydl.ydl_av.messge_service.callback.LoginCallback
import
com.ydl.ydl_av.messge_service.request.LoginParam
import
com.ydl.ydl_av.messge_service.request.LoginParam
import
com.ydl.ydl_av.messge_service.response.CallLocalResponse
import
com.ydl.ydl_av.messge_service.response.CallLocalResponse
import
com.ydl.ydl_av.messge_service.response.CallRemoteResponse
import
com.ydl.ydl_av.messge_service.response.CallRemoteResponse
import
com.ydl.ydlcommon.app.Apm
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.LogUtil
...
@@ -43,7 +42,6 @@ import io.agora.rtm.RtmStatusCode.ConnectionChangeReason.CONNECTION_CHANGE_REASO
...
@@ -43,7 +42,6 @@ import io.agora.rtm.RtmStatusCode.ConnectionChangeReason.CONNECTION_CHANGE_REASO
import
io.reactivex.Observable
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
io.reactivex.schedulers.Schedulers
import
org.json.JSONObject
import
java.util.*
import
java.util.*
import
java.util.concurrent.TimeUnit
import
java.util.concurrent.TimeUnit
...
@@ -451,6 +449,7 @@ class YDLavManager {
...
@@ -451,6 +449,7 @@ class YDLavManager {
}
}
override
fun
onFailure
(
msg
:
String
?)
{
override
fun
onFailure
(
msg
:
String
?)
{
Apm
.
reportCustom
(
"agora_login_error"
,
msg
?:
""
,
Exception
(
msg
))
LogUtil
.
e
(
"[agora]实时消息登录失败:$msg"
)
LogUtil
.
e
(
"[agora]实时消息登录失败:$msg"
)
writeAgoraLog
(
writeAgoraLog
(
"声网rtm登录失败:$msg-------Time:${
"声网rtm登录失败:$msg-------Time:${
...
@@ -667,6 +666,8 @@ class YDLavManager {
...
@@ -667,6 +666,8 @@ class YDLavManager {
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e
* 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
)
{
override
fun
onConnectionStateChanged
(
state
:
Int
,
reason
:
Int
)
{
val
msg
=
"state:${state},reason:${reason}"
Apm
.
reportCustom
(
"agora_connectionstate_error"
,
msg
,
Exception
(
msg
))
sdkStatus
=
state
sdkStatus
=
state
writeAgoraLog
(
writeAgoraLog
(
"声网rtm登录状态:${state}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
,
"声网rtm登录状态:${state}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}"
,
...
...
m-confide/src/main/java/com/ydl/confide/intro/ExpertIntroActivity.kt
View file @
72e6eea2
...
@@ -99,7 +99,7 @@ class ExpertIntroActivity : AppCompatActivity() {
...
@@ -99,7 +99,7 @@ class ExpertIntroActivity : AppCompatActivity() {
binding
.
viewPager
.
adapter
=
adapter
binding
.
viewPager
.
adapter
=
adapter
binding
.
viewPager
.
registerOnPageChangeCallback
(
object
:
ViewPager2
.
OnPageChangeCallback
()
{
binding
.
viewPager
.
registerOnPageChangeCallback
(
object
:
ViewPager2
.
OnPageChangeCallback
()
{
override
fun
onPageSelected
(
position
:
Int
)
{
override
fun
onPageSelected
(
position
:
Int
)
{
adapter
.
onSelect
(
position
)
adapter
.
onSelect
(
position
,
lastSelectPos
)
if
(
position
==
data
.
size
-
1
&&
lastSelectPos
<
position
)
{
if
(
position
==
data
.
size
-
1
&&
lastSelectPos
<
position
)
{
loadMore
()
loadMore
()
}
}
...
...
m-confide/src/main/java/com/ydl/confide/intro/IntroAdapter.kt
View file @
72e6eea2
...
@@ -166,7 +166,7 @@ internal class IntroAdapter(
...
@@ -166,7 +166,7 @@ internal class IntroAdapter(
ijkVideoView
?.
pause
()
ijkVideoView
?.
pause
()
}
}
fun
onSelect
(
position
:
Int
)
{
fun
onSelect
(
position
:
Int
,
lastPos
:
Int
)
{
curPos
=
position
curPos
=
position
onLoadDialStatus
(
position
)
onLoadDialStatus
(
position
)
if
(!
ConfideNetworkUtil
.
isWifi
(
context
)
&&
!
hasAgreePlayWithoutWiFi
)
{
if
(!
ConfideNetworkUtil
.
isWifi
(
context
)
&&
!
hasAgreePlayWithoutWiFi
)
{
...
@@ -177,6 +177,15 @@ internal class IntroAdapter(
...
@@ -177,6 +177,15 @@ internal class IntroAdapter(
// entry.value.seekTo(0)
// entry.value.seekTo(0)
entry
.
value
.
start
()
entry
.
value
.
start
()
}
else
{
}
else
{
if
(
entry
.
key
==
lastPos
)
{
ActionCountUtils
.
record
(
"listen_counselor_content_play_page"
,
"listen_counselor_content_playtime_click"
,
data
[
lastPos
].
confideId
?:
""
,
if
(
data
[
lastPos
].
isVideo
)
"1"
else
"2"
,
(
entry
.
value
.
currentPosition
/
1000F
).
toString
()
)
}
entry
.
value
.
seekTo
(
0
)
entry
.
value
.
seekTo
(
0
)
entry
.
value
.
pause
()
entry
.
value
.
pause
()
}
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/activity/WatchMessagePictureActivity.java
View file @
72e6eea2
...
@@ -8,8 +8,6 @@ import android.graphics.Color;
...
@@ -8,8 +8,6 @@ import android.graphics.Color;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.provider.MediaStore
;
import
android.provider.MediaStore
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.core.view.ViewCompat
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
...
@@ -17,6 +15,9 @@ import android.view.View;
...
@@ -17,6 +15,9 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
androidx.core.view.ViewCompat
;
import
androidx.viewpager.widget.PagerAdapter
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.Glide
;
import
com.luck.picture.lib.photoview.PhotoView
;
import
com.luck.picture.lib.photoview.PhotoView
;
import
com.netease.nimlib.sdk.AbortableFuture
;
import
com.netease.nimlib.sdk.AbortableFuture
;
...
@@ -31,6 +32,7 @@ import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum;
...
@@ -31,6 +32,7 @@ import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum;
import
com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgTypeEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgTypeEnum
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.ydl.ydlcommon.app.Apm
;
import
com.yidianling.im.R
;
import
com.yidianling.im.R
;
import
com.yidianling.nimbase.common.ToastHelper
;
import
com.yidianling.nimbase.common.ToastHelper
;
import
com.yidianling.nimbase.common.activity.ToolBarOptions
;
import
com.yidianling.nimbase.common.activity.ToolBarOptions
;
...
@@ -335,6 +337,22 @@ public class WatchMessagePictureActivity extends UI {
...
@@ -335,6 +337,22 @@ public class WatchMessagePictureActivity extends UI {
onDownloadStart
(
msg
);
onDownloadStart
(
msg
);
message
=
msg
;
// 下载成功之后,判断是否是同一条消息时需要使用
message
=
msg
;
// 下载成功之后,判断是否是同一条消息时需要使用
downloadFuture
=
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
msg
,
false
);
downloadFuture
=
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
msg
,
false
);
downloadFuture
.
setCallback
(
new
RequestCallback
<
Void
>()
{
@Override
public
void
onSuccess
(
Void
o
)
{
}
@Override
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
)));
}
@Override
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
throwable
);
}
});
}
}
private
boolean
isOriginImageHasDownloaded
(
final
IMMessage
message
)
{
private
boolean
isOriginImageHasDownloaded
(
final
IMMessage
message
)
{
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/activity/WatchVideoActivity.java
View file @
72e6eea2
...
@@ -10,7 +10,6 @@ import android.media.MediaPlayer.OnPreparedListener;
...
@@ -10,7 +10,6 @@ import android.media.MediaPlayer.OnPreparedListener;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
androidx.appcompat.app.ActionBar
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.DisplayMetrics
;
import
android.util.DisplayMetrics
;
import
android.view.SurfaceHolder
;
import
android.view.SurfaceHolder
;
...
@@ -23,21 +22,25 @@ import android.widget.ImageView;
...
@@ -23,21 +22,25 @@ import android.widget.ImageView;
import
android.widget.RelativeLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.appcompat.app.ActionBar
;
import
com.netease.nimlib.sdk.AbortableFuture
;
import
com.netease.nimlib.sdk.AbortableFuture
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.Observer
;
import
com.netease.nimlib.sdk.Observer
;
import
com.netease.nimlib.sdk.RequestCallback
;
import
com.netease.nimlib.sdk.msg.MsgService
;
import
com.netease.nimlib.sdk.msg.MsgService
;
import
com.netease.nimlib.sdk.msg.MsgServiceObserve
;
import
com.netease.nimlib.sdk.msg.MsgServiceObserve
;
import
com.netease.nimlib.sdk.msg.attachment.VideoAttachment
;
import
com.netease.nimlib.sdk.msg.attachment.VideoAttachment
;
import
com.netease.nimlib.sdk.msg.constant.AttachStatusEnum
;
import
com.netease.nimlib.sdk.msg.constant.AttachStatusEnum
;
import
com.netease.nimlib.sdk.msg.model.AttachmentProgress
;
import
com.netease.nimlib.sdk.msg.model.AttachmentProgress
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.ydl.ydlcommon.app.Apm
;
import
com.yidianling.im.R
;
import
com.yidianling.nimbase.common.ToastHelper
;
import
com.yidianling.nimbase.common.ToastHelper
;
import
com.yidianling.nimbase.common.activity.ToolBarOptions
;
import
com.yidianling.nimbase.common.activity.ToolBarOptions
;
import
com.yidianling.nimbase.common.activity.UI
;
import
com.yidianling.nimbase.common.activity.UI
;
import
com.yidianling.nimbase.common.util.file.FileUtil
;
import
com.yidianling.nimbase.common.util.file.FileUtil
;
import
com.yidianling.nimbase.common.util.sys.TimeUtil
;
import
com.yidianling.nimbase.common.util.sys.TimeUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.uikit.custom.config.YDLToolBarOptions
;
import
com.yidianling.uikit.custom.config.YDLToolBarOptions
;
/**
/**
...
@@ -499,6 +502,21 @@ public class WatchVideoActivity extends UI implements Callback {
...
@@ -499,6 +502,21 @@ public class WatchVideoActivity extends UI implements Callback {
// async download original image
// async download original image
onDownloadStart
(
message
);
onDownloadStart
(
message
);
downloadFuture
=
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
message
,
false
);
downloadFuture
=
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
message
,
false
);
downloadFuture
.
setCallback
(
new
RequestCallback
<
Void
>()
{
@Override
public
void
onSuccess
(
Void
o
)
{
}
@Override
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
)));
}
@Override
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
throwable
);
}
});
downloading
=
true
;
downloading
=
true
;
}
}
}
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
72e6eea2
...
@@ -4,13 +4,9 @@ import android.animation.Animator;
...
@@ -4,13 +4,9 @@ import android.animation.Animator;
import
android.animation.ObjectAnimator
;
import
android.animation.ObjectAnimator
;
import
android.animation.ValueAnimator
;
import
android.animation.ValueAnimator
;
import
android.annotation.SuppressLint
;
import
android.annotation.SuppressLint
;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.media.AudioManager
;
import
android.media.AudioManager
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.os.Message
;
...
@@ -30,7 +26,6 @@ import androidx.appcompat.app.AppCompatActivity;
...
@@ -30,7 +26,6 @@ import androidx.appcompat.app.AppCompatActivity;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.blankj.utilcode.util.SPUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.Observer
;
import
com.netease.nimlib.sdk.Observer
;
...
@@ -49,28 +44,20 @@ import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
...
@@ -49,28 +44,20 @@ import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
import
com.ydl.webview.H5Params
;
import
com.ydl.webview.H5Params
;
import
com.ydl.webview.NewH5Activity
;
import
com.ydl.webview.NewH5Activity
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.base.config.HttpConfig
;
import
com.ydl.ydlcommon.app.Apm
;
import
com.ydl.ydlcommon.data.PlatformDataManager
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.modular.ModularServiceManager
;
import
com.ydl.ydlcommon.modular.ModularServiceManager
;
import
com.ydl.ydlcommon.ui.LoadingDialogFragment
;
import
com.ydl.ydlcommon.utils.AnimUtils
;
import
com.ydl.ydlcommon.utils.AnimUtils
;
import
com.ydl.ydlcommon.utils.LogUtil
;
import
com.ydl.ydlcommon.utils.LogUtil
;
import
com.ydl.ydlcommon.utils.NetworkParamsUtils
;
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
;
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
;
import
com.ydl.ydlcommon.utils.YdlBuryPointUtil
;
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
;
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
;
import
com.ydl.ydlcommon.utils.log.AliYunLogConfig
;
import
com.ydl.ydlcommon.utils.log.AliYunLogConfig
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlcommon.utils.log.LogHelper
;
import
com.ydl.ydlcommon.utils.log.LogHelper
;
import
com.ydl.ydlcommon.utils.remind.HttpErrorUtils
;
import
com.ydl.ydlcommon.view.CircleImageView
;
import
com.ydl.ydlcommon.view.CircleImageView
;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.ydl.ydlcommon.view.dialog.ListDialog
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.R
;
import
com.yidianling.im.bean.RemoveHistory
;
import
com.yidianling.im.config.constants.ImConstants
;
import
com.yidianling.im.event.CloseBottomWebviewEvent
;
import
com.yidianling.im.event.CloseBottomWebviewEvent
;
import
com.yidianling.im.event.MultipleAnswerBean
;
import
com.yidianling.im.event.MultipleAnswerBean
;
import
com.yidianling.im.event.MultipleSelectedEvent
;
import
com.yidianling.im.event.MultipleSelectedEvent
;
...
@@ -97,7 +84,6 @@ import com.yidianling.uikit.api.NimUIKitImpl;
...
@@ -97,7 +84,6 @@ import com.yidianling.uikit.api.NimUIKitImpl;
import
com.yidianling.uikit.business.ait.AitManager
;
import
com.yidianling.uikit.business.ait.AitManager
;
import
com.yidianling.uikit.business.session.activity.YDLBaseMessageActivity
;
import
com.yidianling.uikit.business.session.activity.YDLBaseMessageActivity
;
import
com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper
;
import
com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper
;
import
com.yidianling.uikit.business.session.helper.MessageListPanelHelper
;
import
com.yidianling.uikit.business.session.module.input.InputPanel
;
import
com.yidianling.uikit.business.session.module.input.InputPanel
;
import
com.yidianling.uikit.business.session.module.list.MessageListPanelEx
;
import
com.yidianling.uikit.business.session.module.list.MessageListPanelEx
;
import
com.yidianling.uikit.business.session.view.ChatPrivateTips
;
import
com.yidianling.uikit.business.session.view.ChatPrivateTips
;
...
@@ -1336,6 +1322,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
...
@@ -1336,6 +1322,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
public
void
onFailed
(
int
code
)
{
public
void
onFailed
(
int
code
)
{
if
(
msg
!=
null
)
{
if
(
msg
!=
null
)
{
sendFailWithBlackList
(
code
,
msg
);
sendFailWithBlackList
(
code
,
msg
);
Apm
.
INSTANCE
.
reportCustom
(
"yx_sendmessage_error"
,
"sessionId:"
+
msg
.
getSessionId
(),
new
Exception
(
String
.
valueOf
(
code
)));
}
}
}
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MessageListPanelEx.java
View file @
72e6eea2
...
@@ -7,14 +7,15 @@ import android.graphics.Bitmap;
...
@@ -7,14 +7,15 @@ import android.graphics.Bitmap;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.provider.MediaStore
;
import
android.provider.MediaStore
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
import
android.util.Pair
;
import
android.util.Pair
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.NIMSDK
;
import
com.netease.nimlib.sdk.NIMSDK
;
import
com.netease.nimlib.sdk.Observer
;
import
com.netease.nimlib.sdk.Observer
;
...
@@ -40,6 +41,7 @@ import com.netease.nimlib.sdk.msg.model.TeamMessageReceipt;
...
@@ -40,6 +41,7 @@ import com.netease.nimlib.sdk.msg.model.TeamMessageReceipt;
import
com.netease.nimlib.sdk.robot.model.RobotAttachment
;
import
com.netease.nimlib.sdk.robot.model.RobotAttachment
;
import
com.netease.nimlib.sdk.team.constant.TeamMemberType
;
import
com.netease.nimlib.sdk.team.constant.TeamMemberType
;
import
com.netease.nimlib.sdk.team.model.TeamMember
;
import
com.netease.nimlib.sdk.team.model.TeamMember
;
import
com.ydl.ydlcommon.app.Apm
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.R
;
import
com.yidianling.im.session.extension.CustomAttachLingxiWhichQuestion
;
import
com.yidianling.im.session.extension.CustomAttachLingxiWhichQuestion
;
...
@@ -838,7 +840,23 @@ public class MessageListPanelEx {
...
@@ -838,7 +840,23 @@ public class MessageListPanelEx {
public
void
doOkAction
()
{
public
void
doOkAction
()
{
// 正常情况收到消息后附件会自动下载。如果下载失败,可调用该接口重新下载
// 正常情况收到消息后附件会自动下载。如果下载失败,可调用该接口重新下载
if
(
message
.
getAttachment
()
!=
null
&&
message
.
getAttachment
()
instanceof
FileAttachment
)
if
(
message
.
getAttachment
()
!=
null
&&
message
.
getAttachment
()
instanceof
FileAttachment
)
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
message
,
true
);
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
message
,
true
)
.
setCallback
(
new
RequestCallback
<
Void
>()
{
@Override
public
void
onSuccess
(
Void
o
)
{
}
@Override
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
)));
}
@Override
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
throwable
);
}
});
}
}
};
};
...
@@ -1145,6 +1163,8 @@ public class MessageListPanelEx {
...
@@ -1145,6 +1163,8 @@ public class MessageListPanelEx {
@Override
@Override
public
void
onFailed
(
int
code
)
{
public
void
onFailed
(
int
code
)
{
String
sessionId
=
item
.
getSessionId
();
Apm
.
INSTANCE
.
reportCustom
(
"yx_revoke_error"
,
"sessionId:"
+
sessionId
,
new
Exception
(
String
.
valueOf
(
code
)));
if
(
code
==
ResponseCode
.
RES_OVERDUE
)
{
if
(
code
==
ResponseCode
.
RES_OVERDUE
)
{
ToastHelper
.
showToast
(
container
.
activity
,
R
.
string
.
im_revoke_failed
);
ToastHelper
.
showToast
(
container
.
activity
,
R
.
string
.
im_revoke_failed
);
}
else
{
}
else
{
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/viewholder/MsgViewHolderAudio.java
View file @
72e6eea2
...
@@ -10,18 +10,20 @@ import android.widget.ImageView;
...
@@ -10,18 +10,20 @@ import android.widget.ImageView;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.RequestCallback
;
import
com.netease.nimlib.sdk.msg.MsgService
;
import
com.netease.nimlib.sdk.msg.MsgService
;
import
com.netease.nimlib.sdk.msg.attachment.AudioAttachment
;
import
com.netease.nimlib.sdk.msg.attachment.AudioAttachment
;
import
com.netease.nimlib.sdk.msg.constant.AttachStatusEnum
;
import
com.netease.nimlib.sdk.msg.constant.AttachStatusEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgStatusEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgStatusEnum
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.ydl.ydlcommon.app.Apm
;
import
com.yidianling.im.R
;
import
com.yidianling.nimbase.business.session.audio.MessageAudioControl
;
import
com.yidianling.nimbase.business.session.audio.MessageAudioControl
;
import
com.yidianling.nimbase.common.media.audioplayer.Playable
;
import
com.yidianling.nimbase.common.media.audioplayer.Playable
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.nimbase.common.util.sys.ScreenUtil
;
import
com.yidianling.nimbase.common.util.sys.ScreenUtil
;
import
com.yidianling.nimbase.common.util.sys.TimeUtil
;
import
com.yidianling.nimbase.common.util.sys.TimeUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.uikit.api.NimUIKitImpl
;
import
com.yidianling.uikit.api.NimUIKitImpl
;
/**
/**
...
@@ -71,7 +73,24 @@ public class MsgViewHolderAudio extends MsgViewHolderBase {
...
@@ -71,7 +73,24 @@ public class MsgViewHolderAudio extends MsgViewHolderBase {
if
(
audioControl
!=
null
)
{
if
(
audioControl
!=
null
)
{
if
(
message
.
getDirect
()
==
MsgDirectionEnum
.
In
&&
message
.
getAttachStatus
()
!=
AttachStatusEnum
.
transferred
)
{
if
(
message
.
getDirect
()
==
MsgDirectionEnum
.
In
&&
message
.
getAttachStatus
()
!=
AttachStatusEnum
.
transferred
)
{
if
(
message
.
getAttachStatus
()
==
AttachStatusEnum
.
fail
||
message
.
getAttachStatus
()
==
AttachStatusEnum
.
def
)
{
if
(
message
.
getAttachStatus
()
==
AttachStatusEnum
.
fail
||
message
.
getAttachStatus
()
==
AttachStatusEnum
.
def
)
{
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
message
,
false
);
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
message
,
false
)
.
setCallback
(
new
RequestCallback
<
Void
>()
{
@Override
public
void
onSuccess
(
Void
o
)
{
}
@Override
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
)));
}
@Override
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
throwable
);
}
});
}
}
return
;
return
;
}
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/viewholder/MsgViewHolderBase.java
View file @
72e6eea2
...
@@ -13,12 +13,14 @@ import android.widget.TextView;
...
@@ -13,12 +13,14 @@ import android.widget.TextView;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.NIMSDK
;
import
com.netease.nimlib.sdk.NIMSDK
;
import
com.netease.nimlib.sdk.RequestCallback
;
import
com.netease.nimlib.sdk.msg.MsgService
;
import
com.netease.nimlib.sdk.msg.MsgService
;
import
com.netease.nimlib.sdk.msg.attachment.FileAttachment
;
import
com.netease.nimlib.sdk.msg.attachment.FileAttachment
;
import
com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgStatusEnum
;
import
com.netease.nimlib.sdk.msg.constant.MsgStatusEnum
;
import
com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
;
import
com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.ydl.ydlcommon.app.Apm
;
import
com.yidianling.im.R
;
import
com.yidianling.im.R
;
import
com.yidianling.nimbase.common.ui.imageview.HeadImageView
;
import
com.yidianling.nimbase.common.ui.imageview.HeadImageView
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
...
@@ -140,7 +142,23 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
...
@@ -140,7 +142,23 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
*/
*/
protected
void
downloadAttachment
()
{
protected
void
downloadAttachment
()
{
if
(
message
.
getAttachment
()
!=
null
&&
message
.
getAttachment
()
instanceof
FileAttachment
)
if
(
message
.
getAttachment
()
!=
null
&&
message
.
getAttachment
()
instanceof
FileAttachment
)
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
message
,
true
);
NIMClient
.
getService
(
MsgService
.
class
).
downloadAttachment
(
message
,
true
)
.
setCallback
(
new
RequestCallback
<
Void
>()
{
@Override
public
void
onSuccess
(
Void
o
)
{
}
@Override
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
)));
}
@Override
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
reportCustom
(
"yx_attchment_error"
,
""
,
throwable
);
}
});
}
}
// 设置FrameLayout子控件的gravity参数
// 设置FrameLayout子控件的gravity参数
...
...
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
View file @
72e6eea2
...
@@ -12,6 +12,7 @@ import android.view.View
...
@@ -12,6 +12,7 @@ import android.view.View
import
android.widget.ImageView
import
android.widget.ImageView
import
android.widget.RelativeLayout
import
android.widget.RelativeLayout
import
android.widget.TextView
import
android.widget.TextView
import
com.blankj.utilcode.util.ToastUtils
import
com.mobile.auth.gatewayauth.*
import
com.mobile.auth.gatewayauth.*
import
com.mobile.auth.gatewayauth.model.TokenRet
import
com.mobile.auth.gatewayauth.model.TokenRet
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.base.BaseActivity
...
@@ -535,6 +536,7 @@ object OneKeyLoginHelp {
...
@@ -535,6 +536,7 @@ object OneKeyLoginHelp {
// }
// }
}
}
else
->
{
// 其它失败原因
else
->
{
// 其它失败原因
ToastUtils
.
showShort
(
"您的网络环境较差,请输入手机号码进行登录。"
)
mPhoneNumberAuthHelper
?.
hideLoginLoading
()
mPhoneNumberAuthHelper
?.
hideLoginLoading
()
// 跳转到原生登录界面
// 跳转到原生登录界面
mActivity
.
runOnUiThread
{
mActivity
.
runOnUiThread
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/app/ApmInit.kt
0 → 100644
View file @
72e6eea2
package
com.ydl.ydlcommon.app
import
android.content.Context
import
com.apm.insight.MonitorCrash
import
com.apm.insight.log.VLog
import
com.bytedance.apm.insight.ApmInsight
import
com.bytedance.apm.insight.ApmInsightInitConfig
import
com.bytedance.apm.insight.IDynamicParams
import
com.meituan.android.walle.WalleChannelReader
object
Apm
{
private
var
crash
:
MonitorCrash
?
=
null
fun
initApm
(
context
:
Context
,
appId
:
String
,
vCode
:
Long
,
vName
:
String
,
debug
:
Boolean
,
uidCall
:
()
->
String
?)
{
val
channel
=
if
(
debug
)
"debug"
else
WalleChannelReader
.
getChannel
(
context
)
crash
=
MonitorCrash
.
init
(
context
,
appId
,
vCode
,
vName
)
crash
?.
config
()
?.
setChannel
(
channel
)
val
builder
=
ApmInsightInitConfig
.
builder
()
.
aid
(
appId
)
//.batteryMonitor(true)
//.cpuMonitor(true)
//.fpsMonitor(true)
//.seriousBlockDetect(true)
.
blockDetect
(
true
)
// .enableWebViewMonitor(true)
.
channel
(
channel
)
.
debugMode
(
debug
)
.
enableLogRecovery
(
true
)
.
setDynamicParams
(
ApmParams
(
crash
,
uidCall
))
ApmInsight
.
getInstance
().
init
(
context
,
builder
.
build
())
VLog
.
init
(
context
,
20
)
}
fun
reportCustom
(
type
:
String
,
msg
:
String
,
throwable
:
Throwable
)
{
crash
?.
reportCustomErr
(
msg
,
type
,
throwable
)
}
}
private
class
ApmParams
(
val
crash
:
MonitorCrash
?,
val
uidCall
:
()
->
String
?)
:
IDynamicParams
()
{
override
fun
getUserUniqueID
():
String
?
{
return
null
}
override
fun
getAbSdkVersion
():
String
?
{
return
null
}
override
fun
getSsid
():
String
?
{
return
null
}
override
fun
getDid
():
String
?
{
return
null
}
override
fun
getUserId
():
String
?
{
val
uid
=
uidCall
.
invoke
()
crash
?.
config
()
?.
setUID
(
uid
)
return
uid
}
}
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
View file @
72e6eea2
...
@@ -4,7 +4,9 @@ import android.annotation.SuppressLint
...
@@ -4,7 +4,9 @@ import android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.text.TextUtils
import
android.text.TextUtils
import
com.facebook.stetho.okhttp3.StethoInterceptor
import
com.facebook.stetho.okhttp3.StethoInterceptor
import
com.google.gson.Gson
import
com.ydl.pushserver.pushagent.YdlPushAgent
import
com.ydl.pushserver.pushagent.YdlPushAgent
import
com.ydl.ydlcommon.app.Apm
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.bean.AuthBean
import
com.ydl.ydlcommon.bean.AuthBean
import
com.ydl.ydlcommon.bean.GatewayRequestDTO
import
com.ydl.ydlcommon.bean.GatewayRequestDTO
...
@@ -15,6 +17,7 @@ import com.ydl.ydlcommon.data.http.GsonProvider
...
@@ -15,6 +17,7 @@ import com.ydl.ydlcommon.data.http.GsonProvider
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.api.ApiRequestUtil
import
com.ydl.ydlcommon.data.http.api.ApiRequestUtil
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.AliYunLogConfig
import
com.ydl.ydlcommon.utils.log.AliYunLogConfig
...
@@ -23,7 +26,6 @@ import com.ydl.ydlnet.builder.config.OkHttpConfig
...
@@ -23,7 +26,6 @@ import com.ydl.ydlnet.builder.config.OkHttpConfig
import
com.ydl.ydlnet.builder.factory.ApiFactory
import
com.ydl.ydlnet.builder.factory.ApiFactory
import
com.ydl.ydlnet.builder.interceptor.log.RequestHandler
import
com.ydl.ydlnet.builder.interceptor.log.RequestHandler
import
com.ydl.ydlnet.builder.interceptor.log.RequestLogInterceptor
import
com.ydl.ydlnet.builder.interceptor.log.RequestLogInterceptor
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.common.tools.ToastUtil
...
@@ -31,6 +33,8 @@ import io.reactivex.functions.Action
...
@@ -31,6 +33,8 @@ import io.reactivex.functions.Action
import
okhttp3.*
import
okhttp3.*
import
okio.Buffer
import
okio.Buffer
import
okio.BufferedSink
import
okio.BufferedSink
import
java.io.EOFException
import
java.nio.charset.Charset
import
java.util.*
import
java.util.*
import
kotlin.collections.ArrayList
import
kotlin.collections.ArrayList
import
kotlin.collections.HashMap
import
kotlin.collections.HashMap
...
@@ -141,7 +145,8 @@ class HttpConfig {
...
@@ -141,7 +145,8 @@ class HttpConfig {
commonParams
(),
commonParams
(),
requestHead
(
appName
),
requestHead
(
appName
),
addEncryptionHeaderParamsInterceptor
(),
addEncryptionHeaderParamsInterceptor
(),
responseErrorInterceptor
()
responseErrorInterceptor
(),
respErrorInterceptor
()
)
)
.
setRequestHandler
(
getRequestHandler
())
.
setRequestHandler
(
getRequestHandler
())
.
setReadTimeout
(
15
)
.
setReadTimeout
(
15
)
...
@@ -183,6 +188,53 @@ class HttpConfig {
...
@@ -183,6 +188,53 @@ class HttpConfig {
}
}
}
}
private
fun
respErrorInterceptor
():
Interceptor
{
return
Interceptor
{
val
req
=
it
.
request
()
val
resp
=
it
.
proceed
(
req
)
if
(
appDebug
)
return
@Interceptor
resp
val
code
=
resp
.
code
()
val
message
=
resp
.
message
()
val
api
=
req
.
url
().
encodedPath
()
if
(!
resp
.
isSuccessful
)
{
Apm
.
reportCustom
(
"network_request_error"
,
"${api}(${code},${message})"
,
Exception
(
"${api}(${code},${message})"
))
}
else
{
try
{
val
body
=
resp
.
body
()
?:
return
@Interceptor
resp
val
buffer
=
body
.
source
().
buffer
()
if
(!
isPlaintext
(
buffer
))
return
@Interceptor
resp
val
readString
=
buffer
.
clone
().
readString
(
Charset
.
forName
(
"UTF-8"
))
val
fromJson
=
Gson
().
fromJson
<
BaseAPIResponse
<
Any
>>(
readString
,
BaseAPIResponse
::
class
.
java
)
if
(
fromJson
.
code
!=
"200"
)
{
Apm
.
reportCustom
(
"network_business_error"
,
"${api}(${fromJson.code},${fromJson.msg})"
,
Exception
(
"${api}(${fromJson.code},${fromJson.msg})"
))
}
}
catch
(
throwable
:
Throwable
)
{
LogUtil
.
e
(
throwable
.
message
)
}
}
return
@Interceptor
resp
}
}
private
fun
isPlaintext
(
buffer
:
Buffer
):
Boolean
{
return
try
{
val
prefix
=
Buffer
()
val
byteCount
=
if
(
buffer
.
size
()
<
64L
)
buffer
.
size
()
else
64L
buffer
.
copyTo
(
prefix
,
0L
,
byteCount
)
var
i
=
0
while
(
i
<
16
&&
!
prefix
.
exhausted
())
{
val
codePoint
=
prefix
.
readUtf8CodePoint
()
if
(
Character
.
isISOControl
(
codePoint
)
&&
!
Character
.
isWhitespace
(
codePoint
))
{
return
false
}
++
i
}
true
}
catch
(
var6
:
EOFException
)
{
false
}
}
/**
/**
* 接口返回错误日志埋点
* 接口返回错误日志埋点
*/
*/
...
...
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
View file @
72e6eea2
...
@@ -3,7 +3,6 @@ package com.ydl.webview;
...
@@ -3,7 +3,6 @@ package com.ydl.webview;
import
android.annotation.SuppressLint
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.content.ClipData
;
import
android.content.ClipData
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
...
@@ -35,7 +34,6 @@ import com.tencent.smtt.sdk.WebView;
...
@@ -35,7 +34,6 @@ import com.tencent.smtt.sdk.WebView;
import
com.tencent.smtt.sdk.WebViewClient
;
import
com.tencent.smtt.sdk.WebViewClient
;
import
com.umeng.socialize.UMShareAPI
;
import
com.umeng.socialize.UMShareAPI
;
import
com.umeng.socialize.bean.SHARE_MEDIA
;
import
com.umeng.socialize.bean.SHARE_MEDIA
;
import
com.ydl.event.ReloadUrlEvent
;
import
com.ydl.utils.PopUtils
;
import
com.ydl.utils.PopUtils
;
import
com.ydl.utils.ProxyCheckUtils
;
import
com.ydl.utils.ProxyCheckUtils
;
import
com.ydl.utils.WebUrlParamsUtils
;
import
com.ydl.utils.WebUrlParamsUtils
;
...
@@ -1388,7 +1386,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
...
@@ -1388,7 +1386,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
super
.
onDestroy
();
super
.
onDestroy
();
cancelSendNetLossMessage
();
cancelSendNetLossMessage
();
EventBus
.
getDefault
().
unregister
(
this
);
EventBus
.
getDefault
().
unregister
(
this
);
super
.
onDestroy
();
if
(
wv_content
!=
null
)
{
if
(
wv_content
!=
null
)
{
wv_content
.
destroy
();
wv_content
.
destroy
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment