I like how the scrolling in the google+ app is where text of what screen you are on moves when you scroll left to right
in the second image I scroll to the left and the text of that section moves with it.
How can I recreate that?
Have a look at the new ViewPager component: http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
Related
I need to emulate the behavior of Instagram's Reels which scrolls to the next or previous page when the current page is scrolled more than 50% upwards or downwards respectively and the finger goes up. ViewPager2's default behavior isn't satisfactory for this and I don't think I can change it without changing the PagerSnapHelper inside ViewPager2.
Is there any other way I can implement a custom Snap behavior for ViewPager2 then?
I have a fragment with a scrollview that holds a long layout essentially representing 2 different sections that are related, what I want is to control the scrollview so when the user wants to scroll down it always goes all the way down and can never be in the middle so it will never reveal partially the top or bottom parts, same effect backwards when you want to scroll up it just takes over and goes all the way up to reveal the top section of the layout fully.
It is basically how a vertical viewpager will behave but contained within a single long view.
I know how to programatically scroll up or down but I don't know how to avoid the user scrolling to just the middle, I'd like to hook up to some scroll event, detect the direction and go fully in either direction.
I have been researching for the same since two days. Here is what i want to achieve. I havent ever tried much animations in android so please clear my approach wherever required. I will have two pages/screens (one visible at a time) Now when I am on page1, on swiping right to left page 2 will be displayed (achieving this is not that difficult) But here is my problem : when I am scrolling to page2 i would like to animate/translate/slide an image from page1 to page2 (without touching the image) and let the image sit on page2. I am just not sure of how to start with this.
I have thought of few ideas
First: I think i should implement a layout larger then window and then do the required animations and scrolling in it using horizontal scrollview.But now here I am not sure how will I make it look like they are 2 different pages(concerned about handling different screen sizes)
Second:I have seen example libraries of draggable gridview viewpager. But here both of my pages will have different layouts
Third:I am thinking of dividing both of my pages. the lower part of my pages will contain framelayout where I will only change the framelayout's content on scroll and perform hide n show trick on the upper part.But here again the trick is how am I supposed to place the image(contained in framelayout) to upper layout with an animation(image sliding to the top side on its own kind of animation)
Any Ideas. Any views/suggestions. Need all of it.Thank You for your valuable time.
This happens when I am trying to move the image to screen's top-left position. It moves in the left top direction as shown in the images below..
This happens when I am trying to move it besides second fragment textview
But the problem is I want to move it besides second fragment textview while scrolling and when scrolling is done it should come to top left of the screen just like the second fragment textview
I have no idea how to implement a HorizontalScrollView that scrolls on swipes. And it should scroll to specific position. The positions are one the picture. The first one is how it appears from the beginning. Then when you swipe right, the scrll view slides to the beginning and number appears. Then when you swipe left you come back to the first position. And after swipe left from the first position, scroll view scrolls to the end and shows sharing options.
I think this should be implemented with ViewPager rather than Horizontal ScrollView.
Take a look to the official documentation
Hi im wanting to create a function that allows the user to swipe left and right and a button slides in horizontally. for example there will be a big button on screen when you swipe it moves horizontally and another big button could anyone point me in the right direction as i have no idea where to start with it?
heres an example of what i'm looking for
you can use viewpager: http://developer.android.com/reference/android/support/v4/view/ViewPager.html
and when the current page changes (there is a listener to do this) you can change the circle images at the bottom to show the properly page.
:)