alternative to viewpager for android swipe with tabs? - android

is there anyway to have swiping with tabs without using viewpager and also not doing a bunch of gesture detection? if not could someone post a sample of what's needed with the gesture detection. I'm hoping to get the left swipe gesture and then do a supportFragmentTransaction everytime. I would use viewpager but it's the buggiest thing since ant hills and doesn't work. basically I have 5 tabs with 5 fragments and just want to swipe between them and have tabs and hopefully have it circular so that when I'm on the last tab and swipe right it goes to the first. Thanks for all your help in advance!

Related

Android Google Map | Two finger scrolling inside tablayout

i have a google maps (fragment) inside a tablayout
With the tablayout i use a FragmentStateAdapter.
This allows me to nicly swipe through my tabs but (you can guess is) this swiping is working against me on the google maps fragment.
My idea was to setup 2 fiinger control for the map while the single finger could still service the tab-swiper.
i found this post and the answer of Andrii Omelchenko did give some real good pointers for a solution
However i do not have a scrollview and i cannot find any on...-methods in my ViewPagers2 and/or the FragmentStateAdapter to intercept the touch-events as is done in the scrollview.
Does anybody have an idea as how to handle the issue?

Android SlideShow View

I want to show 4 images like a slide show with translate (right to left) animation.
So I used ViewPager with 4 Fragments, and thread for automatic navigation to the next Fragment.
Everything was fine except navigation from the last item to the first.
In that case ViewPager scroll all Fragments (from left to right) to the first one, and this is the problem.
I need something like infinite navigating (right to left).
So what alternatives of ViewPager for doing this there are?
check this out , you can achieve using this
https://github.com/antonyt/InfiniteViewPager
hope it helps :)

How to display adjacent tabs in ViewPager?

Here is a sample from duolingo app:
I want to implement a similar feature. I can use ViewPager to make swiping tabs. What I can't seem to figure out is how to display the adjacent tabs (part of it) alongside the current tab, which is in the center.
I initially thought of implementing this using horizontal LinearLayout, but I don't know how to make the snapping effect. And it also seemed more reasonable to use something which already provides you with swiping and snapping than try to implement your own.
Using ViewPager also let's me use fragments and memory management is also effective for cases of more than a few tabs.
Any help will be appreciated. Thank You in advance.

Swiping in order to call another Activity in Android

I want to make something like transitions between ViewControllers in iOS 7 but in Android, is it possible?
Explanation: please look at image below, I have main Activity which has ViewPager inside, so we can swipe between Fragments. I want to call another Activity (or Fragment) from each Fragment (blue on image) swiping to bottom or to top but this action should be done smoothly like in ViewPager.
You can intercept swipe up and down gestures and set items in viewpager accordingly. Please read this guide on how to intercept swipes in various directions.

ViewPager Automatic Partial Swipe

I have got three pages in my viewpager and by default i have to set the middle one. But for the first time I want to swipe the viewpager a little left and then right to indicate to a user that there are also two more pages, left and right to it. Please guide regarding the automatic partial swipe of viewpager.
Thanks.
please refere this sample code.In this example you will get how to do automatic swipe of viewpager.
https://github.com/JakeWharton/Android-ViewPagerIndicator
before using this library i also have some problem when i use pager.

Categories

Resources