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
d508d3a9
Commit
d508d3a9
authored
Apr 11, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/最新Dev' into MDT群聊搭建
parents
95a65674
fd7f9a0d
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
175 additions
and
43 deletions
+175
-43
ComponentTestApp.java
app/src/main/java/com/ydl/component/base/ComponentTestApp.java
+3
-0
config.gradle
config.gradle
+19
-14
ConsultAssistantDialog.kt
m-consultant/src/main/java/com/yidianling/consultant/dialog/ConsultAssistantDialog.kt
+19
-1
ConsultAssistantDialogUtils.kt
m-consultant/src/main/java/com/yidianling/consultant/modular/singlton/ConsultAssistantDialogUtils.kt
+38
-6
consultant_expert_consult_assistant_popup_window.xml
m-consultant/src/main/res/layout/consultant_expert_consult_assistant_popup_window.xml
+7
-8
consultant_assistant_dialog_img.png
m-consultant/src/ydl/res/drawable-xhdpi/consultant_assistant_dialog_img.png
+0
-0
consultant_assistant_dialog_img.webp
m-consultant/src/ydl/res/drawable-xhdpi/consultant_assistant_dialog_img.webp
+0
-0
home_data.json
m-home/src/main/assets/home_data.json
+1
-0
home_data_xlzx.json
m-home/src/main/assets/home_data_xlzx.json
+6
-3
HomeHeaderBean.kt
m-home/src/main/java/com/yidianling/home/model/bean/HomeHeaderBean.kt
+4
-0
YdlHomeAdapter.kt
m-home/src/ydl/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
+9
-1
HomeButtonBannerView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeButtonBannerView.kt
+10
-6
home_button_banner_view.xml
m-home/src/ydl/res/layout/home_button_banner_view.xml
+1
-0
CmsExamQuestionPaperActivity.kt
m-im/src/main/java/com/yidianling/im/ui/activity/CmsExamQuestionPaperActivity.kt
+1
-1
LoginUtils.kt
m-user/src/main/java/com/yidianling/user/LoginUtils.kt
+6
-1
UserServiceImp.kt
m-user/src/main/java/com/yidianling/user/modular_service/UserServiceImp.kt
+10
-0
OneKeyLoginHelp.kt
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
+19
-1
LoginCallBackListener.kt
m-user/src/main/modular_api/com/yidianling/user/api/listener/LoginCallBackListener.kt
+7
-0
IUserService.kt
m-user/src/main/modular_api/com/yidianling/user/api/service/IUserService.kt
+9
-0
DefaultFormatPrinter.java
ydl-net/src/main/java/com/ydl/ydlnet/builder/interceptor/log/DefaultFormatPrinter.java
+3
-1
build.gradle
ydl-platform/build.gradle
+3
-0
No files found.
app/src/main/java/com/ydl/component/base/ComponentTestApp.java
View file @
d508d3a9
...
...
@@ -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
()
{
...
...
config.gradle
View file @
d508d3a9
...
...
@@ -5,12 +5,12 @@ ext {
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.49.5
2
"
,
"m-consultant"
:
"0.0.60.
04
"
,
"m-confide"
:
"0.0.49.5
3
"
,
"m-consultant"
:
"0.0.60.
10
"
,
"m-fm"
:
"0.0.30.04"
,
"m-user"
:
"0.0.61.9
4
"
,
"m-home"
:
"0.0.22.8
5
"
,
"m-im"
:
"0.0.21.1
7
"
,
"m-user"
:
"0.0.61.9
6
"
,
"m-home"
:
"0.0.22.8
7
"
,
"m-im"
:
"0.0.21.1
8
"
,
"m-dynamic"
:
"0.0.7.35"
,
"m-article"
:
"0.0.0.10"
,
...
...
@@ -26,14 +26,14 @@ 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.1
7
"
,
"m-user-api"
:
"0.0.10.1
9
"
,
"m-home-api"
:
"0.0.4.2"
,
"m-im-api"
:
"0.0.12.23"
,
"m-dynamic-api"
:
"0.0.3.71"
,
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.40.
79
"
,
"ydl-platform"
:
"0.0.40.
83
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.58"
,
...
...
@@ -76,6 +76,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"
,
...
...
@@ -89,11 +90,11 @@ ext {
//第三步 若干
"m-confide"
:
"0.0.49.52"
,
"m-consultant"
:
"0.0.60.
03
"
,
"m-consultant"
:
"0.0.60.
10
"
,
"m-fm"
:
"0.0.30.07"
,
"m-user"
:
"0.0.61.9
4
"
,
"m-home"
:
"0.0.22.8
5
"
,
"m-im"
:
"0.0.21.1
7
"
,
"m-user"
:
"0.0.61.9
6
"
,
"m-home"
:
"0.0.22.8
7
"
,
"m-im"
:
"0.0.21.1
8
"
,
"m-dynamic"
:
"0.0.7.35"
,
"m-article"
:
"0.0.0.8"
,
...
...
@@ -108,14 +109,14 @@ 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.1
7
"
,
"m-user-api"
:
"0.0.10.1
9
"
,
"m-home-api"
:
"0.0.4.2"
,
"m-im-api"
:
"0.0.12.23"
,
"m-dynamic-api"
:
"0.0.3.71"
,
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.40.
79
"
,
"ydl-platform"
:
"0.0.40.
83
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.58"
,
...
...
@@ -155,7 +156,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"
,
...
...
m-consultant/src/main/java/com/yidianling/consultant/dialog/ConsultAssistantDialog.kt
View file @
d508d3a9
...
...
@@ -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
()
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/modular/singlton/ConsultAssistantDialogUtils.kt
View file @
d508d3a9
...
...
@@ -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
()
{
}
})
}
}
...
...
m-consultant/src/main/res/layout/consultant_expert_consult_assistant_popup_window.xml
View file @
d508d3a9
...
...
@@ -10,17 +10,17 @@
android:layout_height=
"84dp"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"2
5
dp"
android:layout_marginRight=
"2
2
dp"
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=
"#
80
ffffff"
/>
<LinearLayout
android:id=
"@+id/ll_desc_assistant"
...
...
@@ -66,6 +66,7 @@
android:layout_height=
"wrap_content"
android:text=
"为你精准匹配咨询师 "
android:textColor=
"#ffffff"
android:textStyle=
"bold"
android:textSize=
"12dp"
/>
<ImageView
...
...
@@ -78,14 +79,13 @@
</LinearLayout>
<
Imag
eView
<
com.facebook.drawee.view.SimpleDrawe
eView
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
m-consultant/src/ydl/res/drawable-xhdpi/consultant_assistant_dialog_img.png
deleted
100644 → 0
View file @
95a65674
41.5 KB
m-consultant/src/ydl/res/drawable-xhdpi/consultant_assistant_dialog_img.webp
0 → 100644
View file @
d508d3a9
File added
m-home/src/main/assets/home_data.json
View file @
d508d3a9
...
...
@@ -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
,
...
...
m-home/src/main/assets/home_data_xlzx.json
View file @
d508d3a9
...
...
@@ -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
},
...
...
m-home/src/main/java/com/yidianling/home/model/bean/HomeHeaderBean.kt
View file @
d508d3a9
...
...
@@ -43,6 +43,10 @@ class HomeHeaderBean : HomeItemBaseBean {
* 专家名称
*/
var
doctorName
:
String
?
=
null
/*
* 倾诉免费标识
* */
var
listenFree
:
Boolean
?
=
null
class
AskCategoryDataBean
{
/**
...
...
m-home/src/ydl/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
View file @
d508d3a9
...
...
@@ -57,6 +57,11 @@ 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
()
...
...
@@ -64,6 +69,7 @@ class YdlHomeAdapter(private val mContext: Context,
this
.
list
.
clear
()
}
this
.
list
.
addAll
(
list
)
this
.
listenFree
=
list
[
0
]
?.
headerBean
?.
listenFree
//重置标记位
confidePosition
=
-
1
consultPosition
=
-
1
...
...
@@ -131,7 +137,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
->
{
...
...
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeButtonBannerView.kt
View file @
d508d3a9
...
...
@@ -22,7 +22,7 @@ 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
...
...
@@ -36,10 +36,14 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
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_temp
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
RESOURCE
)
.
into
(
qingsuGif
)
if
(
listenFree
){
qingsuGif
.
visibility
=
View
.
VISIBLE
Glide
.
with
(
context
)
.
load
(
R
.
drawable
.
qingsu_new_free_dynamic
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
RESOURCE
)
.
into
(
qingsuGif
)
}
initButtonView
()
homeModuleButtonBannerFirst
.
setOnClickListener
{
...
...
@@ -67,7 +71,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
buttonParams
=
LinearLayout
.
LayoutParams
(
viewWidth
,
viewHeight
)
buttonParamsFrame
=
FrameLayout
.
LayoutParams
(
viewWidth
,
viewHeight
)
buttonParamsFrame2
=
FrameLayout
.
LayoutParams
((
viewWidth
/
2.0
).
toInt
(),
(
viewHeight
/
2.3
).
toInt
())
buttonParamsFrame2
!!
.
setMargins
((((
viewWidth
/
6
f
).
toInt
())),
0
,
0
,
0
)
buttonParamsFrame2
!!
.
setMargins
((((
viewWidth
/
12
f
).
toInt
())),
0
,
0
,
0
)
qingsuGif
.
layoutParams
=
buttonParamsFrame2
homeModuleButtonBannerFirst
.
layoutParams
=
buttonParams
...
...
m-home/src/ydl/res/layout/home_button_banner_view.xml
View file @
d508d3a9
...
...
@@ -111,6 +111,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/qingsuGif"
android:visibility=
"gone"
>
</ImageView>
</FrameLayout>
...
...
m-im/src/main/java/com/yidianling/im/ui/activity/CmsExamQuestionPaperActivity.kt
View file @
d508d3a9
...
...
@@ -841,7 +841,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
ToastUtil
.
toastShort
(
"咨询助理忙碌中,请稍后再试"
)
})
}
},
2
000
)
},
1
000
)
}
...
...
m-user/src/main/java/com/yidianling/user/LoginUtils.kt
View file @
d508d3a9
...
...
@@ -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
)
...
...
@@ -107,6 +111,7 @@ object LoginUtils {
@JvmStatic
fun
loginSuccessOperate
(
activity
:
Activity
)
{
logingCallBackListener
?.
loginSuccess
()
// 登录成功后,如果一键登录界面没有关闭,则关闭掉
OneKeyLoginHelp
.
quitLoginPage
()
val
size
=
ActivityManager
.
getActivitySize
()
...
...
m-user/src/main/java/com/yidianling/user/modular_service/UserServiceImp.kt
View file @
d508d3a9
...
...
@@ -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
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
View file @
d508d3a9
...
...
@@ -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
...
...
@@ -526,6 +527,7 @@ object OneKeyLoginHelp {
// 号码验证监听
private
lateinit
var
verifyTokenResultListener
:
VerifyTokenResultListener
interface
VerifyTokenResultListener
{
fun
onTokenSuccess
(
result
:
String
)
...
...
@@ -591,7 +593,23 @@ object OneKeyLoginHelp {
}
return
UserHelper
.
isLogin
()
}
/**
* @param isOpenDialog true: 使用弹窗展示一键登录
* false: 使用全页面展示一键登录
* @return true:登录。false:未登录
* */
fun
startLoginByStatusLoginCallBack
(
context
:
Context
,
isOpenDialog
:
Boolean
,
listener
:
LoginCallBackListener
)
{
LoginUtils
.
setLoginCallBack
(
listener
)
if
(!
UserHelper
.
isLogin
())
{
if
(
this
::
mActivity
.
isInitialized
)
{
//如果mActivity有初始化,代表项目使用了一键登录
startLogin
(
context
as
Activity
,
isOpenDialog
)
}
else
{
//如果mActivity未初始化,使用正常登录
RegisterAndLoginActivity
.
start
(
context
)
}
}
}
/**
* @param isOpenDialog true 使用弹窗
* */
...
...
m-user/src/main/modular_api/com/yidianling/user/api/listener/LoginCallBackListener.kt
0 → 100644
View file @
d508d3a9
package
com.yidianling.user.api.listener
interface
LoginCallBackListener
{
fun
loginSuccess
()
fun
notLogin
()
}
\ No newline at end of file
m-user/src/main/modular_api/com/yidianling/user/api/service/IUserService.kt
View file @
d508d3a9
...
...
@@ -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
ydl-net/src/main/java/com/ydl/ydlnet/builder/interceptor/log/DefaultFormatPrinter.java
View file @
d508d3a9
...
...
@@ -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
);
}
}
/**
...
...
ydl-platform/build.gradle
View file @
d508d3a9
...
...
@@ -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"
]
...
...
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