fix: compile against the material3 that ships, ending the tab crash (#10)

floret-kit 0.7.0 pulls in material3 1.5.0-alpha29 on the runtime
classpath while the app still compiled against alpha21. alpha29 removed
the composable-content ButtonGroup overload, so the stopwatch and timer
controls threw NoSuchMethodError as soon as a tab opened.

Align the Compose BOM, material3, core-ktx and appcompat with
floret-kit 0.7.0, and make each variant's compile classpath resolve
consistently with its runtime classpath, so a future skew fails the
build instead of a user's app. The two ButtonGroups never used
animateWidth, so they become a Row with the group's spacing; the
removed ToggleButtonDefaults.shapes() was the default anyway.
This commit is contained in:
makiolaj committed 2026-10-08 09:23:46 +02:00
1 parent f5052f3fa9
commit e49afb182c
5 files changed
+18 -10

No files matched your search

+10
View File
@@ -154,6 +154,16 @@ ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
// Compile against the library versions the APK actually ships. floret-kit's
// `implementation` deps reach only the runtime classpath, so a newer material3
// there once won at runtime while the app compiled against an older one, and
// a removed ButtonGroup overload crashed every tab with NoSuchMethodError (#10).
androidComponents {
onVariants { variant ->
variant.compileConfiguration.shouldResolveConsistentlyWith(variant.runtimeConfiguration)
}
}
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
@@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.Text
import androidx.compose.material3.ToggleButton
import androidx.compose.material3.ToggleButtonDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
@@ -59,7 +58,6 @@ internal fun RepeatDaySelector(
ToggleButton(
checked = day in repeatDays,
onCheckedChange = { onDayToggled(day) },
shapes = ToggleButtonDefaults.shapes(),
modifier = Modifier
.weight(1f)
.semantics { contentDescription = full },
@@ -11,7 +11,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonGroup
import androidx.compose.material3.ButtonGroupDefaults
import androidx.compose.material3.CircularWavyProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.FilledTonalButton
@@ -180,7 +180,7 @@ private fun StopwatchControls(
) {
val lapLimit = stringResource(R.string.stopwatch_lap_limit)
ButtonGroup(modifier = modifier) {
Row(modifier = modifier, horizontalArrangement = ButtonGroupDefaults.HorizontalArrangement) {
val primaryInteraction = remember { MutableInteractionSource() }
val primary = when (mode) {
StopwatchState.RUNNING -> R.string.stopwatch_pause to onPause
@@ -18,7 +18,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Close
import androidx.compose.material3.ButtonGroup
import androidx.compose.material3.ButtonGroupDefaults
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.FilledTonalIconButton
@@ -248,7 +248,7 @@ private fun TimerControls(
TimerMode.IDLE -> R.string.timer_add_minute to onAddMinute
}
ButtonGroup(modifier = modifier) {
Row(modifier = modifier, horizontalArrangement = ButtonGroupDefaults.HorizontalArrangement) {
val actions = buildList {
add(primary)
if (mode == TimerMode.RUNNING || mode == TimerMode.PAUSED) {
+4 -4
View File
@@ -3,15 +3,15 @@ agp = "9.2.1"
kotlin = "2.3.21"
ksp = "2.3.9"
hilt = "2.59.2"
coreKtx = "1.19.0"
appcompat = "1.7.1"
coreKtx = "1.19.1"
appcompat = "1.8.0"
lifecycleRuntime = "2.10.0"
activityCompose = "1.13.0"
composeBom = "2026.05.01"
composeBom = "2026.09.00"
# Material 3 Expressive APIs currently live only in the 1.5 alpha line.
# Pin explicitly to override the BOM (which ships stable 1.4.0).
# Re-evaluate when 1.5.0 stable lands.
material3 = "1.5.0-alpha21"
material3 = "1.5.0-alpha29"
datastore = "1.2.1"
# SAF directory writing for export/backup (DocumentFile).
documentfile = "1.1.0"