A fully functional Android app built entirely with Kotlin and Jetpack Compose
Add hoverable to scrollbar
TJ Dahunsi795c5e32a9bc
diff --git a/core/designsystem/src/main/java/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/Scrollbar.kt b/core/designsystem/src/main/java/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/Scrollbar.ktindex 4984946bc..dfe0ce1f0 100644--- a/core/designsystem/src/main/java/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/Scrollbar.kt+++ b/core/designsystem/src/main/java/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/Scrollbar.kt@@ -21,6 +21,7 @@ import androidx.compose.foundation.gestures.Orientationimport androidx.compose.foundation.gestures.detectTapGesturesimport androidx.compose.foundation.gestures.draggableimport androidx.compose.foundation.gestures.rememberDraggableState+import androidx.compose.foundation.hoverableimport androidx.compose.foundation.interaction.MutableInteractionSourceimport androidx.compose.foundation.interaction.PressInteractionimport androidx.compose.foundation.layout.Box@@ -221,9 +222,10 @@ fun Scrollbar(Box(modifier = modifier.run {+ val withHover = interactionSource?.let(::hoverable) ?: thiswhen (orientation) {- Orientation.Vertical -> fillMaxHeight()- Orientation.Horizontal -> fillMaxWidth()+ Orientation.Vertical -> withHover.fillMaxHeight()+ Orientation.Horizontal -> withHover.fillMaxWidth()}}.onGloballyPositioned { coordinates ->