作者 杨谦

1.聊天等(接口返回数据问题)

2.直播:没有职位入参等...界面部分调整
3....各种接口缺省..待调试
正在显示 23 个修改的文件 包含 264 行增加96 行删除
... ... @@ -49,6 +49,7 @@ open class LessonClazz(
open class LessonClassDetail(
var id: Int,
var is_complete: Int,
var name: String,
var lesson_id: String,
var lesson_class_id: String,
... ...
package com.br_technology.securitytrain_master.ui.view.bank.fragment
import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.base.common.ConstantType
... ... @@ -9,11 +11,16 @@ import com.br_technology.securitytrain_master.ui.view.bank.activity.*
import com.br_technology.securitytrain_master.ui.view.bank.adapter.PracticeAdapter
import com.br_technology.securitytrain_master.ui.view.bank.bean.PracticeBean
import com.br_technology.securitytrain_master.ui.view.bank.viewmodel.BankViewModel
import com.br_technology.securitytrain_master.ui.view.home.event.GetWorkTypeEvent
import com.br_technology.securitytrain_master.util.TYPE_All
import com.br_technology.securitytrain_master.util.TYPE_HOME
import com.br_technology.securitytrain_master.util.sp_job_name
import com.br_technology.securitytrain_master.view.ClassifyPop
import com.br_technology.securitytrain_master.view.DialogStar
import com.br_technology.securitytrain_master.view.listener.DialogListener
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
/**
* createTime:2021/7/27 15:47
... ... @@ -26,19 +33,38 @@ class BankFragment :
private var practiceList: MutableList<PracticeBean>? = null
private var practiceAdapter: PracticeAdapter? = null
private val classifyPop by lazy {
ClassifyPop(requireActivity())
ClassifyPop(requireActivity(), TYPE_All)
}
private val dialogStarDialog by lazy {
DialogStar(requireActivity())
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
EventBus.getDefault().register(this)
}
override fun onDestroyView() {
super.onDestroyView()
EventBus.getDefault().unregister(this)
}
override fun initData() {
super.initData()
practiceList = mutableListOf()
mViewModel.practiceList(page, 20)
binding.apply {
// 标题栏类型
type.text= sp_job_name
type.text = sp_job_name
type.setOnClickListener {
if (mViewModel.beanData().value == null) {
mViewModel.workType()
} else {
mViewModel.beanData().value?.apply {
classifyPop.showAsDropDown(binding.type)
}
}
}
// 模拟考试
mockExam.setOnClickListener {
startActivity(MockExamActivity::class.java)
... ... @@ -129,4 +155,11 @@ class BankFragment :
}
})
}
@Subscribe
fun eventGet(data: GetWorkTypeEvent) {
if (data.type == TYPE_HOME || data.type == TYPE_All) {
binding.type.text = (data.name)
}
}
}
\ No newline at end of file
... ...
package com.br_technology.securitytrain_master.ui.view.bank.viewmodel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.br_technology.securitytrain_master.base.network.response.BaseResponse
import com.br_technology.securitytrain_master.base.network.response.CommonList
import com.br_technology.securitytrain_master.base.view.BaseViewModel
import com.br_technology.securitytrain_master.ui.view.bank.bean.PracticeBean
import com.br_technology.securitytrain_master.ui.view.bank.repository.BankRepository
import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean
import com.br_technology.securitytrain_master.base.network.response.BaseResponse
import com.br_technology.securitytrain_master.base.network.response.CommonList
import com.br_technology.securitytrain_master.util.sp_job_id
/**
... ... @@ -16,8 +17,12 @@ import com.br_technology.securitytrain_master.util.sp_job_id
*/
class BankViewModel : BaseViewModel<BankRepository>() {
var mWorkTypeBean: MutableLiveData<BaseResponse<WorkTypeBean>> = MutableLiveData()
fun workType(
fun beanData(): LiveData<BaseResponse<WorkTypeBean>> {
return mWorkTypeBean
}
fun workType(
) {
mRepository.workType(mWorkTypeBean)
}
... ...
package com.br_technology.securitytrain_master.ui.view.home.activity
import android.os.Bundle
import android.view.View
import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentPagerAdapter
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.base.view.BasePagerAdapter
import com.br_technology.securitytrain_master.databinding.ActivityLiveCourseBinding
import com.br_technology.securitytrain_master.ui.view.bank.viewmodel.BankViewModel
import com.br_technology.securitytrain_master.ui.view.home.event.GetWorkTypeEvent
import com.br_technology.securitytrain_master.ui.view.home.fragment.OnLiveCourseFragment
import com.br_technology.securitytrain_master.ui.view.home.viewmodel.LiveCourseViewModel
import com.br_technology.securitytrain_master.util.TYPE_All
import com.br_technology.securitytrain_master.util.TYPE_LIVE
import com.br_technology.securitytrain_master.util.sp_job_name
import com.br_technology.securitytrain_master.view.ClassifyPop
import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
import com.google.android.material.tabs.TabLayout
import com.gyf.immersionbar.ImmersionBar
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
/**
* Time: 7/31/2021 10:43
... ... @@ -22,10 +28,10 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
*/
class LiveCourseActivity
:
BaseLifeCycleActivity<LiveCourseViewModel, ActivityLiveCourseBinding>(ActivityLiveCourseBinding::inflate) {
BaseLifeCycleActivity<BankViewModel, ActivityLiveCourseBinding>(ActivityLiveCourseBinding::inflate) {
private val classifyPop by lazy {
ClassifyPop(this)
ClassifyPop(this, TYPE_All)
}
override fun initView() {
... ... @@ -33,15 +39,29 @@ class LiveCourseActivity
ImmersionBar.with(this@LiveCourseActivity).statusBarDarkFont(true).init();
}
override fun initDataObserver() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
EventBus.getDefault().register(this)
}
override fun onDestroy() {
super.onDestroy()
EventBus.getDefault().unregister(this)
}
override fun initDataObserver() {
//工种
mViewModel.mWorkTypeBean.observe(this, {
classifyPop.setList(it.data.list)
if (!classifyPop.isShowing) {
classifyPop.showAsDropDown(binding.toolBar)
}
})
}
override fun initData() {
super.initData()
binding.apply {
toolBar.setRightText(sp_job_name)
toolBar.setRightTextDrawable(
ContextCompat.getDrawable(
... ... @@ -49,15 +69,17 @@ class LiveCourseActivity
R.mipmap.down_arrow
)
)
// toolBar.addRightListener(object : ToolBarClickListener {
// override fun onClick(view: View) {
// if (!classifyPop.isShowing) {
// classifyPop.showAsDropDown(view)
// }
//
// }
// })
toolBar.addRightListener(object : ToolBarClickListener {
override fun onClick(view: View) {
if (mViewModel.beanData().value == null) {
mViewModel.workType()
} else {
mViewModel.beanData().value?.apply {
classifyPop.showAsDropDown(binding.toolBar)
}
}
}
})
val searchResultAdapter = BasePagerAdapter(
supportFragmentManager,
FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
... ... @@ -76,19 +98,21 @@ class LiveCourseActivity
tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
})
}
}
@Subscribe
fun eventGet(data: GetWorkTypeEvent) {
if (data.type == TYPE_LIVE || data.type == TYPE_All) {
binding.toolBar.setRightText(data.name)
}
}
}
\ No newline at end of file
... ...
... ... @@ -3,7 +3,6 @@ package com.br_technology.securitytrain_master.ui.view.home.activity.course
import android.Manifest
import android.location.LocationManager
import android.util.Log
import com.br_technology.securitytrain_master.base.common.ConstantParamKey
import com.br_technology.securitytrain_master.base.common.ConstantParamKey.CLASS_ID
import com.br_technology.securitytrain_master.base.common.ConstantParamKey.LESSON_ID
import com.br_technology.securitytrain_master.base.common.ConstantParamKey.TRAIN_CLASS_ID
... ... @@ -44,21 +43,26 @@ class LocationSignActivity :
BaseApplication.instance.mLocationManager.coordinateType =
TencentLocationManager.COORDINATE_TYPE_GCJ02;
rvSign.setOnClickListener {
if (mLocation != null && mLessonId != null&&mTrainClassId!=null&&mClassId!=null) {
// mViewModel.sign(
// mClassId ?: "",
// "${mLocation?.latitude}",
// "${mLocation?.longitude}"
// )
val map = hashMapOf<String,String>()
map.put("class_id",mClassId?:"")
map.put("lat","${mLocation?.latitude}")
map.put("lng","${mLocation?.longitude}")
mViewModel.recordTrainLesson("$mLessonId","$mTrainClassId",null, map)
if (mLocation != null && mLessonId != null && mTrainClassId != null && mClassId != null) {
mViewModel.sign(
mClassId ?: "",
"${mLocation?.latitude}",
"${mLocation?.longitude}"
)
val map = hashMapOf<String, String>()
map.put("class_id", mClassId ?: "")
map.put("lat", "${mLocation?.latitude}")
map.put("lng", "${mLocation?.longitude}")
mViewModel.recordTrainLesson("$mLessonId", "$mTrainClassId", null, map)
}
}
}
mViewModel.signData.observe(this, {
if (it.code == 1) {
toast("已签到")
}
})
}
override fun initData() {
... ...
... ... @@ -8,6 +8,7 @@ import com.br_technology.securitytrain_master.ui.view.home.viewmodel.VideoDetail
import com.br_technology.securitytrain_master.view.MyVideoPlayer
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
import java.math.BigDecimal
/**
* Time: 12/8/2021 15:46
... ... @@ -28,7 +29,7 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity
binding.videoPlayer.mStatusChange = object : MyVideoPlayer.IStatusChange {
override fun status(isPause: Boolean, isFinish: Boolean) {
if (!TextUtils.isEmpty(intent.getStringExtra(ConstantParamKey.COMMON_URL))) {
mViewModel.record(binding.videoPlayer.getProgressTime())
mViewModel.record(timeGet(binding.videoPlayer.getProgressTime()))
}
}
}
... ... @@ -51,6 +52,14 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity
}
}
fun timeGet(str: String): String {
var data = ""
val decemal = BigDecimal(str)
val ddd = BigDecimal("1000")
data = decemal.divide(ddd).toString()
return data
}
override fun onBackPressed() {
binding.videoPlayer.onBackPressed()
if (GSYVideoManager.backFromWindowFull(this)) {
... ...
... ... @@ -157,7 +157,15 @@ class CourseDetailChildAdapter :
val data = item.lessonVideoChild
data?.apply {
holder.setText(R.id.tv_name, data.name)
holder.setText(R.id.tv_time, data.video_length)
holder.setText(
R.id.tv_time, "${
if (data.is_complete == 0) {
"未完成"
} else {
"已完成"
}
}${data.video_length}"
)
holder.setText(R.id.tv_index, "${item.pos + 1}.${holder.layoutPosition + 1}")
}
}
... ... @@ -165,7 +173,13 @@ class CourseDetailChildAdapter :
val data = item.lessonVideoNormalChild
data?.apply {
holder.setText(R.id.tv_name, data.name)
holder.setText(R.id.tv_time, data.video_length)
holder.setText(R.id.tv_time, "${
if (data.is_complete == 0) {
"未完成"
} else {
"已完成"
}
}${data.video_length}")
holder.setText(R.id.tv_index, "${item.pos + 1}.${holder.layoutPosition + 1}")
}
}
... ...
... ... @@ -5,7 +5,8 @@ package com.br_technology.securitytrain_master.ui.view.home.event
* Author: Captain
* Description: 初见时你很迷人
*/
class GetWorkTypeEvent(var id: Int, var name: String) {
}
class GetWorkTypeEvent(var id: Int, var name: String, var type: Int)
class StatusTypeEvent(var id: Int, var name: String)
\ No newline at end of file
class StatusTypeEvent(var id: Int, var name: String)
class TransType(var id: Int)
\ No newline at end of file
... ...
... ... @@ -25,7 +25,7 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
* Author: Captain
* Description: 初见时你很迷人
*/
class CourseListFragment(var courseData: TrainCourseData,var tranClassId:String) :
class CourseListFragment(var courseData: TrainCourseData, var tranClassId: String) :
BaseLifeCycleFragment<CourseListViewModel, FragmentCourseListBinding>(FragmentCourseListBinding::inflate) {
override fun initDataObserver() {
}
... ... @@ -106,12 +106,20 @@ class CourseListFragment(var courseData: TrainCourseData,var tranClassId:String)
)
}
TYPE_COURSE_DETAIL_ITEM_OFF -> {
startActivity(
Intent(activity, LocationSignActivity::class.java)
.putExtra(ConstantParamKey.CLASS_ID, item.lessonOffChild?.id.toString())
.putExtra(ConstantParamKey.LESSON_ID, item.lessonOffChild?.lesson_id.toString())
.putExtra(ConstantParamKey.TRAIN_CLASS_ID,tranClassId )
)
if (item.lessonOffChild?.is_sign == 0) {
startActivity(
Intent(activity, LocationSignActivity::class.java)
.putExtra(
ConstantParamKey.CLASS_ID,
item.lessonOffChild?.id.toString()
)
.putExtra(
ConstantParamKey.LESSON_ID,
item.lessonOffChild?.lesson_id.toString()
)
.putExtra(ConstantParamKey.TRAIN_CLASS_ID, tranClassId)
)
}
}
}
}
... ...
... ... @@ -28,7 +28,6 @@ import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
import com.gyf.immersionbar.components.SimpleImmersionOwner
import com.luck.picture.lib.tools.ToastUtils
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
import com.youth.banner.adapter.BannerImageAdapter
import com.youth.banner.holder.BannerImageHolder
... ... @@ -82,22 +81,6 @@ class HomeFragment :
)
)
}
for (news in data) {
val textView = TextView(context)
textView.maxLines = 1
textView.text = news.title
textView.ellipsize = TextUtils.TruncateAt.END
textView.setOnClickListener {
// 公告弹框
ToastUtils.s(requireContext(), "aaa")
}
binding.flipperScan.addView(
textView, ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
)
}
if (data.size > 1) {
binding.flipperScan.flipInterval = 3000
binding.flipperScan.startFlipping()
... ...
... ... @@ -8,9 +8,11 @@ import com.br_technology.securitytrain_master.databinding.FragmentOnliveCourseBi
import com.br_technology.securitytrain_master.expand.addItemDecoration2
import com.br_technology.securitytrain_master.ui.bean.LessonLiveBean
import com.br_technology.securitytrain_master.ui.view.home.adapter.LiveAdapter
import com.br_technology.securitytrain_master.ui.view.home.event.TransType
import com.br_technology.securitytrain_master.ui.view.home.viewmodel.OnLiveCourseFragmentViewModel
import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
import org.greenrobot.eventbus.Subscribe
/**
* Time: 7/31/2021 10:58
... ... @@ -73,7 +75,7 @@ class OnLiveCourseFragment
val status = adapter.data.get(position).lessonlive.live_status
if (status == "3") {
showTip("教师未开播")
showTip("未开播")
return@setOnItemClickListener
}
var url = ""
... ... @@ -110,4 +112,9 @@ class OnLiveCourseFragment
return fragment
}
}
@Subscribe
fun getTransType(data: TransType) {
}
}
\ No newline at end of file
... ...
... ... @@ -13,9 +13,10 @@ import com.br_technology.securitytrain_master.base.view.BaseViewModel
*/
class LocationSignViewModel : BaseViewModel<LessonRepository>() {
val liveData = MutableLiveData<BaseResponse<Void>>()
val signData = MutableLiveData<BaseResponse<Void>>()
fun sign(lessonId: String, lat: String, lng: String) {
mRepository.lessonOffSignup(lessonId, lat, lng, liveData)
mRepository.lessonOffSignup(lessonId, lat, lng, signData)
}
fun recordTrainLesson(lesson_id: String,
... ...
package com.br_technology.securitytrain_master.ui.view.mine.activity
import android.content.Intent
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.ActivityAcademicFeedbackBinding
import com.br_technology.securitytrain_master.ui.view.mine.adapter.AcademicFeedbackAdapter
... ... @@ -45,8 +46,9 @@ class AcademicFeedbackActivity :
mViewModel.mAcademicFeedbackDetailBean.observe(this, {
DialogTitle(this@AcademicFeedbackActivity)
.setImageTitle(R.mipmap.jiangshipingxi_bg)
.setInfo(it.data.detail.des ?: "")
.hideCompleteButton(true)
.setInfo(it.data.detail.content ?: "")
.hideCompleteButton(true).hideLeftButton(true)
.setInfoSizeMin(100)
.setTitleIsVisible(false)
.show()
})
... ... @@ -64,6 +66,15 @@ class AcademicFeedbackActivity :
academicFeedbackAdapter?.setOnItemClickListener { _, _, position ->
mViewModel.academicFeedbackDetail(academicFeedbackList!![position].train_class_id)
}
academicFeedbackAdapter?.apply {
iChat = object : AcademicFeedbackAdapter.IChat {
override fun chat(teacherId: String) {
val intent = Intent(baseContext, ChatActivity::class.java)
intent.putExtra("id", teacherId)
startActivity(intent)
}
}
}
initLoadMore()
... ...
... ... @@ -54,7 +54,7 @@ class ChatRecordActivity :
}
chatRecordAdapter.setOnItemClickListener { _, _, position ->
val id = chatRecordAdapter.data[position].id
val id = chatRecordAdapter.data[position].teacher_id
val intent = Intent(baseContext,ChatActivity::class.java)
intent.putExtra("id",id)
startActivity(intent)
... ...
package com.br_technology.securitytrain_master.ui.view.mine.adapter
import android.view.View
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.ui.view.mine.bean.AcademicFeedbackBean
import com.bumptech.glide.Glide
... ... @@ -18,11 +19,25 @@ class AcademicFeedbackAdapter(
layoutResId: Int,
data: MutableList<AcademicFeedbackBean.ListBean.DataBean>?
) :
BaseQuickAdapter<AcademicFeedbackBean.ListBean.DataBean, BaseViewHolder>(layoutResId, data),LoadMoreModule {
BaseQuickAdapter<AcademicFeedbackBean.ListBean.DataBean, BaseViewHolder>(layoutResId, data),
LoadMoreModule {
interface IChat {
fun chat(teacherId: String)
}
var iChat: IChat? = null
override fun convert(holder: BaseViewHolder, item: AcademicFeedbackBean.ListBean.DataBean) {
Glide.with(context).load(item.image).apply(RequestOptions.bitmapTransform(RoundedCorners(14))).into(holder.getView(R.id.iv_cover))
holder.setText(R.id.tv_title,item.name)
holder.setText(R.id.tv_course_time,"已完成" + item.class_hours.toString() + "课时")
Glide.with(context).load(item.image)
.apply(RequestOptions.bitmapTransform(RoundedCorners(14)))
.into(holder.getView(R.id.iv_cover))
holder.setText(R.id.tv_title, item.name)
holder.setText(R.id.tv_course_time, "已完成" + item.class_hours.toString() + "课时")
iChat?.let { chat ->
holder.getView<View>(R.id.tv_goChat).setOnClickListener {
chat.chat("${item.teacher_id}")
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -71,6 +71,7 @@ public class AcademicFeedbackBean {
private Integer train_id;
private Integer train_class_id;
private Integer user_id;
private Integer teacher_id;
private Integer class_hours;
private String status;
private Integer create_time;
... ... @@ -81,6 +82,14 @@ public class AcademicFeedbackBean {
private String content;
private Integer is_read;
public Integer getTeacher_id() {
return teacher_id;
}
public void setTeacher_id(Integer teacher_id) {
this.teacher_id = teacher_id;
}
public Integer getId() {
return id;
}
... ...
... ... @@ -308,7 +308,7 @@ class ClassDutyCourseFragment(val type: Int) :
2 -> {
val status = response.status
if (status == "3") {
showTip("教师未开播")
showTip("未开播")
return
}
var url = ""
... ...
... ... @@ -18,11 +18,15 @@ const val POI_ID = "pos_id"
const val POI_NAME = "pos_name"
var token by SpUtil(TOKEN,"")
var userId by SpUtil(USERID,0)
var phone_number by SpUtil(PHONE_NUMBER,"")
var is_login by SpUtil(IS_LOGIN,false)
var sp_job_id by SpUtil(POI_ID,0)
var sp_job_name by SpUtil(POI_NAME,"")
var token by SpUtil(TOKEN, "")
var userId by SpUtil(USERID, 0)
var phone_number by SpUtil(PHONE_NUMBER, "")
var is_login by SpUtil(IS_LOGIN, false)
var sp_job_id by SpUtil(POI_ID, 0)
var sp_job_name by SpUtil(POI_NAME, "")
const val TYPE_LIVE = 0
const val TYPE_HOME = 1
const val TYPE_All = 9
... ...
... ... @@ -11,6 +11,8 @@ import com.br_technology.securitytrain_master.expand.screenWidth
import com.br_technology.securitytrain_master.ui.view.home.adapter.TextCourseTypeAdapter
import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean
import com.br_technology.securitytrain_master.ui.view.home.event.GetWorkTypeEvent
import com.br_technology.securitytrain_master.util.sp_job_id
import com.br_technology.securitytrain_master.util.sp_job_name
import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
import org.greenrobot.eventbus.EventBus
... ... @@ -19,7 +21,7 @@ import org.greenrobot.eventbus.EventBus
* auth:张继
* des:
*/
class ClassifyPop(context: Activity) : PopupWindow(context) {
class ClassifyPop(context: Activity, type: Int) : PopupWindow(context) {
private var mWorkTypeList: MutableList<WorkTypeBean.ListBean>? = null
private var textCourseTypeAdapter: TextCourseTypeAdapter? = null
... ... @@ -31,7 +33,6 @@ class ClassifyPop(context: Activity) : PopupWindow(context) {
fun setList(workTypeList: MutableList<WorkTypeBean.ListBean>) {
mWorkTypeList = workTypeList
mWorkTypeList?.let { textCourseTypeAdapter?.addList(it) }
}
init {
... ... @@ -58,15 +59,18 @@ class ClassifyPop(context: Activity) : PopupWindow(context) {
mWorkTypeList?.let { textCourseTypeAdapter?.addList(it) }
complete.setOnClickListener {
val index:Int = (mWorkTypeList?.size?:mWorkTypeList?.size) as Int
val index: Int = (mWorkTypeList?.size ?: mWorkTypeList?.size) as Int
if (index > pos) {
mWorkTypeList?.get(pos)!!.let {
sp_job_id = it.id
sp_job_name = it.name
}
EventBus.getDefault().post(
mWorkTypeList?.get(pos)!!.let { it1 -> GetWorkTypeEvent(it1.id, it1.name) })
mWorkTypeList?.get(pos)!!
.let { it1 -> GetWorkTypeEvent(it1.id, it1.name, type) })
}
dismiss()
}
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -13,6 +13,7 @@ import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.DialogTitleBinding
import com.br_technology.securitytrain_master.expand.TranslateUnit
import com.br_technology.securitytrain_master.expand.dp2px
import com.br_technology.securitytrain_master.expand.screenWidth
import com.br_technology.securitytrain_master.view.listener.DialogListener
... ... @@ -101,12 +102,28 @@ class DialogTitle(context: Context) : Dialog(context, R.style.UserDefaultDialog)
return this
}
fun hideLeftButton(boolean: Boolean): DialogTitle {
if (boolean) {
binding.viewCard.visibility = View.GONE
binding.space.visibility = View.GONE
} else {
binding.viewCard.visibility = View.VISIBLE
binding.space.visibility = View.VISIBLE
}
return this
}
fun setInfo(title: String): DialogTitle {
binding.info.text = title
binding.info.visibility = View.VISIBLE
return this
}
fun setInfoSizeMin(dpx: Int): DialogTitle {
binding.info.minHeight = TranslateUnit.dp2px(context, dpx * 1.0f)
return this
}
fun viewAnswerSheetListener(callBack: () -> Unit) {
this.viewAnswerSheet = callBack
}
... ...
... ... @@ -67,8 +67,6 @@ class MyVideoPlayer : StandardGSYVideoPlayer, LifecycleObserver {
showFull()
}
}
}
private fun showFull() {
... ... @@ -114,6 +112,11 @@ class MyVideoPlayer : StandardGSYVideoPlayer, LifecycleObserver {
super.onComplete(url, *objects)
mStatusChange?.status(false, true)
}
override fun onAutoComplete(url: String?, vararg objects: Any?) {
super.onAutoComplete(url, *objects)
mStatusChange?.status(false, true)
}
}).build(this)
currentPlayer.startPlayLogic()
... ...
... ... @@ -34,12 +34,12 @@
<TextView
android:id="@+id/info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:gravity="center"
android:gravity="top|center_horizontal"
android:text="共9道题"
android:textColor="@color/color_96"
android:textSize="12sp"
... ... @@ -49,8 +49,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center_horizontal"
android:layout_marginBottom="24dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
... ... @@ -65,8 +65,10 @@
android:textSize="15sp" />
<View
android:id="@+id/space"
android:layout_width="@dimen/dp_40"
android:layout_height="match_parent" />
android:layout_height="40dp" />
<TextView
android:id="@+id/complete"
android:layout_width="118dp"
... ...
... ... @@ -36,6 +36,19 @@
android:textSize="12sp" />
<TextView
android:id="@+id/tv_goChat"
android:layout_width="72dp"
android:layout_height="28dp"
android:layout_below="@id/tv_course_time"
android:layout_marginEnd="16dp"
android:layout_toStartOf="@+id/tv_jiangshipingxi"
android:background="@drawable/solid_25_4"
android:gravity="center"
android:text="去聊天"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_jiangshipingxi"
android:layout_width="72dp"
android:layout_height="28dp"
... ...