Status Update
Comments
ni...@gmail.com <ni...@gmail.com> #2
Hi,
Thank you for your feedback. I understand that this is a frustrating experience - we aren't in a super easy spot with Swipeable. It currently has a number of critical bugs that need to be addressed first (we are working on this), which is why we are limiting the surface we are exposing for Swipeable in M3 for the time. Our plan for the coming months is to focus on this specific area and improve developer experience.
Material 3 for Jetpack Compose is still in alpha - this means we consider components production-ready, but the API shape is flexible while in alpha. This gives us space to iterate while getting real-world feedback from developers, which ultimately helps improve your experience. Copy-pasting source code for components that are not (fully) implemented or exposed in an alpha version can be a good thing to do in the meantime! Owning the source code while the API shape is still flexible gives you a number of benefits like ease of updating dependencies, even if the APIs change, and allows you to evolve your components in your own pace.
We are aware of your request to expose rememberSwipeableStateFor in M3 though and will do so when the time is right and Swipeable in a good enough spot. I will close this issue in favor of
Description
M3: 1.3.0-beta05
Compose: 1.7.0-beta07
Compiler: 1.5.15
Material Library Version: M3
Material Compose component used:
BottomSheetScaffold with scrollable Column (verticalScroll modifier), but this is also happening with LazyColumn
Android Studio Build: Android Studio Koala | 2024.1.1 Patch 2
Kotlin version: 1.9.25
Sample Code:
class MainActivity : ComponentActivity() {
@OptIn(ExperimentalMaterial3Api::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
BottomSheetBugTheme {
BottomSheetScaffold(
sheetPeekHeight = 75.dp,
scaffoldState = rememberBottomSheetScaffoldState(),
sheetContent = {
SheetContent(modifier = Modifier.fillMaxSize())
}
) {
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Red)
)
}
}
}
}
}
@Composable
fun SheetContent(modifier: Modifier = Modifier) {
Column(
modifier = modifier.verticalScroll(rememberScrollState())
) {
(1..50).forEachIndexed { index, _ ->
if (index != 0)
HorizontalDivider()
Column(
modifier = Modifier
.fillMaxWidth()
.heightIn(min = 74.dp)
.background(Color.Gray),
) {
Text(text = "Hello Google $index")
}
}
}
}
This issue is mostly also related to: