scrollview - How can I shrink the header on scroll down in android -


here link http://tympanus.net/blueprints/animatedheader/ header shrink while scroll down. how can same effect in android.

here sample

i have implemented thing in onscrollviewlistener , in onscrollchanged have write code achieve objective didn't success.

  • block_height fix heigt want stop shrinking ....like 150

  • currentheight intial height of header double of block_height .. 300

please see sample code

if (headerview.getlayoutparams().height <= (block_height * 2)  &&  headerview.getlayoutparams().height >= block_height){      currentheight -= 1;     headerview.getlayoutparams().height = currentheight;     headerview.invalidate();  } 

have @ actionbar library may fulfill requirement

https://github.com/manuelpeinado/fadingactionbar

https://github.com/flavienlaurent/notboringactionbar


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -