作者 杨谦

1.学习报告

2.班级任务完善
3.todo:学情反馈,我的证件,聊天记录啥的
正在显示 23 个修改的文件 包含 746 行增加437 行删除
@@ -331,4 +331,16 @@ interface ApiService { @@ -331,4 +331,16 @@ interface ApiService {
331 fun subPaper( 331 fun subPaper(
332 @Field("user_item_id") user_item_id: Int 332 @Field("user_item_id") user_item_id: Int
333 ): Observable<BaseResponse<SubResult>> 333 ): Observable<BaseResponse<SubResult>>
  334 +
  335 + /**
  336 + * 积分记录
  337 + * @param page 页数
  338 + * @param page_num 每页显示数量
  339 + */
  340 + @FormUrlEncoded
  341 + @POST("/api/user/score_log")
  342 + fun scoreLog(
  343 + @Field("page") page: Int,
  344 + @Field("page_num") page_num: Int
  345 + ): Observable<BaseResponse<CommonDataList<CommonPage<ScoreLog>>>>
334 } 346 }
@@ -266,15 +266,5 @@ interface UserApi : ApiService { @@ -266,15 +266,5 @@ interface UserApi : ApiService {
266 @Field("id") id: Int 266 @Field("id") id: Int
267 ): Observable<BaseResponse<Void>> 267 ): Observable<BaseResponse<Void>>
268 268
269 - /**  
270 - * 积分记录  
271 - * @param page 页数  
272 - * @param page_num 每页显示数量  
273 - */  
274 - @FormUrlEncoded  
275 - @POST("/api/user/score_log")  
276 - fun scoreLog(  
277 - @Field("page") page: Int,  
278 - @Field("page_num") page_num: Int  
279 - ): Observable<BaseResponse<CommonPage<ScoreLog>>> 269 +
280 } 270 }
@@ -76,11 +76,11 @@ class TrainRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSta @@ -76,11 +76,11 @@ class TrainRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSta
76 addRequest(trainService.trainChatRead(train_class_id), liveData) 76 addRequest(trainService.trainChatRead(train_class_id), liveData)
77 } 77 }
78 78
79 - fun trainReport(liveData: MutableLiveData<BaseResponse<CommonReport<TrainReport>>>){ 79 + fun trainReport(liveData: MutableLiveData<BaseResponse<CommonReport<TrainReport>>>) {
80 addRequest(trainService.trainReport(), liveData) 80 addRequest(trainService.trainReport(), liveData)
81 } 81 }
82 82
83 - fun trainLessonBak(liveData: MutableLiveData<BaseResponse<Void>>){ 83 + fun trainLessonBak(liveData: MutableLiveData<BaseResponse<Void>>) {
84 addRequest(trainService.trainLessonBak(), liveData) 84 addRequest(trainService.trainLessonBak(), liveData)
85 } 85 }
86 86
@@ -107,4 +107,12 @@ class TrainRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSta @@ -107,4 +107,12 @@ class TrainRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSta
107 fun subPaper(user_item_id: Int, liveData: MutableLiveData<BaseResponse<SubResult>>) { 107 fun subPaper(user_item_id: Int, liveData: MutableLiveData<BaseResponse<SubResult>>) {
108 addRequest(itemService.subPaper(user_item_id), liveData) 108 addRequest(itemService.subPaper(user_item_id), liveData)
109 } 109 }
  110 +
  111 + fun scoreList(
  112 + page: Int,
  113 + page_num: Int,
  114 + liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<ScoreLog>>>>
  115 + ) {
  116 + addRequest(itemService.scoreLog(page, page_num), liveData)
  117 + }
110 } 118 }
@@ -154,7 +154,7 @@ class UserRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat @@ -154,7 +154,7 @@ class UserRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat
154 154
155 fun scoreLog( 155 fun scoreLog(
156 page: Int, 156 page: Int,
157 - page_num: Int, liveData: MutableLiveData<BaseResponse<CommonPage<ScoreLog>>> 157 + page_num: Int, liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<ScoreLog>>>>
158 ) { 158 ) {
159 addRequest(userService.scoreLog(page, page_num), liveData) 159 addRequest(userService.scoreLog(page, page_num), liveData)
160 } 160 }
@@ -99,6 +99,7 @@ open class CertLog( @@ -99,6 +99,7 @@ open class CertLog(
99 99
100 open class ScoreLog( 100 open class ScoreLog(
101 var id: Int, 101 var id: Int,
  102 + var createtime: String,
102 var score: Int, // 获得积分 103 var score: Int, // 获得积分
103 var type: String, // 获取方式:类型:1=每日一练,2=挑战答题,3=专项练习,4=培训计划考试.5=培训计划练习,6=模拟考试[未完待续……],7=班级任务 104 var type: String, // 获取方式:类型:1=每日一练,2=挑战答题,3=专项练习,4=培训计划考试.5=培训计划练习,6=模拟考试[未完待续……],7=班级任务
104 var memo: String // 获取积分来源 105 var memo: String // 获取积分来源
@@ -133,25 +133,24 @@ open class TrainReport( @@ -133,25 +133,24 @@ open class TrainReport(
133 ) 133 )
134 134
135 open class TrainReportUser( 135 open class TrainReportUser(
136 -// var id: Int,  
137 -// var nickname: String, // 姓名  
138 -// var mobile: String,//手机号", // 手机号  
139 -// var gender: Int, // 性别1=男2=女 136 + var id: Int,
  137 + var nickname: String, // 姓名
  138 + var mobile: String,//手机号", // 手机号
  139 + var gender: Int, // 性别1=男2=女
140 var avatar: String,//"https://security.brofirst.cn/uploads/20211030/e777a39142bf8ab8dd3e02b6eb9f9d9f.jpg", // 头像 140 var avatar: String,//"https://security.brofirst.cn/uploads/20211030/e777a39142bf8ab8dd3e02b6eb9f9d9f.jpg", // 头像
141 - var score: Int  
142 -// , // 积分  
143 -// var identity: String, // 身份证号  
144 -// var user_id: Int,  
145 -// var createtime: Long, // 建档日期  
146 -// var class_hours_count: Int, // 培训总学时  
147 -// var item_count: Int, // 练习题量  
148 -// var lessons: String, // 结业课程  
149 -// var is_end: Int, // 是否结业0=否1=是  
150 -// var class_name: String, // 班级名称  
151 -// var train_sort_name: String, // 培训类型  
152 -// var time: String, // 时间  
153 -// var train_name: String, // 培训单位  
154 -// var class_hours: Int, // 培训学时 141 + var score: Int, // 积分
  142 + var identity: String, // 身份证号
  143 + var user_id: Int,
  144 + var createtime: String, // 建档日期
  145 + var class_hours_count: Int, // 培训总学时
  146 + var item_count: Int, // 练习题量
  147 + var lessons: String, // 结业课程
  148 + var is_end: Int, // 是否结业0=否1=是
  149 + var class_name: String, // 班级名称
  150 + var train_sort_name: String, // 培训类型
  151 + var time: String, // 时间
  152 + var train_name: String, // 培训单位
  153 + var class_hours: Int, // 培训学时
155 ) 154 )
156 155
157 open class TrainStudyTrain( 156 open class TrainStudyTrain(
@@ -210,6 +209,7 @@ open class TrainReportExam( @@ -210,6 +209,7 @@ open class TrainReportExam(
210 var is_complete: String, // 是否完成0=否1=是 209 var is_complete: String, // 是否完成0=否1=是
211 var date: String, 210 var date: String,
212 var score: Int, // 积分 211 var score: Int, // 积分
  212 + var update_time_text: String, // 积分
213 var is_pass: String, //是否通过0=否1=是 213 var is_pass: String, //是否通过0=否1=是
214 var trainexam: TrainReportExamMsg 214 var trainexam: TrainReportExamMsg
215 ) 215 )
@@ -46,19 +46,13 @@ class SearchActivity : @@ -46,19 +46,13 @@ class SearchActivity :
46 // 点击搜索按钮 46 // 点击搜索按钮
47 search.setOnClickListener { 47 search.setOnClickListener {
48 // 点击搜索时隐藏历史记录 48 // 点击搜索时隐藏历史记录
49 - historyGroup.visibility = View.GONE  
50 - historyRecycler.visibility = View.GONE  
51 - tabLayout.visibility = View.VISIBLE  
52 - viewPager.visibility = View.VISIBLE 49 + showData(true)
53 EventBus.getDefault().post(SearchEvent(searchEdit.text.toString())) 50 EventBus.getDefault().post(SearchEvent(searchEdit.text.toString()))
54 } 51 }
55 52
56 searchEdit.setOnClickListener { 53 searchEdit.setOnClickListener {
57 // 输入框点击时显示历史记录 54 // 输入框点击时显示历史记录
58 - historyGroup.visibility = View.VISIBLE  
59 - historyRecycler.visibility = View.VISIBLE  
60 - tabLayout.visibility = View.GONE  
61 - viewPager.visibility = View.GONE 55 + showData(false)
62 } 56 }
63 57
64 val searchResultAdapter = BasePagerAdapter( 58 val searchResultAdapter = BasePagerAdapter(
@@ -86,6 +80,20 @@ class SearchActivity : @@ -86,6 +80,20 @@ class SearchActivity :
86 mViewModel.searchLog() 80 mViewModel.searchLog()
87 } 81 }
88 82
  83 + fun showData(show: Boolean) {
  84 + if (show) {
  85 + binding.historyRecycler.visibility = View.GONE
  86 + binding.historyGroup.visibility = View.GONE
  87 + binding.tabLayout.visibility = View.VISIBLE
  88 + binding.viewPager.visibility = View.VISIBLE
  89 + } else {
  90 + binding.historyGroup.visibility = View.VISIBLE
  91 + binding.historyRecycler.visibility = View.VISIBLE
  92 + binding.tabLayout.visibility = View.GONE
  93 + binding.viewPager.visibility = View.GONE
  94 + }
  95 + }
  96 +
89 override fun initDataObserver() { 97 override fun initDataObserver() {
90 mViewModel.liveData.observe(this, { 98 mViewModel.liveData.observe(this, {
91 val historyAdapter = HistoryAdapter() 99 val historyAdapter = HistoryAdapter()
@@ -94,15 +102,14 @@ class SearchActivity : @@ -94,15 +102,14 @@ class SearchActivity :
94 historyAdapter.addListener(object : OnItemClickListener<SearchLog> { 102 historyAdapter.addListener(object : OnItemClickListener<SearchLog> {
95 override fun onClick(position: Int, data: SearchLog) { 103 override fun onClick(position: Int, data: SearchLog) {
96 EventBus.getDefault().post(SearchEvent(data.keyword)) 104 EventBus.getDefault().post(SearchEvent(data.keyword))
97 - binding.historyRecycler.visibility = View.GONE  
98 - binding.historyGroup.visibility = View.GONE  
99 - binding.tabLayout.visibility = View.VISIBLE  
100 - binding.viewPager.visibility = View.VISIBLE 105 + showData(true)
101 } 106 }
102 }) 107 })
103 }) 108 })
104 mViewModel.clearData.observe(this, { 109 mViewModel.clearData.observe(this, {
105 mViewModel.searchLog() 110 mViewModel.searchLog()
  111 + EventBus.getDefault().post(SearchEvent(""))
  112 + showData(true)
106 }) 113 })
107 } 114 }
108 } 115 }
@@ -24,8 +24,33 @@ class TextCourseTypeAdapter : BaseAdapter<WorkTypeBean.ListBean, AdapterCourseTy @@ -24,8 +24,33 @@ class TextCourseTypeAdapter : BaseAdapter<WorkTypeBean.ListBean, AdapterCourseTy
24 return AdapterCourseTypeBinding.inflate(from, parent, false) 24 return AdapterCourseTypeBinding.inflate(from, parent, false)
25 } 25 }
26 26
27 - override fun onBind(holder: AdapterCourseTypeBinding, position: Int, data: WorkTypeBean.ListBean) { 27 + override fun onBind(
  28 + holder: AdapterCourseTypeBinding,
  29 + position: Int,
  30 + data: WorkTypeBean.ListBean
  31 + ) {
28 holder.name.isSelected = position == index 32 holder.name.isSelected = position == index
29 holder.name.text = data.name 33 holder.name.text = data.name
30 } 34 }
  35 +}
  36 +
  37 +class StatusName(var type: Int, var str: String)
  38 +
  39 +class StatusAdapter : BaseAdapter<StatusName, AdapterCourseTypeBinding>() {
  40 + var index: Int = 0
  41 +
  42 + override fun getViewBinding(
  43 + context: Context,
  44 + parent: ViewGroup,
  45 + viewType: Int,
  46 + from: LayoutInflater
  47 + ): AdapterCourseTypeBinding {
  48 + return AdapterCourseTypeBinding.inflate(from, parent, false)
  49 + }
  50 +
  51 + override fun onBind(holder: AdapterCourseTypeBinding, position: Int, data: StatusName) {
  52 + holder.name.isSelected = position == index
  53 + holder.name.text = data.str
  54 + }
  55 +
31 } 56 }
@@ -6,4 +6,6 @@ package com.br_technology.securitytrain_master.ui.view.home.event @@ -6,4 +6,6 @@ package com.br_technology.securitytrain_master.ui.view.home.event
6 * Description: 初见时你很迷人 6 * Description: 初见时你很迷人
7 */ 7 */
8 class GetWorkTypeEvent(var id: Int, var name: String) { 8 class GetWorkTypeEvent(var id: Int, var name: String) {
9 -}  
  9 +}
  10 +
  11 +class StatusTypeEvent(var id: Int, var name: String)
1 package com.br_technology.securitytrain_master.ui.view.mine.activity 1 package com.br_technology.securitytrain_master.ui.view.mine.activity
2 2
  3 +import android.os.Bundle
3 import android.view.View 4 import android.view.View
4 import androidx.core.content.ContextCompat 5 import androidx.core.content.ContextCompat
5 import androidx.fragment.app.FragmentPagerAdapter 6 import androidx.fragment.app.FragmentPagerAdapter
@@ -9,11 +10,15 @@ import com.br_technology.securitytrain_master.base.common.ConstantType.TYPE_CLAS @@ -9,11 +10,15 @@ import com.br_technology.securitytrain_master.base.common.ConstantType.TYPE_CLAS
9 import com.br_technology.securitytrain_master.base.common.ConstantType.TYPE_CLASS_PRACTICE 10 import com.br_technology.securitytrain_master.base.common.ConstantType.TYPE_CLASS_PRACTICE
10 import com.br_technology.securitytrain_master.base.view.BasePagerAdapter 11 import com.br_technology.securitytrain_master.base.view.BasePagerAdapter
11 import com.br_technology.securitytrain_master.databinding.ActivityClassDutyBinding 12 import com.br_technology.securitytrain_master.databinding.ActivityClassDutyBinding
  13 +import com.br_technology.securitytrain_master.ui.view.home.adapter.StatusName
  14 +import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent
12 import com.br_technology.securitytrain_master.ui.view.mine.fragment.ClassDutyCourseFragment 15 import com.br_technology.securitytrain_master.ui.view.mine.fragment.ClassDutyCourseFragment
13 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyViewModel 16 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyViewModel
14 -import com.br_technology.securitytrain_master.view.ClassifyPop 17 +import com.br_technology.securitytrain_master.view.StatusPop
15 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener 18 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
16 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 19 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
  20 +import org.greenrobot.eventbus.EventBus
  21 +import org.greenrobot.eventbus.Subscribe
17 22
18 /** 23 /**
19 * Time: 8/3/2021 11:15 24 * Time: 8/3/2021 11:15
@@ -26,11 +31,28 @@ class ClassDutyActivity : @@ -26,11 +31,28 @@ class ClassDutyActivity :
26 31
27 32
28 private val classifyPop by lazy { 33 private val classifyPop by lazy {
29 - ClassifyPop(this) 34 + //type 状态0=全部1=已完成2=未完成
  35 + val pop = StatusPop(this)
  36 + pop.setList(mutableListOf(StatusName(0, "全部"), StatusName(1, "已完成"), StatusName(2, "未完成")))
  37 + return@lazy pop
30 } 38 }
31 39
32 - override fun initDataObserver() { 40 + override fun onCreate(savedInstanceState: Bundle?) {
  41 + super.onCreate(savedInstanceState)
  42 + EventBus.getDefault().register(this)
  43 + }
  44 +
  45 + override fun onDestroy() {
  46 + super.onDestroy()
  47 + EventBus.getDefault().unregister(this)
  48 + }
33 49
  50 + @Subscribe
  51 + fun statusChange(status: StatusTypeEvent) {
  52 + binding.toolBar.setRightText(status.name)
  53 + }
  54 +
  55 + override fun initDataObserver() {
34 } 56 }
35 57
36 override fun initData() { 58 override fun initData() {
@@ -66,6 +88,7 @@ class ClassDutyActivity : @@ -66,6 +88,7 @@ class ClassDutyActivity :
66 val titles = listOf("课程", "练习", "考试") 88 val titles = listOf("课程", "练习", "考试")
67 searchResultAdapter.addData(list.toMutableList()) 89 searchResultAdapter.addData(list.toMutableList())
68 searchResultAdapter.addTitle(titles) 90 searchResultAdapter.addTitle(titles)
  91 + viewPager.offscreenPageLimit = 2
69 viewPager.adapter = searchResultAdapter 92 viewPager.adapter = searchResultAdapter
70 tabLayout.setupWithViewPager(viewPager) 93 tabLayout.setupWithViewPager(viewPager)
71 } 94 }
1 package com.br_technology.securitytrain_master.ui.view.mine.activity 1 package com.br_technology.securitytrain_master.ui.view.mine.activity
2 2
3 import android.annotation.SuppressLint 3 import android.annotation.SuppressLint
  4 +import android.view.View
4 import com.br_technology.securitytrain_master.databinding.ActivityLearningReportBinding 5 import com.br_technology.securitytrain_master.databinding.ActivityLearningReportBinding
5 import com.br_technology.securitytrain_master.expand.glideRound 6 import com.br_technology.securitytrain_master.expand.glideRound
6 import com.br_technology.securitytrain_master.ui.view.mine.adapter.LearningReportAdapter 7 import com.br_technology.securitytrain_master.ui.view.mine.adapter.LearningReportAdapter
7 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LearningReportViewModel 8 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LearningReportViewModel
8 import com.br_technology.securitytrain_master.util.TranslateUnit 9 import com.br_technology.securitytrain_master.util.TranslateUnit
9 -import com.br_technology.securitytrain_master.view.ClassifyPop  
10 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 10 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
11 11
12 /** 12 /**
@@ -20,9 +20,8 @@ class LearningReportActivity : @@ -20,9 +20,8 @@ class LearningReportActivity :
20 ActivityLearningReportBinding::inflate 20 ActivityLearningReportBinding::inflate
21 ) { 21 ) {
22 22
23 - private val classifyPop by lazy {  
24 - ClassifyPop(this)  
25 - } 23 + var page = 0
  24 + var learningReportAdapter: LearningReportAdapter? = null
26 25
27 @SuppressLint("SetTextI18n") 26 @SuppressLint("SetTextI18n")
28 override fun initDataObserver() { 27 override fun initDataObserver() {
@@ -36,35 +35,53 @@ class LearningReportActivity : @@ -36,35 +35,53 @@ class LearningReportActivity :
36 ) 35 )
37 } 36 }
38 }) 37 })
  38 + mViewModel.dataList.observe(this, {
  39 + val data = it.data.list.data
  40 + binding.smartRefresh.finishRefresh()
  41 + binding.smartRefresh.finishLoadMore()
  42 + binding.smartRefresh.setEnableLoadMore(data.size == 10)
  43 + if (page == 1) {
  44 + learningReportAdapter = LearningReportAdapter()
  45 + binding.recyclerview.adapter = learningReportAdapter
  46 + learningReportAdapter?.addList(data)
  47 + boolData(data.isNotEmpty())
  48 + } else {
  49 + learningReportAdapter?.addList(data)
  50 + }
  51 + })
  52 + }
  53 +
  54 + private fun boolData(boolean: Boolean) {
  55 + if (boolean) {
  56 + binding.smartRefresh.visibility = View.VISIBLE
  57 + binding.tvNoData.visibility = View.GONE
  58 + } else {
  59 + binding.smartRefresh.visibility = View.GONE
  60 + binding.tvNoData.visibility = View.VISIBLE
  61 + }
39 } 62 }
40 63
41 override fun initData() { 64 override fun initData() {
42 super.initData() 65 super.initData()
43 mViewModel.getReport() 66 mViewModel.getReport()
44 binding.apply { 67 binding.apply {
45 -// toolBar.setRightText("全部")  
46 -// toolBar.setRightTextDrawable(  
47 -// ContextCompat.getDrawable(  
48 -// baseContext,  
49 -// R.mipmap.down_arrow  
50 -// )  
51 -// )  
52 -//  
53 -// toolBar.addRightListener(object : ToolBarClickListener {  
54 -// override fun onClick(view: View) {  
55 -// if (!classifyPop.isShowing) {  
56 -// classifyPop.showAsDropDown(view)  
57 -// }  
58 -// }  
59 -// })  
60 -  
61 - val learningReportAdapter = LearningReportAdapter()  
62 -// recyclerview.adapter = learningReportAdapter  
63 -// learningReportAdapter.addList(list)  
64 -  
65 tvCreateReport.setOnClickListener { 68 tvCreateReport.setOnClickListener {
66 startActivity(LearningReportDetailActivity::class.java) 69 startActivity(LearningReportDetailActivity::class.java)
67 } 70 }
  71 + smartRefresh.setOnRefreshListener { refresh() }
  72 + smartRefresh.setOnLoadMoreListener { loadMore() }
68 } 73 }
  74 + refresh()
  75 + }
  76 +
  77 + fun refresh() {
  78 + page = 1
  79 + mViewModel.getScoreList(page)
69 } 80 }
  81 +
  82 + private fun loadMore() {
  83 + page++
  84 + mViewModel.getScoreList(page)
  85 + }
  86 +
70 } 87 }
1 package com.br_technology.securitytrain_master.ui.view.mine.activity 1 package com.br_technology.securitytrain_master.ui.view.mine.activity
2 2
  3 +import android.annotation.SuppressLint
  4 +import androidx.core.content.ContextCompat
3 import com.br_technology.securitytrain_master.R 5 import com.br_technology.securitytrain_master.R
4 import com.br_technology.securitytrain_master.databinding.ActivityLearningReportDetailBinding 6 import com.br_technology.securitytrain_master.databinding.ActivityLearningReportDetailBinding
5 -import com.br_technology.securitytrain_master.ui.view.home.pojo.VideoCourse 7 +import com.br_technology.securitytrain_master.expand.glideRound
6 import com.br_technology.securitytrain_master.ui.view.mine.adapter.LearningReportDetailAdapter 8 import com.br_technology.securitytrain_master.ui.view.mine.adapter.LearningReportDetailAdapter
7 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LearningReportViewModel 9 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LearningReportViewModel
  10 +import com.br_technology.securitytrain_master.util.TranslateUnit
8 import com.gyf.immersionbar.ImmersionBar 11 import com.gyf.immersionbar.ImmersionBar
9 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 12 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
10 13
@@ -18,8 +21,32 @@ class LearningReportDetailActivity : @@ -18,8 +21,32 @@ class LearningReportDetailActivity :
18 BaseLifeCycleActivity<LearningReportViewModel, ActivityLearningReportDetailBinding>( 21 BaseLifeCycleActivity<LearningReportViewModel, ActivityLearningReportDetailBinding>(
19 ActivityLearningReportDetailBinding::inflate 22 ActivityLearningReportDetailBinding::inflate
20 ) { 23 ) {
  24 + @SuppressLint("SetTextI18n")
21 override fun initDataObserver() { 25 override fun initDataObserver() {
22 - 26 + mViewModel.data.observe(this, {
  27 + val data = it.data.report.exam_list
  28 + if (data.isNotEmpty()) {
  29 + val learningReportDetailAdapter = LearningReportDetailAdapter()
  30 + binding.recyclerview.adapter = learningReportDetailAdapter
  31 + learningReportDetailAdapter.addList(data)
  32 + }
  33 + it.data.report.user.let { user ->
  34 + binding.txtEnd.text = if (user.is_end == 1) {
  35 + "已结业"
  36 + } else {
  37 + "未结业"
  38 + }
  39 + binding.tvClassName.text = user.class_name
  40 + binding.tvClassType.text = user.train_sort_name
  41 + binding.tvTime.text = user.createtime
  42 + binding.tvCompany.text = user.train_name
  43 + binding.tvLesson.text = "${user.class_hours_count}学时"
  44 + binding.ivAvtar.glideRound(
  45 + user.avatar,
  46 + TranslateUnit.dp2px(this@LearningReportDetailActivity, 64f)
  47 + )
  48 + }
  49 + })
23 } 50 }
24 51
25 override fun initView() { 52 override fun initView() {
@@ -29,23 +56,15 @@ class LearningReportDetailActivity : @@ -29,23 +56,15 @@ class LearningReportDetailActivity :
29 56
30 override fun initData() { 57 override fun initData() {
31 super.initData() 58 super.initData()
  59 + mViewModel.getReport()
32 binding.apply { 60 binding.apply {
33 - toolBar.setTitleColor(resources.getColor(R.color.white))  
34 - toolBar.setBackImg(R.mipmap.ic_back_white)  
35 -  
36 - val learningReportDetailAdapter = LearningReportDetailAdapter()  
37 - val list = mutableListOf(  
38 - VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "45分", "通过"),  
39 - VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "68分", "通过"),  
40 - VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "100分", "通过"),  
41 - VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"),  
42 - VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"),  
43 - VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"),  
44 - VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"),  
45 - VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"), 61 + toolBar.setTitleColor(
  62 + ContextCompat.getColor(
  63 + this@LearningReportDetailActivity,
  64 + R.color.white
  65 + )
46 ) 66 )
47 - recyclerview.adapter = learningReportDetailAdapter  
48 - learningReportDetailAdapter.addList(list) 67 + toolBar.setBackImg(R.mipmap.ic_back_white)
49 } 68 }
50 } 69 }
51 } 70 }
1 package com.br_technology.securitytrain_master.ui.view.mine.adapter 1 package com.br_technology.securitytrain_master.ui.view.mine.adapter
2 2
  3 +import android.annotation.SuppressLint
3 import android.content.Context 4 import android.content.Context
4 import android.view.LayoutInflater 5 import android.view.LayoutInflater
5 import android.view.ViewGroup 6 import android.view.ViewGroup
6 import com.br_technology.securitytrain_master.base.view.BaseAdapter 7 import com.br_technology.securitytrain_master.base.view.BaseAdapter
7 import com.br_technology.securitytrain_master.databinding.ItemLearningReportBinding 8 import com.br_technology.securitytrain_master.databinding.ItemLearningReportBinding
8 -import com.br_technology.securitytrain_master.ui.view.home.pojo.VideoCourse 9 +import com.br_technology.securitytrain_master.ui.bean.ScoreLog
9 10
10 /** 11 /**
11 * Time: 8/2/2021 16:37 12 * Time: 8/2/2021 16:37
12 * Author: Captain 13 * Author: Captain
13 * Description: 初见时你很迷人 14 * Description: 初见时你很迷人
14 */ 15 */
15 -class LearningReportAdapter : BaseAdapter<VideoCourse,ItemLearningReportBinding>() { 16 +class LearningReportAdapter : BaseAdapter<ScoreLog, ItemLearningReportBinding>() {
16 override fun getViewBinding( 17 override fun getViewBinding(
17 context: Context, 18 context: Context,
18 parent: ViewGroup, 19 parent: ViewGroup,
@@ -22,10 +23,41 @@ class LearningReportAdapter : BaseAdapter<VideoCourse,ItemLearningReportBinding> @@ -22,10 +23,41 @@ class LearningReportAdapter : BaseAdapter<VideoCourse,ItemLearningReportBinding>
22 return ItemLearningReportBinding.inflate(from, parent, false) 23 return ItemLearningReportBinding.inflate(from, parent, false)
23 } 24 }
24 25
25 - override fun onBind(holder: ItemLearningReportBinding, position: Int, data: VideoCourse) {  
26 - holder.tvTitle.text = data.courseName  
27 - holder.tvTime.text = data.lesson  
28 - holder.tvType.text = data.head  
29 - holder.tvScore.text = data.name 26 + @SuppressLint("SetTextI18n")
  27 + override fun onBind(holder: ItemLearningReportBinding, position: Int, data: ScoreLog) {
  28 + holder.tvTitle.text = data.memo
  29 + holder.tvTime.text = data.createtime
  30 + holder.tvType.text = getStr(data.type.toInt())
  31 + holder.tvScore.text = "+${data.score}"
  32 + }
  33 +
  34 + fun getStr(type: Int): String {
  35 + //获取方式:类型:1=每日一练,2=挑战答题,3=专项练习,4=培训计划考试.5=培训计划练习,6=模拟考试[未完待续……],7=班级任务
  36 + when (type) {
  37 + 1 -> {
  38 + return "(每日一练)"
  39 + }
  40 + 2 -> {
  41 + return "(挑战答题)"
  42 + }
  43 + 3 -> {
  44 + return "(专项练习)"
  45 + }
  46 + 4 -> {
  47 + return "(培训计划考试)"
  48 + }
  49 + 5 -> {
  50 + return "(培训计划练习)"
  51 + }
  52 + 6 -> {
  53 + return "(模拟考试)"
  54 + }
  55 + 7 -> {
  56 + return "(班级任务)"
  57 + }
  58 + else -> {
  59 + return "(每日一练)"
  60 + }
  61 + }
30 } 62 }
31 } 63 }
1 package com.br_technology.securitytrain_master.ui.view.mine.adapter 1 package com.br_technology.securitytrain_master.ui.view.mine.adapter
2 2
  3 +import android.annotation.SuppressLint
3 import android.content.Context 4 import android.content.Context
4 import android.view.LayoutInflater 5 import android.view.LayoutInflater
5 import android.view.ViewGroup 6 import android.view.ViewGroup
  7 +import androidx.core.content.ContextCompat
  8 +import com.br_technology.securitytrain_master.R
6 import com.br_technology.securitytrain_master.base.view.BaseAdapter 9 import com.br_technology.securitytrain_master.base.view.BaseAdapter
7 import com.br_technology.securitytrain_master.databinding.ItemExamForAllBinding 10 import com.br_technology.securitytrain_master.databinding.ItemExamForAllBinding
8 -import com.br_technology.securitytrain_master.ui.view.home.pojo.VideoCourse 11 +import com.br_technology.securitytrain_master.ui.bean.TrainReportExam
9 12
10 /** 13 /**
11 * Time: 8/2/2021 17:42 14 * Time: 8/2/2021 17:42
12 * Author: Captain 15 * Author: Captain
13 * Description: 初见时你很迷人 16 * Description: 初见时你很迷人
14 */ 17 */
15 -class LearningReportDetailAdapter : BaseAdapter<VideoCourse,ItemExamForAllBinding>() { 18 +class LearningReportDetailAdapter : BaseAdapter<TrainReportExam, ItemExamForAllBinding>() {
16 override fun getViewBinding( 19 override fun getViewBinding(
17 context: Context, 20 context: Context,
18 parent: ViewGroup, 21 parent: ViewGroup,
@@ -22,10 +25,20 @@ class LearningReportDetailAdapter : BaseAdapter<VideoCourse,ItemExamForAllBindin @@ -22,10 +25,20 @@ class LearningReportDetailAdapter : BaseAdapter<VideoCourse,ItemExamForAllBindin
22 return ItemExamForAllBinding.inflate(from, parent, false) 25 return ItemExamForAllBinding.inflate(from, parent, false)
23 } 26 }
24 27
25 - override fun onBind(holder: ItemExamForAllBinding, position: Int, data: VideoCourse) {  
26 - holder.tvTitle.text = data.courseName  
27 - holder.tvTime.text = data.lesson  
28 - holder.tvStatus.text = data.name  
29 - holder.tvScore.text = data.head 28 + @SuppressLint("UseCompatLoadingForDrawables", "SetTextI18n")
  29 + override fun onBind(holder: ItemExamForAllBinding, position: Int, data: TrainReportExam) {
  30 + holder.tvTitle.text = data.title
  31 + holder.tvStatus.text = if (data.is_pass == "1") {
  32 + "已通过"
  33 + } else {
  34 + "未通过"
  35 + }
  36 + holder.tvStatus.background = if (data.is_pass == "1") {
  37 + ContextCompat.getDrawable(holder.root.context, R.mipmap.report_pass)
  38 + } else {
  39 + ContextCompat.getDrawable(holder.root.context, R.mipmap.report_nopass)
  40 + }
  41 + holder.tvTime.text = data.update_time_text
  42 + holder.tvScore.text = "${data.trainexam.score}分"
30 } 43 }
31 } 44 }
@@ -2,6 +2,7 @@ package com.br_technology.securitytrain_master.ui.view.mine.fragment @@ -2,6 +2,7 @@ package com.br_technology.securitytrain_master.ui.view.mine.fragment
2 2
3 import android.annotation.SuppressLint 3 import android.annotation.SuppressLint
4 import android.content.Intent 4 import android.content.Intent
  5 +import android.os.Bundle
5 import android.view.View 6 import android.view.View
6 import com.br_technology.securitytrain_master.base.common.ConstantParamKey 7 import com.br_technology.securitytrain_master.base.common.ConstantParamKey
7 import com.br_technology.securitytrain_master.base.common.ConstantType 8 import com.br_technology.securitytrain_master.base.common.ConstantType
@@ -10,6 +11,7 @@ import com.br_technology.securitytrain_master.ui.bean.* @@ -10,6 +11,7 @@ import com.br_technology.securitytrain_master.ui.bean.*
10 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity 11 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity
11 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CoursePractiseActivity 12 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CoursePractiseActivity
12 import com.br_technology.securitytrain_master.ui.view.home.activity.course.TextDetailActivity 13 import com.br_technology.securitytrain_master.ui.view.home.activity.course.TextDetailActivity
  14 +import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent
13 import com.br_technology.securitytrain_master.ui.view.mine.adapter.CourseAdapter 15 import com.br_technology.securitytrain_master.ui.view.mine.adapter.CourseAdapter
14 import com.br_technology.securitytrain_master.ui.view.mine.adapter.TrainTestAdapter 16 import com.br_technology.securitytrain_master.ui.view.mine.adapter.TrainTestAdapter
15 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyCourseViewModel 17 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyCourseViewModel
@@ -17,6 +19,8 @@ import com.br_technology.securitytrain_master.util.TranslateUnit @@ -17,6 +19,8 @@ import com.br_technology.securitytrain_master.util.TranslateUnit
17 import com.br_technology.securitytrain_master.view.DialogMention 19 import com.br_technology.securitytrain_master.view.DialogMention
18 import com.br_technology.securitytrain_master.view.VerticalDecoration 20 import com.br_technology.securitytrain_master.view.VerticalDecoration
19 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment 21 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
  22 +import org.greenrobot.eventbus.EventBus
  23 +import org.greenrobot.eventbus.Subscribe
20 import java.text.SimpleDateFormat 24 import java.text.SimpleDateFormat
21 import java.util.* 25 import java.util.*
22 26
@@ -35,6 +39,33 @@ class ClassDutyCourseFragment(val type: Int) : @@ -35,6 +39,33 @@ class ClassDutyCourseFragment(val type: Int) :
35 var courseAdapter: CourseAdapter? = null 39 var courseAdapter: CourseAdapter? = null
36 var trainTestAdapter: TrainTestAdapter? = null 40 var trainTestAdapter: TrainTestAdapter? = null
37 var lessonBean: LessonList? = null 41 var lessonBean: LessonList? = null
  42 + var status = 0
  43 +
  44 + override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
  45 + super.onViewCreated(view, savedInstanceState)
  46 + EventBus.getDefault().register(this)
  47 + }
  48 +
  49 + override fun onDestroyView() {
  50 + EventBus.getDefault().unregister(this)
  51 + super.onDestroyView()
  52 + }
  53 +
  54 + @Subscribe
  55 + fun statusChange(status: StatusTypeEvent) {
  56 + this.status = status.id
  57 + refreshData()
  58 + }
  59 +
  60 + private fun boolData(boolean: Boolean) {
  61 + if (boolean) {
  62 + binding.layData.visibility = View.VISIBLE
  63 + binding.tvNoData.visibility = View.GONE
  64 + } else {
  65 + binding.layData.visibility = View.GONE
  66 + binding.tvNoData.visibility = View.VISIBLE
  67 + }
  68 + }
38 69
39 @SuppressLint("SetTextI18n") 70 @SuppressLint("SetTextI18n")
40 override fun initDataObserver() { 71 override fun initDataObserver() {
@@ -48,15 +79,14 @@ class ClassDutyCourseFragment(val type: Int) : @@ -48,15 +79,14 @@ class ClassDutyCourseFragment(val type: Int) :
48 "已学课时:${lessonBean!!.lesson_class_user}/ ${lessonBean!!.lesson_class_count}" 79 "已学课时:${lessonBean!!.lesson_class_user}/ ${lessonBean!!.lesson_class_count}"
49 } 80 }
50 val list = it.data.list 81 val list = it.data.list
51 - if (list.isNotEmpty()) {  
52 - if (page == 1) {  
53 - courseAdapter = CourseAdapter()  
54 - courseAdapter?.setListener(this)  
55 - courseAdapter?.setList(list)  
56 - binding.recyclerview.adapter = courseAdapter  
57 - } else {  
58 - courseAdapter?.addData(list)  
59 - } 82 + if (page == 1) {
  83 + courseAdapter = CourseAdapter()
  84 + courseAdapter?.setListener(this)
  85 + courseAdapter?.setList(list)
  86 + binding.recyclerview.adapter = courseAdapter
  87 + boolData(list.isNotEmpty())
  88 + } else {
  89 + courseAdapter?.addData(list)
60 } 90 }
61 if (list.size < 10) { 91 if (list.size < 10) {
62 courseAdapter?.loadMoreModule?.loadMoreEnd() 92 courseAdapter?.loadMoreModule?.loadMoreEnd()
@@ -67,15 +97,14 @@ class ClassDutyCourseFragment(val type: Int) : @@ -67,15 +97,14 @@ class ClassDutyCourseFragment(val type: Int) :
67 mViewModel.listPractise.observe(this, { 97 mViewModel.listPractise.observe(this, {
68 binding.smartRefresh.isRefreshing = false 98 binding.smartRefresh.isRefreshing = false
69 val list = it.data.list 99 val list = it.data.list
70 - if (list.isNotEmpty()) {  
71 - if (page == 1) {  
72 - trainTestAdapter = TrainTestAdapter()  
73 - trainTestAdapter?.setListener(this)  
74 - trainTestAdapter?.addData(transPracticeData(list))  
75 - binding.recyclerview.adapter = trainTestAdapter  
76 - } else {  
77 - trainTestAdapter?.addData(transPracticeData(list))  
78 - } 100 + if (page == 1) {
  101 + trainTestAdapter = TrainTestAdapter()
  102 + trainTestAdapter?.setListener(this)
  103 + trainTestAdapter?.addData(transPracticeData(list))
  104 + binding.recyclerview.adapter = trainTestAdapter
  105 + boolData(list.isNotEmpty())
  106 + } else {
  107 + trainTestAdapter?.addData(transPracticeData(list))
79 } 108 }
80 if (list.size < 10) { 109 if (list.size < 10) {
81 trainTestAdapter?.loadMoreModule?.loadMoreEnd() 110 trainTestAdapter?.loadMoreModule?.loadMoreEnd()
@@ -86,15 +115,14 @@ class ClassDutyCourseFragment(val type: Int) : @@ -86,15 +115,14 @@ class ClassDutyCourseFragment(val type: Int) :
86 mViewModel.listExam.observe(this, { 115 mViewModel.listExam.observe(this, {
87 binding.smartRefresh.isRefreshing = false 116 binding.smartRefresh.isRefreshing = false
88 val list = it.data.list 117 val list = it.data.list
89 - if (list.isNotEmpty()) {  
90 - if (page == 1) {  
91 - trainTestAdapter = TrainTestAdapter()  
92 - trainTestAdapter?.setListener(this)  
93 - trainTestAdapter?.addData(transExamData(list))  
94 - binding.recyclerview.adapter = trainTestAdapter  
95 - } else {  
96 - trainTestAdapter?.addData(transExamData(list))  
97 - } 118 + if (page == 1) {
  119 + trainTestAdapter = TrainTestAdapter()
  120 + trainTestAdapter?.setListener(this)
  121 + trainTestAdapter?.addData(transExamData(list))
  122 + binding.recyclerview.adapter = trainTestAdapter
  123 + boolData(list.isNotEmpty())
  124 + } else {
  125 + trainTestAdapter?.addData(transExamData(list))
98 } 126 }
99 if (list.size < 10) { 127 if (list.size < 10) {
100 trainTestAdapter?.loadMoreModule?.loadMoreEnd() 128 trainTestAdapter?.loadMoreModule?.loadMoreEnd()
@@ -106,9 +134,9 @@ class ClassDutyCourseFragment(val type: Int) : @@ -106,9 +134,9 @@ class ClassDutyCourseFragment(val type: Int) :
106 134
107 private fun getData() { 135 private fun getData() {
108 when (type) { 136 when (type) {
109 - ConstantType.TYPE_CLASS_COURSE -> mViewModel.getTrainLessonList(0, page)  
110 - ConstantType.TYPE_CLASS_PRACTICE -> mViewModel.getTrainPractiseList(0, page)  
111 - ConstantType.TYPE_CLASS_EXAM -> mViewModel.getTrainExamList(0, page) 137 + ConstantType.TYPE_CLASS_COURSE -> mViewModel.getTrainLessonList(status, page)
  138 + ConstantType.TYPE_CLASS_PRACTICE -> mViewModel.getTrainPractiseList(status, page)
  139 + ConstantType.TYPE_CLASS_EXAM -> mViewModel.getTrainExamList(status, page)
112 else -> { 140 else -> {
113 } 141 }
114 } 142 }
@@ -179,6 +207,7 @@ class ClassDutyCourseFragment(val type: Int) : @@ -179,6 +207,7 @@ class ClassDutyCourseFragment(val type: Int) :
179 courseAdapter?.loadMoreModule?.setOnLoadMoreListener { 207 courseAdapter?.loadMoreModule?.setOnLoadMoreListener {
180 loadMore() 208 loadMore()
181 } 209 }
  210 + binding.tvNoData.text = "暂无课程"
182 } 211 }
183 else -> { 212 else -> {
184 trainTestAdapter = TrainTestAdapter() 213 trainTestAdapter = TrainTestAdapter()
@@ -188,6 +217,11 @@ class ClassDutyCourseFragment(val type: Int) : @@ -188,6 +217,11 @@ class ClassDutyCourseFragment(val type: Int) :
188 courseAdapter?.loadMoreModule?.setOnLoadMoreListener { 217 courseAdapter?.loadMoreModule?.setOnLoadMoreListener {
189 loadMore() 218 loadMore()
190 } 219 }
  220 + if (ConstantType.TYPE_CLASS_PRACTICE == type) {
  221 + binding.tvNoData.text = "暂无练习"
  222 + } else {
  223 + binding.tvNoData.text = "暂无考试"
  224 + }
191 } 225 }
192 } 226 }
193 } 227 }
@@ -238,10 +272,12 @@ class ClassDutyCourseFragment(val type: Int) : @@ -238,10 +272,12 @@ class ClassDutyCourseFragment(val type: Int) :
238 if (bool) { 272 if (bool) {
239 startNext(item) 273 startNext(item)
240 } else { 274 } else {
241 - dialogMention.show()  
242 - dialogMention.setListener {  
243 - startNext(item)  
244 - } 275 +// dialogMention.show()
  276 +// dialogMention.setListener {
  277 +// startNext(item)
  278 +// }
  279 + // ios 不做跳转,保持一致
  280 + showTip("不在考试时间")
245 } 281 }
246 } else { 282 } else {
247 showTip("考试已结束") 283 showTip("考试已结束")
@@ -2,10 +2,12 @@ package com.br_technology.securitytrain_master.ui.view.mine.viewmodel @@ -2,10 +2,12 @@ package com.br_technology.securitytrain_master.ui.view.mine.viewmodel
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.network.response.BaseResponse 4 import com.br_technology.securitytrain_master.base.network.response.BaseResponse
  5 +import com.br_technology.securitytrain_master.base.network.response.CommonDataList
  6 +import com.br_technology.securitytrain_master.base.network.response.CommonPage
5 import com.br_technology.securitytrain_master.base.network.response.CommonReport 7 import com.br_technology.securitytrain_master.base.network.response.CommonReport
6 import com.br_technology.securitytrain_master.base.repository.TrainRepository 8 import com.br_technology.securitytrain_master.base.repository.TrainRepository
7 import com.br_technology.securitytrain_master.base.view.BaseViewModel 9 import com.br_technology.securitytrain_master.base.view.BaseViewModel
8 -import com.br_technology.securitytrain_master.ui.bean.TrainDetail 10 +import com.br_technology.securitytrain_master.ui.bean.ScoreLog
9 import com.br_technology.securitytrain_master.ui.bean.TrainReport 11 import com.br_technology.securitytrain_master.ui.bean.TrainReport
10 12
11 /** 13 /**
@@ -16,11 +18,13 @@ import com.br_technology.securitytrain_master.ui.bean.TrainReport @@ -16,11 +18,13 @@ import com.br_technology.securitytrain_master.ui.bean.TrainReport
16 class LearningReportViewModel : BaseViewModel<TrainRepository>() { 18 class LearningReportViewModel : BaseViewModel<TrainRepository>() {
17 val data = MutableLiveData<BaseResponse<CommonReport<TrainReport>>>() 19 val data = MutableLiveData<BaseResponse<CommonReport<TrainReport>>>()
18 20
19 - fun getReport(){ 21 + val dataList = MutableLiveData<BaseResponse<CommonDataList<CommonPage<ScoreLog>>>>()
  22 +
  23 + fun getReport() {
20 mRepository.trainReport(data) 24 mRepository.trainReport(data)
21 } 25 }
22 26
23 - fun getDetail(){  
24 -// mRepository.get(data) 27 + fun getScoreList(page: Int) {
  28 + mRepository.scoreList(page, 10, dataList)
25 } 29 }
26 } 30 }
  1 +package com.br_technology.securitytrain_master.view
  2 +
  3 +import android.app.Activity
  4 +import android.view.LayoutInflater
  5 +import android.view.ViewGroup
  6 +import android.widget.FrameLayout
  7 +import android.widget.PopupWindow
  8 +import androidx.core.content.ContextCompat
  9 +import com.br_technology.securitytrain_master.databinding.StatusClassifyBinding
  10 +import com.br_technology.securitytrain_master.ui.view.home.adapter.StatusAdapter
  11 +import com.br_technology.securitytrain_master.ui.view.home.adapter.StatusName
  12 +import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent
  13 +import com.br_technology.securitytrain_master.util.TranslateUnit
  14 +import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
  15 +import org.greenrobot.eventbus.EventBus
  16 +
  17 +/**
  18 + * createTime:2021/7/30 9:25
  19 + * auth:张继
  20 + * des:
  21 + */
  22 +class StatusPop(context: Activity) : PopupWindow(context) {
  23 +
  24 + private var mWorkTypeList: MutableList<StatusName>? = null
  25 + private var textCourseTypeAdapter: StatusAdapter? = null
  26 + private var pos: Int = 0
  27 + private val binding by lazy {
  28 + StatusClassifyBinding.inflate(LayoutInflater.from(context))
  29 + }
  30 +
  31 + fun setList(workTypeList: MutableList<StatusName>) {
  32 + mWorkTypeList = workTypeList
  33 + mWorkTypeList?.let { textCourseTypeAdapter?.addList(it) }
  34 + }
  35 +
  36 + init {
  37 +
  38 + contentView = binding.root
  39 + width = TranslateUnit.dp2px(contentView.context, 100f)
  40 + height = ViewGroup.LayoutParams.WRAP_CONTENT
  41 + setBackgroundDrawable(ContextCompat.getDrawable(context, android.R.color.transparent))
  42 + isOutsideTouchable = true
  43 +
  44 +
  45 + binding.apply {
  46 + mWorkTypeList = mutableListOf()
  47 + textCourseTypeAdapter = StatusAdapter()
  48 + textCourseTypeAdapter?.addListener(object : OnItemClickListener<StatusName> {
  49 + override fun onClick(position: Int, data: StatusName) {
  50 + textCourseTypeAdapter!!.index = position
  51 + textCourseTypeAdapter!!.notifyDataSetChanged()
  52 + pos = position
  53 + }
  54 + })
  55 + courseType.layoutParams = FrameLayout.LayoutParams(
  56 + TranslateUnit.dp2px(contentView.context, 100f),
  57 + FrameLayout.LayoutParams.WRAP_CONTENT
  58 + )
  59 + courseType.adapter = textCourseTypeAdapter
  60 + mWorkTypeList?.let { textCourseTypeAdapter?.addList(it) }
  61 + textCourseTypeAdapter?.addListener(object : OnItemClickListener<StatusName> {
  62 + override fun onClick(position: Int, data: StatusName) {
  63 + EventBus.getDefault().post(StatusTypeEvent(data.type, data.str))
  64 + dismiss()
  65 + }
  66 + })
  67 + }
  68 + }
  69 +
  70 +
  71 +}
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 android:layout_width="match_parent" 4 android:layout_width="match_parent"
5 - android:layout_height="match_parent"> 5 + android:layout_height="match_parent"
  6 + android:orientation="vertical">
6 7
7 <include 8 <include
8 android:id="@+id/include" 9 android:id="@+id/include"
@@ -12,15 +13,12 @@ @@ -12,15 +13,12 @@
12 android:id="@+id/tool_bar" 13 android:id="@+id/tool_bar"
13 android:layout_width="match_parent" 14 android:layout_width="match_parent"
14 android:layout_height="wrap_content" 15 android:layout_height="wrap_content"
15 - android:layout_below="@id/include"  
16 -  
17 app:toolTitle="学习报告" /> 16 app:toolTitle="学习报告" />
18 17
19 <RelativeLayout 18 <RelativeLayout
20 android:id="@+id/rl" 19 android:id="@+id/rl"
21 android:layout_width="match_parent" 20 android:layout_width="match_parent"
22 android:layout_height="wrap_content" 21 android:layout_height="wrap_content"
23 - android:layout_below="@id/tool_bar"  
24 android:background="@mipmap/learning_report_top_bg"> 22 android:background="@mipmap/learning_report_top_bg">
25 23
26 <ImageView 24 <ImageView
@@ -44,29 +42,64 @@ @@ -44,29 +42,64 @@
44 42
45 </RelativeLayout> 43 </RelativeLayout>
46 44
47 - <androidx.recyclerview.widget.RecyclerView  
48 - android:id="@+id/recyclerview" 45 + <FrameLayout
49 android:layout_width="match_parent" 46 android:layout_width="match_parent"
50 - android:layout_height="wrap_content"  
51 - android:layout_below="@id/rl"  
52 - android:nestedScrollingEnabled="false"  
53 - android:overScrollMode="never"  
54 - android:scrollbars="none"  
55 - app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"> 47 + android:layout_height="0dp"
  48 + android:layout_weight="1">
  49 +
  50 + <TextView
  51 + android:id="@+id/tv_no_data"
  52 + android:layout_width="match_parent"
  53 + android:layout_height="wrap_content"
  54 + android:layout_marginTop="24dp"
  55 + android:text="暂无积分记录"
  56 + android:visibility="gone"
  57 + android:drawableTop="@mipmap/search_none"
  58 + android:gravity="center" />
  59 +
  60 + <com.scwang.smart.refresh.layout.SmartRefreshLayout
  61 + android:id="@+id/smart_refresh"
  62 + android:layout_width="match_parent"
  63 + android:layout_height="match_parent">
  64 +
  65 + <com.scwang.smart.refresh.header.MaterialHeader
  66 + android:layout_width="match_parent"
  67 + android:layout_height="wrap_content" />
  68 +
  69 + <androidx.recyclerview.widget.RecyclerView
  70 + android:id="@+id/recyclerview"
  71 + android:layout_width="match_parent"
  72 + android:layout_height="wrap_content"
  73 + android:nestedScrollingEnabled="false"
  74 + android:overScrollMode="never"
  75 + android:scrollbars="none"
  76 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager">
  77 +
  78 + </androidx.recyclerview.widget.RecyclerView>
  79 +
  80 + <com.scwang.smart.refresh.footer.ClassicsFooter
  81 + android:layout_width="match_parent"
  82 + android:layout_height="wrap_content" />
  83 + </com.scwang.smart.refresh.layout.SmartRefreshLayout>
  84 + </FrameLayout>
  85 +
  86 +
56 87
57 - </androidx.recyclerview.widget.RecyclerView>  
58 88
59 <TextView 89 <TextView
60 android:id="@+id/tv_create_report" 90 android:id="@+id/tv_create_report"
61 - android:layout_width="343dp" 91 + android:layout_width="match_parent"
62 android:layout_height="44dp" 92 android:layout_height="44dp"
63 android:layout_alignParentBottom="true" 93 android:layout_alignParentBottom="true"
64 android:layout_centerHorizontal="true" 94 android:layout_centerHorizontal="true"
65 - android:layout_marginBottom="42dp" 95 + android:layout_marginStart="32dp"
  96 + android:layout_marginTop="16dp"
  97 + android:layout_marginEnd="32dp"
  98 + android:layout_marginBottom="16dp"
66 android:background="@drawable/solid_25_4" 99 android:background="@drawable/solid_25_4"
67 android:gravity="center" 100 android:gravity="center"
68 android:text="生成报告" 101 android:text="生成报告"
69 android:textColor="@color/white" 102 android:textColor="@color/white"
70 android:textSize="16sp" /> 103 android:textSize="16sp" />
71 104
72 -</RelativeLayout>  
  105 +</LinearLayout>
@@ -15,271 +15,264 @@ @@ -15,271 +15,264 @@
15 android:background="@color/color_25" 15 android:background="@color/color_25"
16 app:toolTitle="学习报告" /> 16 app:toolTitle="学习报告" />
17 17
18 -<!-- <androidx.core.widget.NestedScrollView-->  
19 -<!-- android:layout_width="match_parent"-->  
20 -<!-- android:layout_height="match_parent">-->  
21 -  
22 -  
23 -<!-- <LinearLayout-->  
24 -<!-- android:layout_width="match_parent"-->  
25 -<!-- android:layout_height="match_parent"-->  
26 -<!-- android:orientation="vertical">-->  
27 - 18 + <androidx.core.widget.NestedScrollView
  19 + android:layout_width="match_parent"
  20 + android:layout_height="match_parent">
28 21
29 - <FrameLayout  
30 - android:layout_width="344dp"  
31 - android:layout_height="375dp"  
32 - android:layout_gravity="center_horizontal"  
33 - android:layout_marginTop="15dp"> 22 + <LinearLayout
  23 + android:layout_width="match_parent"
  24 + android:layout_height="match_parent"
  25 + android:orientation="vertical">
34 26
35 - <LinearLayout 27 + <FrameLayout
36 android:layout_width="344dp" 28 android:layout_width="344dp"
37 - android:layout_height="343dp"  
38 - android:layout_marginTop="32dp"  
39 - android:background="@drawable/solid_ff_4"  
40 - android:orientation="vertical"> 29 + android:layout_height="375dp"
  30 + android:layout_gravity="center_horizontal"
  31 + android:layout_marginTop="15dp">
41 32
42 <LinearLayout 33 <LinearLayout
43 - android:layout_width="wrap_content"  
44 - android:layout_height="wrap_content"  
45 - android:layout_gravity="center_horizontal"  
46 - android:layout_marginTop="41dp"  
47 - android:background="@mipmap/create_learning_report_top_bg" 34 + android:layout_width="344dp"
  35 + android:layout_height="343dp"
  36 + android:layout_marginTop="32dp"
  37 + android:background="@drawable/solid_ff_4"
48 android:orientation="vertical"> 38 android:orientation="vertical">
49 39
50 - <TextView 40 + <LinearLayout
51 android:layout_width="wrap_content" 41 android:layout_width="wrap_content"
52 android:layout_height="wrap_content" 42 android:layout_height="wrap_content"
53 android:layout_gravity="center_horizontal" 43 android:layout_gravity="center_horizontal"
54 - android:layout_marginTop="16dp"  
55 - android:text="结业"  
56 - android:textColor="@color/color_e8"  
57 - android:textSize="24sp"  
58 - android:textStyle="bold" /> 44 + android:layout_marginTop="41dp"
  45 + android:background="@mipmap/create_learning_report_top_bg"
  46 + android:orientation="vertical">
59 47
  48 + <TextView
  49 + android:id="@+id/txt_end"
  50 + android:layout_width="wrap_content"
  51 + android:layout_height="wrap_content"
  52 + android:layout_gravity="center_horizontal"
  53 + android:layout_marginTop="16dp"
  54 + android:text="结业"
  55 + android:textColor="@color/color_e8"
  56 + android:textSize="24sp"
  57 + android:textStyle="bold" />
60 58
61 - </LinearLayout>  
62 59
  60 + </LinearLayout>
63 61
64 - <View  
65 - android:layout_width="match_parent"  
66 - android:layout_height="1dp"  
67 - android:layout_marginStart="16dp"  
68 - android:layout_marginTop="16dp"  
69 - android:layout_marginEnd="16dp"  
70 - android:background="@color/color_eb">  
71 -  
72 - </View>  
73 62
74 - <LinearLayout  
75 - android:layout_width="match_parent"  
76 - android:layout_height="wrap_content"  
77 - android:orientation="horizontal">  
78 -  
79 - <TextView  
80 - android:layout_width="wrap_content"  
81 - android:layout_height="wrap_content" 63 + <View
  64 + android:layout_width="match_parent"
  65 + android:layout_height="1dp"
82 android:layout_marginStart="16dp" 66 android:layout_marginStart="16dp"
83 - android:layout_marginTop="15dp"  
84 - android:layout_weight="1"  
85 - android:text="班级名称"  
86 - android:textColor="@color/color_96"  
87 - android:textSize="12sp" />  
88 -  
89 - <TextView  
90 - android:id="@+id/tvClassName"  
91 - android:layout_width="wrap_content"  
92 - android:layout_height="wrap_content"  
93 - android:layout_marginTop="15dp" 67 + android:layout_marginTop="16dp"
94 android:layout_marginEnd="16dp" 68 android:layout_marginEnd="16dp"
95 - android:layout_weight="1"  
96 - android:gravity="end"  
97 - android:text="三岗人员培训资格"  
98 - android:textColor="@color/color_32"  
99 - android:textSize="12sp" /> 69 + android:background="@color/color_eb">
100 70
101 - </LinearLayout>  
102 -  
103 -  
104 - <LinearLayout  
105 - android:layout_width="match_parent"  
106 - android:layout_height="wrap_content"  
107 - android:orientation="horizontal"> 71 + </View>
108 72
109 - <TextView  
110 - android:layout_width="wrap_content" 73 + <LinearLayout
  74 + android:layout_width="match_parent"
111 android:layout_height="wrap_content" 75 android:layout_height="wrap_content"
112 - android:layout_marginStart="16dp"  
113 - android:layout_marginTop="15dp"  
114 - android:layout_weight="1"  
115 - android:text="培训类型"  
116 - android:textColor="@color/color_96"  
117 - android:textSize="12sp" />  
118 -  
119 - <TextView  
120 - android:id="@+id/tv_class_type"  
121 - android:layout_width="wrap_content" 76 + android:orientation="horizontal">
  77 +
  78 + <TextView
  79 + android:layout_width="wrap_content"
  80 + android:layout_height="wrap_content"
  81 + android:layout_marginStart="16dp"
  82 + android:layout_marginTop="15dp"
  83 + android:layout_weight="1"
  84 + android:text="班级名称"
  85 + android:textColor="@color/color_96"
  86 + android:textSize="12sp" />
  87 +
  88 + <TextView
  89 + android:id="@+id/tvClassName"
  90 + android:layout_width="wrap_content"
  91 + android:layout_height="wrap_content"
  92 + android:layout_marginTop="15dp"
  93 + android:layout_marginEnd="16dp"
  94 + android:layout_weight="1"
  95 + android:gravity="end"
  96 + android:textColor="@color/color_32"
  97 + android:textSize="12sp" />
  98 +
  99 + </LinearLayout>
  100 +
  101 +
  102 + <LinearLayout
  103 + android:layout_width="match_parent"
122 android:layout_height="wrap_content" 104 android:layout_height="wrap_content"
123 - android:layout_marginTop="15dp"  
124 - android:layout_marginEnd="16dp"  
125 - android:layout_weight="1"  
126 - android:gravity="end"  
127 - android:text="三岗培训"  
128 - android:textColor="@color/color_32"  
129 - android:textSize="12sp" />  
130 -  
131 - </LinearLayout>  
132 -  
133 - <LinearLayout  
134 - android:layout_width="match_parent"  
135 - android:layout_height="wrap_content"  
136 - android:orientation="horizontal">  
137 -  
138 - <TextView  
139 - android:layout_width="wrap_content" 105 + android:orientation="horizontal">
  106 +
  107 + <TextView
  108 + android:layout_width="wrap_content"
  109 + android:layout_height="wrap_content"
  110 + android:layout_marginStart="16dp"
  111 + android:layout_marginTop="15dp"
  112 + android:layout_weight="1"
  113 + android:text="培训类型"
  114 + android:textColor="@color/color_96"
  115 + android:textSize="12sp" />
  116 +
  117 + <TextView
  118 + android:id="@+id/tv_class_type"
  119 + android:layout_width="wrap_content"
  120 + android:layout_height="wrap_content"
  121 + android:layout_marginTop="15dp"
  122 + android:layout_marginEnd="16dp"
  123 + android:layout_weight="1"
  124 + android:gravity="end"
  125 + android:textColor="@color/color_32"
  126 + android:textSize="12sp" />
  127 +
  128 + </LinearLayout>
  129 +
  130 + <LinearLayout
  131 + android:layout_width="match_parent"
140 android:layout_height="wrap_content" 132 android:layout_height="wrap_content"
141 - android:layout_marginStart="16dp"  
142 - android:layout_marginTop="15dp"  
143 - android:layout_weight="1"  
144 - android:text="时间"  
145 - android:textColor="@color/color_96"  
146 - android:textSize="12sp" />  
147 -  
148 - <TextView  
149 - android:id="@+id/tv_time"  
150 - android:layout_width="wrap_content" 133 + android:orientation="horizontal">
  134 +
  135 + <TextView
  136 + android:layout_width="wrap_content"
  137 + android:layout_height="wrap_content"
  138 + android:layout_marginStart="16dp"
  139 + android:layout_marginTop="15dp"
  140 + android:layout_weight="1"
  141 + android:text="时间"
  142 + android:textColor="@color/color_96"
  143 + android:textSize="12sp" />
  144 +
  145 + <TextView
  146 + android:id="@+id/tv_time"
  147 + android:layout_width="wrap_content"
  148 + android:layout_height="wrap_content"
  149 + android:layout_marginTop="15dp"
  150 + android:layout_marginEnd="16dp"
  151 + android:layout_weight="1"
  152 + android:gravity="end"
  153 + android:textColor="@color/color_32"
  154 + android:textSize="12sp" />
  155 +
  156 + </LinearLayout>
  157 +
  158 + <LinearLayout
  159 + android:layout_width="match_parent"
151 android:layout_height="wrap_content" 160 android:layout_height="wrap_content"
152 - android:layout_marginTop="15dp"  
153 - android:layout_marginEnd="16dp"  
154 - android:layout_weight="1"  
155 - android:gravity="end"  
156 - android:text="2021/07/08-2021/07/09"  
157 - android:textColor="@color/color_32"  
158 - android:textSize="12sp" /> 161 + android:orientation="horizontal">
  162 +
  163 + <TextView
  164 + android:layout_width="wrap_content"
  165 + android:layout_height="wrap_content"
  166 + android:layout_marginStart="16dp"
  167 + android:layout_marginTop="15dp"
  168 + android:layout_weight="1"
  169 + android:text="培训单位"
  170 + android:textColor="@color/color_96"
  171 + android:textSize="12sp" />
  172 +
  173 + <TextView
  174 + android:id="@+id/tv_company"
  175 + android:layout_width="wrap_content"
  176 + android:layout_height="wrap_content"
  177 + android:layout_marginTop="15dp"
  178 + android:layout_marginEnd="16dp"
  179 + android:layout_weight="1"
  180 + android:gravity="end"
  181 + android:textColor="@color/color_32"
  182 + android:textSize="12sp" />
  183 +
  184 + </LinearLayout>
  185 +
  186 + <LinearLayout
  187 + android:layout_width="match_parent"
  188 + android:layout_height="wrap_content"
  189 + android:orientation="horizontal">
  190 +
  191 + <TextView
  192 + android:layout_width="wrap_content"
  193 + android:layout_height="wrap_content"
  194 + android:layout_marginStart="16dp"
  195 + android:layout_marginTop="15dp"
  196 + android:layout_weight="1"
  197 + android:text="培训学时"
  198 + android:textColor="@color/color_96"
  199 + android:textSize="12sp" />
  200 +
  201 + <TextView
  202 + android:id="@+id/tv_lesson"
  203 + android:layout_width="wrap_content"
  204 + android:layout_height="wrap_content"
  205 + android:layout_marginTop="15dp"
  206 + android:layout_marginEnd="16dp"
  207 + android:layout_weight="1"
  208 + android:gravity="end"
  209 + android:textColor="@color/color_32"
  210 + android:textSize="12sp" />
  211 +
  212 + </LinearLayout>
159 213
160 </LinearLayout> 214 </LinearLayout>
161 215
162 - <LinearLayout  
163 - android:layout_width="match_parent"  
164 - android:layout_height="wrap_content"  
165 - android:orientation="horizontal"> 216 + <ImageView
  217 + android:id="@+id/iv_avtar"
  218 + android:layout_width="64dp"
  219 + android:layout_height="64dp"
  220 + android:layout_gravity="center_horizontal" />
166 221
167 - <TextView  
168 - android:layout_width="wrap_content"  
169 - android:layout_height="wrap_content"  
170 - android:layout_marginStart="16dp"  
171 - android:layout_marginTop="15dp"  
172 - android:layout_weight="1"  
173 - android:text="培训单位"  
174 - android:textColor="@color/color_96"  
175 - android:textSize="12sp" />  
176 -  
177 - <TextView  
178 - android:id="@+id/tv_company"  
179 - android:layout_width="wrap_content"  
180 - android:layout_height="wrap_content"  
181 - android:layout_marginTop="15dp"  
182 - android:layout_marginEnd="16dp"  
183 - android:layout_weight="1"  
184 - android:gravity="end"  
185 - android:text="天津百荣培训中心"  
186 - android:textColor="@color/color_32"  
187 - android:textSize="12sp" /> 222 + </FrameLayout>
188 223
189 - </LinearLayout> 224 + <RelativeLayout
  225 + android:layout_width="match_parent"
  226 + android:layout_height="25dp"
  227 + android:layout_marginTop="24dp"
  228 + android:orientation="horizontal">
190 229
191 - <LinearLayout  
192 - android:layout_width="match_parent" 230 + <TextView
  231 + android:id="@+id/tv"
  232 + android:layout_width="wrap_content"
193 android:layout_height="wrap_content" 233 android:layout_height="wrap_content"
194 - android:orientation="horizontal">  
195 -  
196 - <TextView  
197 - android:layout_width="wrap_content"  
198 - android:layout_height="wrap_content"  
199 - android:layout_marginStart="16dp"  
200 - android:layout_marginTop="15dp"  
201 - android:layout_weight="1"  
202 - android:text="培训学时"  
203 - android:textColor="@color/color_96"  
204 - android:textSize="12sp" />  
205 -  
206 - <TextView  
207 - android:id="@+id/tv_lesson"  
208 - android:layout_width="wrap_content"  
209 - android:layout_height="wrap_content"  
210 - android:layout_marginTop="15dp"  
211 - android:layout_marginEnd="16dp"  
212 - android:layout_weight="1"  
213 - android:gravity="end"  
214 - android:text="12学时"  
215 - android:textColor="@color/color_32"  
216 - android:textSize="12sp" />  
217 -  
218 - </LinearLayout> 234 + android:layout_centerInParent="true"
  235 + android:text="考试汇总"
  236 + android:textColor="@color/white"
  237 + android:textSize="18sp"
  238 + android:textStyle="bold" />
219 239
220 - </LinearLayout> 240 + <View
  241 + android:layout_width="16dp"
  242 + android:layout_height="1dp"
  243 + android:layout_centerVertical="true"
  244 + android:layout_marginEnd="8dp"
  245 + android:layout_toStartOf="@id/tv"
  246 + android:background="@color/white">
221 247
222 - <ImageView  
223 - android:layout_width="64dp"  
224 - android:layout_height="64dp"  
225 - android:layout_gravity="center_horizontal"  
226 - android:src="@mipmap/placeholder_head" /> 248 + </View>
227 249
228 - </FrameLayout> 250 + <View
  251 + android:layout_width="16dp"
  252 + android:layout_height="1dp"
  253 + android:layout_centerVertical="true"
  254 + android:layout_marginStart="8dp"
  255 + android:layout_toEndOf="@id/tv"
  256 + android:background="@color/white">
229 257
  258 + </View>
230 259
231 - <RelativeLayout  
232 - android:layout_width="match_parent"  
233 - android:layout_height="25dp"  
234 - android:layout_marginTop="24dp"  
235 - android:orientation="horizontal"> 260 + </RelativeLayout>
236 261
237 - <TextView  
238 - android:id="@+id/tv"  
239 - android:layout_width="wrap_content" 262 + <androidx.recyclerview.widget.RecyclerView
  263 + android:id="@+id/recyclerview"
  264 + android:layout_width="match_parent"
240 android:layout_height="wrap_content" 265 android:layout_height="wrap_content"
241 - android:layout_centerInParent="true"  
242 - android:text="考试汇总"  
243 - android:textColor="@color/white"  
244 - android:textSize="18sp"  
245 - android:textStyle="bold" />  
246 -  
247 - <View  
248 - android:layout_width="16dp"  
249 - android:layout_height="1dp"  
250 - android:layout_centerVertical="true"  
251 - android:layout_marginEnd="8dp"  
252 - android:layout_toStartOf="@id/tv"  
253 - android:background="@color/white">  
254 -  
255 - </View>  
256 -  
257 - <View  
258 - android:layout_width="16dp"  
259 - android:layout_height="1dp"  
260 - android:layout_centerVertical="true"  
261 - android:layout_marginStart="8dp"  
262 - android:layout_toEndOf="@id/tv"  
263 - android:background="@color/white">  
264 -  
265 - </View>  
266 -  
267 - </RelativeLayout>  
268 -  
269 - <androidx.recyclerview.widget.RecyclerView  
270 - android:id="@+id/recyclerview"  
271 - android:layout_width="match_parent"  
272 - android:layout_height="match_parent"  
273 - android:layout_marginStart="16dp"  
274 - android:layout_marginTop="16dp"  
275 - android:layout_marginEnd="16dp"  
276 - android:layout_marginBottom="37dp"  
277 - android:overScrollMode="never"  
278 - android:scrollbars="none"  
279 - app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />  
280 -  
281 -<!-- </LinearLayout>-->  
282 -<!-- </androidx.core.widget.NestedScrollView>--> 266 + android:layout_marginStart="16dp"
  267 + android:layout_marginTop="16dp"
  268 + android:layout_marginEnd="16dp"
  269 + android:layout_marginBottom="37dp"
  270 + android:overScrollMode="never"
  271 + android:nestedScrollingEnabled="false"
  272 + android:scrollbars="none"
  273 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
  274 + </LinearLayout>
  275 + </androidx.core.widget.NestedScrollView>
283 276
284 277
285 </LinearLayout> 278 </LinearLayout>
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools" 4 xmlns:tools="http://schemas.android.com/tools"
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 - android:layout_height="match_parent"  
7 - android:orientation="vertical"  
8 - android:foreground="?attr/selectableItemBackground"  
9 - android:background="@color/white"> 6 + android:layout_height="match_parent">
10 7
11 - <androidx.swiperefreshlayout.widget.SwipeRefreshLayout  
12 - android:id="@+id/smart_refresh" 8 + <TextView
  9 + android:id="@+id/tv_no_data"
13 android:layout_width="match_parent" 10 android:layout_width="match_parent"
14 - android:layout_height="0dp"  
15 - android:layout_weight="1"> 11 + android:layout_height="wrap_content"
  12 + android:layout_marginTop="24dp"
  13 + android:drawableTop="@mipmap/search_none"
  14 + android:gravity="center"
  15 + android:visibility="gone" />
16 16
17 - <androidx.recyclerview.widget.RecyclerView  
18 - android:id="@+id/recyclerview" 17 +
  18 + <LinearLayout
  19 + android:id="@+id/lay_data"
  20 + android:layout_width="match_parent"
  21 + android:layout_height="match_parent"
  22 + android:background="@color/white"
  23 + android:orientation="vertical">
  24 +
  25 + <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
  26 + android:id="@+id/smart_refresh"
19 android:layout_width="match_parent" 27 android:layout_width="match_parent"
20 - android:layout_height="wrap_content" 28 + android:layout_height="0dp"
  29 + android:layout_weight="1">
  30 +
  31 + <androidx.recyclerview.widget.RecyclerView
  32 + android:id="@+id/recyclerview"
  33 + android:layout_width="match_parent"
  34 + android:layout_height="wrap_content"
  35 + android:layout_marginStart="16dp"
  36 + android:layout_marginEnd="16dp"
  37 + android:layout_marginBottom="32dp"
  38 + android:overScrollMode="never"
  39 + android:scrollbars="none"
  40 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
  41 + </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
  42 +
  43 + <LinearLayout
  44 + android:id="@+id/ll"
  45 + android:layout_width="match_parent"
  46 + android:layout_height="22dp"
21 android:layout_marginStart="16dp" 47 android:layout_marginStart="16dp"
  48 + android:layout_marginTop="16dp"
22 android:layout_marginEnd="16dp" 49 android:layout_marginEnd="16dp"
23 - android:layout_marginBottom="32dp"  
24 - android:overScrollMode="never"  
25 - android:scrollbars="none"  
26 - app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />  
27 - </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> 50 + android:layout_marginBottom="16dp"
  51 + android:orientation="horizontal">
28 52
29 - <LinearLayout  
30 - android:id="@+id/ll"  
31 - android:layout_width="match_parent"  
32 - android:layout_marginTop="16dp"  
33 - android:layout_height="22dp"  
34 - android:layout_marginStart="16dp"  
35 - android:layout_marginEnd="16dp"  
36 - android:layout_marginBottom="16dp"  
37 - android:orientation="horizontal">  
38 -  
39 -  
40 - <ProgressBar  
41 - android:id="@+id/pr_upload_value"  
42 - style="@android:style/Widget.ProgressBar.Horizontal"  
43 - android:layout_width="210dp"  
44 - android:layout_height="20dp"  
45 - android:layout_gravity="center_vertical"  
46 - android:max="100"  
47 - android:min="0"  
48 - android:progressDrawable="@drawable/progressbar_lesson_time"  
49 - tools:progress="50" />  
50 -  
51 - <TextView  
52 - android:id="@+id/tv_value"  
53 - android:layout_width="wrap_content"  
54 - android:layout_height="wrap_content"  
55 - android:layout_gravity="center_vertical"  
56 - android:layout_marginStart="24dp"  
57 - android:text="已学课时:6/12"  
58 - android:textColor="@color/color_32"  
59 - android:textSize="14sp" /> 53 +
  54 + <ProgressBar
  55 + android:id="@+id/pr_upload_value"
  56 + style="@android:style/Widget.ProgressBar.Horizontal"
  57 + android:layout_width="210dp"
  58 + android:layout_height="20dp"
  59 + android:layout_gravity="center_vertical"
  60 + android:max="100"
  61 + android:min="0"
  62 + android:progressDrawable="@drawable/progressbar_lesson_time"
  63 + tools:progress="50" />
  64 +
  65 + <TextView
  66 + android:id="@+id/tv_value"
  67 + android:layout_width="wrap_content"
  68 + android:layout_height="wrap_content"
  69 + android:layout_gravity="center_vertical"
  70 + android:layout_marginStart="24dp"
  71 + android:text="已学课时:6/12"
  72 + android:textColor="@color/color_32"
  73 + android:textSize="14sp" />
  74 + </LinearLayout>
60 </LinearLayout> 75 </LinearLayout>
61 -</LinearLayout>  
  76 +</FrameLayout>
@@ -33,7 +33,6 @@ @@ -33,7 +33,6 @@
33 android:layout_width="wrap_content" 33 android:layout_width="wrap_content"
34 android:layout_height="wrap_content" 34 android:layout_height="wrap_content"
35 android:layout_alignParentEnd="true" 35 android:layout_alignParentEnd="true"
36 - android:background="@mipmap/report_pass"  
37 android:gravity="center" 36 android:gravity="center"
38 android:text="通过" 37 android:text="通过"
39 android:textColor="@color/white" 38 android:textColor="@color/white"
@@ -64,6 +64,7 @@ @@ -64,6 +64,7 @@
64 android:layout_marginTop="28dp" 64 android:layout_marginTop="28dp"
65 android:layout_marginEnd="16dp" 65 android:layout_marginEnd="16dp"
66 android:text="+10" 66 android:text="+10"
  67 + android:textStyle="bold"
67 android:textColor="@color/color_25" 68 android:textColor="@color/color_25"
68 android:textSize="20sp" /> 69 android:textSize="20sp" />
69 70
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + android:id="@+id/course_type"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + android:background="@android:color/transparent"
  8 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>