Stay organized with collections Save and categorize content based on your preferences.

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 androidx.wear.widget.CircularProgressLayout from the Jetpack Wear library 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

This interface is deprecated. use the androidx.wear.widget.CircularProgressLayout from the Jetpack Wear library instead.  

Inherited constants

Inherited fields

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

Public constructors

DelayedConfirmationView

public DelayedConfirmationView (Context context)

Parameters
context Context

DelayedConfirmationView

public DelayedConfirmationView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

DelayedConfirmationView

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

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

onTouchEvent

public boolean onTouchEvent (MotionEvent event)

Parameters
event MotionEvent

Returns
boolean

reset

public void reset ()

Resets the timer.

setListener

public 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.

setStartTimeMs

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

setTotalTimeMs

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

start

public void start ()

Starts the timer countdown.

Protected methods

onDraw

protected void onDraw (Canvas canvas)

Parameters
canvas Canvas