Skip to content

Instantly share code, notes, and snippets.

@yuriyskulskiy
Created August 19, 2020 20:19
Show Gist options
  • Save yuriyskulskiy/42dbe859990058fbd3f040c2cfe9ad63 to your computer and use it in GitHub Desktop.
Save yuriyskulskiy/42dbe859990058fbd3f040c2cfe9ad63 to your computer and use it in GitHub Desktop.
AnimatedLayout part 5: update LinearLayout with parallaxValue
public void applyParallax(float translateValue) {
mBackgroundImg.setTranslationY(translateValue - this.getHeight() / 8f);
mTitleTV.setTranslationY(+translateValue * 2);
mProfileCircleIV.setTranslationY(translateValue * 2);
mWeatherIcon.setTranslationY(translateValue * 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment