merge code

This commit is contained in:
qiji4215 2023-05-06 14:57:04 +08:00
parent 7a09721dc8
commit bfd9df9d8a
20 changed files with 162 additions and 56 deletions

View File

@ -116,7 +116,7 @@ class LoginViewModel @Inject constructor(
//文件夹初始化
try {
loginStatus.postValue(LoginStatus.LOGIN_STATUS_FOLDER_INIT)
createUserFolder(context, "1")
createUserFolder(context, "02911")
} catch (e: IOException) {
loginStatus.postValue(LoginStatus.LOGIN_STATUS_FOLDER_FAILURE)
}

View File

@ -313,6 +313,7 @@ class EvaluationResultViewModel @Inject constructor(
fun saveData() {
viewModelScope.launch(Dispatchers.IO) {
val realm = Realm.getDefaultInstance()
liveDataQsRecordBean.value!!.checkTime = DateTimeUtil.getDataTime()
realm.executeTransaction {
it.copyToRealmOrUpdate(liveDataQsRecordBean.value)
}

View File

@ -51,14 +51,18 @@ class QsRecordListAdapter(
holder.itemView.setOnClickListener {
itemClickListener!!.onItemClickListener(position)
}
changeViews(binding, qsRecordBean)
changeViews(position, binding, qsRecordBean)
}
private fun changeViews(binding: AdapterQsRecordListBinding, qsRecordBean: QsRecordBean) {
private fun changeViews(position: Int,binding: AdapterQsRecordListBinding, qsRecordBean: QsRecordBean) {
if(position<99)
binding.qsRecordIndex.text = (position+1).toString()
else
binding.qsRecordIndex.text = "99."
binding.qsRecordClassType.text = qsRecordBean.classType
binding.qsRecordProblemType.text = qsRecordBean.problemType
binding.qsRecordPhenomenon.text = qsRecordBean.phenomenon
binding.qsRecordProblemLink.text = qsRecordBean.problemLink
binding.qsRecordTime.text = qsRecordBean.checkTime
}
override fun getItemViewRes(position: Int): Int {

View File

@ -44,6 +44,7 @@ class QsRecordListFragment : BaseFragment(){
binding.qsRecyclerview.adapter = adapter
viewModel.liveDataQSList.observe(viewLifecycleOwner) {
adapter.refreshData(it)
binding.tvTitleCount.text = ""+adapter.data.size+""
}
val itemDecoration = DividerItemDecoration(context, DividerItemDecoration.VERTICAL)
itemDecoration.setDrawable(resources.getDrawable(R.drawable.separator))
@ -57,7 +58,7 @@ class QsRecordListFragment : BaseFragment(){
}
})
binding.recordBack.setOnClickListener{
binding.imgBack.setOnClickListener{
findNavController().navigateUp()
}
}

View File

@ -8,6 +8,7 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.navinfo.collect.library.map.NIMapController
import com.navinfo.omqs.Constant
import com.navinfo.omqs.bean.TaskBean
import com.navinfo.omqs.http.NetResult
import com.navinfo.omqs.http.NetworkService
@ -35,7 +36,7 @@ class TaskListViewModel @Inject constructor(
viewModelScope.launch(Dispatchers.IO) {
var taskList: List<TaskBean> = mutableListOf()
when (val result = networkService.getTaskList("02911")) {
when (val result = networkService.getTaskList(Constant.USER_ID)) {
is NetResult.Success -> {
if (result.data != null) {
val realm = Realm.getDefaultInstance()

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -2,8 +2,8 @@
android:shape="line">
<size android:height="2dp"/>
<stroke
android:color="@color/skyblue"
android:dashWidth="2px"
android:dashGap="2px"
android:color="@color/bg_gray2"
android:dashWidth="1px"
android:dashGap="1px"
android:width="1dp"/>
</shape>

View File

@ -1,53 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="wrap_content"
android:background="@color/ivory"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
tools:context="com.navinfo.omqs.ui.fragment.qsrecordlist.QsRecordListAdapter">
<TextView
android:id="@+id/qs_record_index"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@mipmap/marker"
android:maxLength="3"
android:text=""
android:layout_marginRight="@dimen/default_widget_padding"
style="@style/content_font_default_size_13sp" />
<TextView
android:id="@+id/qs_record_classType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@mipmap/point_blue"
android:text="问题分类"
style="@style/content_font_default"
android:textSize="@dimen/default_font_size" />
<TextView
android:id="@+id/qs_record_problemLink"
style="@style/content_font_default"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/qs_record_classType"
android:drawableLeft="@mipmap/point_blue"
android:layout_marginLeft="@dimen/default_widget_padding"
android:text="问题环节" />
<TextView
android:id="@+id/qs_record_problem_type"
style="@style/content_font_default_size_13sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxEms="6"
android:singleLine="true"
android:ellipsize="end"
android:layout_toRightOf="@id/qs_record_index"
android:text="问题分类" />
<TextView
android:id="@+id/qs_record_time"
style="@style/content_font_default_size_13sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/default_widget_padding"
android:layout_toRightOf="@id/qs_record_classType"
android:maxLines="1"
android:text="" />
<TextView
android:id="@+id/qs_record_problem_type"
style="@style/content_font_default_size_10sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/qs_record_classType"
android:drawableLeft="@mipmap/point_blue"
android:layout_toRightOf="@id/qs_record_index"
android:layout_marginTop="5dp"
android:text="问题类型" />
<TextView
android:id="@+id/qs_record_phenomenon"
style="@style/content_font_default_size_13sp"
style="@style/content_font_default_size_10sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/qs_record_problem_type"
android:maxLines="2"
android:layout_below="@id/qs_record_classType"
android:drawableLeft="@mipmap/point_blue"
android:layout_marginLeft="@dimen/default_widget_padding"
android:layout_marginTop="5dp"
android:text="问题现象" />

View File

@ -13,30 +13,85 @@
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
style="@style/left_pannel_title_layout">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/record_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="5dp"
app:layout_constraintBottom_toBottomOf="parent"
android:background="@drawable/selector_bg_round_button"
android:foreground="@drawable/ripple_btn_press"
style="@style/btn_round"
android:src="@drawable/ic_baseline_keyboard_arrow_left_24"></androidx.appcompat.widget.AppCompatImageView>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/record_title"
android:layout_width="wrap_content"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/evaluation_appbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/left_pannel_title_font"
android:textStyle="bold"
android:text="我的数据"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"></androidx.appcompat.widget.AppCompatTextView>
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/eight"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:src="@drawable/btn_back_xml" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:paddingTop="@dimen/ten"
android:paddingBottom="@dimen/five"
android:text="测评结果"
android:textColor="@color/highFontColor"
android:textSize="@dimen/default_font_size" />
<TextView
android:id="@+id/tv_title_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title"
android:paddingLeft="@dimen/ten"
android:layout_alignStart="@+id/tv_title"
android:paddingBottom="@dimen/ten"
android:textSize="@dimen/card_title_font_3size"
android:text="共0个"
android:textColor="@color/cv_gray_153" />
<ImageView
android:id="@+id/img_refrush"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:padding="@dimen/eight"
android:layout_centerInParent="true"
android:layout_marginRight="@dimen/eight"
android:background="@drawable/icon_refrush" />
<ImageView
android:id="@+id/img_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="@dimen/eight"
android:layout_marginRight="@dimen/eight"
android:layout_toLeftOf="@+id/img_refrush"
android:background="@drawable/icon_order" />
<ImageView
android:id="@+id/img_filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="@dimen/eight"
android:layout_marginRight="@dimen/eight"
android:layout_toLeftOf="@+id/img_order"
android:background="@drawable/icon_filter" />
</RelativeLayout>
</com.google.android.material.appbar.AppBarLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.cardview.widget.CardView

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/filter"
android:contentDescription="筛选"
android:icon="@drawable/icon_filter"
android:title="筛选"
app:showAsAction="ifRoom" />
<item
android:id="@+id/order"
android:contentDescription="排序"
android:icon="@drawable/icon_order"
android:title="排序"
app:showAsAction="ifRoom" />
<item
android:id="@+id/refrush"
android:contentDescription="刷新"
android:icon="@drawable/icon_refrush"
android:title="刷新"
app:showAsAction="ifRoom" />
</menu>

View File

@ -39,7 +39,7 @@
<item
android:id="@+id/personal_center_menu_qs_record_list"
android:icon="@drawable/baseline_person_24"
android:title="我的数据" />
android:title="测评结果" />
<item
android:id="@+id/personal_center_menu_layer_manager"
android:icon="@drawable/baseline_person_24"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 332 B

View File

@ -63,6 +63,15 @@
<item name="android:layout_height">wrap_content</item>
</style>
<!-- 默认字体 -->
<style name="content_font_default_size_10sp">
<item name="android:gravity">center_vertical</item>
<item name="android:textSize">@dimen/card_title_font_3size</item>
<item name="android:textColor">@color/black</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style>
<!-- 输入框基本样式 -->
<style name="input_blue_type" parent="content_font_default">
<item name="android:textSize">16sp</item>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB