Commit 2fa9d499 by 严久程

课程\fm

parent f00a57bc
......@@ -44,7 +44,7 @@ ext {
//第三步 若干
"m-confide" : "0.0.18",
"m-consultant" : "0.0.25",
"m-course" : "0.0.11",
"m-course" : "0.0.13",
"m-fm" : "0.0.14",
"m-muse" : "0.0.10",
"m-tests" : "0.0.7",
......
......@@ -129,7 +129,6 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
search_view.setTextTitle("搜索")
init()
loadData()
initCouponHintView()
setClick()
......@@ -195,7 +194,8 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
NewH5Activity.start(this@CourseListContainerActivity, h5Params)
}
}
getData(false)
loadData()
}
/**
......@@ -225,6 +225,9 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
}
}
}
getData(false)
if (selectedCourseList.size > 0) {
classify_layout.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
classify_layout.setTextColor(
......@@ -536,6 +539,10 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
iv_course_list_empty_view.visibility = View.GONE
v_loading.visibility = View.GONE
} else {
if (adapter!!.count > 0) {
// hasMore = false
load_more_list_view_container.loadMoreFinish(false, false)
} else {
lv_content.visibility = View.GONE
tv_course_list_empty_prompt.visibility = View.VISIBLE
iv_course_list_empty_view.visibility = View.VISIBLE
......@@ -543,6 +550,7 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
tv_course_list_empty_prompt.text = "还没有相应的课程哦~"
v_loading.visibility = View.GONE
}
}
}, { throwable ->
v_loading.visibility = View.GONE
if (adapter!!.mDataList == null || adapter!!.mDataList.size <= 0) {
......
......@@ -497,7 +497,6 @@ class CoursePlayActivity : BaseActivity() {
}
fun showLoadingDialog() {
showProgressDialog(null)
}
......@@ -636,14 +635,11 @@ class CoursePlayActivity : BaseActivity() {
AudioPlayer.get().playMusic?.coverPath = courPlayBean?.courseExtra?.pic
AudioPlayer.get().playMusic?.artist = courPlayBean?.courseExtra?.doctorName
PlayerFloatHelper.playTempData.clear()
val hashMap = HashMap<String, String>()
hashMap["course_id"] = course_id.toString()
PlayerFloatHelper.playTempData.putAll(hashMap)
// PlayerFloatHelper.show(
// this,
// playTypeEnum = PlayTypeEnum.PLAY_TYPE_COURSE,
// playData = hashMap
// )
}
......@@ -655,14 +651,6 @@ class CoursePlayActivity : BaseActivity() {
var status = Utils.getValue(videoView, "status")
//视频课程正在播放中
if (status == PlayStateParams.STATE_PLAYING) {
//todo 视屏播放
// YDLMusicHelper.title = courPlayBean?.courseExtra?.title
// YDLMusicHelper.cover = courPlayBean?.courseExtra?.pic
// YDLMusicHelper.name = courPlayBean?.courseExtra?.doctorName
// YDLMusicHelper.isVideoPlaying = true
// YDLMusicHelper.playType = 1
// YDLMusicHelper.courseVideoUlr = (play_view as CoursePlayItemViewVideo).videoUrl
// YDLMusicHelper.course_id = courPlayBean?.courseExtra?.id!!.toInt()
VideoFloatHelper.setVideoInfo(
course_id.toString(),
......@@ -702,9 +690,9 @@ class CoursePlayActivity : BaseActivity() {
}
override fun onDestroy() {
super.onDestroy()
videoView?.onDestroy()
play_view?.onDestroy()
play_view = null
super.onDestroy()
}
}
......@@ -187,14 +187,7 @@ class CoursePlayItemViewAudio : RelativeLayout, PlayViewInterface {
}
override fun onDestroy() {
//释放播放器
if (AudioPlayer.get().isPlaying) {
playView?.onDestroy()
playView = null
AudioPlayer.get().stopPlayer()
} else {
playView?.onDestroy()
playView = null
}
}
}
\ No newline at end of file
......@@ -190,6 +190,7 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
if (demoType == 1) {
music.path = url
PlayerFloatHelper.playTempData.clear()
val hashMap = HashMap<String, String>()
hashMap["course_id"] = fileInfo["courseId"].toString()
AudioPlayer.get().singlePlay(music)
......
......@@ -3,6 +3,7 @@ package com.yidianling.course.lifeCallback
import android.app.Activity
import android.app.Application
import android.os.Bundle
import android.text.TextUtils
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.view.PlayTypeEnum
import com.ydl.media.view.PlayerFloatHelper
......@@ -26,8 +27,13 @@ class CoursePlayLifecycle : Application.ActivityLifecycleCallbacks {
AudioPlayer.get().stopPlayer()
} else {
PlayerFloatHelper.showIfPlaying(activity!!)
if (!TextUtils.isEmpty(PlayerFloatHelper.playTempData["course_id"])) {
PlayerFloatHelper.playingType = PlayTypeEnum.PLAY_TYPE_COURSE
}
if (!TextUtils.isEmpty(PlayerFloatHelper.playTempData["fmId"])) {
PlayerFloatHelper.playingType = PlayTypeEnum.PLAY_TYPE_FM
}
}
}
override fun onActivityStarted(activity: Activity?) {
......
......@@ -20,7 +20,6 @@ import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.actionutil.BIConstants
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.course.CourseConstants
......@@ -136,11 +135,18 @@ class CourseItemNewView : ConstraintLayout {
iv_play.setOnClickListener {
playMedia()
ActionCountUtils.count(CourseBIConstants.CourseListEvent.POSITION_COURSE_LIST_AUDITION_CLICK, course.id)
ActionCountUtils.count(
CourseBIConstants.CourseListEvent.POSITION_COURSE_LIST_AUDITION_CLICK,
course.id
)
}
tv_view_course.setOnClickListener {
if (TextUtils.equals(course.courseType, "1") || TextUtils.equals(course.courseType, "7") || TextUtils.equals(course.courseType, "6")) {
if (TextUtils.equals(course.courseType, "1") || TextUtils.equals(
course.courseType,
"7"
) || TextUtils.equals(course.courseType, "6")
) {
ARouter.getInstance()
.build("/course/play")
.withInt("course_id", course.id.toInt())
......@@ -164,7 +170,11 @@ class CourseItemNewView : ConstraintLayout {
}
}
if (TextUtils.equals("1", course.isPromotion) || TextUtils.equals("3", course.isPromotion)) {
if (TextUtils.equals("1", course.isPromotion) || TextUtils.equals(
"3",
course.isPromotion
)
) {
tv_cu_xiao.visibility = View.VISIBLE
if (TextUtils.equals("1", course.isPromotion)) {
if (course.promotionApplyFee.contains(".")) {
......@@ -181,7 +191,11 @@ class CourseItemNewView : ConstraintLayout {
if (course.isBuy) {
tv_view_course.visibility = View.VISIBLE
if (TextUtils.equals(course.courseType, "1") || TextUtils.equals(course.courseType, "7") || TextUtils.equals(course.courseType, "6")) {
if (TextUtils.equals(course.courseType, "1") || TextUtils.equals(
course.courseType,
"7"
) || TextUtils.equals(course.courseType, "6")
) {
tv_view_course.text = "立即听课"
} else {
tv_view_course.text = "查看课程"
......@@ -201,7 +215,14 @@ class CourseItemNewView : ConstraintLayout {
tv_price_decimal.visibility = View.VISIBLE
if (TextUtils.isEmpty(course.originalApplyFee) || TextUtils.equals(course.originalApplyFee, "0") || TextUtils.equals(course.originalApplyFee, "0.0") || TextUtils.equals(course.originalApplyFee, "0.00")) {
if (TextUtils.isEmpty(course.originalApplyFee) || TextUtils.equals(
course.originalApplyFee,
"0"
) || TextUtils.equals(
course.originalApplyFee,
"0.0"
) || TextUtils.equals(course.originalApplyFee, "0.00")
) {
tv_original_price.visibility = View.GONE
} else {
tv_original_price.visibility = View.VISIBLE
......@@ -221,20 +242,19 @@ class CourseItemNewView : ConstraintLayout {
PlayerFloatHelper.removeView(mContext)
}
val music=Music()
music.title=course.title
music.artist=doctorName
music.coverPath=if (!TextUtils.isEmpty(course.image)) course.image else course.pic
val music = Music()
music.title = course.title
music.artist = doctorName
music.coverPath = if (!TextUtils.isEmpty(course.image)) course.image else course.pic
PlayerFloatHelper.isCanClick = false
if (course.demoType == 1) {
PlayerFloatHelper.playingType=PlayTypeEnum.PLAY_TYPE_COURSE
music.path=course.demoFile
music.path = course.demoFile
val hashMap = HashMap<String, String>()
hashMap["course_id"] =course.id.toString()
PlayerFloatHelper.playTempData.clear()
hashMap["course_id"] = course.id.toString()
AudioPlayer.get().singlePlay(music)
PlayerFloatHelper.show(
mContext,
......
......@@ -249,8 +249,8 @@ class HPlayView : RelativeLayout, OnPlayerEventListener {
}
fun onDestroy() {
AudioPlayer.get().removeOnPlayEventListener(this)
mContext = null
mHandler = null
AudioPlayer.get().removeOnPlayEventListener(this)
}
}
\ No newline at end of file
......@@ -51,7 +51,7 @@
android:background="@drawable/course_filter_select_nor"
android:gravity="center"
android:orientation="vertical"
android:text="免费"
android:text="10元体验"
android:textColor="@color/course_color_242424"
android:textSize="14dp" />
......
......@@ -416,6 +416,7 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
}
LogUtil.d("fmDetail.id not equal " + fmDetail.getId());
HashMap<String,String> map = new HashMap();
PlayerFloatHelper.Companion.getPlayTempData().clear();
map.put("fmId", String.valueOf(fmDetail.getId()));
map.put("fmTitle", String.valueOf(fmDetail.getTitle()));
map.put("fmAuthor", String.valueOf(fmDetail.getAuthor()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment