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
14134f56
Commit
14134f56
authored
Dec 20, 2019
by
严久程
Browse files
Options
Browse Files
Download
Plain Diff
动态bug修复
im模块4.0.20内容增加 basecommand字段修改
parents
ca3a5007
c0d6d99e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
183 additions
and
145 deletions
+183
-145
DemoModel.kt
app/src/main/java/com/ydl/component/mvp/DemoModel.kt
+3
-1
DemoPresenter.kt
app/src/main/java/com/ydl/component/mvp/DemoPresenter.kt
+5
-0
config.gradle
config.gradle
+2
-2
ExpertSearchBigShotBean.java
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchBigShotBean.java
+5
-5
ExpertSearchRecommandBean.java
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchRecommandBean.java
+5
-5
ExpertSearchTopShowBean.kt
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchTopShowBean.kt
+1
-1
RecommendListView.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/topView/RecommendListView.kt
+1
-1
home_data.json
m-home/src/main/assets/home_data.json
+0
-0
IHomeBaseContract.kt
m-home/src/main/java/com/yidianling/home/constants/IHomeBaseContract.kt
+1
-1
BaseHomePresenterImpl.kt
m-home/src/main/java/com/yidianling/home/presenter/BaseHomePresenterImpl.kt
+8
-5
HomePresenterImpl.kt
m-home/src/xlzx/java/com/yidianling/home/presenter/HomePresenterImpl.kt
+2
-2
HomeConsultItemView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
+1
-1
HomeConfideRecyleSuspendListener.kt
m-home/src/ydl/java/com/yidianling/home/listener/HomeConfideRecyleSuspendListener.kt
+77
-75
HomePresenterImpl.kt
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
+5
-2
YdlHomeFragment.kt
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
+7
-5
HomeConsultItemView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
+4
-4
UserBIConstants.kt
m-user/src/main/java/com/yidianling/user/constants/UserBIConstants.kt
+2
-2
InputPassWordPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
+2
-5
LoginPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
+3
-4
VerificationCodePresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
+1
-1
OkHttpConfig.java
ydl-net/src/main/java/com/ydl/ydlnet/builder/config/OkHttpConfig.java
+3
-1
BaseObserver.java
ydl-net/src/main/java/com/ydl/ydlnet/client/observer/BaseObserver.java
+5
-1
ToastHelper.kt
ydl-pay/src/main/java/com/yidianling/ydl_pay/toast/ToastHelper.kt
+10
-8
YdlRepository.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/app/YdlRepository.kt
+19
-0
ThrowableConsumer.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/ThrowableConsumer.kt
+1
-1
ToastHelper.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/remind/ToastHelper.kt
+9
-11
ToastUtil.java
ydl-utils/src/main/java/com/yidianling/common/tools/ToastUtil.java
+1
-1
No files found.
app/src/main/java/com/ydl/component/mvp/DemoModel.kt
View file @
14134f56
...
@@ -20,7 +20,9 @@ class DemoModel : BaseModel(), DemoContract.Model {
...
@@ -20,7 +20,9 @@ class DemoModel : BaseModel(), DemoContract.Model {
return
YDLHttpUtils
.
obtainApi
(
DemoService
::
class
.
java
)
return
YDLHttpUtils
.
obtainApi
(
DemoService
::
class
.
java
)
.
getFMData
()
.
getFMData
()
.
compose
(
RxUtils
.
resultJavaData
())
.
compose
(
RxUtils
.
resultJavaData
())
.
map
{
throw
RuntimeException
(
"runtime exception"
)
}
}
}
override
fun
getHome
():
Observable
<
JsonObject
>
{
override
fun
getHome
():
Observable
<
JsonObject
>
{
...
...
app/src/main/java/com/ydl/component/mvp/DemoPresenter.kt
View file @
14134f56
...
@@ -7,6 +7,7 @@ import com.ydl.media.audio.AudioPlayer
...
@@ -7,6 +7,7 @@ import com.ydl.media.audio.AudioPlayer
import
com.ydl.media.audio.model.Music
import
com.ydl.media.audio.model.Music
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlnet.client.observer.CommonObserver
import
com.ydl.ydlnet.client.observer.CommonObserver
/**
/**
...
@@ -21,15 +22,18 @@ class DemoPresenter : BasePresenter<DemoContract.View,DemoContract.Model>(),
...
@@ -21,15 +22,18 @@ class DemoPresenter : BasePresenter<DemoContract.View,DemoContract.Model>(),
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
.
subscribe
(
object
:
CommonObserver
<
HomeFMBean
>()
{
.
subscribe
(
object
:
CommonObserver
<
HomeFMBean
>()
{
override
fun
onError
(
errorMsg
:
String
)
{
override
fun
onError
(
errorMsg
:
String
)
{
LogUtil
.
d
(
"RxJava loadUsers ---->: $errorMsg"
)
}
}
override
fun
onSuccess
(
homeFMBean
:
HomeFMBean
)
{
override
fun
onSuccess
(
homeFMBean
:
HomeFMBean
)
{
throw
RuntimeException
(
"runtime exception"
)
homeFMBean
.
list
?.
let
{
homeFMBean
.
list
?.
let
{
AudioPlayer
.
get
().
addPlayList
(
stringToMusicPlayerList
(
it
))
AudioPlayer
.
get
().
addPlayList
(
stringToMusicPlayerList
(
it
))
mView
.
setData
(
""
)
mView
.
setData
(
""
)
}
}
}
}
})
})
}
}
override
fun
loadHome
()
=
mModel
.
getHome
()
override
fun
loadHome
()
=
mModel
.
getHome
()
...
@@ -52,6 +56,7 @@ class DemoPresenter : BasePresenter<DemoContract.View,DemoContract.Model>(),
...
@@ -52,6 +56,7 @@ class DemoPresenter : BasePresenter<DemoContract.View,DemoContract.Model>(),
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
//使用 Rxlifecycle,使 Disposable 和 Activity 一起销毁
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
//使用 Rxlifecycle,使 Disposable 和 Activity 一起销毁
.
subscribe
(
object
:
CommonObserver
<
JsonArray
>()
{
.
subscribe
(
object
:
CommonObserver
<
JsonArray
>()
{
override
fun
onError
(
errorMsg
:
String
)
{
override
fun
onError
(
errorMsg
:
String
)
{
LogUtil
.
d
(
"RxJava loadUsers ---->: $errorMsg"
)
}
}
override
fun
onSuccess
(
users
:
JsonArray
)
{
override
fun
onSuccess
(
users
:
JsonArray
)
{
...
...
config.gradle
View file @
14134f56
...
@@ -44,10 +44,10 @@ ext {
...
@@ -44,10 +44,10 @@ ext {
//第三步 若干
//第三步 若干
"m-confide"
:
"0.0.41.1"
,
"m-confide"
:
"0.0.41.1"
,
"m-consultant"
:
"0.0.51.
1
"
,
"m-consultant"
:
"0.0.51.
3
"
,
"m-fm"
:
"0.0.23.3"
,
"m-fm"
:
"0.0.23.3"
,
"m-user"
:
"0.0.40.3"
,
"m-user"
:
"0.0.40.3"
,
"m-home"
:
"0.0.6.
6
"
,
"m-home"
:
"0.0.6.
18
"
,
"m-muse"
:
"0.0.20.3"
,
"m-muse"
:
"0.0.20.3"
,
"m-tests"
:
"0.0.15.2"
,
"m-tests"
:
"0.0.15.2"
,
...
...
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchBigShotBean.java
View file @
14134f56
...
@@ -151,7 +151,7 @@ public class ExpertSearchBigShotBean {
...
@@ -151,7 +151,7 @@ public class ExpertSearchBigShotBean {
private
int
id
;
private
int
id
;
private
int
parentId
;
private
int
parentId
;
private
int
i
am
geType
;
private
int
i
ma
geType
;
private
int
isShow
;
private
int
isShow
;
private
String
createTime
;
private
String
createTime
;
private
String
updateTime
;
private
String
updateTime
;
...
@@ -174,12 +174,12 @@ public class ExpertSearchBigShotBean {
...
@@ -174,12 +174,12 @@ public class ExpertSearchBigShotBean {
this
.
parentId
=
parentId
;
this
.
parentId
=
parentId
;
}
}
public
int
getI
am
geType
()
{
public
int
getI
ma
geType
()
{
return
i
am
geType
;
return
i
ma
geType
;
}
}
public
void
setI
am
geType
(
int
iamgeType
)
{
public
void
setI
ma
geType
(
int
iamgeType
)
{
this
.
i
am
geType
=
iamgeType
;
this
.
i
ma
geType
=
iamgeType
;
}
}
public
int
getIsShow
()
{
public
int
getIsShow
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchRecommandBean.java
View file @
14134f56
...
@@ -152,7 +152,7 @@ public class ExpertSearchRecommandBean {
...
@@ -152,7 +152,7 @@ public class ExpertSearchRecommandBean {
private
int
id
;
private
int
id
;
private
int
parentId
;
private
int
parentId
;
private
int
i
am
geType
;
private
int
i
ma
geType
;
private
int
isShow
;
private
int
isShow
;
private
String
createTime
;
private
String
createTime
;
private
String
updateTime
;
private
String
updateTime
;
...
@@ -175,12 +175,12 @@ public class ExpertSearchRecommandBean {
...
@@ -175,12 +175,12 @@ public class ExpertSearchRecommandBean {
this
.
parentId
=
parentId
;
this
.
parentId
=
parentId
;
}
}
public
int
getI
am
geType
()
{
public
int
getI
ma
geType
()
{
return
i
am
geType
;
return
i
ma
geType
;
}
}
public
void
setI
am
geType
(
int
iamgeType
)
{
public
void
setI
ma
geType
(
int
iamgeType
)
{
this
.
i
am
geType
=
iamgeType
;
this
.
i
ma
geType
=
iamgeType
;
}
}
public
int
getIsShow
()
{
public
int
getIsShow
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchTopShowBean.kt
View file @
14134f56
...
@@ -3,5 +3,5 @@ package com.yidianling.consultant.bean
...
@@ -3,5 +3,5 @@ package com.yidianling.consultant.bean
class
ExpertSearchTopShowBean
(
class
ExpertSearchTopShowBean
(
var
doctorSpecialTopics
:
ArrayList
<
ExpertSearchBigShotBean
>,
var
doctorSpecialTopics
:
ArrayList
<
ExpertSearchBigShotBean
>,
var
sceneSpecialTopic
:
ArrayList
<
ExpertSearchRecommandBean
>
var
sceneSpecialTopic
s
:
ArrayList
<
ExpertSearchRecommandBean
>
)
)
m-consultant/src/main/java/com/yidianling/consultant/ui/view/topView/RecommendListView.kt
View file @
14134f56
...
@@ -79,7 +79,7 @@ class RecommendListView : LinearLayout {
...
@@ -79,7 +79,7 @@ class RecommendListView : LinearLayout {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
Consumer
{
.
subscribe
(
Consumer
{
if
(
null
!=
mContext
)
{
if
(
null
!=
mContext
)
{
mSceneSpecialTopicList
.
addAll
(
it
.
sceneSpecialTopic
)
mSceneSpecialTopicList
.
addAll
(
it
.
sceneSpecialTopic
s
)
mDoctorSpecialTopicsList
.
addAll
(
it
.
doctorSpecialTopics
)
mDoctorSpecialTopicsList
.
addAll
(
it
.
doctorSpecialTopics
)
setData
()
setData
()
}
}
...
...
m-home/src/main/assets/home_data.json
View file @
14134f56
This diff is collapsed.
Click to expand it.
m-home/src/main/java/com/yidianling/home/constants/IHomeBaseContract.kt
View file @
14134f56
...
@@ -105,7 +105,7 @@ class IHomeBaseContract {
...
@@ -105,7 +105,7 @@ class IHomeBaseContract {
/**
/**
*获取咨询列表
*获取咨询列表
*/
*/
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
)
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
,
isCancelHome
:
Boolean
=
true
)
/**
/**
* 首页问答 - 点赞
* 首页问答 - 点赞
...
...
m-home/src/main/java/com/yidianling/home/presenter/BaseHomePresenterImpl.kt
View file @
14134f56
...
@@ -58,9 +58,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
...
@@ -58,9 +58,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
//首页缓存版本号
//首页缓存版本号
var
HOME_PAGER_DATA_CACHE_VERISON
=
"HOME_PAGER_DATA_CACHE_VERISON"
var
HOME_PAGER_DATA_CACHE_VERISON
=
"HOME_PAGER_DATA_CACHE_VERISON"
private
var
mConsultDisposable
:
Disposable
?
=
null
var
mConsultDisposable
:
Disposable
?
=
null
private
var
mConfideDisposable
:
Disposable
?
=
null
var
mConfideDisposable
:
Disposable
?
=
null
private
var
mHomeDisposable
:
Disposable
?
=
null
var
mHomeDisposable
:
Disposable
?
=
null
var
mConfideType
:
String
=
""
var
mConfideType
:
String
=
""
var
mConsultType
:
String
=
""
var
mConsultType
:
String
=
""
...
@@ -151,10 +151,13 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
...
@@ -151,10 +151,13 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
/**
/**
*获取咨询列表
*获取咨询列表
*/
*/
override
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
)
{
override
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
,
isCancelHome
:
Boolean
)
{
disposeConsult
()
disposeConsult
()
disposeHome
()
if
(
isCancelHome
)
{
disposeHome
()
}
mConsultType
=
type
mConsultType
=
type
...
...
m-home/src/xlzx/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
14134f56
...
@@ -161,7 +161,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
...
@@ -161,7 +161,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
disposeHome
()
disposeHome
()
val
homeList
:
MutableList
<
HomePagerDataBean
>
=
mutableListOf
()
val
homeList
:
MutableList
<
HomePagerDataBean
>
=
mutableListOf
()
LogUtil
.
d
(
"mConsultType-loadHomeData:$mConsultType"
)
LogUtil
.
d
(
"mConsultType-loadHomeData:$mConsultType"
)
Observable
.
mergeArray
(
mHomeDisposable
=
Observable
.
mergeArray
(
mModel
.
headerRequest
()
mModel
.
headerRequest
()
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
.
map
{
it
->
.
map
{
it
->
...
@@ -183,7 +183,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
...
@@ -183,7 +183,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
if
(
it
.
consultCategoryData
!=
null
&&
it
.
consultCategoryData
!!
.
isNotEmpty
())
{
if
(
it
.
consultCategoryData
!=
null
&&
it
.
consultCategoryData
!!
.
isNotEmpty
())
{
//咨询分类和缓存分类不一致,重新加载咨询列表数据
//咨询分类和缓存分类不一致,重新加载咨询列表数据
if
(
it
.
consultCategoryData
!!
[
0
].
id
.
toString
()
!=
mConsultType
)
{
if
(
it
.
consultCategoryData
!!
[
0
].
id
.
toString
()
!=
mConsultType
)
{
getConsultData
(
"${it.consultCategoryData!![0].id}"
,
0
)
getConsultData
(
"${it.consultCategoryData!![0].id}"
,
0
,
false
)
}
}
}
}
// homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW))
// homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW))
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
View file @
14134f56
...
@@ -61,7 +61,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
...
@@ -61,7 +61,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
//设置红包、原价
//设置红包、原价
setPrice
(
bean
)
setPrice
(
bean
)
this
.
setOnClickListener
{
this
.
setOnClickListener
{
val
url
=
URLUtils
.
appendParmas
(
bean
.
h
Url
,
"cateId"
,
cateId
)
val
url
=
URLUtils
.
appendParmas
(
bean
.
link
Url
,
"cateId"
,
cateId
)
homeEvent
!!
.
consultItemClick
(
url
,
bean
.
doctorId
)
homeEvent
!!
.
consultItemClick
(
url
,
bean
.
doctorId
)
}
}
}
}
...
...
m-home/src/ydl/java/com/yidianling/home/listener/HomeConfideRecyleSuspendListener.kt
View file @
14134f56
This diff is collapsed.
Click to expand it.
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
14134f56
...
@@ -20,8 +20,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers
...
@@ -20,8 +20,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Action
import
io.reactivex.functions.Action
import
io.reactivex.functions.Consumer
import
io.reactivex.functions.Consumer
import
io.reactivex.schedulers.Schedulers
import
io.reactivex.schedulers.Schedulers
import
java.util.*
import
java.util.concurrent.TimeUnit
import
java.util.concurrent.TimeUnit
/**
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:
* @描述:
...
@@ -42,7 +44,7 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
...
@@ -42,7 +44,7 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
disposeHome
()
disposeHome
()
val
homeList
:
MutableList
<
HomePagerDataBean
>
=
mutableListOf
()
val
homeList
:
MutableList
<
HomePagerDataBean
>
=
mutableListOf
()
LogUtil
.
d
(
"mConsultType-loadHomeData:$mConsultType"
)
LogUtil
.
d
(
"mConsultType-loadHomeData:$mConsultType"
)
Observable
.
mergeArray
(
mHomeDisposable
=
Observable
.
mergeArray
(
mModel
.
headerRequest
()
mModel
.
headerRequest
()
.
compose
(
RxUtils
.
applySchedulers
(
mView
)).
map
{
it
->
.
compose
(
RxUtils
.
applySchedulers
(
mView
)).
map
{
it
->
//首页头部数据 分类 & Banner
//首页头部数据 分类 & Banner
...
@@ -57,7 +59,7 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
...
@@ -57,7 +59,7 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
if
(
it
.
consultCategoryData
!=
null
&&
it
.
consultCategoryData
!!
.
isNotEmpty
())
{
if
(
it
.
consultCategoryData
!=
null
&&
it
.
consultCategoryData
!!
.
isNotEmpty
())
{
//咨询分类和缓存分类不一致,重新加载咨询列表数据
//咨询分类和缓存分类不一致,重新加载咨询列表数据
if
(
it
.
consultCategoryData
!!
[
0
].
id
.
toString
()
!=
mConsultType
)
{
if
(
it
.
consultCategoryData
!!
[
0
].
id
.
toString
()
!=
mConsultType
)
{
getConsultData
(
"${it.consultCategoryData!![0].id}"
,
0
)
getConsultData
(
"${it.consultCategoryData!![0].id}"
,
0
,
false
)
}
}
}
}
homeList
.
add
(
HomePagerDataBean
(
YdlHomeViewHolderConstract
.
BUTTON_BANNER_VIEW
))
homeList
.
add
(
HomePagerDataBean
(
YdlHomeViewHolderConstract
.
BUTTON_BANNER_VIEW
))
...
@@ -130,6 +132,7 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
...
@@ -130,6 +132,7 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
.
subscribe
(
Consumer
{},
object
:
ThrowableConsumer
()
{
.
subscribe
(
Consumer
{},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
override
fun
accept
(
msg
:
String
)
{
mView
.
homeDataFail
(
msg
)
mView
.
homeDataFail
(
msg
)
mHomeDisposable
?.
dispose
()
}
}
},
Action
{
},
Action
{
homeList
.
sortWith
(
compareBy
{
it
.
type
})
homeList
.
sortWith
(
compareBy
{
it
.
type
})
...
...
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
View file @
14134f56
...
@@ -66,6 +66,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
...
@@ -66,6 +66,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
* tablayou上次选中的tab下标
* tablayou上次选中的tab下标
*/
*/
private
var
confideLastSelectPosition
=
0
private
var
confideLastSelectPosition
=
0
private
var
confideLastSelectType
=
""
/**
/**
* TabLayout.OnTabSelectedListener
* TabLayout.OnTabSelectedListener
*/
*/
...
@@ -75,6 +76,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
...
@@ -75,6 +76,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
* 咨询tablayout上次选中的下标
* 咨询tablayout上次选中的下标
*/
*/
private
var
consultLastSelectPosition
=
0
private
var
consultLastSelectPosition
=
0
private
var
consultLastSelectType
=
""
/**
/**
* 悬浮tablayout监听事件
* 悬浮tablayout监听事件
*/
*/
...
@@ -207,7 +209,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
...
@@ -207,7 +209,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
*/
*/
override
fun
getConfideData
(
type
:
String
,
selectPosition
:
Int
)
{
override
fun
getConfideData
(
type
:
String
,
selectPosition
:
Int
)
{
confideLastSelectPosition
=
selectPosition
confideLastSelectPosition
=
selectPosition
// tab_layout.getTabAt(confideLastSelectPosition)!!.select()
confideLastSelectType
=
type
mPresenter
?.
getConfideData
(
type
,
selectPosition
)
mPresenter
?.
getConfideData
(
type
,
selectPosition
)
}
}
...
@@ -216,7 +218,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
...
@@ -216,7 +218,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
*/
*/
override
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
)
{
override
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
)
{
consultLastSelectPosition
=
selectPosition
consultLastSelectPosition
=
selectPosition
// tab_consultLayout.getTabAt(consultLastSelectPosition)
consultLastSelectType
=
type
mPresenter
?.
getConsultData
(
type
,
selectPosition
)
mPresenter
?.
getConsultData
(
type
,
selectPosition
)
}
}
...
@@ -296,10 +298,9 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
...
@@ -296,10 +298,9 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
if
(
bean
.
type
==
YdlHomeViewHolderConstract
.
PAGER_BANNER_VIEW
)
{
if
(
bean
.
type
==
YdlHomeViewHolderConstract
.
PAGER_BANNER_VIEW
)
{
initTabLayout
(
bean
.
headerBean
!!
.
listenCategoryDate
)
initTabLayout
(
bean
.
headerBean
!!
.
listenCategoryDate
)
initConsultTabLayout
(
bean
.
headerBean
!!
.
consultCategoryData
)
initConsultTabLayout
(
bean
.
headerBean
!!
.
consultCategoryData
)
consultLastSelectType
=
bean
.
headerBean
!!
.
consultCategoryData
!!
[
0
].
id
.
toString
()
}
}
}
}
//每次全局更新后重置下标位
consultLastSelectPosition
=
0
}
}
/**
/**
...
@@ -419,7 +420,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
...
@@ -419,7 +420,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
super
.
onResume
()
super
.
onResume
()
if
(
userVisibleHint
)
{
if
(
userVisibleHint
)
{
ActionCountUtils
.
count
(
HomeBIConstants
.
YDL_USER_MAIN_PAGE_VISIT
)
ActionCountUtils
.
count
(
HomeBIConstants
.
YDL_USER_MAIN_PAGE_VISIT
)
mPresenter
?.
loadHomeData
()
mPresenter
?.
getConsultData
(
consultLastSelectType
,
consultLastSelectPosition
)
mPresenter
?.
getConfideData
(
confideLastSelectType
,
confideLastSelectPosition
)
showConsultAssistantDialog
()
showConsultAssistantDialog
()
}
}
...
...
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
View file @
14134f56
...
@@ -46,7 +46,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
...
@@ -46,7 +46,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
//设置头像
//设置头像
setHead
(
bean
)
setHead
(
bean
)
//设置名称
//设置名称
tv_consult_name
.
text
=
bean
.
doctorN
ame
tv_consult_name
.
text
=
bean
.
n
ame
//咨询师标签
//咨询师标签
tag_view
.
initData
(
StringUtils
.
strToList
(
bean
.
tags
))
tag_view
.
initData
(
StringUtils
.
strToList
(
bean
.
tags
))
//设置向TA倾诉人数
//设置向TA倾诉人数
...
@@ -58,7 +58,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
...
@@ -58,7 +58,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
//设置红包、原价
//设置红包、原价
setPrice
(
bean
)
setPrice
(
bean
)
this
.
setOnClickListener
{
this
.
setOnClickListener
{
val
url
=
URLUtils
.
appendParmas
(
bean
.
h
Url
,
"cateId"
,
cateId
)
val
url
=
URLUtils
.
appendParmas
(
bean
.
link
Url
,
"cateId"
,
cateId
)
homeEvent
!!
.
consultItemClick
(
url
,
bean
.
doctorId
)
homeEvent
!!
.
consultItemClick
(
url
,
bean
.
doctorId
)
}
}
}
}
...
@@ -71,7 +71,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
...
@@ -71,7 +71,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
op
.
errorPic
=
R
.
drawable
.
platform_head_place_hold_pic
op
.
errorPic
=
R
.
drawable
.
platform_head_place_hold_pic
op
.
loadingPic
=
R
.
drawable
.
platform_head_place_hold_pic
op
.
loadingPic
=
R
.
drawable
.
platform_head_place_hold_pic
op
.
transform
=
0
op
.
transform
=
0
YDLImageCacheManager
.
showImage
(
mContext
,
bean
.
doctorH
ead
,
img_consult_head
,
op
)
YDLImageCacheManager
.
showImage
(
mContext
,
bean
.
h
ead
,
img_consult_head
,
op
)
}
}
/**
/**
...
@@ -118,7 +118,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
...
@@ -118,7 +118,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
}
}
private
fun
setPrice
(
bodyBean
:
HomeConsultBean
.
ListBean
)
{
private
fun
setPrice
(
bodyBean
:
HomeConsultBean
.
ListBean
)
{
val
confideFee
=
bodyBean
.
serviceFe
e
val
confideFee
=
bodyBean
.
minBookingPric
e
val
sb
=
StringBuffer
()
val
sb
=
StringBuffer
()
tv_price
.
text
=
sb
.
append
(
"¥"
).
append
(
confideFee
).
toString
()
tv_price
.
text
=
sb
.
append
(
"¥"
).
append
(
confideFee
).
toString
()
}
}
...
...
m-user/src/main/java/com/yidianling/user/constants/UserBIConstants.kt
View file @
14134f56
...
@@ -19,8 +19,8 @@ class UserBIConstants {
...
@@ -19,8 +19,8 @@ class UserBIConstants {
//百度监测 用户注册行为
//百度监测 用户注册行为
const
val
APP_REGISTER_PAGE
=
"app_register_page"
const
val
APP_REGISTER_PAGE
=
"app_register_page"
const
val
POSITION_LOGIN_CLICK
=
"login_main|
login_click"
//登录点击
const
val
POSITION_LOGIN_CLICK
=
PART_ID_LOGIN_MAIN_PREFIX
+
"
login_click"
//登录点击
const
val
POSITION_LOGIN_SUCCESS_CLICK
=
"login_main|
login_success_click"
//登录成功点击
const
val
POSITION_LOGIN_SUCCESS_CLICK
=
PART_ID_LOGIN_MAIN_PREFIX
+
"
login_success_click"
//登录成功点击
//百度监测 应用启动
//百度监测 应用启动
const
val
POSITION_APP_START_UP_CLICK
=
"app_start_up_click"
//应用启动
const
val
POSITION_APP_START_UP_CLICK
=
"app_start_up_click"
//应用启动
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
View file @
14134f56
...
@@ -57,7 +57,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
...
@@ -57,7 +57,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
}
else
{
}
else
{
ToastUtil
.
toastShort
(
"修改密码成功"
)
ToastUtil
.
toastShort
(
"修改密码成功"
)
saveUserData
(
it
.
data
)
saveUserData
(
it
.
data
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
UserBIConstants
.
ACTION_TYPE_RESET_PWD
)
ActionCountUtils
.
count
Uid
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
it
.
data
.
uid
!!
,
UserBIConstants
.
ACTION_TYPE_RESET_PWD
)
if
(
it
.
data
.
firstLogin
==
1
)
{
//第一次登录:是注册
if
(
it
.
data
.
firstLogin
==
1
)
{
//第一次登录:是注册
ModularServiceManager
.
provide
(
IHomeService
::
class
.
java
).
setDouble11ShowType
(
true
)
ModularServiceManager
.
provide
(
IHomeService
::
class
.
java
).
setDouble11ShowType
(
true
)
// 重设密码登录已经不可能是首次登录,所以不进行百度埋点
// 重设密码登录已经不可能是首次登录,所以不进行百度埋点
...
@@ -78,10 +78,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
...
@@ -78,10 +78,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
*/
*/
@SuppressLint
(
"CheckResult"
)
@SuppressLint
(
"CheckResult"
)
override
fun
userLoginByPassword
(
inputPassword
:
String
,
phone
:
String
,
phoneCountryCode
:
String
)
{
override
fun
userLoginByPassword
(
inputPassword
:
String
,
phone
:
String
,
phoneCountryCode
:
String
)
{
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
UserBIConstants
.
ACTION_TYPE_PWD_LOGIN
)
ActionCountUtils
.
count
(
UserBIConstants
.
ACTION_TYPE_PWD_LOGIN
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
UserBIConstants
.
ACTION_TYPE_RESET_PWD
)
var
param
=
PhoneLoginPwdParam
(
StringUtils
.
md5
(
inputPassword
),
phoneCountryCode
,
phone
)
var
param
=
PhoneLoginPwdParam
(
StringUtils
.
md5
(
inputPassword
),
phoneCountryCode
,
phone
)
mModel
.
userLoginByPassword
(
param
)
mModel
.
userLoginByPassword
(
param
)
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
View file @
14134f56
...
@@ -59,7 +59,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
...
@@ -59,7 +59,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
@SuppressLint
(
"CheckResult"
)
@SuppressLint
(
"CheckResult"
)
override
fun
autoLogin
(
bean
:
PhoneLoginAutoParam
)
{
override
fun
autoLogin
(
bean
:
PhoneLoginAutoParam
)
{
ActionCountUtils
.
count
(
UserBIConstants
.
ACTION_TYPE_DIRECT_LOGIN
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
UserBIConstants
.
ACTION_TYPE_DIRECT_LOGIN
)
mModel
.
autoLogin
(
bean
)
mModel
.
autoLogin
(
bean
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
...
@@ -177,7 +177,6 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
...
@@ -177,7 +177,6 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
val
sign1
=
if
(
media
==
SHARE_MEDIA
.
QQ
)
UserBIConstants
.
ACTION_TYPE_QQ_THIRD_LOGIN
else
UserBIConstants
.
ACTION_TYPE_WX_THIRD_LOGIN
val
sign1
=
if
(
media
==
SHARE_MEDIA
.
QQ
)
UserBIConstants
.
ACTION_TYPE_QQ_THIRD_LOGIN
else
UserBIConstants
.
ACTION_TYPE_WX_THIRD_LOGIN
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
sign1
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
sign1
)
UserHttpImpl
.
getInstance
()
UserHttpImpl
.
getInstance
()
.
umLogin
(
activity
,
media
)
.
umLogin
(
activity
,
media
)
.
doOnSubscribe
{
mView
.
showProgressView
()
}
.
doOnSubscribe
{
mView
.
showProgressView
()
}
...
@@ -202,14 +201,14 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
...
@@ -202,14 +201,14 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
ModularServiceManager
.
provide
(
IHomeService
::
class
.
java
).
setDouble11ShowType
(
true
)
ModularServiceManager
.
provide
(
IHomeService
::
class
.
java
).
setDouble11ShowType
(
true
)
mView
.
baiduActionBury
(
it
.
data
.
uid
,
UserBIConstants
.
POSITION_QQ_REGISTER_CLICK
)
mView
.
baiduActionBury
(
it
.
data
.
uid
,
UserBIConstants
.
POSITION_QQ_REGISTER_CLICK
)
}
else
{
}
else
{
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
sign1
)
ActionCountUtils
.
count
Uid
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
it
.
data
.
uid
!!
,
sign1
)
}
}
}
else
{
}
else
{
if
(
it
.
data
.
firstLogin
==
1
)
{
//第一次登录:是注册
if
(
it
.
data
.
firstLogin
==
1
)
{
//第一次登录:是注册
ModularServiceManager
.
provide
(
IHomeService
::
class
.
java
).
setDouble11ShowType
(
true
)
ModularServiceManager
.
provide
(
IHomeService
::
class
.
java
).
setDouble11ShowType
(
true
)
mView
.
baiduActionBury
(
it
.
data
.
uid
,
UserBIConstants
.
POSITION_WX_REGISTER_CLICK
)
mView
.
baiduActionBury
(
it
.
data
.
uid
,
UserBIConstants
.
POSITION_WX_REGISTER_CLICK
)
}
else
{
}
else
{
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
sign1
)
ActionCountUtils
.
count
Uid
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
it
.
data
.
uid
!!
,
sign1
)
}
}
}
}
},
{
},
{
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
View file @
14134f56
...
@@ -130,7 +130,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
...
@@ -130,7 +130,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
* 验证码验证码登录
* 验证码验证码登录
*/
*/
override
fun
loginByMsgCode
(
phone
:
String
,
phoneCountryCode
:
String
,
msgCode
:
String
)
{
override
fun
loginByMsgCode
(
phone
:
String
,
phoneCountryCode
:
String
,
msgCode
:
String
)
{
ActionCountUtils
.
count
(
UserBIConstants
.
ACTION_TYPE_CODE_LOGIN
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
UserBIConstants
.
ACTION_TYPE_CODE_LOGIN
)
var
param
=
PhoneLoginCodeParam
(
msgCode
,
phoneCountryCode
,
phone
)
var
param
=
PhoneLoginCodeParam
(
msgCode
,
phoneCountryCode
,
phone
)
mModel
.
loginByMsgCode
(
param
)
mModel
.
loginByMsgCode
(
param
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
...
...
ydl-net/src/main/java/com/ydl/ydlnet/builder/config/OkHttpConfig.java
View file @
14134f56
...
@@ -17,6 +17,7 @@ import com.ydl.ydlnet.client.interfaces.BuildHeadersListener;
...
@@ -17,6 +17,7 @@ import com.ydl.ydlnet.client.interfaces.BuildHeadersListener;
import
java.io.File
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -25,6 +26,7 @@ import javax.net.ssl.HostnameVerifier;
...
@@ -25,6 +26,7 @@ import javax.net.ssl.HostnameVerifier;
import
okhttp3.Cache
;
import
okhttp3.Cache
;
import
okhttp3.Interceptor
;
import
okhttp3.Interceptor
;
import
okhttp3.OkHttpClient
;
import
okhttp3.OkHttpClient
;
import
okhttp3.Protocol
;
/**
/**
* Created by haorui on 2019-09-02 .
* Created by haorui on 2019-09-02 .
...
@@ -45,7 +47,7 @@ public class OkHttpConfig {
...
@@ -45,7 +47,7 @@ public class OkHttpConfig {
private
static
OkHttpClient
okHttpClient
;
private
static
OkHttpClient
okHttpClient
;
public
OkHttpConfig
()
{
public
OkHttpConfig
()
{
okHttpClientBuilder
=
new
OkHttpClient
.
Builder
();
okHttpClientBuilder
=
new
OkHttpClient
.
Builder
()
.
protocols
(
Collections
.
singletonList
(
Protocol
.
HTTP_1_1
))
;
}
}
public
static
OkHttpConfig
getInstance
()
{
public
static
OkHttpConfig
getInstance
()
{
...
...
ydl-net/src/main/java/com/ydl/ydlnet/client/observer/BaseObserver.java
View file @
14134f56
...
@@ -29,7 +29,11 @@ public abstract class BaseObserver<T> implements Observer<T>, ISubscriber<T> {
...
@@ -29,7 +29,11 @@ public abstract class BaseObserver<T> implements Observer<T>, ISubscriber<T> {
@Override
@Override
public
void
onNext
(
@NonNull
T
t
)
{
public
void
onNext
(
@NonNull
T
t
)
{
doOnNext
(
t
);
try
{
doOnNext
(
t
);
}
catch
(
Exception
e
)
{
onError
(
e
);
}
}
}
@Override
@Override
...
...
ydl-pay/src/main/java/com/yidianling/ydl_pay/toast/ToastHelper.kt
View file @
14134f56
...
@@ -2,8 +2,10 @@ package com.yidianling.ydl_pay.toast
...
@@ -2,8 +2,10 @@ package com.yidianling.ydl_pay.toast
import
android.content.Context
import
android.content.Context
import
android.support.annotation.StringRes
import
android.support.annotation.StringRes
import
android.text.TextUtils
import
android.widget.Toast
import
android.widget.Toast
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.utils.LogUtil
import
com.yidianling.common.tools.ToastUtil
/**
/**
* author : Zhangwenchao
* author : Zhangwenchao
...
@@ -31,16 +33,16 @@ class ToastHelper private constructor() {
...
@@ -31,16 +33,16 @@ class ToastHelper private constructor() {
}
}
private
fun
show
(
context
:
Context
,
text
:
CharSequence
)
{
private
fun
show
(
context
:
Context
,
text
:
CharSequence
)
{
if
(
TextUtils
.
isEmpty
(
text
))
return
ToastUtil
.
toastShort
(
text
.
toString
())
if
(
toast
==
null
)
toast
=
Toast
.
makeText
(
context
,
text
,
Toast
.
LENGTH_SHORT
)
else
toast
?.
setText
(
text
)
toast
?.
show
()
}
}
private
fun
show
(
context
:
Context
,
@StringRes
resId
:
Int
)
{
private
fun
show
(
context
:
Context
,
@StringRes
resId
:
Int
)
{
if
(
toast
==
null
)
toast
=
Toast
.
makeText
(
context
,
resId
,
Toast
.
LENGTH_SHORT
)
try
{
else
toast
?.
setText
(
resId
)
val
text
=
BaseApp
.
getApp
().
resources
.
getString
(
resId
)
toast
?.
show
()
ToastUtil
.
toastShort
(
text
)
}
catch
(
e
:
Exception
)
{
LogUtil
.
e
(
e
.
message
)
}
}
}
private
object
Holder
{
private
object
Holder
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/app/YdlRepository.kt
View file @
14134f56
...
@@ -8,10 +8,13 @@ import com.lzy.imagepicker.view.CropImageView
...
@@ -8,10 +8,13 @@ import com.lzy.imagepicker.view.CropImageView
import
com.ydl.devicesidlib.DeviceIDHelper
import
com.ydl.devicesidlib.DeviceIDHelper
import
com.ydl.ydlcommon.actions.imagepicker.YdlImageLoader
import
com.ydl.ydlcommon.actions.imagepicker.YdlImageLoader
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.data.http.UpLoadLogUtils
import
com.ydl.ydlcommon.utils.BuryPointUtils
import
com.ydl.ydlcommon.utils.BuryPointUtils
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlnet.client.exception.ApiException
import
com.yidianling.common.tools.RxTool
import
com.yidianling.common.tools.RxTool
import
io.reactivex.plugins.RxJavaPlugins
/**
/**
...
@@ -41,6 +44,22 @@ object YdlRepository {
...
@@ -41,6 +44,22 @@ object YdlRepository {
// }
// }
// refWatcher = LeakCanary.install(app)
// refWatcher = LeakCanary.install(app)
initARouter
(
app
,
isDebug
)
initARouter
(
app
,
isDebug
)
initRxPlugin
()
}
private
fun
initRxPlugin
()
{
//保障RxJava调用链流程不会崩溃
RxJavaPlugins
.
setErrorHandler
{
LogUtil
.
e
(
"RxJava ErrorHandler ---->: $it"
)
try
{
val
apiException
=
ApiException
.
handleException
(
it
)
UpLoadLogUtils
.
upLoadLog
(
"RxJava Error Handler "
,
apiException
.
code
,
apiException
.
message
?:
""
)
}
catch
(
e
:
Exception
)
{
LogUtil
.
d
(
"RxJava ErrorHandler UpLoad Log Error ---->: $it"
)
}
}
}
}
/**
/**
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/ThrowableConsumer.kt
View file @
14134f56
package
com.ydl.ydlcommon.data.http
package
com.ydl.ydlcommon.data.http
import
android.text.TextUtils
import
android.text.TextUtils
import
com.ydl.ydlcommon.R
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxNetTool
import
com.yidianling.common.tools.RxNetTool
import
com.ydl.ydlcommon.R
import
io.reactivex.functions.Consumer
import
io.reactivex.functions.Consumer
/**
/**
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/remind/ToastHelper.kt
View file @
14134f56
package
com.ydl.ydlcommon.utils.remind
package
com.ydl.ydlcommon.utils.remind
import
android.support.annotation.StringRes
import
android.support.annotation.StringRes
import
android.text.TextUtils
import
android.widget.Toast
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.utils.LogUtil
import
com.yidianling.common.tools.ToastUtil
/**
/**
* author : Zhangwenchao
* author : Zhangwenchao
...
@@ -14,8 +14,6 @@ import com.ydl.ydlcommon.base.BaseApp
...
@@ -14,8 +14,6 @@ import com.ydl.ydlcommon.base.BaseApp
*/
*/
class
ToastHelper
private
constructor
()
{
class
ToastHelper
private
constructor
()
{
private
var
toast
:
Toast
?
=
null
companion
object
{
companion
object
{
private
fun
getInstance
():
ToastHelper
{
private
fun
getInstance
():
ToastHelper
{
return
Holder
.
INSTANCE
return
Holder
.
INSTANCE
...
@@ -31,16 +29,16 @@ class ToastHelper private constructor() {
...
@@ -31,16 +29,16 @@ class ToastHelper private constructor() {
}
}
private
fun
show
(
text
:
CharSequence
)
{
private
fun
show
(
text
:
CharSequence
)
{
if
(
TextUtils
.
isEmpty
(
text
))
return
ToastUtil
.
toastShort
(
text
.
toString
())
if
(
toast
==
null
)
toast
=
Toast
.
makeText
(
BaseApp
.
getApp
(),
text
,
Toast
.
LENGTH_SHORT
)
else
toast
?.
setText
(
text
)
toast
?.
show
()
}
}
private
fun
show
(
@StringRes
resId
:
Int
)
{
private
fun
show
(
@StringRes
resId
:
Int
)
{
if
(
toast
==
null
)
toast
=
Toast
.
makeText
(
BaseApp
.
getApp
(),
resId
,
Toast
.
LENGTH_SHORT
)
try
{
else
toast
?.
setText
(
resId
)
val
text
=
BaseApp
.
getApp
().
resources
.
getString
(
resId
)
toast
?.
show
()
ToastUtil
.
toastShort
(
text
)
}
catch
(
e
:
Exception
)
{
LogUtil
.
e
(
e
.
message
)
}
}
}
private
object
Holder
{
private
object
Holder
{
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/ToastUtil.java
View file @
14134f56
package
com
.
yidianling
.
common
.
tools
;
package
com
.
yidianling
.
common
.
tools
;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.os.Looper
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
...
@@ -42,6 +41,7 @@ public class ToastUtil {
...
@@ -42,6 +41,7 @@ public class ToastUtil {
handler
.
post
(()
->
toastShort
(
RxTool
.
getContext
(),
msg
));
handler
.
post
(()
->
toastShort
(
RxTool
.
getContext
(),
msg
));
}
}
}
}
private
static
void
showShortToast
(
Context
mContext
,
String
msg
)
{
private
static
void
showShortToast
(
Context
mContext
,
String
msg
)
{
if
(
toast
==
null
)
{
if
(
toast
==
null
)
{
toast
=
Toast
.
makeText
(
mContext
.
getApplicationContext
(),
msg
,
Toast
.
LENGTH_SHORT
);
toast
=
Toast
.
makeText
(
mContext
.
getApplicationContext
(),
msg
,
Toast
.
LENGTH_SHORT
);
...
...
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