Skip to content

Most visited

Recently visited

navigation

DelayedConfirmationView

public class DelayedConfirmationView
extends CircledImageView

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


This class is deprecated.
use the android.support.wear.widget.CircularProgressLayout from the Android Support Library Wear module instead.

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. 

Inherited constants

From class android.view.View

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)

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

DelayedConfirmationView

DelayedConfirmationView (Context context)

Parameters
context Context

DelayedConfirmationView

DelayedConfirmationView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

DelayedConfirmationView

DelayedConfirmationView (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

onTouchEvent

boolean onTouchEvent (MotionEvent event)

Parameters
event MotionEvent

Returns
boolean

reset

void reset ()

Resets the timer.

setListener

void setListener (DelayedConfirmationView.DelayedConfirmationListener listener)

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

Parameters
listener DelayedConfirmationView.DelayedConfirmationListener: listener to register.

See also:

setStartTimeMs

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 long: start time in milliseconds.

setTotalTimeMs

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 long: countdown time in milliseconds.

See also:

start

void start ()

Starts the timer countdown.

Protected methods

onDraw

void onDraw (Canvas canvas)

Parameters
canvas Canvas

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)