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
36c2dd67
Commit
36c2dd67
authored
Nov 20, 2019
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课程\fm
parent
5892c62e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
52 deletions
+67
-52
CoursePlayItemViewVideo.kt
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewVideo.kt
+2
-1
CourseSearchActicity.kt
m-course/src/main/java/com/yidianling/course/courseSearch/CourseSearchActicity.kt
+65
-51
No files found.
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewVideo.kt
View file @
36c2dd67
...
@@ -12,6 +12,7 @@ import com.ydl.media.audio.utils.PlayProgressUtil
...
@@ -12,6 +12,7 @@ import com.ydl.media.audio.utils.PlayProgressUtil
import
com.ydl.media.view.PlayTypeEnum
import
com.ydl.media.view.PlayTypeEnum
import
com.ydl.media.view.PlayerFloatHelper
import
com.ydl.media.view.PlayerFloatHelper
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.yidianling.course.R
import
com.yidianling.course.R
import
com.yidianling.course.bean.CourseExtraBean
import
com.yidianling.course.bean.CourseExtraBean
...
@@ -173,7 +174,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
...
@@ -173,7 +174,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
.
forbidTouch
(
false
)
.
forbidTouch
(
false
)
.
setOnInfoListener
(
object
:
IMediaPlayer
.
OnInfoListener
{
.
setOnInfoListener
(
object
:
IMediaPlayer
.
OnInfoListener
{
override
fun
onInfo
(
mp
:
IMediaPlayer
,
what
:
Int
,
extra
:
Int
):
Boolean
{
override
fun
onInfo
(
mp
:
IMediaPlayer
,
what
:
Int
,
extra
:
Int
):
Boolean
{
LogUtil
.
e
(
"课程播放--状态-$what"
)
if
(
what
==
PlayStateParams
.
STATE_PAUSED
)
{
if
(
what
==
PlayStateParams
.
STATE_PAUSED
)
{
this
@CoursePlayItemViewVideo
.
findViewById
<
View
>(
R
.
id
.
rl_play_pause_layout
).
visibility
=
View
.
VISIBLE
this
@CoursePlayItemViewVideo
.
findViewById
<
View
>(
R
.
id
.
rl_play_pause_layout
).
visibility
=
View
.
VISIBLE
}
else
{
}
else
{
...
...
m-course/src/main/java/com/yidianling/course/courseSearch/CourseSearchActicity.kt
View file @
36c2dd67
...
@@ -97,23 +97,26 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
...
@@ -97,23 +97,26 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
private
fun
initSearchBar
()
{
private
fun
initSearchBar
()
{
window
.
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_VISIBLE
)
window
.
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_VISIBLE
)
activity_course_search_search_bar_view
.
initBarType
(
SearchBarView
.
ENABLE_INPUT
,
object
:
SearchBarView
.
SearchCallBack
{
activity_course_search_search_bar_view
.
initBarType
(
override
fun
cloase
()
{
SearchBarView
.
ENABLE_INPUT
,
finish
()
object
:
SearchBarView
.
SearchCallBack
{
}
override
fun
cloase
()
{
finish
()
}
override
fun
clickSearchBtn
(
str
:
String
)
{
override
fun
clickSearchBtn
(
str
:
String
)
{
inputString
=
str
inputString
=
str
if
(
TextUtils
.
isEmpty
(
str
))
{
if
(
TextUtils
.
isEmpty
(
str
))
{
// showUnusualView("请输入要搜索的内容")
// showUnusualView("请输入要搜索的内容")
ToastUtil
.
toastShort
(
"请输入要搜索的内容"
)
ToastUtil
.
toastShort
(
"请输入要搜索的内容"
)
return
return
}
loadCourseList
(
true
)
}
}
loadCourseList
(
true
)
})
}
activity_course_search_search_bar_view
.
postDelayed
({
})
RxKeyboardTool
.
showSoftInput
(
this
,
activity_course_search_search_bar_view
.
getEditText
())
},
500
)
RxKeyboardTool
.
showSoftInput
(
this
,)
}
}
/**
/**
...
@@ -130,23 +133,29 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
...
@@ -130,23 +133,29 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
*/
*/
private
fun
initRecyclerView
()
{
private
fun
initRecyclerView
()
{
if
(
null
==
courseSearchAdapterWrapper
)
{
if
(
null
==
courseSearchAdapterWrapper
)
{
courseSearchAdapter
=
CourseSearchAdapter
(
this
,
CourseSearchActicity
@
this
,
courseList
!!
)
courseSearchAdapter
=
CourseSearchAdapter
(
this
,
CourseSearchActicity
@
this
,
courseList
!!
)
courseSearchAdapter
!!
.
setOnItemClickListener
(
this
)
courseSearchAdapter
!!
.
setOnItemClickListener
(
this
)
activity_course_search_recycler
.
layoutManager
=
LinearLayoutManager
(
this
)
activity_course_search_recycler
.
layoutManager
=
LinearLayoutManager
(
this
)
courseSearchAdapterWrapper
=
CourseSearchAdapterWrapper
(
courseSearchAdapterWrapper
=
CourseSearchAdapterWrapper
(
this
,
this
,
courseSearchAdapter
!!
,
courseSearchAdapter
!!
,
20
,
20
,
activity_course_search_recycler
)
activity_course_search_recycler
.
setOnLoadMoreListener
(
object
:
CourseSearchAdapterWrapper
.
OnLoadMoreListener
{
)
override
fun
onLoadMore
()
{
.
setOnLoadMoreListener
(
object
:
CourseSearchAdapterWrapper
.
OnLoadMoreListener
{
loadCourseList
(
false
)
override
fun
onLoadMore
()
{
}
loadCourseList
(
false
)
})
}
})
activity_course_search_recycler
.
adapter
=
courseSearchAdapterWrapper
activity_course_search_recycler
.
adapter
=
courseSearchAdapterWrapper
//滑动监听 图片是否加载
//滑动监听 图片是否加载
activity_course_search_recycler
.
addOnScrollListener
(
YDLImageRecyclerOnScrollListener
(
CourseSearchActicity
@
this
))
activity_course_search_recycler
.
addOnScrollListener
(
YDLImageRecyclerOnScrollListener
(
CourseSearchActicity
@
this
)
)
loadCourseList
(
true
)
loadCourseList
(
true
)
}
}
}
}
...
@@ -159,7 +168,12 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
...
@@ -159,7 +168,12 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
if
(
null
!=
courseItem
)
{
if
(
null
!=
courseItem
)
{
val
h5Params
=
H5Params
(
CourseConstants
.
COURSE_DETAIL_H5
+
courseItem
.
id
,
"课程详情"
)
val
h5Params
=
H5Params
(
CourseConstants
.
COURSE_DETAIL_H5
+
courseItem
.
id
,
"课程详情"
)
if
(
null
!=
courseItem
.
share
&&
!
TextUtils
.
isEmpty
(
courseItem
.
share
.
share_url
))
{
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
)
val
shareData
=
ShareData
(
courseItem
.
share
.
share_url
,
courseItem
.
share
.
title
,
courseItem
.
share
.
cover
,
courseItem
.
share
.
desc
)
h5Params
.
shareData
=
shareData
h5Params
.
shareData
=
shareData
}
}
...
@@ -203,36 +217,36 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
...
@@ -203,36 +217,36 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
}
}
CourseSearchApiUtils
.
courseSearchList
(
nowPage
,
inputString
)
CourseSearchApiUtils
.
courseSearchList
(
nowPage
,
inputString
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
Consumer
{
.
subscribe
(
Consumer
{
if
(
it
.
data
.
list
.
isNotEmpty
())
{
if
(
it
.
data
.
list
.
isNotEmpty
())
{
hideUnusualPage
()
hideUnusualPage
()
if
(
type
)
{
if
(
type
)
{
courseList
.
clear
()
courseList
.
clear
()
courseList
.
addAll
(
it
.
data
.
list
)
courseList
.
addAll
(
it
.
data
.
list
)
courseSearchAdapterWrapper
!!
.
notifyDataSetChanged
()
courseSearchAdapterWrapper
!!
.
notifyDataSetChanged
()
}
else
{
courseList
.
addAll
(
it
.
data
.
list
)
courseSearchAdapterWrapper
!!
.
insertData
()
}
}
else
{
}
else
{
if
(!
type
)
{
courseList
.
addAll
(
it
.
data
.
list
)
courseSearchAdapterWrapper
!!
.
noMoreData
()
courseSearchAdapterWrapper
!!
.
insertData
()
}
else
{
showUnusualView
(
"没有搜到相关信息,换个关键词看看吧"
,
true
)
}
}
}
}
else
{
if
(!
type
)
{
courseSearchAdapterWrapper
!!
.
noMoreData
()
}
else
{
showUnusualView
(
"没有搜到相关信息,换个关键词看看吧"
,
true
)
}
}
activity_course_search_swipe_refresh_layout
.
isRefreshing
=
false
},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
Log
.
i
(
"testtest"
,
msg
)
activity_course_search_swipe_refresh_layout
.
isRefreshing
=
false
activity_course_search_swipe_refresh_layout
.
isRefreshing
=
false
},
object
:
ThrowableConsumer
()
{
showUnusualView
(
"请检查你的网络设置"
,
false
)
override
fun
accept
(
msg
:
String
)
{
}
Log
.
i
(
"testtest"
,
msg
)
})
activity_course_search_swipe_refresh_layout
.
isRefreshing
=
false
showUnusualView
(
"请检查你的网络设置"
,
false
)
}
})
}
}
/**
/**
...
...
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