Note: The Wearable Support Library classes under the android.support.wearable package are subject to change. For the full Android API reference, see Reference.
Class Overview
The actual implementation of a watch face that draws on a Canvas. You must implement
 onCreateEngine() to return your concrete Engine
 implementation.
 
Summary
| 
  [Expand]
   Inherited Methods  | 
   
From class
  android.support.wearable.watchface.WatchFaceService.Engine
  
   
  
    
    
	 
    
        | 
            
            
            final
            
            
            int
         | 
        
        getInterruptionFilter()
        
         
          Returns interruption filter selected by the user.
          
    
         
  
   |  
	 
    
        | 
            
            
            final
            
            
            Rect
         | 
        
        getPeekCardPosition()
        
         
          Returns the location of the first peeking card.
          
    
         
  
   |  
	 
    
        | 
            
            
            final
            
            
            int
         | 
        
        getUnreadCount()
        
         
          Returns the number of unread notification cards in the stream.
          
    
         
  
   |  
	 
    
        | 
            
            
            final
            
            
            boolean
         | 
        
        isInAmbientMode()
        
         
          Returns whether the watch face is in ambient mode.
          
    
         
  
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onAmbientModeChanged(boolean inAmbientMode)
        
         
          Called when the device enters or exits ambient mode.
          
    
         
  
   |  
	 
    
        | 
            
            
            
            
            
            Bundle
         | 
        
        onCommand(String action, int x, int y, int z, Bundle extras, boolean resultRequested)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onCreate(SurfaceHolder holder)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onInterruptionFilterChanged(int interruptionFilter)
        
         
          Called when the user changes interruption filter.
          
    
         
  
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onPeekCardPositionUpdate(Rect rect)
        
         
          Called when the first, peeking card positions itself on the screen.
          
    
         
  
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onPropertiesChanged(Bundle properties)
        
         
          Called when the properties of the device are determined.
          
    
         
  
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onTimeTick()
        
         
          Called periodically in ambient mode to update the time shown by the watch face.
          
    
         
  
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onUnreadCountChanged(int count)
        
         
          Called when the number of unread notification cards in the stream has changed.
          
    
         
  
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onVisibilityChanged(boolean visible)
        
         
          Called to inform you of the watch face becoming visible or hidden.
          
    
         
  
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        setWatchFaceStyle(WatchFaceStyle watchFaceStyle)
        
         
          Sets the watch face style.
          
    
         
  
   |  
 
   
 
 | 
   
From class
  android.service.wallpaper.WallpaperService.Engine
  
   
  
    
    
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        dump(String arg0, FileDescriptor arg1, PrintWriter arg2, String[] arg3)
        
   |  
	 
    
        | 
            
            
            
            
            
            int
         | 
        
        getDesiredMinimumHeight()
        
   |  
	 
    
        | 
            
            
            
            
            
            int
         | 
        
        getDesiredMinimumWidth()
        
   |  
	 
    
        | 
            
            
            
            
            
            SurfaceHolder
         | 
        
        getSurfaceHolder()
        
   |  
	 
    
        | 
            
            
            
            
            
            boolean
         | 
        
        isPreview()
        
   |  
	 
    
        | 
            
            
            
            
            
            boolean
         | 
        
        isVisible()
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onApplyWindowInsets(WindowInsets arg0)
        
   |  
	 
    
        | 
            
            
            
            
            
            Bundle
         | 
        
        onCommand(String arg0, int arg1, int arg2, int arg3, Bundle arg4, boolean arg5)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onCreate(SurfaceHolder arg0)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onDesiredSizeChanged(int arg0, int arg1)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onDestroy()
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onOffsetsChanged(float arg0, float arg1, float arg2, float arg3, int arg4, int arg5)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onSurfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onSurfaceCreated(SurfaceHolder arg0)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onSurfaceDestroyed(SurfaceHolder arg0)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onSurfaceRedrawNeeded(SurfaceHolder arg0)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onTouchEvent(MotionEvent arg0)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        onVisibilityChanged(boolean arg0)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        setOffsetNotificationsEnabled(boolean arg0)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        setTouchEventsEnabled(boolean arg0)
        
   |  
 
   
 
 | 
   
From class
  java.lang.Object
  
   
  
    
    
	 
    
        | 
            
            
            
            
            
            Object
         | 
        
        clone()
        
   |  
	 
    
        | 
            
            
            
            
            
            boolean
         | 
        
        equals(Object arg0)
        
   |  
	 
    
        | 
            
            
            
            
            
            void
         | 
        
        finalize()
        
   |  
	 
    
        | 
            
            
            final
            
            
            Class<?>
         | 
        
        getClass()
        
   |  
	 
    
        | 
            
            
            
            
            
            int
         | 
        
        hashCode()
        
   |  
	 
    
        | 
            
            
            final
            
            
            void
         | 
        
        notify()
        
   |  
	 
    
        | 
            
            
            final
            
            
            void
         | 
        
        notifyAll()
        
   |  
	 
    
        | 
            
            
            
            
            
            String
         | 
        
        toString()
        
   |  
	 
    
        | 
            
            
            final
            
            
            void
         | 
        
        wait()
        
   |  
	 
    
        | 
            
            
            final
            
            
            void
         | 
        
        wait(long arg0, int arg1)
        
   |  
	 
    
        | 
            
            
            final
            
            
            void
         | 
        
        wait(long arg0)
        
   |  
 
   
 
 | 
 
Public Constructors
 
    
      
        public 
         
         
         
         
        
      
      CanvasWatchFaceService.Engine
      ()
    
      
    
 
Public Methods
 
    
      
        public 
         
         
         
         
        void
      
      invalidate
      ()
    
      
    
 
 
    
      
        public 
         
         
         
         
        void
      
      onDraw
      (Canvas canvas, Rect bounds)
    
      
    
      
    
      
  
  
      Parameters
      
        
          | canvas
           | the canvas to draw into | 
        
        
          | bounds
           | the bounds in which the watch face should be drawn
 | 
        
      
   
     
 
 
    
      
        public 
         
         
         
         
        void
      
      onSurfaceChanged
      (SurfaceHolder holder, int format, int width, int height)
    
      
    
 
 
    
      
        public 
         
         
         
         
        void
      
      onSurfaceCreated
      (SurfaceHolder holder)
    
      
    
 
 
    
      
        public 
         
         
         
         
        void
      
      onSurfaceRedrawNeeded
      (SurfaceHolder holder)
    
      
    
 
 
    
      
        public 
         
         
         
         
        void
      
      postInvalidate
      ()
    
      
    
      
    
      
  Posts a message to schedule a call to onDraw(Canvas, Rect) to draw the next frame. Unlike
 invalidate(), this method is thread-safe and may be called on any thread.