Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

Show confirmations on Wear

The confirmations that are displayed in Wear OS apps use the whole screen or a larger portion of it than those in handheld apps. This ensures that users can see these confirmations by just glancing at the screen and that they have large enough touch targets to cancel an action.

In addition to the reading the sections below, you should review the Wear OS design principles.

The Wearable UI Library helps you show confirmation animations and timers in your apps:

Confirmation timers
Automatic confirmation timers show users an animated timer that lets them cancel an action they just performed.
Confirmation animations
Confirmation animations give users visual feedback when they complete an action.

The following sections show you how to implement these patterns.

Use automatic confirmation timers

Figure 1: A confirmation timer.

Automatic confirmation timers let users cancel an action they just performed. When the user performs the action, your app shows a button to cancel the action with a timer animation and starts the timer. The user has the option to cancel the action until the timer finishes. Your app gets notified if the user cancels the action and when the timer expires.

To show a confirmation timer when users complete an action in your app:

  1. Add a <CircularProgressLayout> element to your layout.
  2. Implement the OnTimerFinishedListener interface in your activity.
  3. Set the duration of the timer and start it when the user completes an action.

To use CircularProgressLayout in your app, you need to include the following dependencies (or later versions) in the build.gradle file of your wear module:

    compile ''
    compile ''
    compile ''
    compile ''

You can add the <CircularProgressLayout> element to your layout as follows:

      android:layout_height="40dp" />

You can also add any view as a child to CircularProgressLayout to display a progress timer around it. The above example uses an ImageView, but it could also be a TextView to show text inside.

Note: The CircularProgressLayout class replaces a similar, deprecated class in the Wearable Support Library.

To be notified when the timer finishes or when users tap on it, implement the corresponding listener methods in your activity:

public class WearActivity extends Activity implements
    CircularProgressLayout.OnTimerFinishedListener, View.OnClickListener {
  private CircularProgressLayout mCircularProgress;

  protected void onCreate(Bundle savedInstanceState) {
    mCircularProgress =
        (CircularProgressLayout) findViewById(;

  public void onTimerFinished(CircularProgressLayout layout) {
    // User didn't cancel, perform the action

  public void onClick(View view) {
    if (view.equals(mCircularProgress)) {
      // User canceled, abort the action

To start the timer, add the following code to the point in your activity where users select an action:

// Two seconds to cancel the action
// Start the timer

Figure 2: A confirmation animation.

Show confirmation animations

To show a confirmation animation when users complete an action in your app, create an intent that starts ConfirmationActivity from one of your activities. You can specify one of the these animations with the EXTRA_ANIMATION_TYPE intent extra:

You can also add a message that appears under the confirmation icon.

To use the ConfirmationActivity in your app, first declare this activity in your manifest file:


Then determine the result of the user action and start the activity with an intent:

Intent intent = new Intent(this, ConfirmationActivity.class);

After showing the confirmation animation, ConfirmationActivity finishes and your activity resumes.