@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
float parallax = parallaxFactor;
float alpha = alphaFactor;
for (ParallaxedView parallaxedView : parallaxedViews) {
parallaxedView.setOffset(((float)t / parallax), Math.round(t/parallaxFactor));
parallax *= innerParallaxFactor;
if (alpha != DEFAULT_ALPHA_FACTOR) {
float fixedAlpha = (t <= 0) ? 1 : (100 / ((float)t * alpha));
parallaxedView.setAlpha(fixedAlpha);
alpha /= alphaFactor;
}
parallaxedView.animateNow();
}
}