private void init ( Context context ) { try { if ( FrescoSystrace . isTracing ( ) ) { FrescoSystrace . beginSection ( "DraweeView#init" ) ; } if ( mInitialised ) { return ; } mInitialised = true ; mDraweeHolder = DraweeHolder . create ( null , context ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { ColorStateList imageTintList = getImageTintList ( ) ; if ( imageTintList == null ) { return ; } setColorFilter ( imageTintList . getDefaultColor ( ) ) ; } // In Android N and above, visibility handling for Drawables has been changed, which breaks // activity transitions with DraweeViews. mLegacyVisibilityHandlingEnabled = sGlobalLegacyVisibilityHandlingEnabled && context . getApplicationInfo ( ) . targetSdkVersion >= 24 ; // Build.VERSION_CODES.N } finally { if ( FrescoSystrace . isTracing ( ) ) { FrescoSystrace . endSection ( ) ; } } }
This method is idempotent so it only has effect the first time it s called