private float calculatePercentage ( int width ) { int absolute = mMaxWidth - mMinWidth ; int current = width - mMinWidth ; float percentage = 100.0f * current / absolute ; //we can assume that we are crossfaded if the percentage is > 90 mIsCrossfaded = percentage > 90 ; return percentage ; }
calculate the percentage to how many percent the slide is already visible