kanytu / android-parallax-recyclerview

An adapter which could be used to achieve a parallax effect on RecyclerView.
Apache License 2.0
1.61k stars 284 forks source link

Modify header in runtime #42

Closed facundomedica closed 8 years ago

facundomedica commented 8 years ago

I want to change something that is inside my header layout (an Image View alpha) during scroll (just like he toolbar alpha thing). Is this possible?

kanytu commented 8 years ago

Yes it is.

Just implement onParallaxScroll(float percentage, float offset, View parallax);

Then inside it change your parallax view (3rd parameter of onParallaxScroll) alpha to whatever you want. Hint: you can use percentage to calculate an alpha between 0 and 1 :) Check the readme for an example of alpha with the toolbar

facundomedica commented 8 years ago

I missed that completely! But what I really need is to get a Linear Layout that is inside the parallax view. (I'm quite a noob in Android and java) Thanks!

facundomedica commented 8 years ago

Found it! I leave this here if any noob pass by looking for the same as I did

parallax.findViewById(R.id.myLinear).setAlpha(...);