Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
    
    DrawableContainerState
    abstract class DrawableContainerState : Drawable.ConstantState
    
    A ConstantState that can contain several Drawables. This class was made public to enable testing, and its visibility may change in a future release.
    Summary
    
    
      
        
          | Protected methods | 
        
          | open Unit |  | 
      
    
    
      
        
          | Inherited functions | 
        
          | From class ConstantState
                
                  
                    | Drawable | newDrawable()
                         Creates a new Drawable instance from its constant state.   Note: Using this method means density-dependent properties, such as pixel dimensions or bitmap images, will not be updated to match the density of the target display. To ensure correct scaling, use newDrawable(android.content.res.Resources)instead to provide an appropriate Resources object. |  
                    | Drawable | newDrawable(res: Resources?)
                         Creates a new Drawable instance from its constant state using the specified resources. This method should be implemented for drawables that have density-dependent properties.   The default implementation for this method calls through to newDrawable(). |  
                    | Drawable | newDrawable(res: Resources?, theme: Resources.Theme?)
                         Creates a new Drawable instance from its constant state using the specified resources and theme. This method should be implemented for drawables that have theme-dependent properties.   The default implementation for this method calls through to newDrawable(android.content.res.Resources). |  | 
      
    
    Public methods
    
      addChild
      
      fun addChild(dr: Drawable!): Int
      Adds the drawable to the end of the list of contained drawables.
      
        
          
            | Parameters | 
          
            | dr | Drawable!: the drawable to add | 
        
      
      
        
          
            | Return | 
          
            | Int | the position of the drawable within the container | 
        
      
     
    
      canApplyTheme
      
      open fun canApplyTheme(): Boolean
     
    
      canConstantState
      
      open fun canConstantState(): Boolean
     
    
      getChangingConfigurations
      
      open fun getChangingConfigurations(): Int
      Return a bit mask of configuration changes that will impact this drawable (and thus require completely reloading it).
      
        
          
            | Return | 
          
            | Int | Value is either 0or a combination ofandroid.content.pm.ActivityInfo#CONFIG_MCC,android.content.pm.ActivityInfo#CONFIG_MNC,android.content.pm.ActivityInfo#CONFIG_LOCALE,android.content.pm.ActivityInfo#CONFIG_TOUCHSCREEN,android.content.pm.ActivityInfo#CONFIG_KEYBOARD,android.content.pm.ActivityInfo#CONFIG_KEYBOARD_HIDDEN,android.content.pm.ActivityInfo#CONFIG_NAVIGATION,android.content.pm.ActivityInfo#CONFIG_ORIENTATION,android.content.pm.ActivityInfo#CONFIG_SCREEN_LAYOUT,android.content.pm.ActivityInfo#CONFIG_UI_MODE,android.content.pm.ActivityInfo#CONFIG_SCREEN_SIZE,android.content.pm.ActivityInfo#CONFIG_SMALLEST_SCREEN_SIZE,android.content.pm.ActivityInfo#CONFIG_DENSITY,android.content.pm.ActivityInfo#CONFIG_LAYOUT_DIRECTION,android.content.pm.ActivityInfo#CONFIG_COLOR_MODE,android.content.pm.ActivityInfo#CONFIG_FONT_SCALE,android.content.pm.ActivityInfo#CONFIG_GRAMMATICAL_GENDER,android.content.pm.ActivityInfo#CONFIG_FONT_WEIGHT_ADJUSTMENT, android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION,android.content.pm.ActivityInfo#CONFIG_ASSETS_PATHS, andandroid.content.pm.ActivityInfo#CONFIG_RESOURCES_UNUSED | 
        
      
     
    
    
      getChildCount
      
      fun getChildCount(): Int
     
    
    
      getConstantHeight
      
      fun getConstantHeight(): Int
     
    
      getConstantMinimumHeight
      
      fun getConstantMinimumHeight(): Int
     
    
      getConstantMinimumWidth
      
      fun getConstantMinimumWidth(): Int
     
    
      getConstantPadding
      
      fun getConstantPadding(): Rect!
     
    
      getConstantWidth
      
      fun getConstantWidth(): Int
     
    
      getEnterFadeDuration
      
      fun getEnterFadeDuration(): Int
     
    
      getExitFadeDuration
      
      fun getExitFadeDuration(): Int
     
    
      getOpacity
      
      fun getOpacity(): Int
     
    
      growArray
      
      open fun growArray(
    oldSize: Int, 
    newSize: Int
): Unit
     
    
      isConstantSize
      
      fun isConstantSize(): Boolean
     
    
      isStateful
      
      fun isStateful(): Boolean
     
    
      setConstantSize
      
      fun setConstantSize(constant: Boolean): Unit
     
    
      setEnterFadeDuration
      
      fun setEnterFadeDuration(duration: Int): Unit
     
    
      setExitFadeDuration
      
      fun setExitFadeDuration(duration: Int): Unit
     
    
      setVariablePadding
      
      fun setVariablePadding(variable: Boolean): Unit
      A boolean value indicating whether to use the maximum padding value of all frames in the set (false), or to use the padding value of the frame being shown (true). Default value is false.
     
    Protected methods
    
      computeConstantSize
      
      protected open fun computeConstantSize(): Unit
     
  
  
  
    
  
 
  
    
    
      
       
    
    
  
  
  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-04-17 UTC.
  
  
  
    
      [null,null,["Last updated 2025-04-17 UTC."],[],[]]