ShineDown
ShineDown

Reputation: 1879

Android home screen swipe feature

How can i implement home screen swipe feature of android for a user to swipe between 2 view which covers the entire page. During the swipe the View must animate 100%, but the background must move by only 20%.

Upvotes: 2

Views: 851

Answers (1)

cYrixmorten
cYrixmorten

Reputation: 7108

I have extensively used: custom scroll view for my app using vertical scroling.

It should be possible to put a bitmap or the like in the background and then when user swipes, manually move/animate the bitmap a factor of 0.20, unless at the edge of the bitmap of course.

Or, as you indicate, having two views. Then you just have to somehow have to, either make the background view ignore user input and let the top view control it, or find a way to pass the input down to the background, having it automatically use a factor 0.20.

Have not tried something similar but believe the link above gives you a lot of control over what is happening.

Upvotes: 1

Related Questions