作者 杨谦

1.学习报告

2.班级任务完善
3.todo:学情反馈,我的证件,聊天记录啥的
正在显示 23 个修改的文件 包含 746 行增加437 行删除
... ... @@ -331,4 +331,16 @@ interface ApiService {
fun subPaper(
@Field("user_item_id") user_item_id: Int
): Observable<BaseResponse<SubResult>>
/**
* 积分记录
* @param page 页数
* @param page_num 每页显示数量
*/
@FormUrlEncoded
@POST("/api/user/score_log")
fun scoreLog(
@Field("page") page: Int,
@Field("page_num") page_num: Int
): Observable<BaseResponse<CommonDataList<CommonPage<ScoreLog>>>>
}
\ No newline at end of file
... ...
... ... @@ -266,15 +266,5 @@ interface UserApi : ApiService {
@Field("id") id: Int
): Observable<BaseResponse<Void>>
/**
* 积分记录
* @param page 页数
* @param page_num 每页显示数量
*/
@FormUrlEncoded
@POST("/api/user/score_log")
fun scoreLog(
@Field("page") page: Int,
@Field("page_num") page_num: Int
): Observable<BaseResponse<CommonPage<ScoreLog>>>
}
\ No newline at end of file
... ...
... ... @@ -76,11 +76,11 @@ class TrainRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSta
addRequest(trainService.trainChatRead(train_class_id), liveData)
}
fun trainReport(liveData: MutableLiveData<BaseResponse<CommonReport<TrainReport>>>){
fun trainReport(liveData: MutableLiveData<BaseResponse<CommonReport<TrainReport>>>) {
addRequest(trainService.trainReport(), liveData)
}
fun trainLessonBak(liveData: MutableLiveData<BaseResponse<Void>>){
fun trainLessonBak(liveData: MutableLiveData<BaseResponse<Void>>) {
addRequest(trainService.trainLessonBak(), liveData)
}
... ... @@ -107,4 +107,12 @@ class TrainRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSta
fun subPaper(user_item_id: Int, liveData: MutableLiveData<BaseResponse<SubResult>>) {
addRequest(itemService.subPaper(user_item_id), liveData)
}
fun scoreList(
page: Int,
page_num: Int,
liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<ScoreLog>>>>
) {
addRequest(itemService.scoreLog(page, page_num), liveData)
}
}
\ No newline at end of file
... ...
... ... @@ -154,7 +154,7 @@ class UserRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat
fun scoreLog(
page: Int,
page_num: Int, liveData: MutableLiveData<BaseResponse<CommonPage<ScoreLog>>>
page_num: Int, liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<ScoreLog>>>>
) {
addRequest(userService.scoreLog(page, page_num), liveData)
}
... ...
... ... @@ -99,6 +99,7 @@ open class CertLog(
open class ScoreLog(
var id: Int,
var createtime: String,
var score: Int, // 获得积分
var type: String, // 获取方式:类型:1=每日一练,2=挑战答题,3=专项练习,4=培训计划考试.5=培训计划练习,6=模拟考试[未完待续……],7=班级任务
var memo: String // 获取积分来源
... ...
... ... @@ -133,25 +133,24 @@ open class TrainReport(
)
open class TrainReportUser(
// var id: Int,
// var nickname: String, // 姓名
// var mobile: String,//手机号", // 手机号
// var gender: Int, // 性别1=男2=女
var id: Int,
var nickname: String, // 姓名
var mobile: String,//手机号", // 手机号
var gender: Int, // 性别1=男2=女
var avatar: String,//"https://security.brofirst.cn/uploads/20211030/e777a39142bf8ab8dd3e02b6eb9f9d9f.jpg", // 头像
var score: Int
// , // 积分
// var identity: String, // 身份证号
// var user_id: Int,
// var createtime: Long, // 建档日期
// var class_hours_count: Int, // 培训总学时
// var item_count: Int, // 练习题量
// var lessons: String, // 结业课程
// var is_end: Int, // 是否结业0=否1=是
// var class_name: String, // 班级名称
// var train_sort_name: String, // 培训类型
// var time: String, // 时间
// var train_name: String, // 培训单位
// var class_hours: Int, // 培训学时
var score: Int, // 积分
var identity: String, // 身份证号
var user_id: Int,
var createtime: String, // 建档日期
var class_hours_count: Int, // 培训总学时
var item_count: Int, // 练习题量
var lessons: String, // 结业课程
var is_end: Int, // 是否结业0=否1=是
var class_name: String, // 班级名称
var train_sort_name: String, // 培训类型
var time: String, // 时间
var train_name: String, // 培训单位
var class_hours: Int, // 培训学时
)
open class TrainStudyTrain(
... ... @@ -210,6 +209,7 @@ open class TrainReportExam(
var is_complete: String, // 是否完成0=否1=是
var date: String,
var score: Int, // 积分
var update_time_text: String, // 积分
var is_pass: String, //是否通过0=否1=是
var trainexam: TrainReportExamMsg
)
... ...
... ... @@ -46,19 +46,13 @@ class SearchActivity :
// 点击搜索按钮
search.setOnClickListener {
// 点击搜索时隐藏历史记录
historyGroup.visibility = View.GONE
historyRecycler.visibility = View.GONE
tabLayout.visibility = View.VISIBLE
viewPager.visibility = View.VISIBLE
showData(true)
EventBus.getDefault().post(SearchEvent(searchEdit.text.toString()))
}
searchEdit.setOnClickListener {
// 输入框点击时显示历史记录
historyGroup.visibility = View.VISIBLE
historyRecycler.visibility = View.VISIBLE
tabLayout.visibility = View.GONE
viewPager.visibility = View.GONE
showData(false)
}
val searchResultAdapter = BasePagerAdapter(
... ... @@ -86,6 +80,20 @@ class SearchActivity :
mViewModel.searchLog()
}
fun showData(show: Boolean) {
if (show) {
binding.historyRecycler.visibility = View.GONE
binding.historyGroup.visibility = View.GONE
binding.tabLayout.visibility = View.VISIBLE
binding.viewPager.visibility = View.VISIBLE
} else {
binding.historyGroup.visibility = View.VISIBLE
binding.historyRecycler.visibility = View.VISIBLE
binding.tabLayout.visibility = View.GONE
binding.viewPager.visibility = View.GONE
}
}
override fun initDataObserver() {
mViewModel.liveData.observe(this, {
val historyAdapter = HistoryAdapter()
... ... @@ -94,15 +102,14 @@ class SearchActivity :
historyAdapter.addListener(object : OnItemClickListener<SearchLog> {
override fun onClick(position: Int, data: SearchLog) {
EventBus.getDefault().post(SearchEvent(data.keyword))
binding.historyRecycler.visibility = View.GONE
binding.historyGroup.visibility = View.GONE
binding.tabLayout.visibility = View.VISIBLE
binding.viewPager.visibility = View.VISIBLE
showData(true)
}
})
})
mViewModel.clearData.observe(this, {
mViewModel.searchLog()
EventBus.getDefault().post(SearchEvent(""))
showData(true)
})
}
}
\ No newline at end of file
... ...
... ... @@ -24,8 +24,33 @@ class TextCourseTypeAdapter : BaseAdapter<WorkTypeBean.ListBean, AdapterCourseTy
return AdapterCourseTypeBinding.inflate(from, parent, false)
}
override fun onBind(holder: AdapterCourseTypeBinding, position: Int, data: WorkTypeBean.ListBean) {
override fun onBind(
holder: AdapterCourseTypeBinding,
position: Int,
data: WorkTypeBean.ListBean
) {
holder.name.isSelected = position == index
holder.name.text = data.name
}
}
class StatusName(var type: Int, var str: String)
class StatusAdapter : BaseAdapter<StatusName, AdapterCourseTypeBinding>() {
var index: Int = 0
override fun getViewBinding(
context: Context,
parent: ViewGroup,
viewType: Int,
from: LayoutInflater
): AdapterCourseTypeBinding {
return AdapterCourseTypeBinding.inflate(from, parent, false)
}
override fun onBind(holder: AdapterCourseTypeBinding, position: Int, data: StatusName) {
holder.name.isSelected = position == index
holder.name.text = data.str
}
}
\ No newline at end of file
... ...
... ... @@ -6,4 +6,6 @@ package com.br_technology.securitytrain_master.ui.view.home.event
* Description: 初见时你很迷人
*/
class GetWorkTypeEvent(var id: Int, var name: String) {
}
\ No newline at end of file
}
class StatusTypeEvent(var id: Int, var name: String)
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.view.mine.activity
import android.os.Bundle
import android.view.View
import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentPagerAdapter
... ... @@ -9,11 +10,15 @@ import com.br_technology.securitytrain_master.base.common.ConstantType.TYPE_CLAS
import com.br_technology.securitytrain_master.base.common.ConstantType.TYPE_CLASS_PRACTICE
import com.br_technology.securitytrain_master.base.view.BasePagerAdapter
import com.br_technology.securitytrain_master.databinding.ActivityClassDutyBinding
import com.br_technology.securitytrain_master.ui.view.home.adapter.StatusName
import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent
import com.br_technology.securitytrain_master.ui.view.mine.fragment.ClassDutyCourseFragment
import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyViewModel
import com.br_technology.securitytrain_master.view.ClassifyPop
import com.br_technology.securitytrain_master.view.StatusPop
import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
/**
* Time: 8/3/2021 11:15
... ... @@ -26,11 +31,28 @@ class ClassDutyActivity :
private val classifyPop by lazy {
ClassifyPop(this)
//type 状态0=全部1=已完成2=未完成
val pop = StatusPop(this)
pop.setList(mutableListOf(StatusName(0, "全部"), StatusName(1, "已完成"), StatusName(2, "未完成")))
return@lazy pop
}
override fun initDataObserver() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
EventBus.getDefault().register(this)
}
override fun onDestroy() {
super.onDestroy()
EventBus.getDefault().unregister(this)
}
@Subscribe
fun statusChange(status: StatusTypeEvent) {
binding.toolBar.setRightText(status.name)
}
override fun initDataObserver() {
}
override fun initData() {
... ... @@ -66,6 +88,7 @@ class ClassDutyActivity :
val titles = listOf("课程", "练习", "考试")
searchResultAdapter.addData(list.toMutableList())
searchResultAdapter.addTitle(titles)
viewPager.offscreenPageLimit = 2
viewPager.adapter = searchResultAdapter
tabLayout.setupWithViewPager(viewPager)
}
... ...
package com.br_technology.securitytrain_master.ui.view.mine.activity
import android.annotation.SuppressLint
import android.view.View
import com.br_technology.securitytrain_master.databinding.ActivityLearningReportBinding
import com.br_technology.securitytrain_master.expand.glideRound
import com.br_technology.securitytrain_master.ui.view.mine.adapter.LearningReportAdapter
import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LearningReportViewModel
import com.br_technology.securitytrain_master.util.TranslateUnit
import com.br_technology.securitytrain_master.view.ClassifyPop
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
/**
... ... @@ -20,9 +20,8 @@ class LearningReportActivity :
ActivityLearningReportBinding::inflate
) {
private val classifyPop by lazy {
ClassifyPop(this)
}
var page = 0
var learningReportAdapter: LearningReportAdapter? = null
@SuppressLint("SetTextI18n")
override fun initDataObserver() {
... ... @@ -36,35 +35,53 @@ class LearningReportActivity :
)
}
})
mViewModel.dataList.observe(this, {
val data = it.data.list.data
binding.smartRefresh.finishRefresh()
binding.smartRefresh.finishLoadMore()
binding.smartRefresh.setEnableLoadMore(data.size == 10)
if (page == 1) {
learningReportAdapter = LearningReportAdapter()
binding.recyclerview.adapter = learningReportAdapter
learningReportAdapter?.addList(data)
boolData(data.isNotEmpty())
} else {
learningReportAdapter?.addList(data)
}
})
}
private fun boolData(boolean: Boolean) {
if (boolean) {
binding.smartRefresh.visibility = View.VISIBLE
binding.tvNoData.visibility = View.GONE
} else {
binding.smartRefresh.visibility = View.GONE
binding.tvNoData.visibility = View.VISIBLE
}
}
override fun initData() {
super.initData()
mViewModel.getReport()
binding.apply {
// toolBar.setRightText("全部")
// toolBar.setRightTextDrawable(
// ContextCompat.getDrawable(
// baseContext,
// R.mipmap.down_arrow
// )
// )
//
// toolBar.addRightListener(object : ToolBarClickListener {
// override fun onClick(view: View) {
// if (!classifyPop.isShowing) {
// classifyPop.showAsDropDown(view)
// }
// }
// })
val learningReportAdapter = LearningReportAdapter()
// recyclerview.adapter = learningReportAdapter
// learningReportAdapter.addList(list)
tvCreateReport.setOnClickListener {
startActivity(LearningReportDetailActivity::class.java)
}
smartRefresh.setOnRefreshListener { refresh() }
smartRefresh.setOnLoadMoreListener { loadMore() }
}
refresh()
}
fun refresh() {
page = 1
mViewModel.getScoreList(page)
}
private fun loadMore() {
page++
mViewModel.getScoreList(page)
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.view.mine.activity
import android.annotation.SuppressLint
import androidx.core.content.ContextCompat
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.ActivityLearningReportDetailBinding
import com.br_technology.securitytrain_master.ui.view.home.pojo.VideoCourse
import com.br_technology.securitytrain_master.expand.glideRound
import com.br_technology.securitytrain_master.ui.view.mine.adapter.LearningReportDetailAdapter
import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LearningReportViewModel
import com.br_technology.securitytrain_master.util.TranslateUnit
import com.gyf.immersionbar.ImmersionBar
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
... ... @@ -18,8 +21,32 @@ class LearningReportDetailActivity :
BaseLifeCycleActivity<LearningReportViewModel, ActivityLearningReportDetailBinding>(
ActivityLearningReportDetailBinding::inflate
) {
@SuppressLint("SetTextI18n")
override fun initDataObserver() {
mViewModel.data.observe(this, {
val data = it.data.report.exam_list
if (data.isNotEmpty()) {
val learningReportDetailAdapter = LearningReportDetailAdapter()
binding.recyclerview.adapter = learningReportDetailAdapter
learningReportDetailAdapter.addList(data)
}
it.data.report.user.let { user ->
binding.txtEnd.text = if (user.is_end == 1) {
"已结业"
} else {
"未结业"
}
binding.tvClassName.text = user.class_name
binding.tvClassType.text = user.train_sort_name
binding.tvTime.text = user.createtime
binding.tvCompany.text = user.train_name
binding.tvLesson.text = "${user.class_hours_count}学时"
binding.ivAvtar.glideRound(
user.avatar,
TranslateUnit.dp2px(this@LearningReportDetailActivity, 64f)
)
}
})
}
override fun initView() {
... ... @@ -29,23 +56,15 @@ class LearningReportDetailActivity :
override fun initData() {
super.initData()
mViewModel.getReport()
binding.apply {
toolBar.setTitleColor(resources.getColor(R.color.white))
toolBar.setBackImg(R.mipmap.ic_back_white)
val learningReportDetailAdapter = LearningReportDetailAdapter()
val list = mutableListOf(
VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "45分", "通过"),
VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "68分", "通过"),
VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "100分", "通过"),
VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"),
VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"),
VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"),
VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"),
VideoCourse(R.mipmap.banner, "01:45:00", "自动化制作课程", "99分", "通过"),
toolBar.setTitleColor(
ContextCompat.getColor(
this@LearningReportDetailActivity,
R.color.white
)
)
recyclerview.adapter = learningReportDetailAdapter
learningReportDetailAdapter.addList(list)
toolBar.setBackImg(R.mipmap.ic_back_white)
}
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.view.mine.adapter
import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import com.br_technology.securitytrain_master.base.view.BaseAdapter
import com.br_technology.securitytrain_master.databinding.ItemLearningReportBinding
import com.br_technology.securitytrain_master.ui.view.home.pojo.VideoCourse
import com.br_technology.securitytrain_master.ui.bean.ScoreLog
/**
* Time: 8/2/2021 16:37
* Author: Captain
* Description: 初见时你很迷人
*/
class LearningReportAdapter : BaseAdapter<VideoCourse,ItemLearningReportBinding>() {
class LearningReportAdapter : BaseAdapter<ScoreLog, ItemLearningReportBinding>() {
override fun getViewBinding(
context: Context,
parent: ViewGroup,
... ... @@ -22,10 +23,41 @@ class LearningReportAdapter : BaseAdapter<VideoCourse,ItemLearningReportBinding>
return ItemLearningReportBinding.inflate(from, parent, false)
}
override fun onBind(holder: ItemLearningReportBinding, position: Int, data: VideoCourse) {
holder.tvTitle.text = data.courseName
holder.tvTime.text = data.lesson
holder.tvType.text = data.head
holder.tvScore.text = data.name
@SuppressLint("SetTextI18n")
override fun onBind(holder: ItemLearningReportBinding, position: Int, data: ScoreLog) {
holder.tvTitle.text = data.memo
holder.tvTime.text = data.createtime
holder.tvType.text = getStr(data.type.toInt())
holder.tvScore.text = "+${data.score}"
}
fun getStr(type: Int): String {
//获取方式:类型:1=每日一练,2=挑战答题,3=专项练习,4=培训计划考试.5=培训计划练习,6=模拟考试[未完待续……],7=班级任务
when (type) {
1 -> {
return "(每日一练)"
}
2 -> {
return "(挑战答题)"
}
3 -> {
return "(专项练习)"
}
4 -> {
return "(培训计划考试)"
}
5 -> {
return "(培训计划练习)"
}
6 -> {
return "(模拟考试)"
}
7 -> {
return "(班级任务)"
}
else -> {
return "(每日一练)"
}
}
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.view.mine.adapter
import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.base.view.BaseAdapter
import com.br_technology.securitytrain_master.databinding.ItemExamForAllBinding
import com.br_technology.securitytrain_master.ui.view.home.pojo.VideoCourse
import com.br_technology.securitytrain_master.ui.bean.TrainReportExam
/**
* Time: 8/2/2021 17:42
* Author: Captain
* Description: 初见时你很迷人
*/
class LearningReportDetailAdapter : BaseAdapter<VideoCourse,ItemExamForAllBinding>() {
class LearningReportDetailAdapter : BaseAdapter<TrainReportExam, ItemExamForAllBinding>() {
override fun getViewBinding(
context: Context,
parent: ViewGroup,
... ... @@ -22,10 +25,20 @@ class LearningReportDetailAdapter : BaseAdapter<VideoCourse,ItemExamForAllBindin
return ItemExamForAllBinding.inflate(from, parent, false)
}
override fun onBind(holder: ItemExamForAllBinding, position: Int, data: VideoCourse) {
holder.tvTitle.text = data.courseName
holder.tvTime.text = data.lesson
holder.tvStatus.text = data.name
holder.tvScore.text = data.head
@SuppressLint("UseCompatLoadingForDrawables", "SetTextI18n")
override fun onBind(holder: ItemExamForAllBinding, position: Int, data: TrainReportExam) {
holder.tvTitle.text = data.title
holder.tvStatus.text = if (data.is_pass == "1") {
"已通过"
} else {
"未通过"
}
holder.tvStatus.background = if (data.is_pass == "1") {
ContextCompat.getDrawable(holder.root.context, R.mipmap.report_pass)
} else {
ContextCompat.getDrawable(holder.root.context, R.mipmap.report_nopass)
}
holder.tvTime.text = data.update_time_text
holder.tvScore.text = "${data.trainexam.score}分"
}
}
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@ package com.br_technology.securitytrain_master.ui.view.mine.fragment
import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.view.View
import com.br_technology.securitytrain_master.base.common.ConstantParamKey
import com.br_technology.securitytrain_master.base.common.ConstantType
... ... @@ -10,6 +11,7 @@ import com.br_technology.securitytrain_master.ui.bean.*
import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity
import com.br_technology.securitytrain_master.ui.view.home.activity.course.CoursePractiseActivity
import com.br_technology.securitytrain_master.ui.view.home.activity.course.TextDetailActivity
import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent
import com.br_technology.securitytrain_master.ui.view.mine.adapter.CourseAdapter
import com.br_technology.securitytrain_master.ui.view.mine.adapter.TrainTestAdapter
import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyCourseViewModel
... ... @@ -17,6 +19,8 @@ import com.br_technology.securitytrain_master.util.TranslateUnit
import com.br_technology.securitytrain_master.view.DialogMention
import com.br_technology.securitytrain_master.view.VerticalDecoration
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import java.text.SimpleDateFormat
import java.util.*
... ... @@ -35,6 +39,33 @@ class ClassDutyCourseFragment(val type: Int) :
var courseAdapter: CourseAdapter? = null
var trainTestAdapter: TrainTestAdapter? = null
var lessonBean: LessonList? = null
var status = 0
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
EventBus.getDefault().register(this)
}
override fun onDestroyView() {
EventBus.getDefault().unregister(this)
super.onDestroyView()
}
@Subscribe
fun statusChange(status: StatusTypeEvent) {
this.status = status.id
refreshData()
}
private fun boolData(boolean: Boolean) {
if (boolean) {
binding.layData.visibility = View.VISIBLE
binding.tvNoData.visibility = View.GONE
} else {
binding.layData.visibility = View.GONE
binding.tvNoData.visibility = View.VISIBLE
}
}
@SuppressLint("SetTextI18n")
override fun initDataObserver() {
... ... @@ -48,15 +79,14 @@ class ClassDutyCourseFragment(val type: Int) :
"已学课时:${lessonBean!!.lesson_class_user}/ ${lessonBean!!.lesson_class_count}"
}
val list = it.data.list
if (list.isNotEmpty()) {
if (page == 1) {
courseAdapter = CourseAdapter()
courseAdapter?.setListener(this)
courseAdapter?.setList(list)
binding.recyclerview.adapter = courseAdapter
} else {
courseAdapter?.addData(list)
}
if (page == 1) {
courseAdapter = CourseAdapter()
courseAdapter?.setListener(this)
courseAdapter?.setList(list)
binding.recyclerview.adapter = courseAdapter
boolData(list.isNotEmpty())
} else {
courseAdapter?.addData(list)
}
if (list.size < 10) {
courseAdapter?.loadMoreModule?.loadMoreEnd()
... ... @@ -67,15 +97,14 @@ class ClassDutyCourseFragment(val type: Int) :
mViewModel.listPractise.observe(this, {
binding.smartRefresh.isRefreshing = false
val list = it.data.list
if (list.isNotEmpty()) {
if (page == 1) {
trainTestAdapter = TrainTestAdapter()
trainTestAdapter?.setListener(this)
trainTestAdapter?.addData(transPracticeData(list))
binding.recyclerview.adapter = trainTestAdapter
} else {
trainTestAdapter?.addData(transPracticeData(list))
}
if (page == 1) {
trainTestAdapter = TrainTestAdapter()
trainTestAdapter?.setListener(this)
trainTestAdapter?.addData(transPracticeData(list))
binding.recyclerview.adapter = trainTestAdapter
boolData(list.isNotEmpty())
} else {
trainTestAdapter?.addData(transPracticeData(list))
}
if (list.size < 10) {
trainTestAdapter?.loadMoreModule?.loadMoreEnd()
... ... @@ -86,15 +115,14 @@ class ClassDutyCourseFragment(val type: Int) :
mViewModel.listExam.observe(this, {
binding.smartRefresh.isRefreshing = false
val list = it.data.list
if (list.isNotEmpty()) {
if (page == 1) {
trainTestAdapter = TrainTestAdapter()
trainTestAdapter?.setListener(this)
trainTestAdapter?.addData(transExamData(list))
binding.recyclerview.adapter = trainTestAdapter
} else {
trainTestAdapter?.addData(transExamData(list))
}
if (page == 1) {
trainTestAdapter = TrainTestAdapter()
trainTestAdapter?.setListener(this)
trainTestAdapter?.addData(transExamData(list))
binding.recyclerview.adapter = trainTestAdapter
boolData(list.isNotEmpty())
} else {
trainTestAdapter?.addData(transExamData(list))
}
if (list.size < 10) {
trainTestAdapter?.loadMoreModule?.loadMoreEnd()
... ... @@ -106,9 +134,9 @@ class ClassDutyCourseFragment(val type: Int) :
private fun getData() {
when (type) {
ConstantType.TYPE_CLASS_COURSE -> mViewModel.getTrainLessonList(0, page)
ConstantType.TYPE_CLASS_PRACTICE -> mViewModel.getTrainPractiseList(0, page)
ConstantType.TYPE_CLASS_EXAM -> mViewModel.getTrainExamList(0, page)
ConstantType.TYPE_CLASS_COURSE -> mViewModel.getTrainLessonList(status, page)
ConstantType.TYPE_CLASS_PRACTICE -> mViewModel.getTrainPractiseList(status, page)
ConstantType.TYPE_CLASS_EXAM -> mViewModel.getTrainExamList(status, page)
else -> {
}
}
... ... @@ -179,6 +207,7 @@ class ClassDutyCourseFragment(val type: Int) :
courseAdapter?.loadMoreModule?.setOnLoadMoreListener {
loadMore()
}
binding.tvNoData.text = "暂无课程"
}
else -> {
trainTestAdapter = TrainTestAdapter()
... ... @@ -188,6 +217,11 @@ class ClassDutyCourseFragment(val type: Int) :
courseAdapter?.loadMoreModule?.setOnLoadMoreListener {
loadMore()
}
if (ConstantType.TYPE_CLASS_PRACTICE == type) {
binding.tvNoData.text = "暂无练习"
} else {
binding.tvNoData.text = "暂无考试"
}
}
}
}
... ... @@ -238,10 +272,12 @@ class ClassDutyCourseFragment(val type: Int) :
if (bool) {
startNext(item)
} else {
dialogMention.show()
dialogMention.setListener {
startNext(item)
}
// dialogMention.show()
// dialogMention.setListener {
// startNext(item)
// }
// ios 不做跳转,保持一致
showTip("不在考试时间")
}
} else {
showTip("考试已结束")
... ...
... ... @@ -2,10 +2,12 @@ package com.br_technology.securitytrain_master.ui.view.mine.viewmodel
import androidx.lifecycle.MutableLiveData
import com.br_technology.securitytrain_master.base.network.response.BaseResponse
import com.br_technology.securitytrain_master.base.network.response.CommonDataList
import com.br_technology.securitytrain_master.base.network.response.CommonPage
import com.br_technology.securitytrain_master.base.network.response.CommonReport
import com.br_technology.securitytrain_master.base.repository.TrainRepository
import com.br_technology.securitytrain_master.base.view.BaseViewModel
import com.br_technology.securitytrain_master.ui.bean.TrainDetail
import com.br_technology.securitytrain_master.ui.bean.ScoreLog
import com.br_technology.securitytrain_master.ui.bean.TrainReport
/**
... ... @@ -16,11 +18,13 @@ import com.br_technology.securitytrain_master.ui.bean.TrainReport
class LearningReportViewModel : BaseViewModel<TrainRepository>() {
val data = MutableLiveData<BaseResponse<CommonReport<TrainReport>>>()
fun getReport(){
val dataList = MutableLiveData<BaseResponse<CommonDataList<CommonPage<ScoreLog>>>>()
fun getReport() {
mRepository.trainReport(data)
}
fun getDetail(){
// mRepository.get(data)
fun getScoreList(page: Int) {
mRepository.scoreList(page, 10, dataList)
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.view
import android.app.Activity
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.PopupWindow
import androidx.core.content.ContextCompat
import com.br_technology.securitytrain_master.databinding.StatusClassifyBinding
import com.br_technology.securitytrain_master.ui.view.home.adapter.StatusAdapter
import com.br_technology.securitytrain_master.ui.view.home.adapter.StatusName
import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent
import com.br_technology.securitytrain_master.util.TranslateUnit
import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
import org.greenrobot.eventbus.EventBus
/**
* createTime:2021/7/30 9:25
* auth:张继
* des:
*/
class StatusPop(context: Activity) : PopupWindow(context) {
private var mWorkTypeList: MutableList<StatusName>? = null
private var textCourseTypeAdapter: StatusAdapter? = null
private var pos: Int = 0
private val binding by lazy {
StatusClassifyBinding.inflate(LayoutInflater.from(context))
}
fun setList(workTypeList: MutableList<StatusName>) {
mWorkTypeList = workTypeList
mWorkTypeList?.let { textCourseTypeAdapter?.addList(it) }
}
init {
contentView = binding.root
width = TranslateUnit.dp2px(contentView.context, 100f)
height = ViewGroup.LayoutParams.WRAP_CONTENT
setBackgroundDrawable(ContextCompat.getDrawable(context, android.R.color.transparent))
isOutsideTouchable = true
binding.apply {
mWorkTypeList = mutableListOf()
textCourseTypeAdapter = StatusAdapter()
textCourseTypeAdapter?.addListener(object : OnItemClickListener<StatusName> {
override fun onClick(position: Int, data: StatusName) {
textCourseTypeAdapter!!.index = position
textCourseTypeAdapter!!.notifyDataSetChanged()
pos = position
}
})
courseType.layoutParams = FrameLayout.LayoutParams(
TranslateUnit.dp2px(contentView.context, 100f),
FrameLayout.LayoutParams.WRAP_CONTENT
)
courseType.adapter = textCourseTypeAdapter
mWorkTypeList?.let { textCourseTypeAdapter?.addList(it) }
textCourseTypeAdapter?.addListener(object : OnItemClickListener<StatusName> {
override fun onClick(position: Int, data: StatusName) {
EventBus.getDefault().post(StatusTypeEvent(data.type, data.str))
dismiss()
}
})
}
}
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/include"
... ... @@ -12,15 +13,12 @@
android:id="@+id/tool_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/include"
app:toolTitle="学习报告" />
<RelativeLayout
android:id="@+id/rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tool_bar"
android:background="@mipmap/learning_report_top_bg">
<ImageView
... ... @@ -44,29 +42,64 @@
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/rl"
android:nestedScrollingEnabled="false"
android:overScrollMode="never"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager">
android:layout_height="0dp"
android:layout_weight="1">
<TextView
android:id="@+id/tv_no_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="暂无积分记录"
android:visibility="gone"
android:drawableTop="@mipmap/search_none"
android:gravity="center" />
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/smart_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.scwang.smart.refresh.header.MaterialHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
android:overScrollMode="never"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager">
</androidx.recyclerview.widget.RecyclerView>
<com.scwang.smart.refresh.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</FrameLayout>
</androidx.recyclerview.widget.RecyclerView>
<TextView
android:id="@+id/tv_create_report"
android:layout_width="343dp"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="42dp"
android:layout_marginStart="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="16dp"
android:background="@drawable/solid_25_4"
android:gravity="center"
android:text="生成报告"
android:textColor="@color/white"
android:textSize="16sp" />
</RelativeLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
... ...
... ... @@ -15,271 +15,264 @@
android:background="@color/color_25"
app:toolTitle="学习报告" />
<!-- <androidx.core.widget.NestedScrollView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent">-->
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:orientation="vertical">-->
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="344dp"
android:layout_height="375dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
<FrameLayout
android:layout_width="344dp"
android:layout_height="343dp"
android:layout_marginTop="32dp"
android:background="@drawable/solid_ff_4"
android:orientation="vertical">
android:layout_height="375dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="41dp"
android:background="@mipmap/create_learning_report_top_bg"
android:layout_width="344dp"
android:layout_height="343dp"
android:layout_marginTop="32dp"
android:background="@drawable/solid_ff_4"
android:orientation="vertical">
<TextView
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="结业"
android:textColor="@color/color_e8"
android:textSize="24sp"
android:textStyle="bold" />
android:layout_marginTop="41dp"
android:background="@mipmap/create_learning_report_top_bg"
android:orientation="vertical">
<TextView
android:id="@+id/txt_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="结业"
android:textColor="@color/color_e8"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@color/color_eb">
</View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="班级名称"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tvClassName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:text="三岗人员培训资格"
android:textColor="@color/color_32"
android:textSize="12sp" />
android:background="@color/color_eb">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</View>
<TextView
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="培训类型"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_class_type"
android:layout_width="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="班级名称"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tvClassName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:textColor="@color/color_32"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:text="三岗培训"
android:textColor="@color/color_32"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="培训类型"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_class_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:textColor="@color/color_32"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="时间"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="时间"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:textColor="@color/color_32"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:text="2021/07/08-2021/07/09"
android:textColor="@color/color_32"
android:textSize="12sp" />
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="培训单位"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_company"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:textColor="@color/color_32"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="培训学时"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_lesson"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:textColor="@color/color_32"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_avtar"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_gravity="center_horizontal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="培训单位"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_company"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:text="天津百荣培训中心"
android:textColor="@color/color_32"
android:textSize="12sp" />
</FrameLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_marginTop="24dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:text="培训学时"
android:textColor="@color/color_96"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_lesson"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="end"
android:text="12学时"
android:textColor="@color/color_32"
android:textSize="12sp" />
</LinearLayout>
android:layout_centerInParent="true"
android:text="考试汇总"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="16dp"
android:layout_height="1dp"
android:layout_centerVertical="true"
android:layout_marginEnd="8dp"
android:layout_toStartOf="@id/tv"
android:background="@color/white">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/placeholder_head" />
</View>
</FrameLayout>
<View
android:layout_width="16dp"
android:layout_height="1dp"
android:layout_centerVertical="true"
android:layout_marginStart="8dp"
android:layout_toEndOf="@id/tv"
android:background="@color/white">
</View>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_marginTop="24dp"
android:orientation="horizontal">
</RelativeLayout>
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="考试汇总"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
<View
android:layout_width="16dp"
android:layout_height="1dp"
android:layout_centerVertical="true"
android:layout_marginEnd="8dp"
android:layout_toStartOf="@id/tv"
android:background="@color/white">
</View>
<View
android:layout_width="16dp"
android:layout_height="1dp"
android:layout_centerVertical="true"
android:layout_marginStart="8dp"
android:layout_toEndOf="@id/tv"
android:background="@color/white">
</View>
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="37dp"
android:overScrollMode="never"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<!-- </LinearLayout>-->
<!-- </androidx.core.widget.NestedScrollView>-->
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="37dp"
android:overScrollMode="never"
android:nestedScrollingEnabled="false"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:foreground="?attr/selectableItemBackground"
android:background="@color/white">
android:layout_height="match_parent">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/smart_refresh"
<TextView
android:id="@+id/tv_no_data"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:drawableTop="@mipmap/search_none"
android:gravity="center"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
<LinearLayout
android:id="@+id/lay_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/smart_refresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="32dp"
android:overScrollMode="never"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="22dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="32dp"
android:overScrollMode="never"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
android:layout_marginBottom="16dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_marginTop="16dp"
android:layout_height="22dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/pr_upload_value"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="210dp"
android:layout_height="20dp"
android:layout_gravity="center_vertical"
android:max="100"
android:min="0"
android:progressDrawable="@drawable/progressbar_lesson_time"
tools:progress="50" />
<TextView
android:id="@+id/tv_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp"
android:text="已学课时:6/12"
android:textColor="@color/color_32"
android:textSize="14sp" />
<ProgressBar
android:id="@+id/pr_upload_value"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="210dp"
android:layout_height="20dp"
android:layout_gravity="center_vertical"
android:max="100"
android:min="0"
android:progressDrawable="@drawable/progressbar_lesson_time"
tools:progress="50" />
<TextView
android:id="@+id/tv_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp"
android:text="已学课时:6/12"
android:textColor="@color/color_32"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</FrameLayout>
... ...
... ... @@ -33,7 +33,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:background="@mipmap/report_pass"
android:gravity="center"
android:text="通过"
android:textColor="@color/white"
... ...
... ... @@ -64,6 +64,7 @@
android:layout_marginTop="28dp"
android:layout_marginEnd="16dp"
android:text="+10"
android:textStyle="bold"
android:textColor="@color/color_25"
android:textSize="20sp" />
... ...
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/course_type"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
\ No newline at end of file
... ...