作者 杨谦

1.处理变更

... ... @@ -173,7 +173,8 @@
<activity android:name="com.br_technology.securitytrain_master.ui.view.mine.activity.LearningReportDetailActivity" />
<activity android:name="com.br_technology.securitytrain_master.ui.view.mine.activity.MessageNoticeActivity" />
<activity android:name="com.br_technology.securitytrain_master.ui.view.mine.activity.MessageNoticeDetailActivity" />
<activity android:name="com.br_technology.securitytrain_master.ui.view.mine.activity.ComplaintsAndSuggestionsActivity" />
<activity android:name="com.br_technology.securitytrain_master.ui.view.mine.activity.ComplaintsAndSuggestionsActivity"
android:theme="@style/AppBaseTheme"/>
<activity android:name="com.br_technology.securitytrain_master.ui.view.mine.activity.ComplaintsAndSuggestionsSuccessActivity" />
<activity android:name="com.br_technology.securitytrain_master.ui.view.mine.activity.ClassDutyActivity" />
<activity android:name="com.br_technology.securitytrain_master.ui.view.mine.activity.CollectActivity" />
... ...
... ... @@ -10,7 +10,8 @@ import java.io.File
*/
object Constant {
// const val BASE_URL = "https://admin.anqixing.com"
const val BASE_URL = "https://test.admin.anqixing.com"
const val BASE_URL = "https://security.brofirst.cn"
// const val BASE_URL = "https://test.admin.anqixing.com"
const val USERNAME_KEY = "username"
const val USERID_KEY = "userid"
const val LOGIN_KEY = "login"
... ...
... ... @@ -108,15 +108,11 @@ class DatabaseActivity :
fun refresh() {
page = 1
binding.refresh.setEnableRefresh(false)
binding.refresh.setEnableLoadMore(false)
mViewModel.getDataList(page)
}
private fun loadMore() {
page++
binding.refresh.setEnableRefresh(false)
binding.refresh.setEnableLoadMore(false)
mViewModel.getDataList(page)
}
... ...
... ... @@ -10,6 +10,7 @@ import com.br_technology.securitytrain_master.ui.bean.TrainCourseDetailItemType.
import com.br_technology.securitytrain_master.ui.bean.TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_NORMAL
import com.br_technology.securitytrain_master.ui.bean.TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_OFF
import com.br_technology.securitytrain_master.ui.bean.TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_VIDEO
import com.br_technology.securitytrain_master.util.TimeFenMUtils
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
... ... @@ -164,7 +165,7 @@ class CourseDetailChildAdapter :
} else {
"已完成"
}
}${data.video_length}"
}${formatLength(data.video_length)}"
)
holder.setText(R.id.tv_index, "${item.pos + 1}.${holder.layoutPosition + 1}")
}
... ... @@ -173,13 +174,9 @@ class CourseDetailChildAdapter :
val data = item.lessonVideoNormalChild
data?.apply {
holder.setText(R.id.tv_name, data.name)
holder.setText(R.id.tv_time, "${
if (data.is_complete == 0) {
"未完成"
} else {
"已完成"
}
}${data.video_length}")
holder.setText(
R.id.tv_time, formatLength(data.video_length)
)
holder.setText(R.id.tv_index, "${item.pos + 1}.${holder.layoutPosition + 1}")
}
}
... ... @@ -208,4 +205,13 @@ class CourseDetailChildAdapter :
}
}
}
private fun formatLength(str: String): String {
val temp = if (str.contains(".")) {
str.subSequence(0, str.lastIndexOf("."))
} else {
str
}
return TimeFenMUtils.formatHour(temp.toString())
}
}
\ No newline at end of file
... ...
... ... @@ -19,7 +19,7 @@ class TextLessonsAdapter(layoutResId: Int, data: MutableList<TextLessonBean.List
LoadMoreModule {
override fun convert(holder: BaseViewHolder, item: TextLessonBean.ListBean.DataBean) {
holder.setText(R.id.name, item.name)
holder.setText(R.id.info, item.des)
holder.setText(R.id.info, item.intro)
Glide.with(context).load(item.image)
.apply(RequestOptions.bitmapTransform(RoundedCorners(16)))
.into(holder.getView(R.id.pic))
... ...
package com.br_technology.securitytrain_master.ui.view.mine.activity
import android.view.View
import android.widget.TextView
import com.bigkoo.pickerview.builder.OptionsPickerBuilder
import com.bigkoo.pickerview.view.OptionsPickerView
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.ActivityComplaintsAndSuggestionsBinding
import com.br_technology.securitytrain_master.ui.view.mine.bean.FeedBackTypeBean
import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ComplaintsAndSuggestionsViewModel
import com.br_technology.securitytrain_master.view.DialogFeedType
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
... ... @@ -30,7 +28,7 @@ class ComplaintsAndSuggestionsActivity :
private var is_hide: String = "0"
override fun initDataObserver() {
mViewModel.mCommonBean.observe(this,{
mViewModel.mCommonBean.observe(this, {
startActivity(ComplaintsAndSuggestionsSuccessActivity::class.java)
finish()
})
... ... @@ -114,47 +112,25 @@ class ComplaintsAndSuggestionsActivity :
}
//投诉类型
llType.setOnClickListener {
initCustomOptionPicker()
// initCustomOptionPicker()
dialogShow()
}
}
}
private fun initCustomOptionPicker() { //条件选择器初始化,自定义布局
/**
* @description
*
* 注意事项:
* 自定义布局中,id为 optionspicker 或者 timepicker 的布局以及其子控件必须要有,否则会报空指针。
* 具体可参考demo 里面的两个自定义layout布局。
*/
cardItem = mutableListOf()
cardItem?.add(FeedBackTypeBean("功能异常"))
cardItem?.add(FeedBackTypeBean("体验问题"))
cardItem?.add(FeedBackTypeBean("功能建议"))
cardItem?.add(FeedBackTypeBean("服务投诉"))
cardItem?.add(FeedBackTypeBean("其他问题"))
private var dialogFeedType: DialogFeedType? = null
pvCustomOptions = OptionsPickerBuilder(
this
) { options1, _, _, _ -> //返回的分别是三个级别的选中位置
val tx: String = cardItem!![options1].pickerViewText
binding.tvType.text = tx
private fun dialogShow() {
if (dialogFeedType == null) {
dialogFeedType =
DialogFeedType(this).setListener(object : DialogFeedType.ISelectFeedType {
override fun select(content: String, index: Int) {
binding.tvType.text = content
type = "${index + 1}"
}
})
}
.setLayoutRes(
R.layout.layout_tousu_type
) { v ->
val tvSubmit = v.findViewById<View>(R.id.tv_finish) as TextView
val ivCancel: TextView = v.findViewById<View>(R.id.iv_cancel) as TextView
tvSubmit.setOnClickListener {
pvCustomOptions?.returnData()
pvCustomOptions?.dismiss()
}
ivCancel.setOnClickListener { pvCustomOptions?.dismiss() }
}
.setSelectOptions(0)
.setOutSideCancelable(false)
.build()
pvCustomOptions?.setPicker(cardItem) //添加数据
pvCustomOptions?.show()
dialogFeedType?.show()
}
}
\ No newline at end of file
... ...
... ... @@ -37,8 +37,8 @@ class MyErrorQuestionActivity :
val list =
mutableListOf(
MyErrorQuestionFragment.newInstance(1),
MyErrorQuestionFragment.newInstance(2),
MyErrorQuestionFragment.newInstance(3)
MyErrorQuestionFragment.newInstance(3),
MyErrorQuestionFragment.newInstance(2)
)
val titles = listOf("单选题", "判断题", "多选题")
searchResultAdapter.addData(list.toMutableList())
... ...
package com.br_technology.securitytrain_master.ui.view.mine.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.base.view.BaseAdapter
import com.br_technology.securitytrain_master.databinding.ItemSpecialExercisesBinding
import com.br_technology.securitytrain_master.ui.bean.AnswerRecord
import com.br_technology.securitytrain_master.ui.view.home.pojo.VideoCourse
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
... ... @@ -16,23 +10,11 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder
* Author: Captain
* Description: 初见时你很迷人
*/
class SpecialExercisesAdapter : BaseQuickAdapter<AnswerRecord,BaseViewHolder>(R.layout.item_special_exercises) {
class SpecialExercisesAdapter :
BaseQuickAdapter<AnswerRecord, BaseViewHolder>(R.layout.item_special_exercises) {
override fun convert(holder: BaseViewHolder, item: AnswerRecord) {
holder.setText(R.id.tv_question_title,item.title)
.setText(R.id.tv_timer,item.create_time_text)
.setText(R.id.tv_answer,"答对:${item.correct}/${item.count}")
holder.setText(R.id.tv_question_title, "${item.title}(${item.pos.name ?: ""})")
.setText(R.id.tv_timer, item.create_time_text)
.setText(R.id.tv_answer, "答对:${item.correct}/${item.count}")
}
// override fun getViewBinding(
// context: Context,
// parent: ViewGroup,
// viewType: Int,
// from: LayoutInflater
// ): ItemSpecialExercisesBinding {
// return ItemSpecialExercisesBinding.inflate(from, parent, false)
// }
//
// override fun onBind(holder: ItemSpecialExercisesBinding, position: Int, data: VideoCourse) {
// // 题名称
// holder.tvQuestionTitle.text = data.courseName
// }
}
\ No newline at end of file
... ...
... ... @@ -52,6 +52,11 @@ class ClassDutyCourseFragment(val type: Int) :
super.onDestroyView()
}
override fun onResume() {
super.onResume()
refreshData()
}
@Subscribe
fun statusChange(status: StatusTypeEvent) {
this.status = status.id
... ... @@ -227,11 +232,6 @@ class ClassDutyCourseFragment(val type: Int) :
return response
}
override fun initData() {
super.initData()
getData()
}
val dialogMention: DialogMention by lazy {
DialogMention(requireContext()).apply {
setTitle("温馨提示")
... ... @@ -241,8 +241,6 @@ class ClassDutyCourseFragment(val type: Int) :
//todo 时间校验限制等
fun checkTime(exam: ExamBean) {
}
override fun itemClick(item: TrainTestData) {
... ...
package com.br_technology.securitytrain_master.util;
import android.content.Intent;
import android.util.Log;
import com.luck.picture.lib.tools.StringUtils;
import java.math.BigDecimal;
public class TimeFenMUtils {
... ... @@ -27,12 +22,16 @@ public class TimeFenMUtils {
} else {
DateTimes = seconds + "";
}
return DateTimes;
}
public static String formatHour(String seconds) {
long mss = BigDecimal.valueOf(Double.parseDouble(seconds)).longValue();
long hours = mss / (60 * 60);
long minutes = (mss % (60 * 60)) / 60;
long second = mss % 60;
return (hours > 9 ? hours + "" : "0" + hours) + ":" + (minutes > 9 ? minutes : "0" + minutes) + ":" + (second > 9 ? second : "0" + second);
}
}
... ...
package com.br_technology.securitytrain_master.view
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import com.br_technology.securitytrain_master.R
import com.br_technology.securitytrain_master.databinding.DialogFeedTypeBinding
import com.br_technology.securitytrain_master.expand.dp2px
import com.br_technology.securitytrain_master.expand.screenWidth
/**
* Author by YSir
* Date on 2022/3/15.
* description 反馈类型单选弹框
* PS: Not easy to write code, please indicate.
*/
class DialogFeedType(context: Context) : Dialog(context, R.style.UserDefaultDialog) {
private val binding by lazy {
DialogFeedTypeBinding.inflate(LayoutInflater.from(context))
}
interface ISelectFeedType {
fun select(content: String, index: Int)
}
private var mSelectListener: ISelectFeedType? = null
fun setListener(select: ISelectFeedType): DialogFeedType {
this.mSelectListener = select
return this
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)
val attributes = window?.attributes
attributes?.width = binding.root.screenWidth() - 32.dp2px()
// 点击区域外取消
setCanceledOnTouchOutside(true)
setCancelable(true)
binding.apply {
val listRadiusView =
listOf(feedRadius1, feedRadius2, feedRadius3, feedRadius4, feedRadius5)
val listTextView =
listOf(feedText1, feedText2, feedText3, feedText4, feedText5)
val listTouchView = listOf(feedType1, feedType2, feedType3, feedType4, feedType5)
for ((position, radius) in listRadiusView.withIndex()) {
radius.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
mSelectListener?.select(
listTextView[position].text.toString(),
position
)
for ((index, radiusChild) in listRadiusView.withIndex()) {
if (index != position) {
radiusChild.isChecked = false
}
}
dismiss()
}
}
}
for ((index, touch) in listTouchView.withIndex()) {
touch.setOnClickListener {
if (it.isPressed) {
for ((position, radius) in listRadiusView.withIndex()) {
radius.isChecked = position == index
}
}
}
}
}
}
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical">
<TextView
style="@style/TextSingle"
android:text="选择投诉类型" />
<View style="@style/Space" />
<LinearLayout
android:id="@+id/feed_type_1"
style="@style/LinearText">
<TextView
android:id="@+id/feed_text_1"
style="@style/TextLeft"
android:text="功能异常" />
<RadioButton
android:id="@+id/feed_radius_1"
style="@style/RadiusRight" />
</LinearLayout>
<View style="@style/Space" />
<LinearLayout
android:id="@+id/feed_type_2"
style="@style/LinearText">
<TextView
android:id="@+id/feed_text_2"
style="@style/TextLeft"
android:text="体验问题" />
<RadioButton
android:id="@+id/feed_radius_2"
style="@style/RadiusRight" />
</LinearLayout>
<View style="@style/Space" />
<LinearLayout
android:id="@+id/feed_type_3"
style="@style/LinearText">
<TextView
android:id="@+id/feed_text_3"
style="@style/TextLeft"
android:text="功能建议" />
<RadioButton
android:id="@+id/feed_radius_3"
style="@style/RadiusRight" />
</LinearLayout>
<View style="@style/Space" />
<LinearLayout
android:id="@+id/feed_type_4"
style="@style/LinearText">
<TextView
android:id="@+id/feed_text_4"
style="@style/TextLeft"
android:text="服务投诉" />
<RadioButton
android:id="@+id/feed_radius_4"
style="@style/RadiusRight" />
</LinearLayout>
<View style="@style/Space" />
<LinearLayout
android:id="@+id/feed_type_5"
style="@style/LinearText">
<TextView
android:id="@+id/feed_text_5"
style="@style/TextLeft"
android:text="其他问题" />
<RadioButton
android:id="@+id/feed_radius_5"
style="@style/RadiusRight" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
... ...
... ... @@ -28,8 +28,6 @@
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:overScrollMode="never"
android:scrollbars="none"
... ...
... ... @@ -18,5 +18,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="@color/black"
android:layout_marginBottom="32dp"
android:text="上传证件"/>
</LinearLayout>
\ No newline at end of file
... ...
... ... @@ -22,7 +22,7 @@
<TextView
android:id="@+id/tv_question_title"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="16dp"
... ...
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/text_light_gray</item>
<!-- 状态栏颜色 -->
<item name="colorPrimaryDark">@color/text_light_gray</item>
<!--按钮选中或者点击获得焦点后的颜色-->
<item name="colorAccent">@color/color_25</item>
<!--控制searchView的icon颜色的设置-->
<item name="colorControlNormal">@color/text_light_gray</item>
<!--Button按钮正常状态颜色-->
<item name="colorButtonNormal">@color/text_light_gray</item>
<!--EditText 输入框中字体的颜色-->
<item name="editTextColor">@android:color/white</item>
<!-- 窗口的背景颜色 -->
<item name="android:windowBackground">@android:color/white</item>
<!--导航栏上的标题颜色-->
<item name="android:textColorPrimary">@color/black</item>
<item name="android:listDivider">@color/text_light_gray</item>
</style>
<style name="dialog_progress" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@color/transparent</item><!--背景透明-->
... ... @@ -17,6 +39,7 @@
<attr name="bord_width" format="dimension" />
<attr name="bord_color" format="color" />
</declare-styleable>
<style name="mProgress_circle">
<item name="android:indeterminateDrawable">@anim/progress_circle_shape</item>
<item name="android:minWidth">25dp</item>
... ... @@ -78,4 +101,41 @@
<item name="android:windowFullscreen">true</item>
</style>
<style name="TextSingle">
<item name="android:gravity">center_vertical|start</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">52dp</item>
<item name="android:textSize">18sp</item>
<item name="android:paddingEnd">16dp</item>
<item name="android:paddingStart">16dp</item>
<item name="android:textColor">@color/black</item>
</style>
<style name="TextLeft" parent="@style/TextSingle">
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
<item name="android:paddingEnd">0dp</item>
<item name="android:paddingStart">0dp</item>
</style>
<style name="LinearText">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">52dp</item>
<item name="android:paddingEnd">16dp</item>
<item name="android:paddingStart">16dp</item>
<item name="android:orientation">horizontal</item>
<item name="android:gravity">center_vertical</item>
<item name="android:foreground">?android:attr/selectableItemBackground</item>
</style>
<style name="RadiusRight">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">52dp</item>
</style>
<style name="Space">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">0.5dp</item>
<item name="android:background">@color/text_light_gray</item>
</style>
</resources>
\ No newline at end of file
... ...