private boolean shouldAnimate ( ) { if ( ! mAnimationEnabled ) { return false ; } Display display = currentDisplay ( ) ; if ( display == null ) { return false ; } if ( mVisibleStartTime <= 0 ) { return false ; } long threshold = ( long ) ( 1000 / display . getRefreshRate ( ) ) ; long millisVisible = elapsedRealtime ( ) - mVisibleStartTime ; return millisVisible > threshold ; }
Returns whether now is an appropriate time to perform animations .