Android overhaul: the §9.6 text and date limits in :core:design's Limits.kt
DESCRIPTION_MAX (S-7 and S-19 each had 100), NOTES_MAX (S-7's 1000 and NotesField's private copy), FIRST_DATE and DAYS_AHEAD_MAX (the S-7 and S-9 date pickers each spelled 2000-01-01 and 365). Values unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
+5
-5
@@ -40,7 +40,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import kotlinx.datetime.DateTimeUnit
|
||||
import kotlinx.datetime.LocalDate
|
||||
import kotlinx.datetime.plus
|
||||
import se.hagstedt.kvitt.core.design.R as DesignR
|
||||
import se.hagstedt.kvitt.design.KvittTheme
|
||||
import se.hagstedt.kvitt.design.component.AccountTile
|
||||
import se.hagstedt.kvitt.design.component.AllocationRow
|
||||
@@ -69,20 +68,21 @@ import se.hagstedt.kvitt.design.component.TopBarNavigation
|
||||
import se.hagstedt.kvitt.design.component.detailDate
|
||||
import se.hagstedt.kvitt.design.component.kvittLanguage
|
||||
import se.hagstedt.kvitt.design.component.money
|
||||
import se.hagstedt.kvitt.design.format.DAYS_AHEAD_MAX
|
||||
import se.hagstedt.kvitt.design.format.DateFormatter
|
||||
import se.hagstedt.kvitt.design.format.FIRST_DATE
|
||||
import se.hagstedt.kvitt.design.format.MoneyFormatter
|
||||
import se.hagstedt.kvitt.design.icon.KvittIcon
|
||||
import se.hagstedt.kvitt.design.theme.KvittDimens
|
||||
import se.hagstedt.kvitt.model.Account
|
||||
import se.hagstedt.kvitt.model.FieldError
|
||||
import se.hagstedt.kvitt.model.User
|
||||
import se.hagstedt.kvitt.core.design.R as DesignR
|
||||
|
||||
/** §9.6: the longest settlement note, in code points. */
|
||||
private const val NOTE_MAX = 200
|
||||
|
||||
/** §9.6: dates from 2000-01-01 to today + 365 days. */
|
||||
private val FIRST_DATE = LocalDate(2000, 1, 1)
|
||||
private const val DAYS_AHEAD = 365
|
||||
/** The date picker counts in UTC milliseconds; dates run from [FIRST_DATE] to today + [DAYS_AHEAD_MAX] days (§9.6). */
|
||||
private const val MILLIS_PER_DAY = 86_400_000L
|
||||
|
||||
/**
|
||||
@@ -440,7 +440,7 @@ private fun AddAccountRow(account: Account, colorIndex: Int, onClick: () -> Unit
|
||||
@Composable
|
||||
private fun SettleDatePicker(isoDate: String, actions: SettleActions) {
|
||||
val today = LocalKvittClock.current.today
|
||||
val last = today.plus(DAYS_AHEAD, DateTimeUnit.DAY)
|
||||
val last = today.plus(DAYS_AHEAD_MAX, DateTimeUnit.DAY)
|
||||
val selectable = remember(today) {
|
||||
object : SelectableDates {
|
||||
override fun isSelectableDate(utcTimeMillis: Long): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user