|
@@ -2,14 +2,7 @@ package com.ys.bdtp.adm.mvvm.ui.compose
|
|
|
|
|
|
import androidx.compose.foundation.background
|
|
|
import androidx.compose.foundation.clickable
|
|
|
-import androidx.compose.foundation.layout.Box
|
|
|
-import androidx.compose.foundation.layout.Row
|
|
|
-import androidx.compose.foundation.layout.Spacer
|
|
|
-import androidx.compose.foundation.layout.fillMaxHeight
|
|
|
-import androidx.compose.foundation.layout.fillMaxSize
|
|
|
-import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
-import androidx.compose.foundation.layout.height
|
|
|
-import androidx.compose.foundation.layout.width
|
|
|
+import androidx.compose.foundation.layout.*
|
|
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
|
import androidx.compose.foundation.lazy.items
|
|
|
import androidx.compose.material.Icon
|
|
@@ -26,9 +19,11 @@ import androidx.compose.ui.Alignment
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
+import com.google.gson.Gson
|
|
|
import com.ys.bdtp.adm.app.theme.textBlackColor
|
|
|
import com.ys.bdtp.adm.app.theme.underColor
|
|
|
import com.ys.bdtp.adm.mvvm.model.db.entity.task.FloorEntity
|
|
|
+import com.ys.bdtp.adm.mvvm.model.db.entity.task.FloorInfos
|
|
|
import com.ys.bdtp.adm.mvvm.model.db.relation.BuildingWithFloors
|
|
|
|
|
|
|
|
@@ -68,11 +63,13 @@ fun ExpandList(items: List<BuildingWithFloors>, click: (FloorEntity) -> Unit) {
|
|
|
Icons.Default.ArrowRight,
|
|
|
contentDescription = ""
|
|
|
)
|
|
|
- Text(text = building.building.name, color = textBlackColor)
|
|
|
+ Text(text = building.building.localName, color = textBlackColor)
|
|
|
}
|
|
|
|
|
|
if (building.building.id == selectId && isExpand) {
|
|
|
- building.floors.forEach { floor ->
|
|
|
+ building.floors.sortedByDescending {
|
|
|
+ (Gson().fromJson(it.infos, FloorInfos::class.java)).floorSequenceID
|
|
|
+ }.forEach { floor ->
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
.height(60.dp)
|
|
@@ -84,7 +81,7 @@ fun ExpandList(items: List<BuildingWithFloors>, click: (FloorEntity) -> Unit) {
|
|
|
) {
|
|
|
Spacer(modifier = Modifier.width(48.dp))
|
|
|
Text(
|
|
|
- text = floor.localId,
|
|
|
+ text = floor.localName,
|
|
|
color = textBlackColor,
|
|
|
)
|
|
|
}
|