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.
What is required for detecting translation gestures using the transformable() modifier?
2.
Which modifier is used to detect drag gestures in a specific direction in Jetpack Compose?
3.
What is required to handle multi-directional drag gestures in Jetpack Compose?
4.
Which property of graphicsLayer would you use to rotate a composable?
5.
Which function is used in Jetpack Compose to detect various tap gestures?
6.
Which gesture detection method allows continuous tracking of touch movements?
7.
Which gesture detection method allows tracking both pinch and zoom gestures?
8.
Which gesture detection method is not limited to a single orientation?
9.
How can you simulate multi-touch gestures in an emulator?
10.
Which method is used to create a stateful object for detecting gestures like taps and swipes?
11.
What parameter is used with scrollable() to determine the scroll direction?
12.
What is the role of the TransformableState in the transformable() modifier?
13.
Which modifier is typically used for implementing scrolling behavior in a vertical list?
14.
What does the offset change parameter in rememberTransformableState represent?
15.
Which method is used to create a scroll state in Compose?
16.
What does the offset parameter in detectDragGestures() represent?
17.
Which modifier is used to make a component respond to user scrolling?
18.
How can you enable both horizontal and vertical scrolling for a composable?
19.
Which gesture is commonly used for zooming in or out in a UI?
20.
What is the purpose of the Modifier.clickable in Jetpack Compose?
21.
How is the scale state applied when using the transformable() modifier?
22.
What function should be used to preserve the state of a gesture across recompositions?