Skip to content

Commit

Permalink
Merge pull request #97 from fingerprintjs/feature/app-mouse-drag-support
Browse files Browse the repository at this point in the history
Make the demo app usable with a mouse by supporting dragging of the scrollable content
  • Loading branch information
Sergey-Makarov authored Aug 1, 2023
2 parents 667fa90 + 1555cac commit abf975d
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import androidx.compose.animation.*
import androidx.compose.animation.core.tween
import androidx.compose.animation.core.updateTransition
import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.gestures.draggable
import androidx.compose.foundation.gestures.rememberDraggableState
import androidx.compose.foundation.gestures.scrollBy
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.rememberLazyListState
Expand Down Expand Up @@ -76,7 +80,15 @@ fun <T> InfoColumn(
LazyColumn(
state = state,
modifier = Modifier
.fillMaxSize(),
.fillMaxSize()
.draggable(
orientation = Orientation.Vertical,
state = rememberDraggableState { delta ->
scope.launch {
state.scrollBy(-delta)
}
},
),
contentPadding = PaddingValues(
all = 24.dp
)
Expand Down

0 comments on commit abf975d

Please sign in to comment.