ksoichiro / Android-ObservableScrollView

Android library to observe scroll events on scrollable views.
http://ksoichiro.github.io/Android-ObservableScrollView/
Apache License 2.0
9.66k stars 2.06k forks source link

Click events on Image in parallaxtoolbarScrollView #164

Closed prathya closed 9 years ago

prathya commented 9 years ago

Hello, I'm unable to figure out how I can make click events on ImageView in parallaxscrollView. There is a transperent view blocking the imageView.

eneim commented 9 years ago

That image is for decoration purpose. I suppose you are not about to interact with that though. In case you want to touch that, removing the view above can solve that, but you will lose your translation animation.

Another work around is to handle touch event on the view above imageview then pass the event down

prathya commented 9 years ago

I got it working by setting the elevation to the image. After elevation , imageview will come above View and accept touch events without losing the animation.

mkiisoft commented 9 years ago

Hello @prathya any example? I'm searching for the same a long time ago! Soundhound is using the same effect with a touchable imageview "behind" and Play Store with the videos on top. And if it works for 4.1+ it would be amazing. Thanks!

prathya commented 9 years ago

Hi mkiisoft. Actually there is no need of even setting elevation to the ImageView. Because it is accepting the touch with zero elevation. Just set the transparent View clickable 'false' in xml.