Tell me how to implement the moving down (tapering) view like in Google Play on the app page, above the application name? 
- something from this or what? - pavlofff
- Not really, it affects the toolbar, and I need it as a playmarket, if you go to any application from the phone, you will notice how the main picture slides narrowing up. - Dima
|
1 answer
If you are talking about parallax, then you need to hang the listener on the ScrollView , then I wrote how to do it. The desired ImageView must be the ScrollView item in ScrollView . Shift the ImageView along Y to a height two times smaller than the ScrollView , I do this with the help of NineOldAndroids , compile 'com.nineoldandroids:library:2.4.0
ViewHelper.setTranslationY(mImageView, scrollY / 2f); if there is no need for API9, then the setTranslationY method of the ImageView
- oneNew tools from
support:designallow you to do everything automatically, you only need to place elements on the markup -CoordinatorLayout,CollapsingToolbarLayout,AppBarLayout. All this well simplifies the code. - pavlofff - @pavlofff, hmm, I'll take a look) - katso
- onein the question link in the first comment - pavlofff
- and can be the first to post not only imageview, but tablelayout for example? What would I do like spotify with a picture and buttons? will work? - Dima
- @ Dima, try, in theory, yes. - katso
|