public class

DelayedConfirmationView

extends CircledImageView

Note: The Wearable Support Library classes under the android.support.wearable package are subject to change. For the full Android API reference, see Reference.

java.lang.Object
   ↳ android.view.View
     ↳ android.support.wearable.view.CircledImageView
       ↳ android.support.wearable.view.DelayedConfirmationView

Class Overview

DelayedConfirmationView provides a circular countdown timer, typically used to automatically confirm an operation after a short delay has elapsed. The delay is intended to give the user a chance to cancel the operation by tapping the View.

The developer can specify a countdown interval via setTotalTimeMs(long) and a listener via setListener(DelayedConfirmationView.DelayedConfirmationListener) to be called when the View is tapped or the time has elapsed.

More information on what are required XML attributes can be found at CircledImageView.

Summary

Nested Classes
interface DelayedConfirmationView.DelayedConfirmationListener Implement this interface to receive callbacks when the timer is finished and when the user taps the View to select it. 
[Expand]
Inherited Constants
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
DelayedConfirmationView(Context context)
DelayedConfirmationView(Context context, AttributeSet attrs)
DelayedConfirmationView(Context context, AttributeSet attrs, int defStyle)
Public Methods
boolean onTouchEvent(MotionEvent event)
void reset()
Resets the timer.
void setListener(DelayedConfirmationView.DelayedConfirmationListener listener)
Sets a listener to get callbacks for when the timer finishes or cancelled.
void setStartTimeMs(long time)
Artificially sets the start time in milliseconds for the Timer to countdown from.
void setTotalTimeMs(long time)
Sets the total time in milliseconds for the Timer to countdown to.
void start()
Starts the timer countdown.
Protected Methods
void onDraw(Canvas canvas)
[Expand]
Inherited Methods
From class android.support.wearable.view.CircledImageView
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public DelayedConfirmationView (Context context)

public DelayedConfirmationView (Context context, AttributeSet attrs)

public DelayedConfirmationView (Context context, AttributeSet attrs, int defStyle)

Public Methods

public boolean onTouchEvent (MotionEvent event)

public void reset ()

Resets the timer.

public void setListener (DelayedConfirmationView.DelayedConfirmationListener listener)

Sets a listener to get callbacks for when the timer finishes or cancelled.

Parameters
listener listener to register.

public void setStartTimeMs (long time)

Artificially sets the start time in milliseconds for the Timer to countdown from. This should be called after the timer is started with start().

Parameters
time start time in milliseconds.

public void setTotalTimeMs (long time)

Sets the total time in milliseconds for the Timer to countdown to. Once the countdown is finished, if there is a listener registered, calls the listener.

Parameters
time countdown time in milliseconds.

public void start ()

Starts the timer countdown.

Protected Methods

protected void onDraw (Canvas canvas)