Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Wear Yes or No Confirmation dialog?

Tags:

wear-os

How to add an android notification which asks for a Yes or No confirmation on an android wear?

Yes or NO Confirmation

like image 786
nizam.sp Avatar asked May 08 '15 11:05

nizam.sp


1 Answers

To build this into a notification, you would need to create a custom notification. See here for creating custom layouts for notifications - https://developer.android.com/training/wearables/apps/layouts.html#CustomNotifications

There is no predefined Wear activity/layout for this type of yes/no confirmation. You would need to build this yourself - perhaps with a BoxInsetLayout and two ImageButtons for yes and no.

You can find info on the BoxInsetLayout here - https://developer.android.com/training/wearables/ui/layouts.html#same-layout

This will ensure that your layout looks ok on both square and round devices.

If you're looking for a common Wear experience, you'll probably want to use a DelayedConfirmationTimer and a ConfirmationActivity. These are commonly used to give the user time to cancel their input and to provide an indication that a process is complete, respectively. You can find details here https://developer.android.com/training/wearables/ui/confirm.html

like image 167
Fat Russell Avatar answered Nov 17 '22 05:11

Fat Russell