正在显示
12 个修改的文件
包含
204 行增加
和
82 行删除
@@ -4,22 +4,34 @@ | @@ -4,22 +4,34 @@ | ||
4 | <option name="filePathToZoomLevelMap"> | 4 | <option name="filePathToZoomLevelMap"> |
5 | <map> | 5 | <map> |
6 | <entry key="../../../../../Applications/Android Studio.app/Contents/caches/transforms-2/files-2.1/054febce6621ffe68244bdc38929a80b/jetified-gsyVideoPlayer-java-v8.3.3-release-jitpack/res/drawable/video_seek_progress.xml" value="0.1361111111111111" /> | 6 | <entry key="../../../../../Applications/Android Studio.app/Contents/caches/transforms-2/files-2.1/054febce6621ffe68244bdc38929a80b/jetified-gsyVideoPlayer-java-v8.3.3-release-jitpack/res/drawable/video_seek_progress.xml" value="0.1361111111111111" /> |
7 | + <entry key="../../../../../layout/custom_preview.xml" value="0.2890625" /> | ||
7 | <entry key="../../../Library/Android/sdk/platforms/android-30/data/res/layout/auto_complete_list.xml" value="0.2671875" /> | 8 | <entry key="../../../Library/Android/sdk/platforms/android-30/data/res/layout/auto_complete_list.xml" value="0.2671875" /> |
9 | + <entry key="app/src/main/res/layout/activity_account_login.xml" value="0.2671875" /> | ||
8 | <entry key="app/src/main/res/layout/activity_answer_record_details.xml" value="0.2671875" /> | 10 | <entry key="app/src/main/res/layout/activity_answer_record_details.xml" value="0.2671875" /> |
9 | <entry key="app/src/main/res/layout/activity_answer_sheet.xml" value="0.2671875" /> | 11 | <entry key="app/src/main/res/layout/activity_answer_sheet.xml" value="0.2671875" /> |
10 | <entry key="app/src/main/res/layout/activity_class_duty.xml" value="0.2671875" /> | 12 | <entry key="app/src/main/res/layout/activity_class_duty.xml" value="0.2671875" /> |
11 | <entry key="app/src/main/res/layout/activity_database_detail.xml" value="0.2671875" /> | 13 | <entry key="app/src/main/res/layout/activity_database_detail.xml" value="0.2671875" /> |
12 | <entry key="app/src/main/res/layout/activity_main.xml" value="0.2671875" /> | 14 | <entry key="app/src/main/res/layout/activity_main.xml" value="0.2671875" /> |
15 | + <entry key="app/src/main/res/layout/activity_mobile_login.xml" value="0.2462962962962963" /> | ||
13 | <entry key="app/src/main/res/layout/activity_offline_exercise.xml" value="0.2671875" /> | 16 | <entry key="app/src/main/res/layout/activity_offline_exercise.xml" value="0.2671875" /> |
17 | + <entry key="app/src/main/res/layout/activity_online.xml" value="0.2671875" /> | ||
18 | + <entry key="app/src/main/res/layout/activity_online_detail.xml" value="0.2671875" /> | ||
14 | <entry key="app/src/main/res/layout/activity_practice.xml" value="0.2671875" /> | 19 | <entry key="app/src/main/res/layout/activity_practice.xml" value="0.2671875" /> |
15 | <entry key="app/src/main/res/layout/activity_splash.xml" value="0.2671875" /> | 20 | <entry key="app/src/main/res/layout/activity_splash.xml" value="0.2671875" /> |
16 | <entry key="app/src/main/res/layout/activity_video_detail.xml" value="0.2671875" /> | 21 | <entry key="app/src/main/res/layout/activity_video_detail.xml" value="0.2671875" /> |
22 | + <entry key="app/src/main/res/layout/activity_web.xml" value="0.2671875" /> | ||
17 | <entry key="app/src/main/res/layout/adapter_content_practice_item.xml" value="0.2671875" /> | 23 | <entry key="app/src/main/res/layout/adapter_content_practice_item.xml" value="0.2671875" /> |
18 | <entry key="app/src/main/res/layout/adapter_topic.xml" value="0.2671875" /> | 24 | <entry key="app/src/main/res/layout/adapter_topic.xml" value="0.2671875" /> |
25 | + <entry key="app/src/main/res/layout/adapter_video_course.xml" value="0.2671875" /> | ||
19 | <entry key="app/src/main/res/layout/dialog_check_id.xml" value="0.33" /> | 26 | <entry key="app/src/main/res/layout/dialog_check_id.xml" value="0.33" /> |
27 | + <entry key="app/src/main/res/layout/dialog_class_list.xml" value="0.2671875" /> | ||
20 | <entry key="app/src/main/res/layout/fragment_bank.xml" value="0.33" /> | 28 | <entry key="app/src/main/res/layout/fragment_bank.xml" value="0.33" /> |
21 | <entry key="app/src/main/res/layout/fragment_class_duty_course.xml" value="0.2671875" /> | 29 | <entry key="app/src/main/res/layout/fragment_class_duty_course.xml" value="0.2671875" /> |
30 | + <entry key="app/src/main/res/layout/fragment_course_list.xml" value="0.2671875" /> | ||
22 | <entry key="app/src/main/res/layout/item_course.xml" value="0.22552083333333334" /> | 31 | <entry key="app/src/main/res/layout/item_course.xml" value="0.22552083333333334" /> |
32 | + <entry key="app/src/main/res/layout/item_course_off.xml" value="0.2671875" /> | ||
33 | + <entry key="app/src/main/res/layout/item_course_section.xml" value="0.2671875" /> | ||
34 | + <entry key="app/src/main/res/layout/item_course_video.xml" value="0.2671875" /> | ||
23 | <entry key="app/src/main/res/layout/item_mock_examnation.xml" value="0.2671875" /> | 35 | <entry key="app/src/main/res/layout/item_mock_examnation.xml" value="0.2671875" /> |
24 | <entry key="app/src/main/res/layout/item_special_exercises.xml" value="0.2671875" /> | 36 | <entry key="app/src/main/res/layout/item_special_exercises.xml" value="0.2671875" /> |
25 | <entry key="app/src/main/res/layout/layout_loading.xml" value="0.2671875" /> | 37 | <entry key="app/src/main/res/layout/layout_loading.xml" value="0.2671875" /> |
@@ -7,7 +7,21 @@ plugins { | @@ -7,7 +7,21 @@ plugins { | ||
7 | android { | 7 | android { |
8 | compileSdkVersion 31 | 8 | compileSdkVersion 31 |
9 | buildToolsVersion "30.0.3" | 9 | buildToolsVersion "30.0.3" |
10 | + signingConfigs { | ||
11 | + release { | ||
12 | + keyAlias 'key0' | ||
13 | + keyPassword '123456' | ||
14 | + storeFile file('../security.jks') | ||
15 | + storePassword '123456' | ||
16 | + } | ||
10 | 17 | ||
18 | + debug { | ||
19 | + keyAlias 'key0' | ||
20 | + keyPassword '123456' | ||
21 | + storeFile file('../security.jks') | ||
22 | + storePassword '123456' | ||
23 | + } | ||
24 | + } | ||
11 | defaultConfig { | 25 | defaultConfig { |
12 | applicationId "com.br_technology.securitytrain_master" | 26 | applicationId "com.br_technology.securitytrain_master" |
13 | minSdkVersion 21 | 27 | minSdkVersion 21 |
@@ -18,7 +32,11 @@ android { | @@ -18,7 +32,11 @@ android { | ||
18 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | 32 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
19 | 33 | ||
20 | multiDexEnabled true | 34 | multiDexEnabled true |
21 | - | 35 | + ndk { |
36 | + abiFilters "armeabi", "armeabi-v7a", "arm64-v8a" | ||
37 | + //设置支持的SO库架构(开发者可以根据需要,选择一个或多个平台的so) | ||
38 | +// abiFilters /*"armeabi", "armeabi-v7a",*/ "arm64-v8a" | ||
39 | + } | ||
22 | } | 40 | } |
23 | aaptOptions { | 41 | aaptOptions { |
24 | // // aapt 附加参数 | 42 | // // aapt 附加参数 |
@@ -156,4 +174,8 @@ dependencies { | @@ -156,4 +174,8 @@ dependencies { | ||
156 | implementation 'com.umeng.umsdk:common:9.4.4' | 174 | implementation 'com.umeng.umsdk:common:9.4.4' |
157 | implementation 'com.umeng.umsdk:asms:1.4.1' | 175 | implementation 'com.umeng.umsdk:asms:1.4.1' |
158 | implementation 'com.umeng.umsdk:apm:1.5.2' | 176 | implementation 'com.umeng.umsdk:apm:1.5.2' |
177 | + //下拉加载上拉刷新SmartRefresh | ||
178 | + implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3' //核心必须依赖 | ||
179 | + implementation 'com.scwang.smart:refresh-header-classics:2.0.3' //经典刷新头 | ||
180 | + implementation 'com.scwang.smart:refresh-footer-classics:2.0.3' //经典加载 | ||
159 | } | 181 | } |
@@ -56,10 +56,12 @@ open class BaseApplication : Application() { | @@ -56,10 +56,12 @@ open class BaseApplication : Application() { | ||
56 | }) | 56 | }) |
57 | val needDownload = TbsDownloader.needDownload(this, TbsDownloader.DOWNLOAD_OVERSEA_TBS); | 57 | val needDownload = TbsDownloader.needDownload(this, TbsDownloader.DOWNLOAD_OVERSEA_TBS); |
58 | if (needDownload) { | 58 | if (needDownload) { |
59 | - TbsDownloader.startDownload(this); | 59 | + TbsDownloader.startDownload(this) |
60 | } | 60 | } |
61 | initUmeng() | 61 | initUmeng() |
62 | PlayerFactory.setPlayManager(Exo2PlayerManager::class.java) | 62 | PlayerFactory.setPlayManager(Exo2PlayerManager::class.java) |
63 | + SmartRefreshLayout.setDefaultRefreshHeaderCreator { context, layout -> ClassicsHeader(context) } | ||
64 | + SmartRefreshLayout.setDefaultRefreshFooterCreator { context, layout -> ClassicsFooter(context) } | ||
63 | } | 65 | } |
64 | 66 | ||
65 | fun initUmeng() { | 67 | fun initUmeng() { |
@@ -2,6 +2,7 @@ package com.br_technology.securitytrain_master.ui.view.home.activity | @@ -2,6 +2,7 @@ package com.br_technology.securitytrain_master.ui.view.home.activity | ||
2 | 2 | ||
3 | import android.content.Intent | 3 | import android.content.Intent |
4 | import android.content.res.Configuration | 4 | import android.content.res.Configuration |
5 | +import android.content.res.Resources | ||
5 | import android.os.Bundle | 6 | import android.os.Bundle |
6 | import android.text.TextUtils | 7 | import android.text.TextUtils |
7 | import android.view.View | 8 | import android.view.View |
@@ -38,11 +39,15 @@ class DatabaseDetailActivity : | @@ -38,11 +39,15 @@ class DatabaseDetailActivity : | ||
38 | videoPlayer.apply { | 39 | videoPlayer.apply { |
39 | setFullOnClick{ | 40 | setFullOnClick{ |
40 | if(!it) { | 41 | if(!it) { |
42 | + binding.title.visibility = View.GONE | ||
41 | binding.toolBar.visibility = View.GONE | 43 | binding.toolBar.visibility = View.GONE |
42 | binding.inTitle.root.visibility = View.GONE | 44 | binding.inTitle.root.visibility = View.GONE |
45 | + binding.li.setPadding(0,0,0,0) | ||
43 | }else{ | 46 | }else{ |
47 | + binding.title.visibility = View.VISIBLE | ||
44 | binding.toolBar.visibility= View.VISIBLE | 48 | binding.toolBar.visibility= View.VISIBLE |
45 | binding.inTitle.root.visibility= View.VISIBLE | 49 | binding.inTitle.root.visibility= View.VISIBLE |
50 | + binding.li.setPadding(dp2px(16),0,dp2px(16),0) | ||
46 | ImmersionBar.with(this@DatabaseDetailActivity).transparentStatusBar().statusBarDarkFont(true).init() | 51 | ImmersionBar.with(this@DatabaseDetailActivity).transparentStatusBar().statusBarDarkFont(true).init() |
47 | }} | 52 | }} |
48 | } | 53 | } |
@@ -53,6 +58,8 @@ class DatabaseDetailActivity : | @@ -53,6 +58,8 @@ class DatabaseDetailActivity : | ||
53 | } | 58 | } |
54 | } | 59 | } |
55 | } | 60 | } |
61 | + private fun dp2px(i: Int): Int { | ||
62 | + return (Resources.getSystem().displayMetrics.density * i + 0.5f).toInt()} | ||
56 | 63 | ||
57 | override fun initDataObserver() { | 64 | override fun initDataObserver() { |
58 | mViewModel.collectResponse.observe(this, { | 65 | mViewModel.collectResponse.observe(this, { |
@@ -3,6 +3,7 @@ package com.br_technology.securitytrain_master.ui.view.home.activity | @@ -3,6 +3,7 @@ package com.br_technology.securitytrain_master.ui.view.home.activity | ||
3 | import android.content.Intent | 3 | import android.content.Intent |
4 | import android.os.Bundle | 4 | import android.os.Bundle |
5 | import android.view.View | 5 | import android.view.View |
6 | +import android.widget.Toast | ||
6 | import androidx.core.content.ContextCompat | 7 | import androidx.core.content.ContextCompat |
7 | import com.br_technology.securitytrain_master.R | 8 | import com.br_technology.securitytrain_master.R |
8 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey | 9 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey |
@@ -21,6 +22,7 @@ import com.br_technology.securitytrain_master.util.sp_job_name_select | @@ -21,6 +22,7 @@ import com.br_technology.securitytrain_master.util.sp_job_name_select | ||
21 | import com.br_technology.securitytrain_master.view.ClassifyPop | 22 | import com.br_technology.securitytrain_master.view.ClassifyPop |
22 | import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener | 23 | import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener |
23 | import com.chad.library.adapter.base.listener.OnLoadMoreListener | 24 | import com.chad.library.adapter.base.listener.OnLoadMoreListener |
25 | +import com.luck.picture.lib.tools.ToastUtils | ||
24 | import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity | 26 | import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity |
25 | 27 | ||
26 | /** | 28 | /** |
@@ -72,9 +74,9 @@ class OnlineActivity : | @@ -72,9 +74,9 @@ class OnlineActivity : | ||
72 | VideoCourseAdapter(R.layout.adapter_video_course, videoLessonList) | 74 | VideoCourseAdapter(R.layout.adapter_video_course, videoLessonList) |
73 | videoLessonList = mutableListOf() | 75 | videoLessonList = mutableListOf() |
74 | onlineRecycler.adapter = videoCourseAdapter | 76 | onlineRecycler.adapter = videoCourseAdapter |
75 | - videoCourseAdapter?.setOnItemClickListener { adapter, view, position -> | 77 | + videoCourseAdapter?.setOnClick{ |
76 | val course = CourseParam() | 78 | val course = CourseParam() |
77 | - val data = videoLessonList!![position] | 79 | + val data = it |
78 | course.mLessonId = "${data.id}" | 80 | course.mLessonId = "${data.id}" |
79 | course.isTrainClass = false | 81 | course.isTrainClass = false |
80 | course.type = TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_VIDEO | 82 | course.type = TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_VIDEO |
@@ -86,30 +88,72 @@ class OnlineActivity : | @@ -86,30 +88,72 @@ class OnlineActivity : | ||
86 | .putExtra(ConstantParamKey.COURSE_LESSON, data) | 88 | .putExtra(ConstantParamKey.COURSE_LESSON, data) |
87 | ) | 89 | ) |
88 | } | 90 | } |
91 | + videoCourseAdapter?.setOnItemClickListener { adapter, view, position -> | ||
92 | + val course = CourseParam() | ||
93 | + if(videoLessonList?.size!! > position+1){ | ||
94 | + val data = videoLessonList!![position] | ||
95 | + course.mLessonId = "${data.id}" | ||
96 | + course.isTrainClass = false | ||
97 | + course.type = TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_VIDEO | ||
98 | + startActivity( | ||
99 | + Intent( | ||
100 | + this@OnlineActivity, | ||
101 | + CourseDetailActivity::class.java | ||
102 | + ).putExtra(ConstantParamKey.COURSE_BEAN, course) | ||
103 | + .putExtra(ConstantParamKey.COURSE_LESSON, data) | ||
104 | + ) | ||
105 | + }else{ | ||
106 | + Toast.makeText(this@OnlineActivity,"暂无视频",Toast.LENGTH_SHORT).show() | ||
107 | + } | ||
108 | + } | ||
89 | initLoadMore() | 109 | initLoadMore() |
90 | - swipeRefreshlayout.setOnRefreshListener { | ||
91 | - videoCourseAdapter?.loadMoreModule?.isEnableLoadMore = false | 110 | +// swipeRefreshlayout.setOnRefreshListener { |
111 | +// videoCourseAdapter?.loadMoreModule?.isEnableLoadMore = false | ||
112 | +// page = 1 | ||
113 | +// loadData() | ||
114 | +// } | ||
115 | + initRefresh() | ||
116 | + } | ||
117 | + } | ||
118 | + | ||
119 | + /** | ||
120 | + * 加载刷新 | ||
121 | + */ | ||
122 | + private fun initRefresh() { | ||
123 | + binding.srBottle.apply { | ||
124 | + setEnableAutoLoadMore(true) | ||
125 | + setOnRefreshListener { | ||
92 | page = 1 | 126 | page = 1 |
93 | loadData() | 127 | loadData() |
94 | } | 128 | } |
129 | + setOnLoadMoreListener { | ||
130 | + page += 1 | ||
131 | + loadData() | ||
132 | + } | ||
95 | } | 133 | } |
96 | } | 134 | } |
97 | - | ||
98 | - | ||
99 | override fun initDataObserver() { | 135 | override fun initDataObserver() { |
100 | mViewModel.mVideoLessonBean.observe(this, { | 136 | mViewModel.mVideoLessonBean.observe(this, { |
101 | - binding.swipeRefreshlayout.isRefreshing = false | ||
102 | - videoCourseAdapter?.loadMoreModule?.isEnableLoadMore = !(it.data.list.data.size < 10) | 137 | + if(it.code==1){ |
138 | +// videoCourseAdapter?.loadMoreModule?.isEnableLoadMore = !(it.data.list.data.size < 10) | ||
103 | 139 | ||
104 | - videoLessonList?.clear() | ||
105 | - videoLessonList?.addAll(it.data.list.data) | 140 | + videoLessonList?.clear() |
141 | + videoLessonList?.addAll(it.data.list.data) | ||
106 | 142 | ||
107 | - if (page == 1) { | ||
108 | - videoCourseAdapter?.setList(videoLessonList) | ||
109 | - } else { | ||
110 | - videoLessonList?.let { it1 -> videoCourseAdapter?.addData(it1) } | 143 | + if (page == 1) { |
144 | + videoCourseAdapter?.setList(videoLessonList) | ||
145 | + } else { | ||
146 | + videoLessonList?.let { it1 -> videoCourseAdapter?.addData(it1) } | ||
147 | + } | ||
148 | + binding.srBottle.finishRefresh(true) | ||
149 | + binding.srBottle.finishLoadMore(true) | ||
150 | + }else{ | ||
151 | + binding.srBottle.finishRefresh(false) | ||
152 | + binding.srBottle.finishLoadMore(false) | ||
111 | } | 153 | } |
112 | - ++page | 154 | +// binding.swipeRefreshlayout.isRefreshing = false |
155 | + | ||
156 | +// ++page | ||
113 | }) | 157 | }) |
114 | mViewModel.mWorkTypeBean.observe(this, { | 158 | mViewModel.mWorkTypeBean.observe(this, { |
115 | classifyPop.setList(it.data.list) | 159 | classifyPop.setList(it.data.list) |
@@ -124,13 +168,13 @@ class OnlineActivity : | @@ -124,13 +168,13 @@ class OnlineActivity : | ||
124 | } | 168 | } |
125 | 169 | ||
126 | fun initLoadMore() { | 170 | fun initLoadMore() { |
127 | - videoCourseAdapter?.loadMoreModule?.setOnLoadMoreListener(object : OnLoadMoreListener { | ||
128 | - override fun onLoadMore() { | ||
129 | - binding.swipeRefreshlayout.isRefreshing = false | ||
130 | - loadData() | ||
131 | - } | ||
132 | - }) | ||
133 | - videoCourseAdapter?.loadMoreModule?.isAutoLoadMore = true | ||
134 | - videoCourseAdapter?.loadMoreModule?.isEnableLoadMoreIfNotFullPage = false | 171 | +// videoCourseAdapter?.loadMoreModule?.setOnLoadMoreListener(object : OnLoadMoreListener { |
172 | +// override fun onLoadMore() { | ||
173 | +//// binding.swipeRefreshlayout.isRefreshing = false | ||
174 | +// loadData() | ||
175 | +// } | ||
176 | +// }) | ||
177 | +// videoCourseAdapter?.loadMoreModule?.isAutoLoadMore = true | ||
178 | +// videoCourseAdapter?.loadMoreModule?.isEnableLoadMoreIfNotFullPage = false | ||
135 | } | 179 | } |
136 | } | 180 | } |
@@ -2,7 +2,9 @@ package com.br_technology.securitytrain_master.ui.view.home.activity.course | @@ -2,7 +2,9 @@ package com.br_technology.securitytrain_master.ui.view.home.activity.course | ||
2 | 2 | ||
3 | import android.content.res.Configuration | 3 | import android.content.res.Configuration |
4 | import android.text.TextUtils | 4 | import android.text.TextUtils |
5 | +import android.util.Log | ||
5 | import android.view.View | 6 | import android.view.View |
7 | +import android.widget.Toast | ||
6 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey | 8 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey |
7 | import com.br_technology.securitytrain_master.databinding.ActivityVideoDetailBinding | 9 | import com.br_technology.securitytrain_master.databinding.ActivityVideoDetailBinding |
8 | import com.br_technology.securitytrain_master.ui.bean.CourseParam | 10 | import com.br_technology.securitytrain_master.ui.bean.CourseParam |
@@ -26,6 +28,7 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity | @@ -26,6 +28,7 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity | ||
26 | 28 | ||
27 | var courseBean: CourseParam? = null | 29 | var courseBean: CourseParam? = null |
28 | 30 | ||
31 | + private var isFinishs:Boolean=false | ||
29 | override fun initDataObserver() { | 32 | override fun initDataObserver() { |
30 | } | 33 | } |
31 | 34 | ||
@@ -34,12 +37,18 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity | @@ -34,12 +37,18 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity | ||
34 | binding.videoPlayer.mStatusChange = object : MyVideoPlayer.IStatusChange { | 37 | binding.videoPlayer.mStatusChange = object : MyVideoPlayer.IStatusChange { |
35 | override fun status(isPause: Boolean, isFinish: Boolean) { | 38 | override fun status(isPause: Boolean, isFinish: Boolean) { |
36 | if (!TextUtils.isEmpty(intent.getStringExtra(ConstantParamKey.COMMON_URL))) { | 39 | if (!TextUtils.isEmpty(intent.getStringExtra(ConstantParamKey.COMMON_URL))) { |
37 | - mViewModel.record(timeGet(binding.videoPlayer.getProgressTime())) | 40 | + val time = timeGet(binding.videoPlayer.getProgressTime()) |
41 | + mViewModel.record(time) | ||
42 | + val timeLong= binding.videoPlayer.duration | ||
43 | + var timeResult:Double=(time.toDouble()*1000)/timeLong | ||
44 | + if(timeResult >=0.8){ | ||
45 | + isFinishs=true | ||
46 | + } | ||
38 | } | 47 | } |
39 | - if (!isPause && isFinish) { | 48 | + if (!isPause&&isFinish) { |
40 | binding.videoPlayer.setCantTouch(true) | 49 | binding.videoPlayer.setCantTouch(true) |
41 | - EventBus.getDefault() | ||
42 | - .post(VideoClassChange(mViewModel.courseParam.value?.mLessonId ?: "", true)) | 50 | +// EventBus.getDefault() |
51 | +// .post(VideoClassChange(mViewModel.courseParam.value?.mLessonId ?: "", true)) | ||
43 | } | 52 | } |
44 | } | 53 | } |
45 | } | 54 | } |
@@ -97,4 +106,12 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity | @@ -97,4 +106,12 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity | ||
97 | //如果旋转了就全屏 | 106 | //如果旋转了就全屏 |
98 | // binding.videoPlayer.onConfigurationChanged(newConfig, this) | 107 | // binding.videoPlayer.onConfigurationChanged(newConfig, this) |
99 | } | 108 | } |
109 | + | ||
110 | + override fun onDestroy() { | ||
111 | + super.onDestroy() | ||
112 | + if(isFinishs){ | ||
113 | + EventBus.getDefault() | ||
114 | + .post(VideoClassChange(mViewModel.courseParam.value?.mLessonId ?: "", true)) | ||
115 | + } | ||
116 | + } | ||
100 | } | 117 | } |
@@ -17,6 +17,11 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder | @@ -17,6 +17,11 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder | ||
17 | class VideoCourseAdapter(layoutResId: Int, data: MutableList<VideoLessonBean.ListBean.DataBean>?) : | 17 | class VideoCourseAdapter(layoutResId: Int, data: MutableList<VideoLessonBean.ListBean.DataBean>?) : |
18 | BaseQuickAdapter<VideoLessonBean.ListBean.DataBean, BaseViewHolder>(layoutResId, data), | 18 | BaseQuickAdapter<VideoLessonBean.ListBean.DataBean, BaseViewHolder>(layoutResId, data), |
19 | LoadMoreModule { | 19 | LoadMoreModule { |
20 | + private var onClickListener: ((data: VideoLessonBean.ListBean.DataBean) -> Unit?)? = null | ||
21 | + | ||
22 | + fun setOnClick(listener: ( data: VideoLessonBean.ListBean.DataBean) -> Unit){ | ||
23 | + onClickListener = listener | ||
24 | + } | ||
20 | 25 | ||
21 | override fun convert(holder: BaseViewHolder, item: VideoLessonBean.ListBean.DataBean) { | 26 | override fun convert(holder: BaseViewHolder, item: VideoLessonBean.ListBean.DataBean) { |
22 | // 视频首贞图片 | 27 | // 视频首贞图片 |
@@ -27,7 +32,7 @@ class VideoCourseAdapter(layoutResId: Int, data: MutableList<VideoLessonBean.Lis | @@ -27,7 +32,7 @@ class VideoCourseAdapter(layoutResId: Int, data: MutableList<VideoLessonBean.Lis | ||
27 | holder.setText(R.id.lesson, item.class_hours.toString() + "课时") | 32 | holder.setText(R.id.lesson, item.class_hours.toString() + "课时") |
28 | // 视频名称 | 33 | // 视频名称 |
29 | holder.setText(R.id.course_name, item.name) | 34 | holder.setText(R.id.course_name, item.name) |
30 | - val teacher = item.teacher; | 35 | + val teacher = item.teacher |
31 | Glide.with(context) | 36 | Glide.with(context) |
32 | .load( | 37 | .load( |
33 | if (teacher == null) { | 38 | if (teacher == null) { |
@@ -45,6 +50,8 @@ class VideoCourseAdapter(layoutResId: Int, data: MutableList<VideoLessonBean.Lis | @@ -45,6 +50,8 @@ class VideoCourseAdapter(layoutResId: Int, data: MutableList<VideoLessonBean.Lis | ||
45 | teacher.name | 50 | teacher.name |
46 | } | 51 | } |
47 | ) | 52 | ) |
48 | - | 53 | + holder.itemView.setOnClickListener { |
54 | + onClickListener?.invoke(item) | ||
55 | + } | ||
49 | } | 56 | } |
50 | } | 57 | } |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/home/fragment/CourseListFragment.kt
1 | package com.br_technology.securitytrain_master.ui.view.home.fragment | 1 | package com.br_technology.securitytrain_master.ui.view.home.fragment |
2 | 2 | ||
3 | import android.content.Intent | 3 | import android.content.Intent |
4 | +import android.util.Log | ||
4 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey | 5 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey |
5 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COMMON_URL | 6 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COMMON_URL |
6 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COURSE_BEAN | 7 | import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COURSE_BEAN |
@@ -27,6 +27,7 @@ | @@ -27,6 +27,7 @@ | ||
27 | android:layout_marginTop="32dp" | 27 | android:layout_marginTop="32dp" |
28 | android:layout_marginEnd="32dp" | 28 | android:layout_marginEnd="32dp" |
29 | android:background="@null" | 29 | android:background="@null" |
30 | + android:inputType="number" | ||
30 | android:digits="1234567890Xx" | 31 | android:digits="1234567890Xx" |
31 | android:hint="请输入账号" | 32 | android:hint="请输入账号" |
32 | android:textColor="@color/black" | 33 | android:textColor="@color/black" |
@@ -51,53 +51,58 @@ | @@ -51,53 +51,58 @@ | ||
51 | android:padding="12dp" | 51 | android:padding="12dp" |
52 | android:src="@mipmap/share" /> | 52 | android:src="@mipmap/share" /> |
53 | </LinearLayout> | 53 | </LinearLayout> |
54 | - | ||
55 | - <TextView | ||
56 | - android:id="@+id/title" | ||
57 | - android:layout_width="match_parent" | ||
58 | - android:layout_height="wrap_content" | ||
59 | - android:layout_marginStart="16dp" | ||
60 | - android:layout_marginTop="16dp" | ||
61 | - android:layout_marginEnd="16dp" | ||
62 | - android:layout_marginBottom="12dp" | ||
63 | - android:text="课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称" | ||
64 | - android:textColor="@color/color_32" | ||
65 | - android:textSize="17sp" /> | ||
66 | - | ||
67 | - <com.br_technology.securitytrain_master.view.MyVideoPlayer | ||
68 | - android:id="@+id/video_player" | 54 | + <androidx.appcompat.widget.LinearLayoutCompat |
55 | + android:id="@+id/li" | ||
69 | android:layout_width="match_parent" | 56 | android:layout_width="match_parent" |
70 | - android:layout_height="192dp" | ||
71 | - android:layout_marginStart="16dp" | ||
72 | - android:layout_marginEnd="16dp" /> | 57 | + android:layout_height="match_parent" |
58 | + android:paddingHorizontal="16dp" | ||
59 | + android:orientation="vertical" | ||
60 | + > | ||
61 | + <TextView | ||
62 | + android:id="@+id/title" | ||
63 | + android:layout_width="match_parent" | ||
64 | + android:layout_height="wrap_content" | ||
65 | + android:layout_marginTop="16dp" | ||
66 | + android:layout_marginBottom="12dp" | ||
67 | + android:text="课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称课程名称" | ||
68 | + android:textColor="@color/color_32" | ||
69 | + android:textSize="17sp" /> | ||
73 | 70 | ||
74 | - <androidx.core.widget.NestedScrollView | ||
75 | - android:layout_width="match_parent" | ||
76 | - android:layout_height="wrap_content" | ||
77 | - android:layout_marginStart="16dp" | ||
78 | - android:layout_marginEnd="16dp" | ||
79 | - android:overScrollMode="never" | ||
80 | - android:scrollbars="none"> | 71 | + <com.br_technology.securitytrain_master.view.MyVideoPlayer |
72 | + android:id="@+id/video_player" | ||
73 | + android:layout_width="match_parent" | ||
74 | + android:layout_height="192dp" /> | ||
81 | 75 | ||
82 | - <LinearLayout | 76 | + <androidx.core.widget.NestedScrollView |
83 | android:layout_width="match_parent" | 77 | android:layout_width="match_parent" |
84 | - android:layout_height="match_parent" | ||
85 | - android:orientation="vertical"> | 78 | + android:layout_height="wrap_content" |
79 | + android:overScrollMode="never" | ||
80 | + android:scrollbars="none"> | ||
86 | 81 | ||
87 | - <com.br_technology.securitytrain_master.view.MyWebView | ||
88 | - android:id="@+id/web_view" | 82 | + <LinearLayout |
89 | android:layout_width="match_parent" | 83 | android:layout_width="match_parent" |
90 | - android:layout_height="wrap_content" | ||
91 | - android:scrollbars="none" /> | 84 | + android:layout_height="match_parent" |
85 | + android:orientation="vertical"> | ||
86 | + | ||
87 | + <com.br_technology.securitytrain_master.view.MyWebView | ||
88 | + android:id="@+id/web_view" | ||
89 | + android:layout_width="match_parent" | ||
90 | + android:layout_height="wrap_content" | ||
91 | + android:scrollbars="none" /> | ||
92 | + | ||
93 | + <androidx.recyclerview.widget.RecyclerView | ||
94 | + android:id="@+id/pdf" | ||
95 | + android:layout_width="match_parent" | ||
96 | + android:layout_height="wrap_content" | ||
97 | + android:nestedScrollingEnabled="false" | ||
98 | + android:overScrollMode="never" | ||
99 | + android:scrollbars="none" | ||
100 | + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> | ||
101 | + </LinearLayout> | ||
102 | + </androidx.core.widget.NestedScrollView> | ||
103 | + | ||
104 | + | ||
105 | + | ||
106 | + </androidx.appcompat.widget.LinearLayoutCompat> | ||
92 | 107 | ||
93 | - <androidx.recyclerview.widget.RecyclerView | ||
94 | - android:id="@+id/pdf" | ||
95 | - android:layout_width="match_parent" | ||
96 | - android:layout_height="wrap_content" | ||
97 | - android:nestedScrollingEnabled="false" | ||
98 | - android:overScrollMode="never" | ||
99 | - android:scrollbars="none" | ||
100 | - app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> | ||
101 | - </LinearLayout> | ||
102 | - </androidx.core.widget.NestedScrollView> | ||
103 | </LinearLayout> | 108 | </LinearLayout> |
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | android:id="@+id/tool_bar" | 13 | android:id="@+id/tool_bar" |
14 | android:layout_width="match_parent" | 14 | android:layout_width="match_parent" |
15 | android:layout_height="wrap_content" | 15 | android:layout_height="wrap_content" |
16 | - android:layout_below="@id/status_bar" | 16 | + android:layout_below="@id/in_title" |
17 | android:visibility="visible" | 17 | android:visibility="visible" |
18 | app:toolTitle="线下培训" /> | 18 | app:toolTitle="线下培训" /> |
19 | 19 |
@@ -13,14 +13,17 @@ | @@ -13,14 +13,17 @@ | ||
13 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" |
14 | app:toolTitle="在线课程" /> | 14 | app:toolTitle="在线课程" /> |
15 | 15 | ||
16 | - <androidx.swiperefreshlayout.widget.SwipeRefreshLayout | ||
17 | - android:id="@+id/swipeRefreshlayout" | ||
18 | - android:layout_width="match_parent" | ||
19 | - android:layout_height="match_parent" | ||
20 | - android:layout_marginStart="16dp" | ||
21 | - android:layout_marginEnd="16dp"> | ||
22 | - | 16 | +<!-- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout--> |
17 | +<!-- android:id="@+id/swipeRefreshlayout"--> | ||
18 | +<!-- android:layout_width="match_parent"--> | ||
19 | +<!-- android:layout_height="match_parent"--> | ||
20 | +<!-- android:layout_marginStart="16dp"--> | ||
21 | +<!-- android:layout_marginEnd="16dp">--> | ||
23 | 22 | ||
23 | + <com.scwang.smart.refresh.layout.SmartRefreshLayout | ||
24 | + android:id="@+id/sr_bottle" | ||
25 | + android:layout_width="match_parent" | ||
26 | + android:layout_height="match_parent"> | ||
24 | <androidx.recyclerview.widget.RecyclerView | 27 | <androidx.recyclerview.widget.RecyclerView |
25 | android:id="@+id/online_recycler" | 28 | android:id="@+id/online_recycler" |
26 | android:layout_width="match_parent" | 29 | android:layout_width="match_parent" |
@@ -31,6 +34,7 @@ | @@ -31,6 +34,7 @@ | ||
31 | android:scrollbars="none" | 34 | android:scrollbars="none" |
32 | app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" | 35 | app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" |
33 | app:spanCount="2" /> | 36 | app:spanCount="2" /> |
34 | - </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> | 37 | + </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
38 | +<!-- </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>--> | ||
35 | 39 | ||
36 | </LinearLayout> | 40 | </LinearLayout> |
-
请 注册 或 登录 后发表评论