android-viewpager Questions

15

Solved

I have a fragment interface with tabs along the bottom which open different fragments in the main view. I have one particular fragment which is a list of items. If the user selects one of the item...

7

i am using viewpager and tab layout viewPager.setAdapter(Adapter); tablayout.setupWithViewPager(viewPager); viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { int cPage...
Alis asked 2/2, 2016 at 10:21

8

Solved

I have a ViewPager that loads three pages at a time. If I swipe from page 1 to page 2 then to 3, the first page(fragment) goes to onPause(). Then, if I swipe to the second page, 1st page comes to o...

1

The problem: I have a ViewPager setup with a FragmentStatePagerAdapter that uses a global arraylist for the contents of its fragments. When I want to update this global array, I simply call the arr...
Whitford asked 25/7, 2014 at 14:41

7

Solved

Since API 27 FragmentPagerAdapter is deprecated. What's the best alternative to use for this? In my case, I understand something like super(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) ...

5

I'm populating view pager through fragments likes this pagerAdapter = new PagerAdapter(getSupportFragmentManager()); mViewPager = (ViewPager) findViewById(R.id.container); for (int i = 0; i &lt...

3

Solved

I have a WebView in a ViewPager. And the ViewPager seems to consume all the horizontal scrolling, so that I can't scroll in the WebView (vertical works). How can I achieve that the WebView has got...
Blacklist asked 9/1, 2012 at 0:8

6

setCurrentItem() function isnt working for following android(java) code how to make it work ? Intent i = getIntent(); int position = i.getIntExtra("img", 0); viewPager viewPager = (ViewPager) f...
Hyohyoid asked 4/9, 2015 at 15:48

4

Solved

I'm using TabPageIndicator from ViewPagerIndicator lib with ViewPager to display 6 fragments. Suppose I'm on 1st page, if I click 6th tab I'll see all my pages scrolled. Is it possible to disable t...
Obadiah asked 18/4, 2013 at 8:8

9

Solved

I am using ViewPager for swiping between Fragments, but can I use ViewPager to swipe between Views simple XML layout? This is my page Adapter for the ViewPager which is used to swipe between Fragm...
Johnajohnath asked 10/9, 2013 at 4:8

3

Solved

I just started using ViewPager and Tablayout from Material Design (comes with Android Studio). I created 5 fragments and I am able to use an swipe them as needed. Based on user selection in Fragme...

29

How should I select a tab in TabLayout programmatically? TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); tabLayout.setupWithViewPager(viewPager);

3

Solved

I have a ViewPager2 with a fragment inside, in the fragment, I have a custom view with certain touch logic that involves moving the finger. how do I prevent the ViewPager from swiping while the ...
Trifurcate asked 20/2, 2020 at 21:26

12

Solved

I hate posting code, and asking why it doesn't work, but I'm at a loss right now. I've tried to run the following class below, and I get an exception in logcat which I can't explain. Even a google ...
Bitterweed asked 7/3, 2013 at 2:59

2

When using the jetpack compose interoperability API, using LazyRow inside a prebuilt ViewPager causes scroll issues. When trying to scroll items inside the LazyRow the ViewPager moves. Is there any...

10

Solved

Here i have one view pager activity which has one imageview and 2 overlay bars. there overlay bars i made using android xml file layout itself. Here my requirement is like that 1) single tap on ...

27

Solved

Problem: Fragment onResume() in ViewPager is fired before the fragment becomes actually visible. For example, I have 2 fragments with ViewPager and FragmentPagerAdapter. The second fragment is onl...
Boehmite asked 5/4, 2012 at 7:58

4

Solved

I have a android.support.v4.view.ViewPager in my application and I would like to differentiate between a programmatically-initiated smooth scroll and a user-initiated touch scroll. I've had a loo...
Garrek asked 23/7, 2013 at 20:2

3

Solved

So what i am trying to achieve is user would open to first page of the view pager, and the view pager would bounce to half of the second page and bounce back to the fist page indicating that there ...
Libava asked 24/8, 2014 at 20:12

10

I have an Android app that uses ViewPager and FragmentStatePagerAdapter. I however need to add a new feature in which I have to know the swipe direction to move from one fragment view to another, l...

1

Today I was changing from ViewPager to Navigation Component (with Bottom Navigation View) on my Android project. The problem is that, when using ViewPager all is fast as lightning but using Navigat...

43

Solved

I'm using the ViewPager from the compatibility library. I have succussfully got it displaying several views which I can page through. However, I'm having a hard time figuring out how to update the...

4

Solved

I'm trying to set a viewpager inside a BottomSheetDialogFragment but always with the same result: java.lang.IllegalStateException: Fragment does not have a view setupDialog Code: @Override ...
Incontestable asked 12/4, 2016 at 11:5

9

I have a ViewPager which swipes between Fragments. I'm using a FragmentStatePagerAdapter to feed the Fragments to the ViewPager. If the user swipes left at a normal pace, and then swipes right very...

3

Solved

My app's main interface is a viewpager where the user just slides the pages horizontally to get to the various pages. One of the pages has a google mapview (pasted below). My problem is that if the...
Laird asked 24/8, 2012 at 23:15

© 2022 - 2024 — McMap. All rights reserved.