feat: 底部卡片显示班次状态提示
根据选中日期的班次类型(WORK/OFF)在底部卡片展示对应提示语。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a0b1b4b569
commit
380056bf48
@ -26,6 +26,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import kotlinx.datetime.LocalDate
|
import kotlinx.datetime.LocalDate
|
||||||
import plus.rua.project.CalendarViewModel
|
import plus.rua.project.CalendarViewModel
|
||||||
|
import plus.rua.project.ShiftKind
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 底部卡片,折叠状态下支持垂直拖拽触发折叠动画。
|
* 底部卡片,折叠状态下支持垂直拖拽触发折叠动画。
|
||||||
@ -55,6 +56,11 @@ fun BottomCard(
|
|||||||
@Suppress("DEPRECATION") // monthNumber 无替代 API,kotlinx-datetime 尚未提供新接口
|
@Suppress("DEPRECATION") // monthNumber 无替代 API,kotlinx-datetime 尚未提供新接口
|
||||||
val solarDesc = "${selectedDate.monthNumber}月${selectedDate.day}日"
|
val solarDesc = "${selectedDate.monthNumber}月${selectedDate.day}日"
|
||||||
val lunarDesc = formatLunarDate(selectedDate)
|
val lunarDesc = formatLunarDate(selectedDate)
|
||||||
|
val shiftMessage = when (viewModel.shiftKindAt(selectedDate)) {
|
||||||
|
ShiftKind.WORK -> "小小上班,轻松拿下!"
|
||||||
|
ShiftKind.OFF -> "耶耶耶,美美休息!"
|
||||||
|
null -> null
|
||||||
|
}
|
||||||
|
|
||||||
Surface(
|
Surface(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
@ -147,6 +153,17 @@ fun BottomCard(
|
|||||||
fontSize = 14.sp
|
fontSize = 14.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (shiftMessage != null) {
|
||||||
|
Text(
|
||||||
|
text = shiftMessage,
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.CenterHorizontally)
|
||||||
|
.padding(top = 12.dp, bottom = 6.dp),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
fontSize = 14.sp
|
||||||
|
)
|
||||||
|
}
|
||||||
Spacer(modifier = Modifier.height(12.dp))
|
Spacer(modifier = Modifier.height(12.dp))
|
||||||
AnimatedGif(
|
AnimatedGif(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user