Both platforms have standard gestures that users will expect to have access to but in some cases those gestures behave differently on each platform. What happens when the user swipes left and right vs up or down? Should you use long presses? This video explores the use of gestures in mobile apps.
- [Instructor] Offering touch gestures to operate your app is a great way to make the experience fast, fluid, and delightful. You should always be mindful of user expectation, an ability for gesture-based interaction on a platform. Not every user will be as familiar with gestures as others. On Android and iOS, most of the common gestures have very standardized behaviors so users will expect your app to support those. You should utilize those as much as possible. Horizontal swipe is ubiquitous on touch devices.
Unlike iOS, on Android swiping horizontally within a tab must switch tabs. It's a key expected behavior. Outside of tabs, swipe is often for carousels or to dismiss elements from a collection such as removing an item from a list. It's uncommon to offer horizontal scrolling on Android. Snapping to page boundaries is more common. As for the vertical axis, continuous scrolling is preferred on Android and snapping to a page boundary is somewhat discouraged.
Material design encourages using scrolling techniques like pinning to optimize layout at various scrolling positions. For example, the app bar may slide away as you scroll down and reappear as you scroll back up. Swiping from the left or right edge of the screen is also a common gesture. Unlike iOS where left edge swipe takes you back one screen, Android reserves edge swipe for two behaviors. First, if there's a drawer to the left or right of the screen such as the navigational drawer or hamburger menu, swiping inward from the side of the screen should open the drawer.
Secondly, in case you have internally swipeable content, within a tab swiping from the edge should change tabs. One final gesture to consider is long press. On Android, long pressing an item should either select it, begin dragging the item or do nothing. Avoid using long press for contextual menus or less expected behaviors like shortcuts or other functionalities. Because long press is a somewhat hidden gesture, its behavior isn't normally apparent so it's especially best to stick to platform norms.
If you really need to expose contextual actions on items, use an on-screen affordance like overflow icons and popover menus. Make sure you align the popover or overflow when you create these, but we'll get more into controls later. In order to drill deeper into gestures and to better understand them, I highly recommend going to material design's guidelines and Apple's Human Interface Guidelines on their gesture pages. This covers the breakdown of gestures in Android and iOS.
- Understanding gestures
- Laying out your apps
- Using adaptive views
- Adding animation and interactions
- Setting up notifications
- Understanding differences in the visual design: typography, color, and more
- Accommodating keyboard differences
- Building a complete cross-platform app