SmartToolFactory / Jetpack-Compose-Tutorials

๐Ÿš€๐Ÿงจ๐Ÿ“ Series of Tutorials to learn about Jetpack Compose with subjects Material Widgets, Layout, SubcomposeLayout, custom layouts, State, custom rememberable, recomposition, LaunchedEffect, side-effects, Gesture, Animation, Navigation, Canvas, UIs like whatsapp and others.
Apache License 2.0
3.01k stars 312 forks source link

Fix bottom sheet not closing in previews & rotate icon based on bottom sheet. #31

Closed Naveed-Baloch closed 7 months ago

Naveed-Baloch commented 8 months ago

Floating Action State Based on Bottom sheet State

Before After

Bottom Sheet Intractive Mode Issue

Previews for Bottom sheet in intractive mode are not Working as expected as we are using the Toast in confirmStateChange of bottom sheet. We can skip the Toast using isInPreview.

if(!isInPreview) {
  Toast.makeText(context, "State changed to $bottomSheetValue", Toast.LENGTH_SHORT).show()
}

Icon Rotation Animation

https://github.com/SmartToolFactory/Jetpack-Compose-Tutorials/assets/83871075/0d07db1e-efe7-4d28-8fd2-b6b75e0944b0