Questions tagged [android-viewpager]

ViewPager.setcurrentItem( ) freezes ui

The ViewPager is a widget for Android that makes possible displaying different views (or fragments) side by side allowing the user to swipe between them. ViewPager was released as part of the Compatibility Package revision 3 and works with Android 1.6 upwards. ViewPager is a ViewGroup and works in a similar manner to AdapterViews (like ListView and Gallery).

Official Documentation

10802 questions
3
votes
1 answer

Avoid page switching in a ViewPager until the content on the next page is ready

I am using a ViewPager so the user can browse through an infinite collection of images that need to be fetched from the Internet. I would not like to change to the next/previous page, unless its image has already been loaded. So if the user swiped…
mollymay
  • 512
  • 4
  • 13
3
votes
1 answer

FragmentActivity is lost after app is paused for a while

I am experiencing some weird behavior with an android app I have been working on, here is what happens: I use the app for a while, works fine without problems I "pause" the app by clicking on the android home button I use some other apps on the…
Marty
  • 2,965
  • 4
  • 30
  • 45
3
votes
0 answers

Using mergeAdapter from commonsware / cwac-merge in viewpager

I am trying to create a list view in a view pager using a mergeAdapter.So basically what i want is to fetch some dates from my database and and keeping the same dates in a sort of group (with some sort of header ). so i am creating a Arraylist of…
Rajul
  • 5,906
  • 2
  • 22
  • 26
3
votes
1 answer

Show portion of adjacent fragments in view pager

Is there some way to show a small portion of the adjacent fragments while using the ViewPager in Android compatibility package. The view that I want to make will show the current fragment in center and the edges of the fragments which are before and…
Kshitij Aggarwal
  • 5,287
  • 5
  • 34
  • 41
3
votes
0 answers

Android Pagerview as circular menu

I have in my code used standard PagerView (FragmentPagerAdapter) but because standard behavior is moving just from first to last page and I didn't find solutions to change it to circular menu (jump to first page after swipe on last), I hope that…
Tommy
  • 96
  • 5
3
votes
1 answer

android some issue with viewpagerindicator

I am trying to implement viewpagerindicator within my app. I am using viewpagerindicator lib. and my code is bellow link. http://pastebin.com/TRUazPmb I am getting an error, 11-15 13:07:35.145: E/AndroidRuntime(431): Caused by:…
Jyosna
  • 4,436
  • 13
  • 60
  • 93
3
votes
1 answer

Android ViewPager control doesn't appear in Graphical Layout Editor

I would like to use the ViewPager control. I have imported the v4 support package into my build path so there are no issues there. When I insert this into my layout XML it doesn't appear in the Graphical Layout Editor:
Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556
3
votes
2 answers

How to notify all fragments in ViewPager that one of them changed?

My FragmentActivity contains ViewPager with some pages. Once one page is modified, others need to receive notification. So my steps: 1. Send notification from fragment to activity 2. Getting list of fragments 3. Call notify to each one. The problem…
kzotin
  • 5,365
  • 3
  • 29
  • 36
3
votes
0 answers

Compose VerticalPager with scrollable item in it causes laggy nested scroll

I can't accomplish smooth scroll behavior with pager and scrollable item inside it. Is there any way to make transition smooth, or disable it at all ? I'm using 'androidx.compose.foundation:foundation:1.5.0-beta03' version @Composable fun…
3
votes
1 answer

How to disable pager animation of HorizontalPager in Jetpack Compose

I create a page which has 4 tabs and subpages, the HorizontalPager with dragEnabled = false, then I want to disable the animation when I click the tabs for changing the pages. How can I do it? Column(modifier = Modifier.padding(bottom = 0.dp)) { …
3
votes
1 answer

How can I evenly space the tabs in ViewPager?

Does anyone have any tips on keeping the tabs evenly spaced in ViewPager?
adneal
  • 30,484
  • 10
  • 122
  • 151
3
votes
1 answer

Load contents on demand in ViewPager

When i open a page in ViewPager, it instantiates the neighboring pages. What I would like to achieve is 1.load the contents the page only when the page is on focus. 2.show a loading screen, while i populate the page layout which is on focus and…
Yashwanth Kumar
  • 28,931
  • 15
  • 65
  • 69
3
votes
1 answer

Touch Listeners for Parent and Child Views

I have a HorizontalScrollView inside a ViewPager , I have disabled the ontouchevent of the view pager, but the problem is horizontal scroll view is disturbed by this. It doesn't work properly, only moves a little. I just want to understand the touch…
Yashwanth Kumar
  • 28,931
  • 15
  • 65
  • 69
3
votes
1 answer

Jetpack Compose - Lazy loading of data in Accompanist HorizontalPager

The problem is extremely simple and I don't know why anyone hasn't asked it before. I have to query loads of data from database and then show that in HorizontalPager one by one. If I load all of the data at once, before composing HorizontalPager, it…
3
votes
1 answer

Android ViewPager + Webview, ClassCastException! Need webview in a viewpager

I am trying to create a horizontal "listview" of webviews. As suggested by a previous answer to a question, I am using the ViewPager library from the compatibility pack. Unfortunately when I go to add my webview to the view collection, using…
CQM
  • 42,592
  • 75
  • 224
  • 366
1 2 3
99
100