android-viewpager2 Questions

14

Solved

I'm creating a slideshow with ViewPager2. For example, the slideshow has 3 items and I want to show the second item when the activity opens. I use setCurrentItem(int item, boolean smoothScroll) met...
Pessa asked 26/5, 2019 at 8:21

2

I have main fragment with ViewPager2 that contains other fragments. Each child fragment can open another detail fragment (main fragment replaced with details fragment). When I go back to from detai...

9

Solved

I am using Advance Navigation Component with BottomNavigationView. In one tab I have ViewPager2. When I clicked on the tab for the first time, it worked fine. Although the second time, come on that...

4

Solved

Anyone dealing with ViewPager2 + Fragments + GoogleMap? I've ran into a really interesting issue, inside my viewpager i have two tabs that each render fragments. One of the fragments spawns a goo...

8

Solved

Is it possible to enable-disable swiping in new android viewpager2 component?
Passe asked 4/3, 2019 at 7:57

13

Solved

I want to use com.google.android.material.tabs.TabLayout component with Android's new ViewPager implementation androidx.viewpager2.widget.ViewPager2. However, the setupWithViewPager(..) method prov...

4

I am using a ViewPager2 together with an adapter that minimally extends FragmentStateAdapter, as follows: class MyAdapter(fragment: Fragment): FragmentStateAdapter(fragment) { override fun create...
Borage asked 7/10, 2020 at 23:43

5

Solved

I know there is way to change animation duration of ViewPager programmatical slide (here). But its not working on ViewPager2 I tried this: try { final Field scrollerField = ViewPager2.class.ge...
Muncey asked 15/8, 2019 at 6:55

6

Solved

I want to implement Carousel using View Pager2 with preview of left and right page like this: Initially I was using view pager1 which supported. Now I think it's removed viewPagerhost.setPageM...
Pal asked 13/5, 2019 at 14:26

4

Solved

I use a ViewPager2 inside another ViewPager2. Because of this, the slide only works for the root ViewPager. How to make both ViewPager work?
Straightjacket asked 25/5, 2020 at 22:1

2

Solved

I am trying to put a ViewPager2 with 2 tabs(2 fragments) within my main fragment. My fragment class extends Fragment and I need it to contain a ViewPager2 with fragments implemented inside. I coul...
Liquidate asked 31/3, 2020 at 18:47

2

I am currently stuck on an error that continues to slow down the performance of my application. The error does not cause the application to close or crash, or to write an exception to the console. ...

4

I use fragments with ViewPager2, and I notice two relevant IllegalStateExceptions in production (I can't reproduce it myself) occurring in devices like Xiaomi, Yulong, asus, vivo running Android 8 ...
Wharfage asked 31/1, 2020 at 12:41

2

Solved

I just wanna know if I'm doing something wrong since I'm kinda new to all this. If there is anything else that you'll like me to add just let me know. This is the repo branch where I'm trying to i...

3

Solved

I use new android widget ViewPager2 version 1.0.0-alpha03 and when I set click listener on it method onClick() not called. My Actvity class: class MainActivity : AppCompatActivity() { override ...
Unfathomable asked 27/4, 2019 at 12:6

5

Solved

I implemented the new ViewPager for my project. The viewPager2 contains a list of fragment private class ViewPagerAdapter extends FragmentStateAdapter { private ArrayList<Integer> classif...

4

I have a vertical scrolling ViewPager2 and the last children contains a RecyclerView scrolling on the same direction. This is causing a conflicting behaviour, the ViewPager2 always steal the scrol...
Iphlgenia asked 16/10, 2019 at 14:42

4

Solved

I'm using ViewPager2 in my App, it has three pages and each page show different contents, the issue is that it's too sensible that the ViewPager will change the pages even if someone is scrolling d...
Deutzia asked 30/4, 2021 at 13:10

19

Solved

There are a few posts on getting ViewPager to work with varying height items that center around extending ViewPager itself to modify its onMeasure to support this. However, given that ViewPager2 is...
Oneal asked 21/10, 2019 at 19:15

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

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 ...

4

Solved

ViewPager2 PageChangeListener is not working like normal ViewPager.?

6

Solved

I am using ViewPager2 for my project. I need to use nested fragments inside a fragment with viewpager2. it works like charm until I try to navigate between fragments(not nested ones). After the fir...

7

Solved

Can't find a way to remove the ViewPager2 overscroll shadow animation. I know on ViewPager, you can directly just set the overscrollMode attribute to never, however, it does not work on ViewPager2 ...
Idleman asked 3/7, 2019 at 23:6

3

I'm using ViewPager2 with FragmentStateAdapter to bind fragments. Each of my fragment has 3 recycler views laid out vertically. The problem is I'm not able to scroll the recycler view inside the fr...
Superfetation asked 10/2, 2020 at 13:16

© 2022 - 2025 — McMap. All rights reserved.