android.support.wearable.view
Class DelayedConfirmationView
java.lang.Object
FrameLayout
android.support.wearable.view.CircledImageView
android.support.wearable.view.DelayedConfirmationView
public class DelayedConfirmationView
- extends CircledImageView
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(android.support.wearable.view.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.
| Methods inherited from class android.support.wearable.view.CircledImageView |
drawableStateChanged, getCircleRadius, getInitialCircleRadius, onMeasure, setCircleBorderColor, setCircleColor, setCircleColorStateList, setCircleHidden, setCircleRadius, setCircleRadiusPressed, setImageDrawable, setImageResource, setPressed, setProgress, setShadowVisibility |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DelayedConfirmationView
public DelayedConfirmationView(Context context)
DelayedConfirmationView
public DelayedConfirmationView(Context context,
AttributeSet attrs)
DelayedConfirmationView
public DelayedConfirmationView(Context context,
AttributeSet attrs,
int defStyle)
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.
DelayedConfirmationViewListener
- Parameters:
time - countdown time in milliseconds.
setListener
public void setListener(DelayedConfirmationView.DelayedConfirmationListener handler)
- Sets a listener to get callbacks for when the timer finishes or cancelled.
DelayedConfirmationViewListener
- Parameters:
listener - listener to register.
start
public void start()
- Starts the timer countdown.
onDraw
protected void onDraw(Canvas canvas)
- Overrides:
onDraw in class CircledImageView
onTouchEvent
public boolean onTouchEvent(MotionEvent event)