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
8619efbe
Commit
8619efbe
authored
Nov 09, 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
ab5f7bff
0e3e5822
Show whitespace changes
Inline
Side-by-side
Showing
56 changed files
with
326 additions
and
346 deletions
+326
-346
build.gradle
app/build.gradle
+7
-2
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+16
-4
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
+9
-5
modular.gradle
m-consultant/modular.gradle
+2
-2
build.gradle
m-fm/build.gradle
+12
-5
modular.gradle
m-fm/modular.gradle
+2
-2
FMActivity.java
m-fm/src/main/java/com/yidianling/fm/FMActivity.java
+11
-4
FMDetailActivity.java
m-fm/src/main/java/com/yidianling/fm/FMDetailActivity.java
+2
-5
FMListItemView.java
m-fm/src/main/java/com/yidianling/fm/FMListItemView.java
+1
-1
FMListViewFragment.java
m-fm/src/main/java/com/yidianling/fm/FMListViewFragment.java
+2
-2
RoundProgressBar.java
m-fm/src/main/java/com/yidianling/fm/RoundProgressBar.java
+0
-179
FMServiceImpl.kt
m-fm/src/main/java/com/yidianling/fm/modular/FMServiceImpl.kt
+78
-0
FMIn.kt
m-fm/src/main/java/com/yidianling/fm/router/FMIn.kt
+0
-1
IFMService.kt
m-fm/src/main/modular_api/com/yidianling/fm/api/service/IFMService.kt
+18
-0
fm_empty_video.png
m-fm/src/main/res/drawable-xhdpi/fm_empty_video.png
+0
-0
fm_heart_refresh.png
m-fm/src/main/res/drawable-xhdpi/fm_heart_refresh.png
+0
-0
fm_ic_close_24dp.png
m-fm/src/main/res/drawable-xhdpi/fm_ic_close_24dp.png
+0
-0
fm_ic_pause_24dp.png
m-fm/src/main/res/drawable-xhdpi/fm_ic_pause_24dp.png
+0
-0
fm_ic_play_24dp.png
m-fm/src/main/res/drawable-xhdpi/fm_ic_play_24dp.png
+0
-0
fm_msg_next.png
m-fm/src/main/res/drawable-xhdpi/fm_msg_next.png
+0
-0
fm_nim_picker_preview_disable.png
m-fm/src/main/res/drawable-xhdpi/fm_nim_picker_preview_disable.png
+0
-0
fm_nim_picker_preview_normal.png
m-fm/src/main/res/drawable-xhdpi/fm_nim_picker_preview_normal.png
+0
-0
fm_nim_picker_preview_pressed.png
m-fm/src/main/res/drawable-xhdpi/fm_nim_picker_preview_pressed.png
+0
-0
fm_dot_seekbar.xml
m-fm/src/main/res/drawable/fm_dot_seekbar.xml
+0
-0
fm_dot_seekbar_fm.xml
m-fm/src/main/res/drawable/fm_dot_seekbar_fm.xml
+1
-1
fm_ic_music_not.png
m-fm/src/main/res/drawable/fm_ic_music_not.png
+0
-0
fm_nim_picker_preview_btn_selector.xml
m-fm/src/main/res/drawable/fm_nim_picker_preview_btn_selector.xml
+8
-0
fm_seekbar_fm_drag.xml
m-fm/src/main/res/drawable/fm_seekbar_fm_drag.xml
+0
-0
fm_shape_circle_black_bg.xml
m-fm/src/main/res/drawable/fm_shape_circle_black_bg.xml
+0
-0
nim_picker_preview_btn_selector.xml
m-fm/src/main/res/drawable/nim_picker_preview_btn_selector.xml
+0
-9
fm_activity_fm.xml
m-fm/src/main/res/layout/fm_activity_fm.xml
+3
-3
fm_activity_fm_detail.xml
m-fm/src/main/res/layout/fm_activity_fm_detail.xml
+4
-4
fm_fragment_fm_list_view.xml
m-fm/src/main/res/layout/fm_fragment_fm_list_view.xml
+2
-2
fm_ui_fm_list_item.xml
m-fm/src/main/res/layout/fm_ui_fm_list_item.xml
+1
-1
fm_ui_music_notification.xml
m-fm/src/main/res/layout/fm_ui_music_notification.xml
+2
-2
attrs.xml
m-fm/src/main/res/values/attrs.xml
+0
-15
colors.xml
m-fm/src/main/res/values/colors.xml
+1
-1
strings.xml
m-fm/src/main/res/values/strings.xml
+1
-1
colors.xml
m-fm/src/xlzx/res/values/colors.xml
+2
-1
colors.xml
m-fm/src/ydl/res/values/colors.xml
+2
-1
build.gradle
m-muse/build.gradle
+1
-0
build.gradle
m-tests/build.gradle
+1
-1
modular.gradle
m-user/modular.gradle
+2
-2
gradle.properties
ydl-media/gradle.properties
+2
-2
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
ColorUtil.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/bitmap/ColorUtil.java
+10
-0
SlidingTabLayout.java
ydl-platform/src/main/java/com/ydl/ydlcommon/view/SlidingTabLayout.java
+5
-1
gradle.properties
ydl-webview/gradle.properties
+2
-2
No files found.
app/build.gradle
View file @
8619efbe
...
...
@@ -165,10 +165,9 @@ dependencies {
kapt
rootProject
.
ext
.
dependencies
[
"butterknife-compiler"
]
if
(
rootProject
.
ext
.
dev_mod
e
)
{
if
(
tru
e
)
{
//开发模式
api
project
(
':m-user'
)
//api project(':m-fm')
api
project
(
':m-tests'
)
api
project
(
':m-consultant'
)
api
(
project
(
':ydl-platform'
)){
...
...
@@ -176,6 +175,12 @@ dependencies {
}
implementation
project
(
':ydl-webview'
)
implementation
project
(
':ydl-media'
)
// api rootProject.ext.dependencies["ydl-m-fm-module-ydl"]
// api rootProject.ext.dependencies["ydl-m-fm-api"]
api
project
(
':m-fm'
)
implementation
modularPublication
(
'com.ydl:m-fm-api'
)
}
else
{
//发布模式
api
'com.ydl:m-user-module-ydl:0.0.6'
...
...
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
8619efbe
...
...
@@ -19,9 +19,11 @@ import com.ydl.component.mvp.DemoPresenter
import
com.ydl.media.audio.PlayService
import
com.ydl.ydl_router.manager.YDLRouterManager
import
com.ydl.ydl_router.manager.YDLRouterParams
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.fm.api.service.IFMService
import
com.yidianling.tests.home.TestHomeActivity
import
kotlinx.android.synthetic.main.activity_main.*
...
...
@@ -31,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
}
...
...
@@ -48,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
{
...
...
@@ -102,13 +113,14 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
bt_to_fm
.
setOnClickListener
{
YDLRouterManager
.
router
(
IYDLRouterConstant
.
ROUTER_FM_LIST
)
startActivity
(
ModularServiceManager
.
provide
(
IFMService
::
class
.
java
).
fmListIntent
(
this
))
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_FM_LIST)
}
}
override
fun
l
oadData
()
{
override
fun
reL
oadData
()
{
mPresenter
?.
loadUsers
()
}
...
...
app/src/main/java/com/ydl/component/music/MusicPlayActivity.kt
View file @
8619efbe
...
...
@@ -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 @
8619efbe
...
...
@@ -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 @
8619efbe
...
...
@@ -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 @
8619efbe
...
...
@@ -169,12 +169,16 @@ ext {
"ydl-hnet"
:
'com.ydl:h-net:0.0.8'
,
"ydl-utils"
:
'com.ydl:ydl-utils:0.0.2'
,
"ydl-net"
:
'com.ydl:ydl-net:0.0.1'
,
//Modular Api
"ydl-user-router"
:
'com.ydl:router:1.0.0-SNAPSHOT@aar'
,
"ydl-platform"
:
'com.ydl:ydl-platform:0.0.10@aar'
,
//功能组件
"ydl-platform"
:
'com.ydl:ydl-platform:0.0.13@aar'
,
"ydl-webview"
:
'com.ydl:ydl-webview:0.0.15@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'
"ydl-m-muse-api"
:
'com.ydl:m-muse-api:0.0.1'
,
"ydl-m-fm-api"
:
'com.ydl:m-fm-api:0.0.2'
,
"ydl-m-fm-module-ydl"
:
'com.ydl:m-fm-module-ydl:0.0.1@aar'
]
}
m-consultant/modular.gradle
View file @
8619efbe
...
...
@@ -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-fm/build.gradle
View file @
8619efbe
...
...
@@ -2,6 +2,13 @@ apply plugin: 'com.android.library'
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-kapt'
apply
plugin:
'kotlin-android-extensions'
apply
plugin:
'plugin.resTools'
// 资源重命名插件
// 配置资源重命名插件
resConfig
{
new_prefix
=
'fm_'
// 资源前缀
old_prefix
=
''
// 老前缀,可为''空字符串
}
kapt
{
arguments
{
...
...
@@ -62,18 +69,18 @@ dependencies {
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt
"com.alibaba:arouter-compiler:$arouter_compiler"
api
rootProject
.
ext
.
dependencies
[
"ydl-user-router"
]
if
(
rootProject
.
ext
.
dev_mode
){
//开发时使用
api
project
(
":ydl-platform"
)
api
project
(
':m-user'
)
implementation
project
(
':ydl-media'
)
implementation
modularPublication
(
'com.ydl:m-user-api'
)
implementation
project
(
':ydl-media'
)
}
else
{
//发布时使用
api
rootProject
.
ext
.
dependencies
[
"ydl-m-user-api"
]
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
transitive
=
true
}
implementation
project
(
':ydl-media'
)
implementation
rootProject
.
ext
.
dependencies
[
"ydl-m-user-api"
]
implementation
rootProject
.
ext
.
dependencies
[
"ydl-platform"
]
}
}
m-fm/modular.gradle
View file @
8619efbe
...
...
@@ -15,7 +15,7 @@ modular {
groupId
=
"com.ydl"
artifactId
=
"m-fm-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version
=
"0.0.
1
"
version
=
"0.0.
6
"
}
}
...
...
@@ -24,7 +24,7 @@ modular {
groupId
=
"com.ydl"
artifactId
=
"m-fm-api"
//开发时注释掉版本号,发布api时打开
//version = "0.0.1
"
version
=
"0.0.2
"
// API 层打包时需要引入的依赖
apiDependencies
{
implementation
"com.google.code.gson:gson:2.8.2"
...
...
m-fm/src/main/java/com/yidianling/fm/FMActivity.java
View file @
8619efbe
package
com
.
yidianling
.
fm
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.view.ViewPager
;
import
android.widget.PopupWindow
;
...
...
@@ -11,6 +14,7 @@ import com.ydl.media.view.PlayerFloatHelper;
import
com.ydl.ydlcommon.adapter.FragmentWithTabPagerAdapter
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.utils.PopUtils
;
import
com.ydl.ydlcommon.utils.bitmap.ColorUtil
;
import
com.ydl.ydlcommon.view.SlidingTabLayout
;
import
com.ydl.ydlcommon.view.TitleBar
;
...
...
@@ -34,11 +38,13 @@ public class FMActivity extends BaseActivity {
private
PopupWindow
popupWindow
;
public
static
Intent
newIntent
(
Activity
activity
)
{
Intent
intent
=
new
Intent
(
activity
,
FMActivity
.
class
);
return
intent
;
}
@Override
protected
int
layoutResId
()
{
return
R
.
layout
.
activity_fm
;
return
R
.
layout
.
fm_
activity_fm
;
}
@Override
...
...
@@ -75,9 +81,10 @@ public class FMActivity extends BaseActivity {
}
FragmentWithTabPagerAdapter
adapter
=
new
FragmentWithTabPagerAdapter
(
getSupportFragmentManager
(),
titleList
,
fragmentList
);
stl_tab
.
setBackgroundColor
(
Color
.
WHITE
);
stl_tab
.
setSelectedIndicatorColors
(
ColorUtil
.
changeColor
(
this
,
R
.
color
.
fm_google_green
));
stl_tab
.
setSelectColor
(
ColorUtil
.
changeColor
(
this
,
R
.
color
.
fm_google_green
));
vp_content
.
setAdapter
(
adapter
);
stl_tab
.
setIsDoubleTab
(
true
);
stl_tab
.
setSelectedIndicatorColors
(
0xFF1da1f2
);
stl_tab
.
setDividerColors
(
Color
.
TRANSPARENT
);
stl_tab
.
setViewPager
(
vp_content
);
vp_content
.
setCurrentItem
(
0
);
...
...
m-fm/src/main/java/com/yidianling/fm/FMDetailActivity.java
View file @
8619efbe
...
...
@@ -25,15 +25,12 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import
com.ydl.media.audio.AudioPlayer
;
import
com.ydl.media.audio.OnPlayerEventListener
;
import
com.ydl.media.audio.model.Music
;
import
com.ydl.media.audio.utils.PlayProgressUtil
;
import
com.ydl.media.view.PlayerFloatHelper
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.transform.GlideCircleRingTransform
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
;
import
com.ydl.ydlcommon.router.YdlCommonOut
;
import
com.ydl.ydlcommon.utils.UMEventUtils
;
import
com.ydl.ydlcommon.utils.remind.ToastHelper
;
import
com.ydl.ydlcommon.view.TitleBar
;
import
com.ydl.ydlcommon.view.dialog.YDLShareDialog
;
...
...
@@ -158,7 +155,7 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
@Override
protected
int
layoutResId
()
{
return
R
.
layout
.
activity_fm_detail
;
return
R
.
layout
.
fm_
activity_fm_detail
;
}
/**
...
...
@@ -438,7 +435,7 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
// if (PlayerFloatHelper.Companion.isFmPlaying()) {
// iv_play.setImageResource(R.drawable.fm_stop_2);
// } else {
// iv_play.setImageResource(R.drawable.fm_play_2);
// iv_play.setImageResource(R.drawable.fm_
fm_
play_2);
// }
// }
...
...
m-fm/src/main/java/com/yidianling/fm/FMListItemView.java
View file @
8619efbe
...
...
@@ -27,7 +27,7 @@ public class FMListItemView extends LinearLayout {
public
FMListItemView
(
Context
context
)
{
super
(
context
);
inflate
(
context
,
R
.
layout
.
ui_fm_list_item
,
this
);
inflate
(
context
,
R
.
layout
.
fm_
ui_fm_list_item
,
this
);
sdv_head
=
findViewById
(
R
.
id
.
sdv_head
);
tv_title
=
findViewById
(
R
.
id
.
tv_title
);
tv_anchor
=
findViewById
(
R
.
id
.
tv_anchor
);
...
...
m-fm/src/main/java/com/yidianling/fm/FMListViewFragment.java
View file @
8619efbe
...
...
@@ -52,7 +52,7 @@ public class FMListViewFragment extends BaseFragment implements PtrHandler, Load
@Override
public
int
layoutResId
()
{
return
R
.
layout
.
fragment_fm_list_view
;
return
R
.
layout
.
f
m_f
ragment_fm_list_view
;
}
@Override
...
...
@@ -71,7 +71,7 @@ public class FMListViewFragment extends BaseFragment implements PtrHandler, Load
store_house_ptr_frame
=
getRootView
().
findViewById
(
R
.
id
.
store_house_ptr_frame
);
}
final
MaterialHeader
header
=
new
MaterialHeader
(
getActivity
());
int
color
=
getResources
().
getColor
(
R
.
color
.
google_green
);
int
color
=
getResources
().
getColor
(
R
.
color
.
fm_
google_green
);
header
.
setColorSchemeColors
(
new
int
[]{
color
});
header
.
setLayoutParams
(
new
PtrFrameLayout
.
LayoutParams
(-
1
,
-
2
));
int
padding
=
(
int
)
getActivity
().
getResources
().
getDimension
(
R
.
dimen
.
platform_default_dis_size
);
...
...
m-fm/src/main/java/com/yidianling/fm/RoundProgressBar.java
deleted
100644 → 0
View file @
ab5f7bff
package
com
.
yidianling
.
fm
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.graphics.Canvas
;
import
android.graphics.Color
;
import
android.graphics.Paint
;
import
android.graphics.RectF
;
import
android.graphics.Typeface
;
import
android.util.AttributeSet
;
import
android.view.View
;
public
class
RoundProgressBar
extends
View
{
private
Paint
paint
;
private
int
roundColor
;
private
int
roundProgressColor
;
private
int
textColor
;
private
float
textSize
;
private
float
roundWidth
;
private
int
max
;
private
int
progress
;
private
boolean
textIsDisplayable
;
private
int
style
;
public
static
final
int
STROKE
=
0
;
public
static
final
int
FILL
=
1
;
public
RoundProgressBar
(
Context
context
)
{
this
(
context
,
null
);
}
public
RoundProgressBar
(
Context
context
,
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
0
);
}
public
RoundProgressBar
(
Context
context
,
AttributeSet
attrs
,
int
defStyle
)
{
super
(
context
,
attrs
,
defStyle
);
paint
=
new
Paint
();
TypedArray
mTypedArray
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
RoundProgressBar
);
roundColor
=
mTypedArray
.
getColor
(
R
.
styleable
.
RoundProgressBar_roundColor
,
0x558B8B8B
);
roundProgressColor
=
mTypedArray
.
getColor
(
R
.
styleable
.
RoundProgressBar_roundProgressColor
,
0xFF91E300
);
textColor
=
mTypedArray
.
getColor
(
R
.
styleable
.
RoundProgressBar_textColor
,
Color
.
GREEN
);
textSize
=
mTypedArray
.
getDimension
(
R
.
styleable
.
RoundProgressBar_textSize
,
15
);
roundWidth
=
mTypedArray
.
getDimension
(
R
.
styleable
.
RoundProgressBar_roundWidth
,
5
);
max
=
mTypedArray
.
getInteger
(
R
.
styleable
.
RoundProgressBar_round_progress_bar_max_num
,
100
);
textIsDisplayable
=
mTypedArray
.
getBoolean
(
R
.
styleable
.
RoundProgressBar_textIsDisplayable
,
true
);
style
=
mTypedArray
.
getInt
(
R
.
styleable
.
RoundProgressBar_style
,
0
);
mTypedArray
.
recycle
();
}
@Override
protected
void
onDraw
(
Canvas
canvas
)
{
super
.
onDraw
(
canvas
);
int
centre
=
getWidth
()
/
2
;
int
radius
=
(
int
)
(
centre
-
roundWidth
/
2
);
canvas
.
save
();
canvas
.
rotate
(-
90
,
centre
,
centre
);
paint
.
setColor
(
roundColor
);
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setStrokeWidth
(
roundWidth
);
paint
.
setAntiAlias
(
true
);
canvas
.
drawCircle
(
centre
,
centre
,
radius
,
paint
);
paint
.
setStrokeWidth
(
0
);
paint
.
setColor
(
textColor
);
paint
.
setTextSize
(
textSize
);
paint
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
);
int
percent
=
(
int
)
(((
float
)
progress
/
(
float
)
max
)
*
100
);
float
textWidth
=
paint
.
measureText
(
percent
+
"%"
);
if
(
textIsDisplayable
&&
percent
!=
0
&&
style
==
STROKE
)
{
canvas
.
drawText
(
percent
+
"%"
,
centre
-
textWidth
/
2
,
centre
+
textSize
/
2
,
paint
);
}
paint
.
setStrokeWidth
(
roundWidth
);
paint
.
setColor
(
roundProgressColor
);
RectF
oval
=
new
RectF
(
centre
-
radius
,
centre
-
radius
,
centre
+
radius
,
centre
+
radius
);
switch
(
style
)
{
case
STROKE:
{
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
canvas
.
drawArc
(
oval
,
0
,
360
*
progress
/
max
,
false
,
paint
);
break
;
}
case
FILL:
{
paint
.
setStyle
(
Paint
.
Style
.
FILL_AND_STROKE
);
if
(
progress
!=
0
)
canvas
.
drawArc
(
oval
,
0
,
360
*
progress
/
max
,
true
,
paint
);
break
;
}
}
canvas
.
restore
();
}
public
synchronized
int
getMax
()
{
return
max
;
}
public
synchronized
void
setMax
(
int
max
)
{
if
(
max
<
0
)
{
throw
new
IllegalArgumentException
(
"max not less than 0"
);
}
this
.
max
=
max
;
}
public
synchronized
int
getProgress
()
{
return
progress
;
}
public
synchronized
void
setProgress
(
int
progress
)
{
if
(
progress
<
0
)
{
throw
new
IllegalArgumentException
(
"progress not less than 0"
);
}
if
(
progress
>
max
)
{
progress
=
max
;
}
if
(
progress
<=
max
)
{
this
.
progress
=
progress
;
postInvalidate
();
}
}
public
int
getCricleColor
()
{
return
roundColor
;
}
public
void
setCricleColor
(
int
cricleColor
)
{
this
.
roundColor
=
cricleColor
;
}
public
int
getCricleProgressColor
()
{
return
roundProgressColor
;
}
public
void
setCricleProgressColor
(
int
cricleProgressColor
)
{
this
.
roundProgressColor
=
cricleProgressColor
;
}
public
int
getTextColor
()
{
return
textColor
;
}
public
void
setTextColor
(
int
textColor
)
{
this
.
textColor
=
textColor
;
}
public
float
getTextSize
()
{
return
textSize
;
}
public
void
setTextSize
(
float
textSize
)
{
this
.
textSize
=
textSize
;
}
public
float
getRoundWidth
()
{
return
roundWidth
;
}
public
void
setRoundWidth
(
float
roundWidth
)
{
this
.
roundWidth
=
roundWidth
;
}
}
m-fm/src/main/java/com/yidianling/fm/modular/FMServiceImpl.kt
0 → 100644
View file @
8619efbe
package
com.yidianling.fm.modular
import
android.app.Activity
import
android.content.Context
import
android.content.Intent
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.ydl.media.audio.AudioPlayer
import
com.ydl.media.view.PlayerFloatHelper
import
com.yidianling.fm.FMActivity
import
com.yidianling.fm.FMDetailActivity
import
com.yidianling.fm.api.service.IFMService
/**
* Created by xj on 2019/11/6.
*/
@Route
(
path
=
"/fm/FMService"
)
class
FMServiceImpl
:
IFMService
{
constructor
()
override
fun
init
(
context
:
Context
?)
{
}
/**
* 打开FM列表页面
*/
override
fun
fmListIntent
(
activity
:
Activity
):
Intent
{
return
FMActivity
.
newIntent
(
activity
)
}
/**
* 打开FM播放页面
*/
override
fun
fmDetailIntent
(
activity
:
Activity
,
id
:
Int
):
Intent
{
return
FMDetailActivity
.
newIntent
(
activity
,
id
)
}
/**
* 打开FM播放页面
*/
override
fun
fmDetailIntent
(
activity
:
Activity
,
id
:
Int
,
isSplash
:
Boolean
):
Intent
{
return
FMDetailActivity
.
newIntent
(
activity
,
id
,
isSplash
)
}
/**
* 获取FM播放ID
*/
override
fun
getFmId
():
Int
{
return
PlayerFloatHelper
.
getFmId
()
}
/**
* 关闭音乐播放
*/
override
fun
closePlayer
()
{
if
(
AudioPlayer
.
get
().
isPlaying
)
{
AudioPlayer
.
get
().
stopPlayer
()
}
}
/**
* 判断是否正在播放中
*/
override
fun
isPlaying
():
Boolean
{
return
AudioPlayer
.
get
().
isPlaying
}
/**
* 暂停播放
*/
override
fun
pause
(){
AudioPlayer
.
get
().
pausePlayer
()
}
override
fun
replay
()
{}
}
\ No newline at end of file
m-fm/src/main/java/com/yidianling/fm/router/FMIn.kt
View file @
8619efbe
...
...
@@ -15,7 +15,6 @@ object FMIn {
fun
isLogin
():
Boolean
{
return
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
isLogin
()
// return RouterManager.getUserRouter()?.isLogin()?:false
}
fun
mainIntent
(
activity
:
Activity
):
Intent
?
{
...
...
m-fm/src/main/modular_api/com/yidianling/fm/api/service/IFMService.kt
View file @
8619efbe
package
com.yidianling.fm.api.service
import
android.app.Activity
import
android.content.Intent
import
com.alibaba.android.arouter.facade.template.IProvider
/**
...
...
@@ -7,4 +9,19 @@ import com.alibaba.android.arouter.facade.template.IProvider
*/
interface
IFMService
:
IProvider
{
fun
fmListIntent
(
activity
:
Activity
):
Intent
fun
fmDetailIntent
(
activity
:
Activity
,
id
:
Int
):
Intent
fun
fmDetailIntent
(
activity
:
Activity
,
id
:
Int
,
isSplash
:
Boolean
):
Intent
fun
getFmId
():
Int
fun
closePlayer
()
fun
isPlaying
():
Boolean
fun
pause
()
fun
replay
()
}
\ No newline at end of file
m-fm/src/main/res/drawable-xhdpi/empty_video.png
→
m-fm/src/main/res/drawable-xhdpi/
fm_
empty_video.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable-xhdpi/heart_refresh.png
→
m-fm/src/main/res/drawable-xhdpi/
fm_
heart_refresh.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable-xhdpi/ic_close_24dp.png
→
m-fm/src/main/res/drawable-xhdpi/
fm_
ic_close_24dp.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable-xhdpi/ic_pause_24dp.png
→
m-fm/src/main/res/drawable-xhdpi/
fm_
ic_pause_24dp.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable-xhdpi/ic_play_24dp.png
→
m-fm/src/main/res/drawable-xhdpi/
fm_
ic_play_24dp.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable-xhdpi/msg_next.png
→
m-fm/src/main/res/drawable-xhdpi/
fm_
msg_next.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable-xhdpi/nim_picker_preview_disable.png
→
m-fm/src/main/res/drawable-xhdpi/
fm_
nim_picker_preview_disable.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable-xhdpi/nim_picker_preview_normal.png
→
m-fm/src/main/res/drawable-xhdpi/
fm_
nim_picker_preview_normal.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable-xhdpi/nim_picker_preview_pressed.png
→
m-fm/src/main/res/drawable-xhdpi/
fm_
nim_picker_preview_pressed.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable/dot_seekbar.xml
→
m-fm/src/main/res/drawable/
fm_
dot_seekbar.xml
View file @
8619efbe
File moved
m-fm/src/main/res/drawable/dot_seekbar_fm.xml
→
m-fm/src/main/res/drawable/
fm_
dot_seekbar_fm.xml
View file @
8619efbe
...
...
@@ -9,7 +9,7 @@
android:width=
"7dp"
android:height=
"7dp"
/>
<stroke
android:color=
"@color/white"
android:width=
"1dp"
/>
<solid
android:color=
"@color/google_green"
/>
<solid
android:color=
"@color/
fm_
google_green"
/>
</shape>
</item>
<item>
...
...
m-fm/src/main/res/drawable/ic_music_not.png
→
m-fm/src/main/res/drawable/
fm_
ic_music_not.png
View file @
8619efbe
File moved
m-fm/src/main/res/drawable/fm_nim_picker_preview_btn_selector.xml
0 → 100644
View file @
8619efbe
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:drawable=
"@drawable/fm_nim_picker_preview_pressed"
android:state_pressed=
"true"
></item>
<item
android:drawable=
"@drawable/fm_nim_picker_preview_disable"
android:state_enabled=
"false"
></item>
<item
android:drawable=
"@drawable/fm_nim_picker_preview_normal"
></item>
</selector>
m-fm/src/main/res/drawable/seekbar_fm_drag.xml
→
m-fm/src/main/res/drawable/
fm_
seekbar_fm_drag.xml
View file @
8619efbe
File moved
m-fm/src/main/res/drawable/shape_circle_black_bg.xml
→
m-fm/src/main/res/drawable/
fm_
shape_circle_black_bg.xml
View file @
8619efbe
File moved
m-fm/src/main/res/drawable/nim_picker_preview_btn_selector.xml
deleted
100644 → 0
View file @
ab5f7bff
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:drawable=
"@drawable/nim_picker_preview_pressed"
android:state_pressed=
"true"
></item>
<item
android:drawable=
"@drawable/nim_picker_preview_disable"
android:state_enabled=
"false"
></item>
<item
android:drawable=
"@drawable/nim_picker_preview_normal"
></item>
</selector>
\ No newline at end of file
m-fm/src/main/res/layout/activity_fm.xml
→
m-fm/src/main/res/layout/
fm_
activity_fm.xml
View file @
8619efbe
...
...
@@ -9,7 +9,7 @@
android:id=
"@+id/tb_title"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/title_bar_height"
app:pa_left_start_icon_color=
"@color/
google_green"
app:pa_left_start_icon_color=
"@color/
fm_google_green"
app:pa_title_text=
"心灵电台"
/>
<FrameLayout
...
...
@@ -20,7 +20,7 @@
android:id=
"@+id/stl_tab"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
/>
android:background=
"@color/white"
/>
</FrameLayout>
...
...
@@ -28,7 +28,7 @@
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/divide_line_stroke_width"
android:background=
"@color/
divide_color"
/>
android:background=
"@color/
fm_divide_color"
/>
<android.support.v4.view.ViewPager
android:id=
"@+id/vp_content"
...
...
m-fm/src/main/res/layout/activity_fm_detail.xml
→
m-fm/src/main/res/layout/
fm_
activity_fm_detail.xml
View file @
8619efbe
...
...
@@ -61,14 +61,14 @@
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_centerInParent=
"true"
android:background=
"@drawable/
shape_circle_black_bg"
android:background=
"@drawable/
fm_shape_circle_black_bg"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/refresh_icon"
android:layout_width=
"@dimen/platform_dp_25"
android:layout_height=
"@dimen/platform_dp_25"
android:src=
"@drawable/
heart_refresh"
android:src=
"@drawable/
fm_heart_refresh"
android:layout_centerInParent=
"true"
android:visibility=
"gone"
/>
...
...
@@ -241,7 +241,7 @@
android:minHeight=
"1dp"
android:paddingStart=
"4dp"
android:paddingEnd=
"4dp"
android:progressDrawable=
"@drawable/
seekbar_fm_drag"
android:thumb=
"@drawable/
dot_seekbar_fm"
/>
android:progressDrawable=
"@drawable/
fm_seekbar_fm_drag"
android:thumb=
"@drawable/
fm_dot_seekbar_fm"
/>
</RelativeLayout>
</RelativeLayout>
m-fm/src/main/res/layout/fragment_fm_list_view.xml
→
m-fm/src/main/res/layout/f
m_f
ragment_fm_list_view.xml
View file @
8619efbe
...
...
@@ -16,7 +16,7 @@
android:id=
"@+id/lv_content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:divider=
"@color/
divide_color"
android:divider=
"@color/
fm_divide_color"
android:dividerHeight=
"@dimen/divide_line_stroke_width"
/>
<com.ydl.ydlcommon.ui.LogoLoadingView
...
...
@@ -34,7 +34,7 @@
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/
empty_video"
/>
android:src=
"@drawable/
fm_empty_video"
/>
<TextView
android:id=
"@+id/ll_empty_txt"
...
...
m-fm/src/main/res/layout/ui_fm_list_item.xml
→
m-fm/src/main/res/layout/
fm_
ui_fm_list_item.xml
View file @
8619efbe
...
...
@@ -51,7 +51,7 @@
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/
msg_next"
/>
android:src=
"@drawable/
fm_msg_next"
/>
</RelativeLayout>
m-fm/src/main/res/layout/ui_music_notification.xml
→
m-fm/src/main/res/layout/
fm_
ui_music_notification.xml
View file @
8619efbe
...
...
@@ -36,7 +36,7 @@
android:layout_height=
"48dp"
android:contentDescription=
"@string/platform_pause_play"
android:scaleType=
"centerInside"
android:src=
"@drawable/
ic_pause_24dp"
/>
android:src=
"@drawable/
fm_ic_pause_24dp"
/>
<ImageButton
android:id=
"@+id/btn_close"
...
...
@@ -45,6 +45,6 @@
android:layout_height=
"48dp"
android:contentDescription=
"@string/platform_close"
android:scaleType=
"centerInside"
android:src=
"@drawable/
ic_close_24dp"
/>
android:src=
"@drawable/
fm_ic_close_24dp"
/>
</LinearLayout>
m-fm/src/main/res/values/attrs.xml
View file @
8619efbe
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--RoundProgressBar-->
<declare-styleable
name=
"RoundProgressBar"
>
<attr
name=
"roundColor"
format=
"color"
/>
<attr
name=
"roundProgressColor"
format=
"color"
/>
<attr
name=
"roundWidth"
format=
"dimension"
></attr>
<attr
name=
"textColor"
format=
"color"
/>
<attr
name=
"textSize"
format=
"dimension"
/>
<attr
name=
"round_progress_bar_max_num"
format=
"integer"
></attr>
<attr
name=
"textIsDisplayable"
format=
"boolean"
></attr>
<attr
name=
"style"
>
<enum
name=
"STROKE"
value=
"0"
></enum>
<enum
name=
"FILL"
value=
"1"
></enum>
</attr>
</declare-styleable>
</resources>
\ No newline at end of file
m-fm/src/main/res/values/colors.xml
View file @
8619efbe
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"
divide_color"
>
#EDEDED
</color>
<color
name=
"
fm_divide_color"
>
#EDEDED
</color>
</resources>
m-fm/src/main/res/values/strings.xml
View file @
8619efbe
<resources>
<string
name=
"
app_name"
>
FM
</string>
<string
name=
"
fm_app_name"
>
FM
</string>
</resources>
m-fm/src/xlzx/res/values/colors.xml
View file @
8619efbe
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"
google_green"
>
#2ca94f
</color>
<color
name=
"
fm_google_green"
>
#FFDD33
</color>
</resources>
\ No newline at end of file
m-fm/src/ydl/res/values/colors.xml
View file @
8619efbe
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"google_green"
>
#1da1f2
</color>
<color
name=
"
fm_
google_green"
>
#1da1f2
</color>
</resources>
\ No newline at end of file
m-muse/build.gradle
View file @
8619efbe
...
...
@@ -68,6 +68,7 @@ dependencies {
implementation
project
(
':ydl-media'
)
}
else
{
//发布时使用
implementation
project
(
':ydl-media'
)
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
transitive
=
true
}
...
...
m-tests/build.gradle
View file @
8619efbe
...
...
@@ -78,7 +78,7 @@ dependencies {
implementation
modularPublication
(
'com.ydl:m-test-api'
)
}
else
{
//发布时使用
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-test-api"
]
implementation
modularPublication
(
'com.ydl:m-test-api'
)
api
rootProject
.
ext
.
dependencies
[
"ydl-webview"
]
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
transitive
=
true
...
...
m-user/modular.gradle
View file @
8619efbe
...
...
@@ -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
"
}
}
...
...
ydl-media/gradle.properties
View file @
8619efbe
IS_PUBLISH
=
true
VERSION_NAME
=
0.0.1
\ No newline at end of file
VERSION_NAME
=
0.0.4
\ No newline at end of file
ydl-platform/gradle.properties
View file @
8619efbe
IS_PUBLISH
=
true
VERSION_NAME
=
0.0.10
\ No newline at end of file
VERSION_NAME
=
0.0.13
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/RxUtils.kt
View file @
8619efbe
...
...
@@ -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 @
8619efbe
...
...
@@ -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 @
8619efbe
...
...
@@ -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"
)
}
}
protected
fun
createStateView
(
view
:
View
):
ILceViewState
{
val
stateView
=
view
.
findViewById
<
View
>(
R
.
id
.
lce_state_view
)
if
(
stateView
is
ILceViewState
)
{
private
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 @
8619efbe
...
...
@@ -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 @
8619efbe
...
...
@@ -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/bitmap/ColorUtil.java
View file @
8619efbe
package
com
.
ydl
.
ydlcommon
.
utils
.
bitmap
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.graphics.LinearGradient
;
import
android.graphics.Shader
;
...
...
@@ -460,4 +461,13 @@ public class ColorUtil {
return
Color
.
argb
(
alpha
,
red
,
green
,
blue
);
}
public
static
int
changeColor
(
Context
context
,
int
id
){
StringBuffer
stringBuffer
=
new
StringBuffer
();
int
color
=
context
.
getResources
().
getColor
(
id
);
String
hexCode
=
String
.
format
(
"#%06X"
,
Integer
.
valueOf
(
16777215
&
color
));
return
Color
.
parseColor
(
hexCode
);
}
}
ydl-platform/src/main/java/com/ydl/ydlcommon/view/SlidingTabLayout.java
View file @
8619efbe
...
...
@@ -74,9 +74,13 @@ public class SlidingTabLayout extends HorizontalScrollView {
private
static
final
int
TITLE_OFFSET_DIPS
=
24
;
private
static
final
int
TAB_VIEW_PADDING_DIPS
=
16
;
private
static
final
int
TAB_VIEW_TEXT_SIZE_SP
=
14
;
private
static
final
int
SELECT_TEXT_COLOR
=
0xFF1da1f2
;
private
static
int
SELECT_TEXT_COLOR
=
0xFF1da1f2
;
private
static
final
int
UNSELECT_TEXT_COLOR
=
0xFF7D7D7D
;
public
static
void
setSelectColor
(
int
color
)
{
SELECT_TEXT_COLOR
=
color
;
}
private
boolean
isDoubleTab
=
false
;
//this mode has two tab and can not slide
private
int
mTitleOffset
;
...
...
ydl-webview/gradle.properties
View file @
8619efbe
IS_PUBLISH
=
true
VERSION_NAME
=
0.0.14
\ No newline at end of file
VERSION_NAME
=
0.0.15
\ No newline at end of file
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