mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 03:38:23 +00:00
fix(calendar): the calendar filter scrolls with the lenses instead of hiding one
"All calendars" was pinned beside the scrolling lens chips and took its width out of them. Once "Friends going" joined the lenses, the row outgrew an 800px tablet and "Day" sat half-hidden under the pinned chip, with nothing to say the row scrolls. The filter now sits at the end of the same scrolling row, so every lens shows whole and the chip cut by the screen edge is the scroll cue. Checked on the tablet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
318c172a4b
commit
d3e38285b8
+13
-10
@@ -33,6 +33,7 @@ import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
@@ -84,17 +85,12 @@ fun CalendarsTopBar(
|
||||
)
|
||||
}
|
||||
|
||||
Row(
|
||||
CalendarsViewModeTabs(
|
||||
current = viewMode,
|
||||
onChange = onViewModeChange,
|
||||
trailing = trailing,
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),
|
||||
verticalAlignment = androidx.compose.ui.Alignment.CenterVertically,
|
||||
) {
|
||||
CalendarsViewModeTabs(
|
||||
current = viewMode,
|
||||
onChange = onViewModeChange,
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
trailing?.invoke()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,13 +116,19 @@ private fun CalendarsTopNavFilterBar(
|
||||
private fun CalendarsViewModeTabs(
|
||||
current: CalendarsViewMode,
|
||||
onChange: (CalendarsViewMode) -> Unit,
|
||||
trailing: (@Composable () -> Unit)?,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
// The trailing control scrolls with the lenses instead of being pinned beside them: pinned,
|
||||
// it took its width out of the scrolling part, and once the lenses outgrew what was left
|
||||
// (on an 800px tablet, after "Friends going" joined them) the last lens sat half-hidden
|
||||
// against it with nothing to say the row scrolls. A chip cut by the screen edge does.
|
||||
Row(
|
||||
modifier =
|
||||
modifier
|
||||
.horizontalScroll(rememberScrollState())
|
||||
.padding(vertical = 4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
CalendarsViewMode.entries.forEach { mode ->
|
||||
FilterChip(
|
||||
@@ -143,5 +145,6 @@ private fun CalendarsViewModeTabs(
|
||||
shape = MaterialTheme.shapes.small,
|
||||
)
|
||||
}
|
||||
trailing?.invoke()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user