android-viewpager Questions

8

Solved

Is there a way to bypass the normal behavior of ViewPager and its offscreen page limit? My ViewPager contains four fragments, each containing a gridview of images. The problem I have is that on ins...
Criticize asked 25/7, 2012 at 12:52

5

I have a ViewPager which Toolbar tabs. I have to know how many times user clicked tabs and how many times user swiped and selected a page. I am using ViewPager.OnPageChangeListener() for this pur...
Einberger asked 16/12, 2015 at 12:21

2

Solved

What I functionally need is a Vertical ViewPager with GridView. So every page of the ViewPager should have a GridView, but the ViewPager is horizontal. So there are two possibilities: Rotate the...
Renick asked 10/7, 2012 at 8:7

5

Solved

I want lock / disable one particular page(fragment) in viewpager. According to scenario for some people only able to access that page. How restrict swiping to that page. I disabled tab click fo...
Sticker asked 17/6, 2016 at 4:47

17

I'm using Android's ViewPager. What I want to do is to show a preview of the page on both the left and the right. I've seen where I can use a negative pageMargin to show a preview of the right side...
Aniline asked 10/4, 2012 at 23:47

5

Solved

I just migrated my project to androidx and i am getting an inflation error for inflating viewpager component...I replaced android.support.v4.view.ViewPager with androidx.viewpager.widget.ViewPager ...
Auditorium asked 16/7, 2019 at 5:59

16

Solved

I have a ViewPager which instantiates a View. I'd like to disable both the scrolling of the viewpager and the child buttons momentarily while a search result is returned to the view. I've calling v...
Osiris asked 18/10, 2011 at 21:32

13

Solved

I came to know about ViewPager2 and tried to implement it, but didn't find any proper example. Can anyone tell me how can I use it. I am looking for proper usage, not an example.
Lownecked asked 12/2, 2019 at 5:29

14

Solved

I am using a ViewPager with the FragmentStatePagerAdapter to allow navigation between some fragments. Let's say I have three fragments: A, B and C. The ViewPager shows Fragment A initially, and al...
Hensel asked 25/9, 2011 at 14:42

3

Solved

I've created a fairly classic collapsing image layout in Jetpack compose, where I have an image at the top of the screen which parallax scrolls away and at a certain point I change the toolbar back...

8

Solved

When I start an activity which implements viewpager, the viewpager created various fragments. I want to use different layouts for each fragment, but the problem is that viewpager shows only two lay...

2

I have a viewPager2 and FragmentStateAdapter, and there are Fragement1, 2,3 4, I am in fragment2, and want to remove fragment3, and display fragment4 after fragment2. The problem is it always show ...

3

I have problems with implementation of my custom PagerAdapter and using it with a ViewPager. This sample PagerAdapter has 10 items, every item is a button with it's index as text. When I run my pro...
Glaswegian asked 6/2, 2015 at 0:17

10

I have a viewpager2 with multiple fragments in FragmentStateAdapter. Whenever I try to open a new fragment and then go back to my current one with viewpager2, I get an exception: Expected the adap...
Currycomb asked 18/6, 2019 at 10:9

7

Solved

Today I'm trying to set ViewPager.setOnPageChangeListener and I've found out that it's deprecated.
Busload asked 16/6, 2015 at 12:39

3

Solved

I need help to combine ViewPager and BottomNavigationView. But when I swipe the screen as ViewPager works, the fragment become stacked with another fragment. How do I fix this? Stacked fragment ...

8

Solved

I have a simple Activity with TabLayout, ViewPager and 2 Fragments in it. Here's my Activity: public class ManagementCompanyOverviewActivity extends BaseActivity implements ManagementCompanyOvervi...
Idiolect asked 5/9, 2017 at 8:20

18

I'm migrating my ViewPager to ViewPager2 since the latter is supposed to solve all the problems of the former. Unfortunately, when using it with a FragmentStateAdapter, I don't find any way to get ...
Eruption asked 17/4, 2019 at 13:29

2

Solved

I have this weird bug where my RecyclerView scrolls back to top position whenever I start dragging an item in it. It's inside ViewPager if that has any difference. You can see the behavior in .gif ...
Meteorograph asked 29/9, 2020 at 14:0

4

Solved

ViewPager2 PageChangeListener is not working like normal ViewPager.?

9

Solved

What is the difference between FragmentPagerAdapter and FragmentStatePagerAdapter? About FragmentPagerAdapter Google's guide says: This version of the pager is best for use when there are a han...

5

I have a "memory leak" in my adapter (quotes will be explained later). I'm currently using nested fragments to host a viewpager. My setup is as following: 1. Activity (Empty activity that hosts F...
Breathtaking asked 30/12, 2013 at 10:33

13

Solved

I have a ViewPager inside a ScrollView. I need to be able to scroll horizontally as well as vertically. In order to achieve this had to disable the vertical scrolling whenever my ViewPager is touch...
Seger asked 24/7, 2013 at 10:28

27

Solved

I have ViewPager and below it I have 10 buttons. By clicking on button, for example #4, the pager goes immediately to page #4 by mPager.setCurrentItem(3);. But, I want to disable the paging by swip...
Maestro asked 10/3, 2012 at 21:18

5

Solved

I am using 4 fragments inside a ViewPager ,as ViewPager load the previous and next fragment in advance ,and no lifecycle method is called when navigating between fragments. So is there any way to d...
Sami asked 20/2, 2018 at 19:41

© 2022 - 2024 — McMap. All rights reserved.