Не подтверждена Коммит 6cfd3877 создал по автору Vitaly.Smirnov's avatar Vitaly.Smirnov Зафиксировано автором GitHub
Просмотр файлов

Adjust room info UI layout and spacing (#358)

* fix: Adjust room info UI layout and spacing

* chore: update version to 1.0.0 in build files
владелец 969120de
......@@ -84,8 +84,8 @@ android {
targetSdk = libs.versions.android.targetSdk.get().toInt()
applicationId = "band.effective.office.tablet"
versionCode = 1
versionName = "0.0.2"
versionCode = 2
versionName = "1.0.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
......
......@@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
......@@ -85,19 +86,20 @@ fun RoomProperty(
electricSocketCount: Int
) {
Row {
RoomPropertyComponent(
image = Res.drawable.quantity,
text = "$capacity",
color = roomInfoColor
)
if (isHaveTv) {
Spacer(modifier = Modifier.width(spaceBetweenProperty))
RoomPropertyComponent(
image = Res.drawable.tv,
text = stringResource(band.effective.office.tablet.feature.main.Res.string.tv_property),
text = "",
color = roomInfoColor
)
Spacer(modifier = Modifier.width(spaceBetweenProperty))
}
RoomPropertyComponent(
image = Res.drawable.quantity,
text = "$capacity",
color = roomInfoColor,
textModifier = Modifier.widthIn(min = 20.dp)
)
if (electricSocketCount > 0) {
Spacer(modifier = Modifier.width(spaceBetweenProperty))
RoomPropertyComponent(
......@@ -110,7 +112,12 @@ fun RoomProperty(
}
@Composable
fun RoomPropertyComponent(image: DrawableResource, text: String, color: Color) {
fun RoomPropertyComponent(
image: DrawableResource,
text: String,
color: Color,
textModifier: Modifier = Modifier
) {
Row(
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
......@@ -121,7 +128,9 @@ fun RoomPropertyComponent(image: DrawableResource, text: String, color: Color) {
contentDescription = null,
colorFilter = ColorFilter.tint(color)
)
Spacer(modifier = Modifier.width(8.dp))
Text(text = text, style = MaterialTheme.typography.h8)
if (text.isNotEmpty()) {
Spacer(modifier = Modifier.width(8.dp))
Text(text = text, style = MaterialTheme.typography.h8, modifier = textModifier)
}
}
}
\ Нет новой строки в конце файла
......@@ -9,6 +9,6 @@ kotlin.incremental=true
# Project properties
group=band.effective.office
version=0.0.3
version=1.0.0
android.useAndroidX=true
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать