Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
    
    
  
  
    
    
    
    OnPreDrawListener
    interface OnPreDrawListener
    
    
      
        
          | Known Direct Subclasses
              
              
                
                  
                    | TextView | A user interface element that displays text to the user. |  | 
      
    
    
      
        
          | Known Indirect Subclasses
              AutoCompleteTextView, Button , CheckBox , CheckedTextView , Chronometer , CompoundButton , DigitalClock , EditText , ExtractEditText , MultiAutoCompleteTextView , RadioButton , Switch , and 2 others. 
                
                  
                    | AutoCompleteTextView | An editable text view that shows completion suggestions automatically while the user is typing. |  
                    | Button | A user interface element the user can tap or click to perform an action. |  
                    | CheckBox |  A checkbox is a specific type of two-states button that can be either checked or unchecked. |  
                    | CheckedTextView | An extension to TextViewthat supports theCheckableinterface and displays. |  
                    | Chronometer | Class that implements a simple timer. |  
                    | CompoundButton |  A button with two states, checked and unchecked. |  
                    | DigitalClock | Like AnalogClock, but digital. |  
                    | EditText | A user interface element for entering and modifying text. |  
                    | ExtractEditText | * Specialization of EditTextfor showing and interacting with the extracted text in a full-screen input method. |  
                    | MultiAutoCompleteTextView | An editable text view, extending AutoCompleteTextView, that can show completion suggestions for the substring of the text where the user is typing instead of necessarily for the entire thing. |  
                    | RadioButton |  A radio button is a two-states button that can be either checked or unchecked. |  
                    | Switch | A Switch is a two-state toggle widget. |  
                    | TextClock | TextClockcan display the current date and/or time as a formatted string.
 |  
                    | ToggleButton | Displays checked/unchecked states as a button with a "light" indicator and by default accompanied with the text "ON" or "OFF". |  | 
      
    
    Interface definition for a callback to be invoked when the view tree is about to be drawn.
    Summary
    
      
        
          | Public methods | 
        
          | abstract Boolean | Callback method to be invoked when the view tree is about to be drawn. | 
      
    
    Public methods
    
      onPreDraw
      
      abstract fun onPreDraw(): Boolean
      Callback method to be invoked when the view tree is about to be drawn. At this point, all views in the tree have been measured and given a frame. Clients can use this to adjust their scroll bounds or even to request a new layout before drawing occurs.
      
        
          
            | Return | 
          
            | Boolean | Return true to proceed with the current drawing pass, or false to cancel. | 
        
      
      
     
  
  
  
    
  
 
  
    
      
      
    
    
      
    
    
  
       
    
    
      
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2025-02-10 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]