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
77266238
Commit
77266238
authored
Nov 06, 2019
by
徐健
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component
into dev
parents
bef23df6
a22ecff5
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
146 additions
and
128 deletions
+146
-128
build.gradle
app/build.gradle
+2
-2
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+12
-3
MusicPlayActivity.kt
app/src/main/java/com/ydl/component/music/MusicPlayActivity.kt
+10
-2
DemoModel.kt
app/src/main/java/com/ydl/component/mvp/DemoModel.kt
+2
-1
DemoPresenter.kt
app/src/main/java/com/ydl/component/mvp/DemoPresenter.kt
+3
-6
config.gradle
config.gradle
+1
-1
modular.gradle
m-consultant/modular.gradle
+2
-2
TestCategoryListActivity.kt
m-tests/src/main/java/com/yidianling/tests/list/view/TestCategoryListActivity.kt
+1
-1
TestListFragment.kt
m-tests/src/main/java/com/yidianling/tests/list/view/TestListFragment.kt
+1
-1
modular.gradle
m-user/modular.gradle
+2
-2
LoginActivity.java
m-user/src/main/java/com/yidianling/user/ui/LoginActivity.java
+1
-1
InputPassWordActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/InputPassWordActivity.kt
+1
-1
RegisterAndLoginActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
+1
-1
VerificationCodeActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/VerificationCodeActivity.kt
+1
-1
InputPassWordPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
+1
-1
LoginPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
+1
-1
VerificationCodePresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
+1
-1
PhoneCode.java
m-user/src/main/java/com/yidianling/user/widget/PhoneCode.java
+1
-1
gradle.properties
ydl-platform/gradle.properties
+2
-2
RxUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/RxUtils.kt
+1
-0
BaseLceActivity.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/mvp/lce/BaseLceActivity.kt
+35
-27
BaseLceDialogFragment.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/mvp/lce/BaseLceDialogFragment.kt
+31
-25
BaseLceFragment.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/mvp/lce/BaseLceFragment.kt
+31
-18
ILceView.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/mvp/lce/ILceView.kt
+1
-4
UMEventUtils.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/UMEventUtils.java
+0
-22
SafeTipView.kt
ydl-webview/src/main/java/com/ydl/webview/SafeTipView.kt
+1
-1
No files found.
app/build.gradle
View file @
77266238
...
...
@@ -165,7 +165,7 @@ dependencies {
kapt
rootProject
.
ext
.
dependencies
[
"butterknife-compiler"
]
if
(
rootProject
.
ext
.
dev_mod
e
)
{
if
(
tru
e
)
{
//开发模式
api
project
(
':m-user'
)
api
project
(
':m-fm'
)
...
...
@@ -174,7 +174,7 @@ dependencies {
api
(
project
(
':ydl-platform'
)){
transitive
=
true
}
//
implementation project(':ydl-webview')
implementation
project
(
':ydl-webview'
)
implementation
project
(
':ydl-media'
)
}
else
{
//发布模式
...
...
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
77266238
...
...
@@ -33,9 +33,18 @@ import kotlinx.android.synthetic.main.activity_main.*
*/
class
MainActivity
:
BaseLceActivity
<
DemoContract
.
View
,
DemoContract
.
Presenter
>(),
DemoContract
.
View
{
private
var
serviceConnection
:
ServiceConnection
?
=
null
protected
var
playService
:
PlayService
?
=
null
override
fun
getContentViewId
():
Int
{
return
R
.
id
.
lce_content_view
}
override
fun
getStateViewId
():
Int
{
return
R
.
id
.
lce_state_view
}
override
fun
setData
(
data
:
String
)
{
tv_content
.
text
=
data
}
...
...
@@ -50,10 +59,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override
fun
initDataAndEvent
()
{
bindService
()
l
oadData
()
reL
oadData
()
requestPermission
()
tv_user
.
setOnClickListener
{
l
oadData
()
reL
oadData
()
}
tv_home
.
setOnClickListener
{
...
...
@@ -111,7 +120,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override
fun
l
oadData
()
{
override
fun
reL
oadData
()
{
mPresenter
?.
loadUsers
()
}
...
...
app/src/main/java/com/ydl/component/music/MusicPlayActivity.kt
View file @
77266238
...
...
@@ -6,6 +6,14 @@ import com.ydl.component.mvp.DemoPresenter
import
com.ydl.ydlcommon.mvp.lce.BaseLceActivity
class
MusicPlayActivity
:
BaseLceActivity
<
DemoContract
.
View
,
DemoContract
.
Presenter
>(),
DemoContract
.
View
{
override
fun
getContentViewId
():
Int
{
return
R
.
id
.
lce_content_view
}
override
fun
getStateViewId
():
Int
{
return
R
.
id
.
lce_state_view
}
private
var
mPlayFragment
:
PlayFragment
?
=
null
override
fun
createPresenter
():
DemoContract
.
Presenter
{
...
...
@@ -17,10 +25,10 @@ class MusicPlayActivity : BaseLceActivity<DemoContract.View, DemoContract.Prese
}
override
fun
initDataAndEvent
()
{
l
oadData
()
reL
oadData
()
}
override
fun
l
oadData
()
{
override
fun
reL
oadData
()
{
mPresenter
.
loadFmMusic
()
}
...
...
app/src/main/java/com/ydl/component/mvp/DemoModel.kt
View file @
77266238
...
...
@@ -18,7 +18,8 @@ import io.reactivex.Observable
class
DemoModel
:
BaseModel
(),
DemoContract
.
Model
{
override
fun
getFmMusic
():
Observable
<
HomeFMBean
>
{
return
YDLHttpUtils
.
obtainApi
(
DemoService
::
class
.
java
)
.
getFMData
().
compose
(
RxUtils
.
resultJavaData
())
.
getFMData
()
.
compose
(
RxUtils
.
resultJavaData
())
}
...
...
app/src/main/java/com/ydl/component/mvp/DemoPresenter.kt
View file @
77266238
...
...
@@ -24,18 +24,15 @@ class DemoPresenter : BasePresenter<DemoContract.View,DemoContract.Model>(),
}
override
fun
onSuccess
(
homeFMBean
:
HomeFMBean
)
{
// var jsonStirng = Gson().toJson(homeFMBean.list)
// val list = Gson().fromJson<ArrayList<Music>>(jsonStirng, object : TypeToken<ArrayList<Music>>() {}.type)
homeFMBean
.
list
?.
let
{
AudioPlayer
.
get
().
addPlayList
(
stringToMusicPlayerList
(
it
))
mView
.
setData
(
""
)
}
}
})
}
override
fun
loadHome
()
=
mModel
!!
.
getHome
()
override
fun
loadHome
()
=
mModel
.
getHome
()
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
.
subscribe
(
object
:
CommonObserver
<
JsonObject
>()
{
override
fun
onError
(
errorMsg
:
String
)
{
...
...
@@ -43,11 +40,11 @@ class DemoPresenter : BasePresenter<DemoContract.View,DemoContract.Model>(),
override
fun
onSuccess
(
users
:
JsonObject
)
{
var
cateTitle
=
users
.
getAsJsonObject
(
"data"
).
getAsJsonArray
(
"askCategoryData"
).
get
(
0
).
asJsonObject
.
get
(
"cateTitle"
).
asString
;
mView
?
.
setData
(
cateTitle
)
mView
.
setData
(
cateTitle
)
}
})
override
fun
loadUsers
()
=
mModel
!!
.
getUser
()
override
fun
loadUsers
()
=
mModel
.
getUser
()
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
//使用 Rxlifecycle,使 Disposable 和 Activity 一起销毁
.
subscribe
(
object
:
CommonObserver
<
JsonArray
>()
{
override
fun
onError
(
errorMsg
:
String
)
{
...
...
config.gradle
View file @
77266238
...
...
@@ -172,7 +172,7 @@ ext {
//Modular Api
"ydl-user-router"
:
'com.ydl:router:1.0.0-SNAPSHOT@aar'
,
"ydl-platform"
:
'com.ydl:ydl-platform:0.0.1
0
@aar'
,
"ydl-platform"
:
'com.ydl:ydl-platform:0.0.1
2
@aar'
,
"ydl-m-user-api"
:
'com.ydl:m-user-api:0.0.5'
,
"ydl-webview"
:
'com.ydl:ydl-webview:0.0.14@aar'
,
"ydl-m-muse-api"
:
'com.ydl:m-muse-api:0.0.1@aar'
,
...
...
m-consultant/modular.gradle
View file @
77266238
...
...
@@ -8,14 +8,14 @@ modular {
groupId
=
"com.ydl"
artifactId
=
"m-consultant-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version
=
"0.0.1
1
"
version
=
"0.0.1
3
"
}
ydl
{
groupId
=
"com.ydl"
artifactId
=
"m-consultant-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version
=
"0.0.1
1
"
version
=
"0.0.1
3
"
}
}
...
...
m-tests/src/main/java/com/yidianling/tests/list/view/TestCategoryListActivity.kt
View file @
77266238
...
...
@@ -14,7 +14,7 @@ import com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.utils.BuryPointUtils
import
com.ydl.ydlcommon.utils.DisplayUtils
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.UMEventUtils
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import
com.yidianling.common.tools.LogUtil
...
...
m-tests/src/main/java/com/yidianling/tests/list/view/TestListFragment.kt
View file @
77266238
...
...
@@ -20,7 +20,7 @@ import com.ydl.ydlcommon.router.YdlCommonOut
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.utils.BuryPointUtils
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.utils.UMEventUtils
import
com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.router.RouterManager
...
...
m-user/modular.gradle
View file @
77266238
...
...
@@ -8,14 +8,14 @@ modular {
groupId
=
"com.ydl"
artifactId
=
"m-user-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version
=
"0.0.
19
"
version
=
"0.0.
21
"
}
ydl
{
groupId
=
"com.ydl"
artifactId
=
"m-user-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version
=
"0.0.
19
"
version
=
"0.0.
21
"
}
}
...
...
m-user/src/main/java/com/yidianling/user/ui/LoginActivity.java
View file @
77266238
...
...
@@ -8,7 +8,7 @@ import android.view.View;
import
com.ydl.ydlcommon.base.BaseMvpActivity
;
import
com.ydl.ydlcommon.data.http.EncryptUtils
;
import
com.ydl.ydlcommon.utils.ActivityManager
;
import
com.ydl.ydlcommon.utils.UMEventUtils
;
import
com.ydl.ydlcommon.utils.log.LogHelper
;
import
com.ydl.ydlcommon.utils.remind.ToastHelper
;
import
com.ydl.ydlcommon.view.DeleteEditTextView
;
...
...
m-user/src/main/java/com/yidianling/user/ui/login/InputPassWordActivity.kt
View file @
77266238
...
...
@@ -11,7 +11,7 @@ import android.view.animation.AnimationUtils
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.UMEventUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.yidianling.common.tools.RxKeyboardTool
...
...
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
View file @
77266238
...
...
@@ -28,7 +28,7 @@ import com.umeng.socialize.bean.SHARE_MEDIA
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.UMEventUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.actionutil.BIConstants
...
...
m-user/src/main/java/com/yidianling/user/ui/login/VerificationCodeActivity.kt
View file @
77266238
...
...
@@ -10,7 +10,7 @@ import android.view.View
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.UMEventUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.actionutil.BIConstants
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
View file @
77266238
...
...
@@ -5,7 +5,7 @@ import android.text.TextUtils
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.router.YdlCommonOut
import
com.ydl.ydlcommon.utils.StringUtils
import
com.ydl.ydlcommon.utils.UMEventUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.LogHelper
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
View file @
77266238
...
...
@@ -6,7 +6,7 @@ import android.text.TextUtils
import
com.umeng.socialize.bean.SHARE_MEDIA
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.router.YdlCommonOut
import
com.ydl.ydlcommon.utils.UMEventUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.LogHelper
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
View file @
77266238
...
...
@@ -2,7 +2,7 @@ package com.yidianling.user.ui.login.presenter
import
android.text.TextUtils
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.utils.UMEventUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.LogHelper
...
...
m-user/src/main/java/com/yidianling/user/widget/PhoneCode.java
View file @
77266238
...
...
@@ -16,7 +16,7 @@ import android.widget.RelativeLayout;
import
android.widget.TextView
;
import
com.yidianling.user.R
;
import
com.ydl.ydlcommon.utils.UMEventUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
ydl-platform/gradle.properties
View file @
77266238
IS_PUBLISH
=
true
VERSION_NAME
=
0.0.10
\ No newline at end of file
VERSION_NAME
=
0.0.12
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/RxUtils.kt
View file @
77266238
...
...
@@ -86,6 +86,7 @@ object RxUtils {
/**
* RxJava 线程协调 / RxLifecycle绑定方法
* 自动调用 showLoading/hideLoading 方法
* @param view LceView 强转使用
*/
fun
<
T
>
applySchedulers
(
view
:
ILceView
):
ObservableTransformer
<
T
,
T
>
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/mvp/lce/BaseLceActivity.kt
View file @
77266238
...
...
@@ -2,7 +2,6 @@ package com.ydl.ydlcommon.mvp.lce
import
android.support.annotation.CallSuper
import
android.view.View
import
com.ydl.ydlcommon.R
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.mvp.base.IPresenter
import
com.ydl.ydlcommon.mvp.base.IView
...
...
@@ -13,34 +12,28 @@ import com.ydl.ydlcommon.mvp.lce.view.ILceViewState
* Des: LCE 架构 BaseActivity,统一处理页面加载状态
* LCE:L:Loading加载,C:Content加载内容,E:Error加载失败
*
* 【注意:StateView需设置id为:R.id.lce_state_view】
* 【注意:ContentView需设置id为:R.id.lce_content_view】
* 【注意:StateView需继承 ILceViewState 接口】
*/
abstract
class
BaseLceActivity
<
V
:
IView
,
P
:
IPresenter
<
V
>>
:
BaseMvpActivity
<
V
,
P
>(),
ILceView
{
abstract
class
BaseLceActivity
<
V
:
IView
,
P
:
IPresenter
<
V
>>
:
BaseMvpActivity
<
V
,
P
>(),
ILceView
{
pr
otected
lateinit
var
lceStateView
:
ILceViewState
pr
otected
var
lceContentView
:
View
?
=
null
pr
ivate
var
lceStateView
:
ILceViewState
?
=
null
pr
ivate
var
lceContentView
:
View
?
=
null
@CallSuper
override
fun
onContentChanged
()
{
super
.
onContentChanged
()
lceStateView
=
createStateView
()
lceContentView
=
createContentView
()
if
(
lceContentView
==
null
)
{
throw
NullPointerException
(
"请检查布局文件中ContentView是否设置,id需为R.id.lce_content_view"
)
}
}
protected
fun
createStateView
():
ILceViewState
{
val
stateView
=
findViewById
<
View
>(
R
.
id
.
lce_state_view
)
if
(
stateView
is
ILceViewState
)
{
private
fun
createStateView
():
ILceViewState
{
val
stateView
:
View
?
=
findViewById
<
View
>(
getStateViewId
())
if
(
stateView
!=
null
&&
stateView
is
ILceViewState
)
{
val
viewState
=
stateView
as
ILceViewState
viewState
.
setListener
(
object
:
ILceViewState
.
LogoLoadingListener
{
override
fun
onDataResetClick
()
{
l
oadData
()
reL
oadData
()
}
override
fun
onBackClick
()
{
...
...
@@ -51,33 +44,48 @@ abstract class BaseLceActivity<V : IView, P : IPresenter<V>> : BaseMvpActivity<V
}
throw
NullPointerException
(
"请检查布局文件中
StateView是否设置,id需为R.id.lce_state_view
"
"请检查布局文件中
StateView 是否设置,StateView 需继承 ILceViewState 接口 , className:${this.javaClass.simpleName}
"
)
}
protected
fun
createContentView
():
View
{
return
findViewById
(
R
.
id
.
lce_content_view
)
private
fun
createContentView
():
View
{
val
contentView
:
View
?
=
findViewById
<
View
>(
getContentViewId
())
?:
throw
NullPointerException
(
"请检查布局文件中 ContentView 是否设置 , className:${this.javaClass.simpleName}"
)
return
contentView
!!
}
/**
* 获取 ContentView 控件ID
*/
abstract
fun
getContentViewId
():
Int
/**
* 获取 StateVie 控件 ID
*/
abstract
fun
getStateViewId
():
Int
override
fun
showLoading
()
{
lceStateView
.
showLoading
()
lceStateView
?.
showLoading
()
lceContentView
?.
visibility
=
View
.
INVISIBLE
}
override
fun
hideLoading
()
{
lceStateView
.
hideLoading
()
}
override
fun
showContent
()
{
lceContentView
?.
visibility
=
View
.
VISIBLE
lceStateView
.
hideLoading
()
lceStateView
?.
hideLoading
()
}
override
fun
showEmpty
(
msg
:
String
)
{
lceStateView
.
showEmpty
(
msg
)
lceContentView
?.
visibility
=
View
.
INVISIBLE
lceStateView
?.
showEmpty
(
msg
)
}
override
fun
showError
(
msg
:
String
)
{
lceStateView
.
showError
(
msg
)
lceContentView
?.
visibility
=
View
.
INVISIBLE
lceStateView
?.
showError
(
msg
)
}
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/mvp/lce/BaseLceDialogFragment.kt
View file @
77266238
...
...
@@ -4,7 +4,6 @@ import android.os.Bundle
import
android.support.annotation.CallSuper
import
android.support.v4.app.FragmentActivity
import
android.view.View
import
com.ydl.ydlcommon.R
import
com.ydl.ydlcommon.base.BaseMvpDialogFragment
import
com.ydl.ydlcommon.mvp.base.IPresenter
import
com.ydl.ydlcommon.mvp.base.IView
...
...
@@ -21,30 +20,23 @@ import java.util.*
*/
abstract
class
BaseLceDialogFragment
<
V
:
IView
,
P
:
IPresenter
<
V
>>
:
BaseMvpDialogFragment
<
V
,
P
>(),
ILceView
{
pr
otected
var
lceStateView
:
ILceViewState
?
=
null
pr
otected
var
lceContentView
:
View
?
=
null
pr
ivate
var
lceStateView
:
ILceViewState
?
=
null
pr
ivate
var
lceContentView
:
View
?
=
null
@CallSuper
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
lceStateView
=
createStateView
(
view
)
lceContentView
=
createContentView
(
view
)
if
(
lceContentView
==
null
)
{
throw
NullPointerException
(
"请检查布局文件中ContentView是否设置,id需为R.id.lce_content_view"
)
}
}
pr
otected
fun
createStateView
(
view
:
View
):
ILceViewState
{
val
stateView
=
view
.
findViewById
<
View
>(
R
.
id
.
lce_state_view
)
if
(
stateView
is
ILceViewState
)
{
pr
ivate
fun
createStateView
(
view
:
View
):
ILceViewState
{
val
stateView
:
View
?
=
view
.
findViewById
<
View
>(
getStateViewId
()
)
if
(
stateView
!=
null
&&
stateView
is
ILceViewState
)
{
val
viewState
=
stateView
as
ILceViewState
viewState
.
setListener
(
object
:
ILceViewState
.
LogoLoadingListener
{
override
fun
onDataResetClick
()
{
l
oadData
()
reL
oadData
()
}
override
fun
onBackClick
()
{
...
...
@@ -55,34 +47,48 @@ abstract class BaseLceDialogFragment<V : IView, P : IPresenter<V>> : BaseMvpDial
}
throw
NullPointerException
(
"请检查布局文件中
StateView是否设置,id需为R.id.lce_state_view
"
"请检查布局文件中
StateView 是否设置,StateView 需继承 ILceViewState 接口 , className:${this.javaClass.simpleName}
"
)
}
private
fun
createContentView
(
view
:
View
):
View
{
val
contentView
:
View
?
=
view
.
findViewById
<
View
>(
getContentViewId
())
?:
throw
NullPointerException
(
"请检查布局文件中 ContentView 是否设置 , className:${this.javaClass.simpleName}"
)
protected
fun
createContentView
(
view
:
View
):
View
{
return
view
.
findViewById
(
R
.
id
.
lce_content_view
)
return
contentView
!!
}
/**
* 获取 ContentView 控件ID
*/
abstract
fun
getContentViewId
():
Int
/**
* 获取 StateVie 控件 ID
*/
abstract
fun
getStateViewId
():
Int
override
fun
showLoading
()
{
lceStateView
!!
.
showLoading
()
lceStateView
?.
showLoading
()
lceContentView
?.
visibility
=
View
.
INVISIBLE
}
override
fun
hideLoading
()
{
lceStateView
!!
.
hideLoading
()
}
override
fun
showContent
()
{
lceContentView
?.
visibility
=
View
.
VISIBLE
lceStateView
!!
.
hideLoading
()
lceStateView
?.
hideLoading
()
}
override
fun
showEmpty
(
msg
:
String
)
{
lceStateView
!!
.
showEmpty
(
msg
)
lceContentView
?.
visibility
=
View
.
INVISIBLE
lceStateView
?.
showEmpty
(
msg
)
}
override
fun
showError
(
msg
:
String
)
{
lceStateView
!!
.
showError
(
msg
)
lceContentView
?.
visibility
=
View
.
INVISIBLE
lceStateView
?.
showError
(
msg
)
}
override
fun
onDestroyView
()
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/mvp/lce/BaseLceFragment.kt
View file @
77266238
...
...
@@ -4,7 +4,6 @@ import android.os.Bundle
import
android.support.annotation.CallSuper
import
android.support.v4.app.FragmentActivity
import
android.view.View
import
com.ydl.ydlcommon.R
import
com.ydl.ydlcommon.base.BaseMvpFragment
import
com.ydl.ydlcommon.mvp.base.IPresenter
import
com.ydl.ydlcommon.mvp.base.IView
...
...
@@ -20,8 +19,8 @@ import java.util.*
*/
abstract
class
BaseLceFragment
<
V
:
IView
,
P
:
IPresenter
<
V
>>
:
BaseMvpFragment
<
V
,
P
>(),
ILceView
{
pr
otected
var
lceStateView
:
ILceViewState
?
=
null
pr
otected
var
lceContentView
:
View
?
=
null
pr
ivate
var
lceStateView
:
ILceViewState
?
=
null
pr
ivate
var
lceContentView
:
View
?
=
null
@CallSuper
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
...
...
@@ -37,13 +36,13 @@ abstract class BaseLceFragment< V : IView, P : IPresenter<V>> : BaseMvpFragment<
}
pr
otected
fun
createStateView
(
view
:
View
):
ILceViewState
{
val
stateView
=
view
.
findViewById
<
View
>(
R
.
id
.
lce_state_view
)
if
(
stateView
is
ILceViewState
)
{
pr
ivate
fun
createStateView
(
view
:
View
):
ILceViewState
{
val
stateView
:
View
?
=
view
.
findViewById
<
View
>(
getStateViewId
()
)
if
(
stateView
!=
null
&&
stateView
is
ILceViewState
)
{
val
viewState
=
stateView
as
ILceViewState
viewState
.
setListener
(
object
:
ILceViewState
.
LogoLoadingListener
{
override
fun
onDataResetClick
()
{
l
oadData
()
reL
oadData
()
}
override
fun
onBackClick
()
{
...
...
@@ -54,34 +53,48 @@ abstract class BaseLceFragment< V : IView, P : IPresenter<V>> : BaseMvpFragment<
}
throw
NullPointerException
(
"请检查布局文件中
StateView是否设置,id需为R.id.lce_state_view
"
"请检查布局文件中
StateView 是否设置,StateView 需继承 ILceViewState 接口 , className:${this.javaClass.simpleName}
"
)
}
private
fun
createContentView
(
view
:
View
):
View
{
val
contentView
:
View
?
=
view
.
findViewById
<
View
>(
getContentViewId
())
?:
throw
NullPointerException
(
"请检查布局文件中 ContentView 是否设置 , className:${this.javaClass.simpleName}"
)
protected
fun
createContentView
(
view
:
View
):
View
{
return
view
.
findViewById
(
R
.
id
.
lce_content_view
)
return
contentView
!!
}
/**
* 获取 ContentView 控件ID
*/
abstract
fun
getContentViewId
():
Int
/**
* 获取 StateVie 控件 ID
*/
abstract
fun
getStateViewId
():
Int
override
fun
showLoading
()
{
lceStateView
!!
.
showLoading
()
lceStateView
?.
showLoading
()
lceContentView
?.
visibility
=
View
.
INVISIBLE
}
override
fun
hideLoading
()
{
lceStateView
!!
.
hideLoading
()
}
override
fun
showContent
()
{
lceContentView
?.
visibility
=
View
.
VISIBLE
lceStateView
!!
.
hideLoading
()
lceStateView
?.
hideLoading
()
}
override
fun
showEmpty
(
msg
:
String
)
{
lceStateView
!!
.
showEmpty
(
msg
)
lceContentView
?.
visibility
=
View
.
INVISIBLE
lceStateView
?.
showEmpty
(
msg
)
}
override
fun
showError
(
msg
:
String
)
{
lceStateView
!!
.
showError
(
msg
)
lceContentView
?.
visibility
=
View
.
INVISIBLE
lceStateView
?.
showError
(
msg
)
}
override
fun
onDestroyView
()
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/mvp/lce/ILceView.kt
View file @
77266238
...
...
@@ -16,15 +16,12 @@ interface ILceView : IView{
fun
hideLoading
()
@UiThread
fun
showContent
()
@UiThread
fun
showError
(
msg
:
String
)
@UiThread
fun
showEmpty
(
msg
:
String
)
@UiThread
fun
l
oadData
()
fun
reL
oadData
()
}
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/UMEventUtils.java
deleted
100644 → 0
View file @
bef23df6
package
com
.
ydl
.
ydlcommon
.
utils
;
import
android.content.Context
;
import
com.ydl.ydl_router.provider.YDLRouterBurryPointProvider
;
/**
* Created by Wi1ls on 2016/11/11;
*/
//@Route(path = "/burry/point")
public
class
UMEventUtils
implements
YDLRouterBurryPointProvider
{
@Override
public
void
init
(
Context
context
)
{
}
@Override
public
void
burryPoint
(
String
s
,
String
s1
)
{
}
}
ydl-webview/src/main/java/com/ydl/webview/SafeTipView.kt
View file @
77266238
...
...
@@ -10,7 +10,7 @@ import android.view.View
import
android.widget.LinearLayout
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.ydl.ydlcommon.utils.UMEventUtils
import
kotlinx.android.synthetic.main.web_ui_private_safe_hint.view.*
...
...
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