Welcome to the “Detecting Gestures in Compose” Quiz! This quiz is designed to test your knowledge of handling various touch gestures using Jetpack Compose. You’ll encounter questions about gesture detection techniques like tap, long press, drag, scroll, and multi-touch gestures such as pinch and rotation. Whether you’re familiar with gesture modifiers or the more advanced PointerInputScope, this quiz will challenge your understanding and help solidify your knowledge of gesture interactions in Compose.
1.
Which modifier is used to make a component respond to user scrolling?
2.
What does the offset parameter in detectDragGestures() represent?
3.
What function should be used to preserve the state of a gesture across recompositions?
4.
Which method is used to create a scroll state in Compose?
5.
What does the offset change parameter in rememberTransformableState represent?
6.
Which modifier is used to detect drag gestures in a specific direction in Jetpack Compose?
7.
Which modifier is typically used for implementing scrolling behavior in a vertical list?
8.
Which gesture detection method is not limited to a single orientation?
9.
Which function is used in Jetpack Compose to detect various tap gestures?
10.
What is required to handle multi-directional drag gestures in Jetpack Compose?
11.
What is the role of the TransformableState in the transformable() modifier?
12.
Which method is used to create a stateful object for detecting gestures like taps and swipes?
13.
How is the scale state applied when using the transformable() modifier?
14.
What is required for detecting translation gestures using the transformable() modifier?
15.
Which gesture is commonly used for zooming in or out in a UI?
16.
What is the purpose of the Modifier.clickable in Jetpack Compose?
17.
What parameter is used with scrollable() to determine the scroll direction?
18.
Which gesture detection method allows tracking both pinch and zoom gestures?
19.
How can you enable both horizontal and vertical scrolling for a composable?
20.
Which gesture detection method allows continuous tracking of touch movements?
21.
Which property of graphicsLayer would you use to rotate a composable?
22.
How can you simulate multi-touch gestures in an emulator?