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
1e8f36a5
Commit
1e8f36a5
authored
Nov 05, 2019
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课程模块
parent
e4369ba4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
626 additions
and
54 deletions
+626
-54
build.gradle
m-course/build.gradle
+8
-0
CourseListFragment.java
m-course/src/main/java/com/yidianling/course/CourseListFragment.java
+1
-1
PostersShareBean.kt
m-course/src/main/java/com/yidianling/course/bean/PostersShareBean.kt
+1
-1
CourseListContainerActivity.kt
m-course/src/main/java/com/yidianling/course/courseNew/courseList/CourseListContainerActivity.kt
+1
-1
CoursePlayActivity.kt
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayActivity.kt
+13
-6
CoursePlayItemViewAudio.kt
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewAudio.kt
+1
-0
CoursePlayItemViewVideo.kt
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewVideo.kt
+10
-6
CourseSearchActicity.kt
m-course/src/main/java/com/yidianling/course/courseSearch/CourseSearchActicity.kt
+13
-11
CourseSearchApiUtils.kt
m-course/src/main/java/com/yidianling/course/courseSearch/http/CourseSearchApiUtils.kt
+4
-5
CourseSearchListApi.kt
m-course/src/main/java/com/yidianling/course/courseSearch/http/CourseSearchListApi.kt
+1
-1
ICourseSearchListHttp.kt
m-course/src/main/java/com/yidianling/course/courseSearch/http/ICourseSearchListHttp.kt
+1
-2
CourseSpecialListPresenterImpl.kt
m-course/src/main/java/com/yidianling/course/course_special_list/presenter/CourseSpecialListPresenterImpl.kt
+5
-14
HPlayView.kt
m-course/src/main/java/com/yidianling/course/widget/HPlayView.kt
+286
-0
blank.png
m-course/src/main/res/drawable-xhdpi/blank.png
+0
-0
course_default_img.png
m-course/src/main/res/drawable-xhdpi/course_default_img.png
+0
-0
course_ico_course_play.png
m-course/src/main/res/drawable-xhdpi/course_ico_course_play.png
+0
-0
course_ico_img_zixun_empty.png
m-course/src/main/res/drawable-xhdpi/course_ico_img_zixun_empty.png
+0
-0
course_ico_play_float_full.png
m-course/src/main/res/drawable-xhdpi/course_ico_play_float_full.png
+0
-0
course_audio_play.gif
m-course/src/main/res/drawable/course_audio_play.gif
+0
-0
course_dot_seekbar.xml
m-course/src/main/res/drawable/course_dot_seekbar.xml
+11
-0
course_layer_progress.xml
m-course/src/main/res/drawable/course_layer_progress.xml
+27
-0
course_video_bottom_background.xml
m-course/src/main/res/drawable/course_video_bottom_background.xml
+11
-0
activity_course.xml
m-course/src/main/res/layout/activity_course.xml
+2
-2
activity_course_commeny.xml
m-course/src/main/res/layout/activity_course_commeny.xml
+1
-1
activity_course_poster.xml
m-course/src/main/res/layout/activity_course_poster.xml
+1
-1
activity_course_search.xml
m-course/src/main/res/layout/activity_course_search.xml
+76
-0
course_play_music_view.xml
m-course/src/main/res/layout/course_play_music_view.xml
+134
-0
course_videoplay_view.xml
m-course/src/main/res/layout/course_videoplay_view.xml
+0
-0
course_view_course_play_item.xml
m-course/src/main/res/layout/course_view_course_play_item.xml
+13
-0
fragment_course_list.xml
m-course/src/main/res/layout/fragment_course_list.xml
+1
-1
layout_title_bar.xml
m-course/src/main/res/layout/layout_title_bar.xml
+1
-1
colors.xml
m-course/src/main/res/values/colors.xml
+3
-0
course_toolbar_back.png
m-course/src/xlzx/res/drawable-xhdpi/course_toolbar_back.png
+0
-0
course_toolbar_back.png
m-course/src/ydl/res/drawable-xhdpi/course_toolbar_back.png
+0
-0
BIConstants.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/BIConstants.kt
+0
-0
No files found.
m-course/build.gradle
View file @
1e8f36a5
...
...
@@ -60,6 +60,14 @@ dependencies {
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.2'
kapt
'com.alibaba:arouter-compiler:1.2.2'
implementation
'com.jakewharton:butterknife:8.8.1'
api
'com.dou361.ijkplayer-armv5:jjdxm-ijkplayer-armv5:1.0.0'
api
'com.dou361.ijkplayer-arm64:jjdxm-ijkplayer-arm64:1.0.0'
api
'com.dou361.ijkplayer-x86:jjdxm-ijkplayer-x86:1.0.0'
api
'com.dou361.ijkplayer-x86_64:jjdxm-ijkplayer-x86_64:1.0.0'
api
(
'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.6'
)
{
exclude
group:
'com.android.support'
,
module:
'appcompat-v7'
}
api
rootProject
.
ext
.
dependencies
[
"ydl-user-router"
]
if
(
rootProject
.
ext
.
dev_mode
){
//开发时使用
...
...
m-course/src/main/java/com/yidianling/course/CourseListFragment.java
View file @
1e8f36a5
...
...
@@ -238,7 +238,7 @@ public class CourseListFragment extends BaseFragment implements PtrHandler, Load
emptyTv
.
setVisibility
(
View
.
VISIBLE
);
ivEmptyView
.
setVisibility
(
View
.
VISIBLE
);
lvContent
.
setVisibility
(
View
.
GONE
);
ivEmptyView
.
setImageResource
(
R
.
drawable
.
blank
);
ivEmptyView
.
setImageResource
(
R
.
drawable
.
course_
blank
);
emptyTv
.
setText
(
"还没有相应的课程哦~"
);
}
else
{
lvContent
.
setVisibility
(
View
.
VISIBLE
);
...
...
m-course/src/main/java/com/yidianling/course/bean/PostersShareBean.kt
View file @
1e8f36a5
package
com.yidianling.course.bean
import
com.y
idianling.ydlcommon.data
.ShareData
import
com.y
dl.ydlcommon.bean
.ShareData
/**
* @author jiucheng
...
...
m-course/src/main/java/com/yidianling/course/courseNew/courseList/CourseListContainerActivity.kt
View file @
1e8f36a5
...
...
@@ -495,7 +495,7 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
lv_content
.
visibility
=
View
.
GONE
tv_course_list_empty_prompt
.
visibility
=
View
.
VISIBLE
iv_course_list_empty_view
.
visibility
=
View
.
VISIBLE
iv_course_list_empty_view
.
setImageResource
(
R
.
drawable
.
blank
)
iv_course_list_empty_view
.
setImageResource
(
R
.
drawable
.
course_
blank
)
tv_course_list_empty_prompt
.
text
=
"还没有相应的课程哦~"
v_loading
.
visibility
=
View
.
GONE
}
...
...
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayActivity.kt
View file @
1e8f36a5
...
...
@@ -17,7 +17,8 @@ import android.widget.LinearLayout
import
android.widget.TextView
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.bumptech.glide.Glide
import
com.google.android.exoplayer2.ui.PlayerView
import
com.dou361.ijkplayer.widget.PlayStateParams
import
com.dou361.ijkplayer.widget.PlayerView
import
com.ydl.media.audio.AudioPlayer
import
com.ydl.media.audio.utils.PlayProgressUtil
import
com.ydl.media.view.PlayTypeEnum
...
...
@@ -31,7 +32,6 @@ import com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.utils.ScreenUtil
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.UMEventUtils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.view.BaseViewHolder
import
com.ydl.ydlcommon.view.dialog.CommonDialog
...
...
@@ -579,7 +579,7 @@ class CoursePlayActivity : BaseActivity() {
videoView
?.
onConfigurationChanged
(
newConfig
)
handler
.
postDelayed
({
if
(
newConfig
.
screenHeightDp
>
newConfig
.
screenWidthDp
)
{
videoView
?.
fullScreenView
!!
.
setImageResource
(
R
.
drawable
.
ico_play_float_full
)
videoView
?.
fullScreenView
!!
.
setImageResource
(
R
.
drawable
.
course_
ico_play_float_full
)
}
else
{
videoView
?.
fullScreenView
!!
.
setImageResource
(
R
.
drawable
.
ico_play_minify
)
}
...
...
@@ -595,10 +595,17 @@ class CoursePlayActivity : BaseActivity() {
fun
showVideoFloatView
():
Boolean
{
if
(
play_type
==
0
)
{
if
(
YDLMusicHelper
.
isCoursePlaying
())
{
YDLMusicHelper
.
cover
=
courPlayBean
?.
courseExtra
?.
pic
YDLMusicHelper
.
name
=
courPlayBean
?.
courseExtra
?.
doctorName
// if (YDLMusicHelper.isCoursePlaying()) {
// YDLMusicHelper.cover = courPlayBean?.courseExtra?.pic
// YDLMusicHelper.name = courPlayBean?.courseExtra?.doctorName
// }
if
(
AudioPlayer
.
get
().
isPlaying
&&
PlayerFloatHelper
.
playingType
==
PlayTypeEnum
.
PLAY_TYPE_COURSE
)
{
AudioPlayer
.
get
().
playMusic
?.
coverPath
=
courPlayBean
?.
courseExtra
?.
pic
AudioPlayer
.
get
().
playMusic
?.
artist
=
courPlayBean
?.
courseExtra
?.
doctorName
}
}
else
{
if
(
videoView
?.
onBackPressed
()
==
true
)
{
return
false
...
...
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewAudio.kt
View file @
1e8f36a5
...
...
@@ -8,6 +8,7 @@ import com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxNetTool
import
com.yidianling.course.bean.CourseExtraBean
import
com.yidianling.course.bean.CourseMediaBean
import
com.yidianling.course.widget.HPlayView
import
com.yidianling.ydlcommon.bean.CourseExtraBean
import
com.yidianling.ydlcommon.bean.CourseMediaBean
import
com.yidianling.ydlcommon.dialog.CommonDialog
...
...
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewVideo.kt
View file @
1e8f36a5
...
...
@@ -8,6 +8,9 @@ import android.view.View
import
android.widget.RelativeLayout
import
com.dou361.ijkplayer.widget.PlayStateParams
import
com.dou361.ijkplayer.widget.PlayerView
import
com.ydl.media.audio.utils.PlayProgressUtil
import
com.ydl.media.view.PlayTypeEnum
import
com.ydl.media.view.PlayerFloatHelper
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.yidianling.course.R
...
...
@@ -52,7 +55,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
@SuppressLint
(
"InvalidWakeLockTag"
)
private
constructor
(
context
:
CoursePlayActivity
,
playMoudle
:
Int
)
:
super
(
context
)
{
this
.
playMoudle
=
playMoudle
View
.
inflate
(
context
,
R
.
layout
.
view_course_play_item
,
this
)
View
.
inflate
(
context
,
R
.
layout
.
course_
view_course_play_item
,
this
)
activity
=
context
initView
()
...
...
@@ -77,7 +80,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
if
(
isVideoPlaying
)
{
var
time
=
activity
?.
videoView
?.
currentPosition
?:
0
if
(
time
<
3000
)
return
UtilH
.
saveProgress
(
context
,
videoUrl
,
time
)
PlayProgressUtil
.
saveProgress
(
context
,
videoUrl
,
time
)
}
}
},
1000
,
1000
)
...
...
@@ -104,7 +107,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
wakeLock
!!
.
acquire
()
}
activity
?.
videoView
?.
onResume
()
var
hisTime1
=
UtilH
.
getProgress
(
context
,
videoUrl
)
var
hisTime1
=
PlayProgressUtil
.
getProgress
(
context
,
videoUrl
)
activity
?.
videoView
?.
seekTo
(
hisTime1
)
}
...
...
@@ -149,14 +152,15 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
}
}
if
(
canPlay
)
{
YDLMusicHelper
.
playingType
=
YDLMusicHelper
.
PLAY_TYPE_COURSE
PlayerFloatHelper
.
playingType
=
PlayTypeEnum
.
PLAY_TYPE_COURSE
var
url
=
playList
[
index
].
url
url
=
url
.
replace
(
"https"
,
"http"
)
videoUrl
=
url
var
hisTime
=
UtilH
.
getProgress
(
context
,
url
)
var
hisTime
=
PlayProgressUtil
.
getProgress
(
context
,
url
)
try
{
activity
?.
videoView
=
PlayerView
(
activity
)
.
setScaleType
(
PlayStateParams
.
fitparent
)
...
...
@@ -194,7 +198,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
if
(
what
==
PlayStateParams
.
STATE_COMPLETED
)
{
isVideoPlaying
=
false
UtilH
.
saveProgress
(
this
@CoursePlayItemViewVideo
.
activity
,
videoUrl
,
0
)
PlayProgressUtil
.
saveProgress
(
this
@CoursePlayItemViewVideo
.
activity
,
videoUrl
,
0
)
if
(
playList
.
size
-
1
>
this
@CoursePlayItemViewVideo
.
index
)
{
//播放下一曲
play
(
this
@CoursePlayItemViewVideo
.
index
+
1
)
...
...
m-course/src/main/java/com/yidianling/course/courseSearch/CourseSearchActicity.kt
View file @
1e8f36a5
package
com.yidianling.course.courseSearch
import
android.annotation.SuppressLint
import
android.support.v7.widget.LinearLayoutManager
import
android.text.TextUtils
import
android.util.Log
...
...
@@ -7,22 +8,22 @@ import android.view.View
import
android.view.WindowManager
import
android.widget.ImageView
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.ydl.base_module.ui.searchbarview.SearchBarView
import
com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import
com.ydl.ydl_image.manager.YDLImageCacheManager
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.bean.ShareData
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.course.CourseConstants
import
com.yidianling.course.R
import
com.yidianling.course.coursePlay.moudle.Course
import
com.yidianling.course.courseSearch.http.CourseSearchApiUtils
import
com.yidianling.course.courseSearch.view.ICourseSearchView
import
com.yidianling.ydlcommon.base.BaseActivity
import
com.yidianling.ydlcommon.data.ShareData
import
com.yidianling.ydlcommon.h5.H5Params
import
com.yidianling.ydlcommon.h5.NewH5Activity
import
com.yidianling.ydlcommon.http.ThrowableConsumer
import
com.yidianling.ydlcommon.router.IYDLRouterConstant
import
com.yidianling.course.widget.SearchBarView
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Consumer
import
io.reactivex.schedulers.Schedulers
...
...
@@ -153,7 +154,7 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
override
fun
onItemClickEvent
(
position
:
Int
)
{
var
courseItem
=
courseList
[
position
]
if
(
null
!=
courseItem
)
{
val
h5Params
=
H5Params
(
CourseConstants
.
COURSE_DETAIL_H5
+
courseItem
.
id
,
this
.
getString
(
R
.
string
.
course_detail
)
)
val
h5Params
=
H5Params
(
CourseConstants
.
COURSE_DETAIL_H5
+
courseItem
.
id
,
"课程详情"
)
if
(
null
!=
courseItem
.
share
&&
!
TextUtils
.
isEmpty
(
courseItem
.
share
.
share_url
))
{
val
shareData
=
ShareData
(
courseItem
.
share
.
share_url
,
courseItem
.
share
.
title
,
courseItem
.
share
.
cover
,
courseItem
.
share
.
desc
)
h5Params
.
shareData
=
shareData
...
...
@@ -170,8 +171,8 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
val
sp
=
SimpleImageOpConfiger
()
sp
.
heigt
=
height
sp
.
width
=
width
sp
.
errorPic
=
R
.
drawable
.
default_img
sp
.
loadingPic
=
R
.
drawable
.
default_img
sp
.
errorPic
=
R
.
drawable
.
course_
default_img
sp
.
loadingPic
=
R
.
drawable
.
course_
default_img
YDLImageCacheManager
.
showImage
(
CourseSearchActicity
@
this
,
url
,
imageView
,
sp
)
}
...
...
@@ -179,6 +180,7 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
* 根据输入搜索专家课程
* type true代表首次加载,false代表加载下一页
*/
@SuppressLint
(
"CheckResult"
)
fun
loadCourseList
(
type
:
Boolean
)
{
if
(
TextUtils
.
isEmpty
(
inputString
))
{
activity_course_search_swipe_refresh_layout
.
isRefreshing
=
false
...
...
@@ -234,7 +236,7 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
if
(!
TextUtils
.
isEmpty
(
desc
))
activity_course_search_unusual_layout_desc
.
text
=
desc
activity_course_search_unusual_layout
.
visibility
=
View
.
VISIBLE
activity_course_search_recycler
.
visibility
=
View
.
GONE
iv_empty
.
setImageResource
(
if
(
isEmpty
)
R
.
drawable
.
ico_img_zixun_empty
else
R
.
drawable
.
blank
)
iv_empty
.
setImageResource
(
if
(
isEmpty
)
R
.
drawable
.
course_ico_img_zixun_empty
else
R
.
drawable
.
course_
blank
)
}
/**
...
...
m-course/src/main/java/com/yidianling/course/courseSearch/http/CourseSearchApiUtils.kt
View file @
1e8f36a5
package
com.yidianling.course.courseSearch.http
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.course.coursePlay.common.net.NetApiStore
import
com.yidianling.course.courseSearch.CourseSearchBean
import
com.yidianling.ydlcommon.http.BaseAPIResponse
import
com.yidianling.ydlcommon.http.BaseResponse
import
com.yidianling.ydlcommon.http.YdlRetrofitUtils
import
io.reactivex.Observable
/**
...
...
@@ -20,8 +20,7 @@ class CourseSearchApiUtils {
* 专家课程搜索列表
*/
fun
courseSearchList
(
page
:
Int
,
keyWord
:
String
)
:
Observable
<
BaseAPIResponse
<
CourseSearchBean
>>
{
return
YdlRetrofitUtils
.
getRxRetrofit
().
newBuilder
().
baseUrl
(
YdlRetrofitUtils
.
SERVER_API_JAVA_URL
).
build
()
.
create
(
CourseSearchListApi
::
class
.
java
).
courseSearchList
(
page
,
keyWord
)
return
YDLHttpUtils
.
obtainApi
(
CourseSearchListApi
::
class
.
java
).
courseSearchList
(
page
,
keyWord
)
}
}
...
...
m-course/src/main/java/com/yidianling/course/courseSearch/http/CourseSearchListApi.kt
View file @
1e8f36a5
package
com.yidianling.course.courseSearch.http
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.yidianling.course.courseSearch.CourseSearchBean
import
com.yidianling.ydlcommon.http.BaseAPIResponse
import
io.reactivex.Observable
import
retrofit2.http.*
...
...
m-course/src/main/java/com/yidianling/course/courseSearch/http/ICourseSearchListHttp.kt
View file @
1e8f36a5
package
com.yidianling.course.courseSearch.http
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.yidianling.course.courseSearch.CourseSearchBean
import
com.yidianling.ydlcommon.http.BaseAPIResponse
import
com.yidianling.ydlcommon.http.BaseResponse
import
io.reactivex.Observable
/**
...
...
m-course/src/main/java/com/yidianling/course/course_special_list/presenter/CourseSpecialListPresenterImpl.kt
View file @
1e8f36a5
...
...
@@ -3,13 +3,12 @@ package com.yidianling.course.course_special_list.presenter
import
com.google.gson.Gson
import
com.google.gson.reflect.TypeToken
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.yidianling.common.tools.RxNetTool
import
com.yidianling.course.course_special_list.bean.CourseSpecialItemBean
import
com.yidianling.course.course_special_list.contract.ICourseSpecialListContract
import
com.yidianling.course.course_special_list.http.CourseSpecialListParam
import
com.yidianling.course.course_special_list.model.CourseSpecialListModelImpl
import
com.yidianling.ydlcommon.http.ThrowableConsumer
import
com.yidianling.ydlcommon.mvp.RxPresenter
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Consumer
import
io.reactivex.schedulers.Schedulers
...
...
@@ -22,17 +21,9 @@ import io.reactivex.schedulers.Schedulers
* @date 2018/9/18
*/
class
CourseSpecialListPresenterImpl
(
var
view
:
ICourseSpecialListContract
.
View
)
:
ICourseSpecialListContract
.
Presenter
{
override
fun
attachView
(
view
:
ICourseSpecialListContract
.
View
)
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
override
fun
detachView
()
{
TODO
(
"not implemented"
)
//To change body of crea ted functions use File | Settings | File Templates.
}
override
fun
destroy
()
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
BasePresenter
<
ICourseSpecialListContract
.
View
,
ICourseSpecialListContract
.
Model
>(),
ICourseSpecialListContract
.
Presenter
{
override
fun
createModel
():
ICourseSpecialListContract
.
Model
{
return
CourseSpecialListModelImpl
()
}
/**
...
...
@@ -77,7 +68,7 @@ class CourseSpecialListPresenterImpl (var view: ICourseSpecialListContract.View)
* @param loadMore 是否为上拉加载更多
*/
private
fun
requestList
(
page
:
Int
,
loadMore
:
Boolean
){
val
disposable
=
model
.
specialListRequest
(
CourseSpecialListParam
(
page
,
0
))
val
disposable
=
m
M
odel
.
specialListRequest
(
CourseSpecialListParam
(
page
,
0
))
.
subscribeOn
(
Schedulers
.
io
())
.
map
{
it
}
.
filter
{
it
!=
null
}
...
...
m-course/src/main/java/com/yidianling/course/widget/HPlayView.kt
0 → 100644
View file @
1e8f36a5
package
com.yidianling.course.widget
import
android.app.Activity
import
android.os.Handler
import
android.view.View
import
android.widget.RelativeLayout
import
android.widget.SeekBar
import
com.bumptech.glide.Glide
import
com.yidianling.course.R
import
kotlinx.android.synthetic.main.course_play_music_view.view.*
/**
* Created by hgw on 2018/4/28.
*/
class
HPlayView
:
RelativeLayout
,
YDLMusicPlayer
.
MusicControlTaker
{
var
control
:
HMusicPlayService
.
MusicController
?
=
null
var
listener
:
HPlayStatusListener
?
=
null
var
mHandler
:
Handler
?
=
null
//seekBar 按下标记
var
seekBarIsDown
=
false
var
progress
=
0
var
mContext
:
Activity
?
=
null
constructor
(
context1
:
Activity
?)
:
super
(
context1
)
{
this
.
mContext
=
context1
mHandler
=
Handler
()
init
()
}
fun
init
()
{
if
(
mContext
==
null
)
return
YDLMusicPlayer
.
getInstance
().
setMusicControlTaker
(
this
)
View
.
inflate
(
context
,
R
.
layout
.
course_play_music_view
,
this
)
play_icon
.
setOnClickListener
{
if
(
control
?.
isPlaying
()
==
true
)
{
control
?.
pause
()
}
else
{
control
?.
start
()
}
}
img_gif
.
setOnClickListener
{
if
(
control
?.
isPlaying
()
==
false
)
{
control
?.
start
()
}
}
pro_progress
.
setOnSeekBarChangeListener
(
object
:
SeekBar
.
OnSeekBarChangeListener
{
override
fun
onProgressChanged
(
p0
:
SeekBar
?,
p1
:
Int
,
p2
:
Boolean
)
{
if
(
p2
)
{
text_start_time
.
text
=
getStringTime
(
p1
)
progress
=
p1
}
}
override
fun
onStartTrackingTouch
(
p0
:
SeekBar
?)
{
seekBarIsDown
=
true
}
override
fun
onStopTrackingTouch
(
p0
:
SeekBar
?)
{
seekBarIsDown
=
false
//拖动seekbar时不进行以下操作
if
(!
seekBarIsDown
)
{
control
?.
seekTo
(
progress
)
}
}
})
}
fun
showNetNotice
(
event
:
()
->
Unit
)
{
ll_net_notice
.
visibility
=
View
.
VISIBLE
img_gif
.
visibility
=
View
.
GONE
iv_net_notice
.
setOnClickListener
{
hideNetNotice
()
event
()
}
}
fun
hideNetNotice
()
{
ll_net_notice
.
visibility
=
View
.
GONE
img_gif
.
visibility
=
View
.
VISIBLE
}
fun
setData
(
urlLi
:
ArrayList
<
MusicInfoBean
>):
HPlayView
{
control
?.
setData
(
urlLi
)
return
this
}
/**
* 后台进入前台view
*/
fun
updateView
(
index
:
Int
)
{
if
(
control
?.
isPlaying
()
!!
)
{
mHandler
?.
postDelayed
({
pro_progress
.
max
=
control
?.
getDuration
()
?:
0
text_end_time
.
text
=
getStringTime
(
pro_progress
.
max
)
listener
?.
onPrepared
(
control
?.
getCurrentData
(),
index
)
},
0
)
updateButton
()
}
}
/**
* 获取当前播放下标
*/
fun
getCurrentIndex
():
Int
{
return
control
?.
getCurrentIndex
()
?:
0
}
/**
* 获取当前播放url
*/
fun
getCurrentUrl
():
String
{
return
control
?.
getCurrentUrl
()
?:
""
}
fun
play
(
index
:
Int
)
{
updateButton
()
YDLMusicHelper
.
playingType
=
YDLMusicHelper
.
PLAY_TYPE_COURSE
YDLMusicHelper
.
directPlay
(
index
,
true
)
}
fun
setImageBackground
(
url
:
String
?)
{
Glide
.
with
(
mContext
).
load
(
url
).
into
(
img_bg
)
}
/**
* 获取播放控制器
*/
fun
getPlayControl
():
HMusicPlayService
.
MusicController
?
{
return
control
}
/**
* 设置自动播放下一曲
*/
fun
setAutoNext
(
auto
:
Boolean
)
{
control
?.
setAutoPlayNext
(
auto
)
}
override
fun
onReceiveControl
(
control
:
HMusicPlayService
.
MusicController
)
{
this
.
control
=
control
setControl1
(
control
)
}
var
playStatusListener
:
PlayStatusListener
?
=
null
private
fun
setControl1
(
control
:
HMusicPlayService
.
MusicController
?)
{
control
?.
setOpenNotifyCation
(
true
)
if
(
playStatusListener
==
null
)
{
playStatusListener
=
object
:
PlayStatusListener
{
override
fun
beforeStart
(
index
:
Int
)
{
showBufferLoading
(
true
)
}
override
fun
onCompletionListener
()
{
// LogH.d("onCompletionListener")
updateButton
()
}
override
fun
loading
()
{
// LogH.d("loading")
showBufferLoading
(
true
)
}
override
fun
onPrepared
()
{
// LogH.d("onPrepared")
mHandler
?.
postDelayed
({
pro_progress
.
max
=
control
?.
getDuration
()
?:
0
text_end_time
.
text
=
getStringTime
(
pro_progress
.
max
)
listener
?.
onPrepared
(
control
?.
getCurrentData
(),
control
?.
getCurrentIndex
()
?:
0
)
},
0
)
}
override
fun
start
()
{
// LogH.d("start")
setGifVisibity
(
true
)
}
override
fun
pause
()
{
// LogH.d("pause")
setGifVisibity
(
false
)
}
override
fun
onProgressUpdate
(
progress
:
Int
)
{
mHandler
?.
postDelayed
({
//拖动seekbar时不进行以下操作
if
(!
seekBarIsDown
)
{
pro_progress
.
progress
=
progress
text_start_time
.
text
=
getStringTime
(
progress
)
}
},
0
)
}
override
fun
OnErrorListener
(
p1
:
Int
,
p2
:
String
)
{
// LogH.d("OnErrorListener:$p1 $p2")
setGifVisibity
(
false
)
}
override
fun
OnBufferingUpdateListener
(
p1
:
Int
)
{
// LogH.d("OnBufferingUpdateListener:$p1")
mHandler
?.
postDelayed
({
pro_progress
.
secondaryProgress
=
p1
*
pro_progress
.
max
/
100
},
0
)
}
}
YDLMusicPlayer
.
getInstance
().
addListener
(
playStatusListener
!!
)
}
}
fun
showBufferLoading
(
show
:
Boolean
)
{
mHandler
?.
postDelayed
({
if
(
show
)
{
if
(
mContext
!=
null
)
{
Glide
.
with
(
mContext
).
asGif
().
load
(
R
.
mipmap
.
loading5
).
into
(
img_gif
)
}
play_icon
.
setImageResource
(
R
.
drawable
.
ico_course_play
)
}
else
{
if
(
mContext
!=
null
)
{
Glide
.
with
(
mContext
).
asGif
().
load
(
R
.
mipmap
.
audio_play
).
into
(
img_gif
)
}
play_icon
.
setImageResource
(
R
.
drawable
.
ico_course_pause
)
}
},
0
)
}
//显示或隐藏播放动画
fun
setGifVisibity
(
show
:
Boolean
)
{
if
(
context
==
null
)
return
mHandler
?.
postDelayed
({
if
(
show
)
{
if
(
mContext
!=
null
)
{
Glide
.
with
(
mContext
).
asGif
().
load
(
R
.
mipmap
.
audio_play
).
into
(
img_gif
)
}
play_icon
.
setImageResource
(
R
.
drawable
.
ico_course_pause
)
}
else
{
if
(
mContext
!=
null
)
{
Glide
.
with
(
mContext
).
asBitmap
().
load
(
R
.
drawable
.
ico_course_bg_pause
).
into
(
img_gif
)
}
play_icon
.
setImageResource
(
R
.
drawable
.
ico_course_play
)
}
},
0
)
}
//跟新上下音频按钮状态
fun
updateButton
()
{
mHandler
?.
postDelayed
({
if
(
control
?.
isPlaying
()
==
true
)
{
setGifVisibity
(
true
)
}
},
0
)
}
fun
getStringTime
(
time
:
Int
):
String
{
if
(
time
<=
0
)
return
"00:00"
var
min
=
time
/
60000
var
ss
=
(
time
-
min
*
60000
)
/
1000
var
mm
=
""
+
min
var
SS
=
""
+
ss
if
(
min
<
10
)
{
mm
=
"0$mm"
}
if
(
ss
<
10
)
{
SS
=
"0$ss"
}
return
"$mm:$SS"
}
fun
onDestroy
()
{
mContext
=
null
mHandler
=
null
playStatusListener
?.
let
{
YDLMusicPlayer
.
getInstance
().
removeListener
(
it
)
}
}
}
\ No newline at end of file
m-course/src/main/res/drawable-xhdpi/blank.png
deleted
100644 → 0
View file @
e4369ba4
5.43 KB
m-course/src/main/res/drawable-xhdpi/course_default_img.png
0 → 100644
View file @
1e8f36a5
102 Bytes
m-course/src/main/res/drawable-xhdpi/course_ico_course_play.png
0 → 100644
View file @
1e8f36a5
580 Bytes
m-course/src/main/res/drawable-xhdpi/course_ico_img_zixun_empty.png
0 → 100644
View file @
1e8f36a5
31 KB
m-course/src/main/res/drawable-xhdpi/course_ico_play_float_full.png
0 → 100644
View file @
1e8f36a5
509 Bytes
m-course/src/main/res/drawable/course_audio_play.gif
0 → 100644
View file @
1e8f36a5
25 KB
m-course/src/main/res/drawable/course_dot_seekbar.xml
0 → 100644
View file @
1e8f36a5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"oval"
>
<size
android:width=
"17dp"
android:height=
"17dp"
/>
<stroke
android:color=
"@color/white"
android:width=
"6dp"
/>
<solid
android:color=
"@color/color_FFDB26"
/>
</shape>
\ No newline at end of file
m-course/src/main/res/drawable/course_layer_progress.xml
0 → 100644
View file @
1e8f36a5
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@android:id/background"
>
<shape>
<corners
android:radius=
"3dp"
/>
<solid
android:color=
"#C6CACE"
/>
</shape>
</item>
<item
android:id=
"@android:id/secondaryProgress"
>
<clip>
<shape>
<corners
android:radius=
"3dp"
/>
<solid
android:color=
"#ECF0F1"
/>
</shape>
</clip>
</item>
<item
android:id=
"@android:id/progress"
>
<clip>
<shape>
<corners
android:radius=
"3dp"
/>
<solid
android:color=
"@color/color_FFDB26"
/>
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
m-course/src/main/res/drawable/course_video_bottom_background.xml
0 → 100644
View file @
1e8f36a5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<gradient
android:angle=
"270"
android:endColor=
"#99000000"
android:startColor=
"#00000000"
/>
</shape>
\ No newline at end of file
m-course/src/main/res/layout/activity_course.xml
View file @
1e8f36a5
...
...
@@ -24,7 +24,7 @@
android:layout_centerVertical=
"true"
android:paddingLeft=
"15dp"
android:paddingRight=
"10dp"
android:src=
"@drawable/toolbar_back"
/>
android:src=
"@drawable/
course_
toolbar_back"
/>
<TextView
android:id=
"@+id/tv_title"
...
...
@@ -43,7 +43,7 @@
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/toolbar_back"
android:src=
"@drawable/
course_
toolbar_back"
android:text=
"我的课程"
android:textColor=
"@color/right_text_color"
/>
</RelativeLayout>
...
...
m-course/src/main/res/layout/activity_course_commeny.xml
View file @
1e8f36a5
...
...
@@ -13,7 +13,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"19dp"
android:src=
"@drawable/toolbar_back"
android:src=
"@drawable/
course_
toolbar_back"
app:layout_constraintBottom_toBottomOf=
"@+id/tv_title"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/tv_title"
/>
...
...
m-course/src/main/res/layout/activity_course_poster.xml
View file @
1e8f36a5
...
...
@@ -12,7 +12,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingLeft=
"15dp"
android:src=
"@drawable/toolbar_back"
android:src=
"@drawable/
course_
toolbar_back"
app:layout_constraintBottom_toBottomOf=
"@+id/tv_title"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/tv_title"
/>
...
...
m-course/src/main/res/layout/activity_course_search.xml
0 → 100644
View file @
1e8f36a5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<!--<include-->
<!--layout="@layout/base_module_title_bar"/>-->
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"44dp"
android:background=
"@color/color_FFFFFF"
android:gravity=
"center"
android:orientation=
"horizontal"
android:paddingLeft=
"15dp"
>
<ImageView
android:id=
"@+id/activity_course_back_btn"
android:layout_width=
"13dp"
android:layout_height=
"22dp"
android:src=
"@drawable/course_toolbar_back"
android:visibility=
"gone"
/>
<com.yidianling.course.widget.SearchBarView
android:id=
"@+id/activity_course_search_search_bar_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:id=
"@+id/activity_course_search_unusual_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_FFFFFF"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:visibility=
"invisible"
>
<ImageView
android:id=
"@+id/iv_empty"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"51dp"
android:src=
"@drawable/course_blank"
/>
<TextView
android:id=
"@+id/activity_course_search_unusual_layout_desc"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"18dp"
android:textColor=
"@color/color_ACACAC"
/>
</LinearLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id=
"@+id/activity_course_search_swipe_refresh_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/activity_course_search_recycler"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:visibility=
"invisible"
/>
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
m-course/src/main/res/layout/course_play_music_view.xml
0 → 100644
View file @
1e8f36a5
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"211dp"
android:orientation=
"vertical"
>
<RelativeLayout
android:id=
"@+id/rela_play"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/img_bg"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:scaleType=
"centerCrop"
tools:background=
"@color/main_theme"
/>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:alpha=
"0.5"
android:background=
"@color/black"
android:scaleType=
"fitXY"
/>
<ImageView
android:id=
"@+id/img_gif"
android:layout_width=
"80dp"
android:layout_height=
"40dp"
android:layout_centerInParent=
"true"
android:src=
"@drawable/course_audio_play"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_alignParentBottom=
"true"
android:layout_marginBottom=
"15dp"
>
<ImageView
android:id=
"@+id/play_icon"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"3dp"
android:padding=
"14dp"
android:scaleType=
"centerCrop"
android:src=
"@drawable/course_ico_course_play"
/>
<SeekBar
android:id=
"@+id/pro_progress"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"-3dp"
android:layout_toLeftOf=
"@+id/text_start_time"
android:layout_toRightOf=
"@+id/play_icon"
android:maxHeight=
"2dp"
android:minHeight=
"2dp"
android:progressDrawable=
"@drawable/course_layer_progress"
android:thumb=
"@drawable/course_dot_seekbar"
tools:progress=
"0"
/>
<TextView
android:id=
"@+id/text_start_time"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_centerVertical=
"true"
android:layout_toLeftOf=
"@+id/tv_line"
android:gravity=
"center"
android:text=
"00:00"
android:textColor=
"@color/white"
android:textSize=
"11sp"
/>
<TextView
android:id=
"@+id/tv_line"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_centerVertical=
"true"
android:layout_toLeftOf=
"@+id/text_end_time"
android:gravity=
"center"
android:paddingLeft=
"2dp"
android:paddingRight=
"2dp"
android:text=
"/"
android:textColor=
"@color/white"
android:textSize=
"11sp"
/>
<TextView
android:id=
"@+id/text_end_time"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_alignParentRight=
"true"
android:layout_marginRight=
"15dp"
android:gravity=
"center"
android:text=
"00:00"
android:textColor=
"@color/white"
android:textSize=
"11sp"
/>
</RelativeLayout>
<!-- 网络提示-->
<LinearLayout
android:id=
"@+id/ll_net_notice"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#33000000"
android:clickable=
"true"
android:gravity=
"center"
android:orientation=
"vertical"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:gravity=
"center"
android:paddingLeft=
"8dp"
android:paddingRight=
"8dp"
android:text=
"正在使用非Wi-Fi网络,播放将产生流量费用"
android:textColor=
"@android:color/white"
android:textSize=
"14sp"
/>
<ImageView
android:id=
"@+id/iv_net_notice"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:src=
"@drawable/ico_spfc_play"
/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
m-course/src/main/res/layout/course_videoplay_view.xml
0 → 100644
View file @
1e8f36a5
This diff is collapsed.
Click to expand it.
m-course/src/main/res/layout/course_view_course_play_item.xml
0 → 100644
View file @
1e8f36a5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<include
layout=
"@layout/course_videoplay_view"
android:layout_width=
"match_parent"
android:layout_height=
"211dp"
/>
</LinearLayout>
\ No newline at end of file
m-course/src/main/res/layout/fragment_course_list.xml
View file @
1e8f36a5
...
...
@@ -25,7 +25,7 @@
android:id=
"@+id/iv_course_list_empty_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/blank"
android:src=
"@drawable/
course_
blank"
android:visibility=
"gone"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"50dp"
/>
...
...
m-course/src/main/res/layout/layout_title_bar.xml
View file @
1e8f36a5
...
...
@@ -12,7 +12,7 @@
android:layout_centerVertical=
"true"
android:paddingLeft=
"15dp"
android:paddingRight=
"10dp"
android:src=
"@drawable/toolbar_back"
/>
android:src=
"@drawable/
course_
toolbar_back"
/>
<TextView
android:id=
"@+id/tv_title"
...
...
m-course/src/main/res/values/colors.xml
View file @
1e8f36a5
...
...
@@ -128,4 +128,6 @@
<color
name=
"color_99000000"
>
#99000000
</color>
<color
name=
"color_30FFFFFF"
>
#4DFFFFFF
</color>
<color
name=
"color_66000000"
>
#66000000
</color>
<color
name=
"color_FFFFFF"
>
#FFFFFF
</color>
<color
name=
"color_ACACAC"
>
#ACACAC
</color>
</resources>
\ No newline at end of file
m-course/src/xlzx/res/drawable-xhdpi/toolbar_back.png
→
m-course/src/xlzx/res/drawable-xhdpi/
course_
toolbar_back.png
View file @
1e8f36a5
File moved
m-course/src/ydl/res/drawable-xhdpi/toolbar_back.png
→
m-course/src/ydl/res/drawable-xhdpi/
course_
toolbar_back.png
View file @
1e8f36a5
File moved
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/BIConstants.kt
View file @
1e8f36a5
This diff is collapsed.
Click to expand it.
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