作者 刘纪龙

Loong:bug

... ... @@ -4,13 +4,18 @@
<option name="filePathToZoomLevelMap">
<map>
<entry key="../../../../../Applications/Android Studio.app/Contents/caches/transforms-2/files-2.1/054febce6621ffe68244bdc38929a80b/jetified-gsyVideoPlayer-java-v8.3.3-release-jitpack/res/drawable/video_seek_progress.xml" value="0.1361111111111111" />
<entry key="../../../../../Applications/Android Studio.app/Contents/caches/transforms-2/files-2.1/054febce6621ffe68244bdc38929a80b/jetified-gsyVideoPlayer-java-v8.3.3-release-jitpack/res/layout/video_layout_standard.xml" value="0.24537037037037038" />
<entry key="../../../../../layout/custom_preview.xml" value="0.2890625" />
<entry key="../../../Library/Android/sdk/platforms/android-30/data/res/layout/auto_complete_list.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_account_login.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_answer_record_details.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_answer_sheet.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_chat.xml" value="0.29794871794871797" />
<entry key="app/src/main/res/layout/activity_class_duty.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_common_file_read.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_database_detail.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_edit_personal_info.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_exam_type.xml" value="0.22314814814814815" />
<entry key="app/src/main/res/layout/activity_main.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_mobile_login.xml" value="0.2462962962962963" />
<entry key="app/src/main/res/layout/activity_offline_exercise.xml" value="0.2671875" />
... ... @@ -18,16 +23,22 @@
<entry key="app/src/main/res/layout/activity_online_detail.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_practice.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_splash.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_text_detail.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_video_detail.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/activity_web.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/adapter_content_practice_item.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/adapter_topic.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/adapter_video_course.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/chat_life_adapter.xml" value="0.29794871794871797" />
<entry key="app/src/main/res/layout/chat_right_adapter.xml" value="0.29794871794871797" />
<entry key="app/src/main/res/layout/dialog_check_id.xml" value="0.33" />
<entry key="app/src/main/res/layout/dialog_class_list.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/fragment_bank.xml" value="0.33" />
<entry key="app/src/main/res/layout/fragment_class_duty_course.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/fragment_course_list.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/fragment_home.xml" value="0.20925925925925926" />
<entry key="app/src/main/res/layout/fragment_mine.xml" value="0.41770401106500693" />
<entry key="app/src/main/res/layout/fragment_online_detail.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/item_course.xml" value="0.22552083333333334" />
<entry key="app/src/main/res/layout/item_course_off.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/item_course_section.xml" value="0.2671875" />
... ... @@ -38,6 +49,7 @@
<entry key="app/src/main/res/layout/layout_tool_bar.xml" value="0.2671875" />
<entry key="app/src/main/res/layout/layout_video_player.xml" value="0.13645833333333332" />
<entry key="app/src/main/res/layout/pop_classify.xml" value="0.3609375" />
<entry key="app/src/main/res/layout/pop_database_list.xml" value="0.2351851851851852" />
</map>
</option>
</component>
... ...
... ... @@ -178,4 +178,6 @@ dependencies {
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3' //核心必须依赖
implementation 'com.scwang.smart:refresh-header-classics:2.0.3' //经典刷新头
implementation 'com.scwang.smart:refresh-footer-classics:2.0.3' //经典加载
//红点
implementation 'cn.yc:YCRedDotViewLib:1.0.3'
}
\ No newline at end of file
... ...
... ... @@ -68,6 +68,7 @@
<activity
android:name="com.br_technology.securitytrain_master.ui.view.splash.SplashActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/Theme.SecurityTrainMaster.Launcher">
<intent-filter>
... ...
... ... @@ -136,6 +136,14 @@ interface ApiService {
fun workType(
): Observable<BaseResponse<WorkTypeBean>>
/**
* 未读消息
*/
@POST("/api/message/msg_unread_count")
fun unMessage(
): Observable<BaseResponse<UnMessageBean>>
/**
* 文本课程详情
*/
... ...
... ... @@ -65,7 +65,8 @@ class ChallengeActivity :
// 下一题
next.setOnClickListener {
if (mPagerAdapter.getCount() <= 0) {
ToastUtils.s(baseContext, "暂无数据")
// ToastUtils.s(baseContext, "暂无数据")
ToastUtils.s(baseContext, "请选择")
return@setOnClickListener
}
next.isClickable = false
... ...
... ... @@ -157,6 +157,10 @@ class QuestionsActivity :
userItemId = it.data.user_item_id
mPagerAdapter.addList(it.data.list)
binding.practicePager.adapter = mPagerAdapter
if(it.data.list.size<=1){
binding.next.visibility=View.GONE
binding.finishJob.visibility=View.VISIBLE
}
} else {
ToastUtils.s(baseContext, it.msg)
}
... ...
... ... @@ -108,10 +108,14 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity
}
override fun onDestroy() {
super.onDestroy()
if(isFinishs){
EventBus.getDefault()
.post(VideoClassChange(mViewModel.courseParam.value?.mLessonId ?: "", true))
}
super.onDestroy()
// if(isFinishs){
// EventBus.getDefault()
// .post(VideoClassChange(mViewModel.courseParam.value?.mLessonId ?: "", true))
// }
}
}
\ No newline at end of file
... ...
... ... @@ -203,9 +203,9 @@ class HomeFragment :
videoLessonList = mutableListOf()
videoCourse.adapter = videoCourseAdapter
videoCourseAdapter?.setOnItemClickListener { _, _, position ->
videoCourseAdapter?.setOnClick { data->
val course = CourseParam()
val data = videoLessonList!![position]
// val data = videoLessonList!![position]
course.mLessonId = "${data.id}"
course.isTrainClass = false
course.type = TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_VIDEO
... ...
... ... @@ -58,14 +58,21 @@ class EditPersonalInfoActivity :
avatar = it.data.fullurl
Glide.with(this).load(avatar).placeholder(R.mipmap.placeholder_head)
.into(binding.ivIcon)
avatar?.let {
mViewModel.changePersonalInfo(
it,
binding.tvName.text.toString(),
""
)
}
}
})
//保存修改
mViewModel.mCommonBean.observe(this, {
it.let {
showTip("修改成功")
finish()
}
// it.let {
// showTip("修改成功")
// finish()
// }
})
//
mViewModel.mUploadFaceFileData.observe(this, {
... ... @@ -102,14 +109,15 @@ class EditPersonalInfoActivity :
rlUpLoadImage.setOnClickListener(this@EditPersonalInfoActivity)
toolBar.addLeftListener(object : ToolBarClickListener {
override fun onClick(view: View) {
finish()
//退出时保存
avatar?.let {
mViewModel.changePersonalInfo(
it,
binding.tvName.text.toString(),
""
)
}
// avatar?.let {
// mViewModel.changePersonalInfo(
// it,
// binding.tvName.text.toString(),
// ""
// )
// }
}
})
... ...
package com.br_technology.securitytrain_master.ui.view.mine.bean
/**
* Author:Loong
* Description:
* Date: 2022/11/23
*/
data class UnMessageBean(val count:Int)
... ...
... ... @@ -308,11 +308,11 @@ class ClassDutyCourseFragment(val type: Int) :
// Toast.makeText(activity, "学员未完成培训课程,无法考试", Toast.LENGTH_SHORT).show()
// return
// }
if (item.isTest && item.exam?.count!! <= 0) {
if (item.isTest && item.exam?.count?:0 <= 0) {
Toast.makeText(activity, "该考试暂无题目", Toast.LENGTH_SHORT).show()
return
}
if (item.isTest && (item.practice?.count!! <= 0)) {
if (item.isTest && (item.practice?.count?:0 <= 0)) {
Toast.makeText(activity, "该练习暂无题目", Toast.LENGTH_SHORT).show()
return
}
... ...
package com.br_technology.securitytrain_master.ui.view.mine.fragment
import android.content.Intent
import android.view.Gravity
import android.view.View
import com.alibaba.fastjson.JSON
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.FragmentMineBinding
import com.br_technology.securitytrain_master.ui.view.home.viewmodel.MineViewModel
... ... @@ -14,6 +16,7 @@ import com.br_technology.securitytrain_master.view.DialogSureCancel
import com.br_technology.securitytrain_master.view.listener.DialogListener
import com.bumptech.glide.Glide
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
import com.ycbjie.ycreddotviewlib.YCRedDotView
/**
* createTime:2021/7/27 15:47
... ... @@ -25,6 +28,7 @@ class MineFragment
View.OnClickListener {
private var identity: String? = null
private var ycRedDotView: YCRedDotView? = null
private val logoutDialog by lazy {
DialogSureCancel(requireContext())
}
... ... @@ -37,27 +41,36 @@ class MineFragment
Glide.with(requireActivity()).load(it.data.info.avatar)
.placeholder(R.mipmap.placeholder_head).into(binding.ivIcon)
identity = it.data.info.identity
binding.departmentName.text = it.data.info.department_name.plus(" - ").plus(it.data.info.pos_name)
binding.departmentName.text =
it.data.info.department_name.plus(" - ").plus(it.data.info.pos_name)
company_is_check = it.data.info.company_check_face.equals("0") // 0为关闭人脸检测
is_set_face = it.data.info.is_check_face.equals("1");
})
mViewModel.mCommonBean.observe(this,{
mViewModel.mCommonBean.observe(this, {
token = ""
showTip("退出登录成功")
logoutDialog.dismiss()
startActivity(Intent(requireContext(), AccountLoginActivity::class.java))
activity?.finish()
})
mViewModel.unMessageBean.observe(this, {
ycRedDotView?.badgeCount = it.data.count
})
}
override fun onResume() {
super.onResume()
mViewModel.getMineInfo()
mViewModel.getUnMessage()
}
override fun initData() {
super.initData()
ycRedDotView = YCRedDotView(context)
ycRedDotView?.setTargetView(binding.liMessage)
ycRedDotView?.setRedHotViewGravity(Gravity.END)
ycRedDotView?.setBadgeMargin(0, 0, 0, 0)
binding.apply {
ivEditInfo.setOnClickListener(this@MineFragment)
rlMineCuoti.setOnClickListener(this@MineFragment)
... ...
... ... @@ -5,6 +5,7 @@ import com.br_technology.securitytrain_master.base.common.State
import com.br_technology.securitytrain_master.base.network.response.BaseResponse
import com.br_technology.securitytrain_master.base.repository.ApiRepository
import com.br_technology.securitytrain_master.ui.view.mine.bean.MineInfoBean
import com.br_technology.securitytrain_master.ui.view.mine.bean.UnMessageBean
import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
... ... @@ -47,5 +48,19 @@ class MineRepository(val loadState: MutableLiveData<State>): ApiRepository(loadS
}
fun getUnMessage(
liveData: MutableLiveData<BaseResponse<UnMessageBean>>
) {
apiService.unMessage()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(
liveData,
loadState,
this
)
)
}
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@ import androidx.lifecycle.MutableLiveData
import com.br_technology.securitytrain_master.base.network.response.BaseResponse
import com.br_technology.securitytrain_master.base.view.BaseViewModel
import com.br_technology.securitytrain_master.ui.view.mine.bean.MineInfoBean
import com.br_technology.securitytrain_master.ui.view.mine.bean.UnMessageBean
import com.br_technology.securitytrain_master.ui.view.mine.repository.MineRepository
/**
... ... @@ -13,7 +14,7 @@ import com.br_technology.securitytrain_master.ui.view.mine.repository.MineReposi
*/
class MineViewModel : BaseViewModel<MineRepository>() {
var mMineInfoBean: MutableLiveData<BaseResponse<MineInfoBean>> = MutableLiveData()
var unMessageBean: MutableLiveData<BaseResponse<UnMessageBean>> = MutableLiveData()
fun getMineInfo() {
mRepository.getMineInfo(mMineInfoBean)
}
... ... @@ -23,4 +24,7 @@ class MineViewModel : BaseViewModel<MineRepository>() {
fun logout() {
mRepository.logout(mCommonBean)
}
fun getUnMessage() {
mRepository.getUnMessage(unMessageBean)
}
}
\ No newline at end of file
... ...
... ... @@ -34,13 +34,23 @@
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<LinearLayout
android:id="@+id/li_message"
android:layout_width="35dp"
android:layout_marginTop="37dp"
android:layout_marginEnd="16dp"
android:src="@mipmap/mine_message" />
android:gravity="center"
android:layout_height="37dp">
<ImageView
android:id="@+id/iv_message"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/mine_message" />
</LinearLayout>
</LinearLayout>
... ...