Urgent.News

What's breaking now, across thousands of outlets.

Tech

Bring one-handed gestures to your Wear OS app

Posted by Chiara Chiappini, Developer Relation Engineer, Android Developer Relations One-handed gestures offer a convenient and touch-free way for users to interact with their watches, enabling them to perform key actions using only the hand on which the device is worn. First introduced on Pixel Watch with Wear OS 6.1, one-handed gestures made quick interactions effortless, such as starting and…

Bring one-handed gestures to your Wear OS app

One-handed gestures are becoming increasingly popular for watch interactions, offering a touch-free method to perform key actions. Initially introduced on Pixel Watch with Wear OS 6.1, these gestures enabled quick actions such as starting/stopping timers, answering calls, and controlling media. With the latest Wear OS 7 update, the functionality has been expanded using a new Gestures framework, giving Original Equipment Manufacturers (OEMs) the ability to map gestures to primary actions and dismissals, and providing an API for developers to integrate gesture control into their apps.

The new Gestures framework is designed around two primary interaction patterns: primary action and dismiss action. The primary action, activated by a double-pinch gesture on Pixel Watch, should be mapped to the most important task in a given context. This could include tasks such as taking a photo, starting/stopping a timer, or answering a call.

The dismiss action, typically mapped to a wrist turn gesture on Pixel Watch, is mapped to the system back button by default and provides an intuitive way to close interruptive screens or return to the watch face. This action can also be overridden for specific use cases, such as silencing an incoming call.

The Wear OS gesture framework is now available to all Wear OS device manufacturers to adopt. Developers can enhance their Wear OS apps with gesture support by using the new Modifier.oneHandedGesture modifier in Compose for Wear OS. This modifier can be applied to any existing interactive composable to make it gesture-aware. To implement gestures, developers must define the gesture configuration, initialize the indicator state, and apply Modifier.oneHandedGesture to their interactive components.

Developers will then need to handle the onGestureAvailable and onGesture callbacks to activate visual hints and execute actions respectively.

Some examples of how gestures can be used include scrolling through notifications to view content and initiate a reply, paging through workout metrics, or scrolling content when the content is the end goal of the user journey and there is a gesture actionable button off-screen. The framework also includes gesture indicator components, such as OneHandedGestureClickIndicator for components like a Button, OneHandedGestureScrollIndicator for scrolling, and OneHandedGestureHandle for providing custom gesture handling.

These components help guide users in learning which gestures are available on a screen, providing animated cues that inform users where they can perform a gesture without being intrusive.

Written by urgent.news from Android Developers Blog's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at android-developers.googleblog.com →

More in Tech

Mesh, Automattic’s CRM for everyone, comes to Android

Mesh, an AI-powered contacts app and relationship manager from Automattic is now an Android app.

  • Mesh, Automattic’s CRM, launched for Android users
  • Incorporates Android features like split-screen and Material You
  • AI tool Nexus AI in early access for relationship management

More from Wednesday 12 August →