Questions tagged [android-viewpager]

ViewPager.setcurrentItem( ) freezes ui

android-viewpager
Filter by
Sorted by
Tagged with
3 votes
1 answer
191 views

Talkback does not announce Page information when ViewPager is launched

I have a simple ViewPager. A very basic one. When we enable accessibility, when user lands on the ViewPager, the talkback announces the Fragment contents inside the ViewPager, ending with "inside ...
0 votes
0 answers
395 views

Show/hide view after recyclerview notifyDataSetChanged

I have a layout which contains the following views: <android.support.v7.widget.RecyclerView android:id="@+id/rvChat" android:layout_width="match_parent" android:layout_height=&...
1 vote
0 answers
486 views

Compose synchronize two HorizontalPager Offset Fraction

Hallo everyone i have created a Compose function with two HorizontalPager but i wanted to synchronize the scrolling between both of them when the user scrolling left or right and i try the following ...
1 vote
2 answers
501 views

How to update a single page content in a ViewPager without scrolling to the first page?

I want to update a specific page in a ViewPager, and stay on that page and not scroll to the first page I tried to update the data list and call notifyDataSetChanged() but it scrolls to the first ...
1 vote
1 answer
141 views

Print pdf in multiple pages if one page not enough

I'm trying to create a PDF from layout; I converted the layout to bitmap and then printed into the pdf page. The application converts the output into a long PDF page, but I want to divide the bitmap ...
0 votes
0 answers
8 views

How to update a text view in the one position of the viewpager

I am using a viewpager to load the pages with multiple text views. Based on some conditions I have update the text view in the current position of the view pager. How do I do this without having to ...
0 votes
0 answers
249 views

What's the best way to use TabRow Tabs with viewModel in Compose?

Currently I'm developing a "pager" , my idea is to fill from the database the "tabs", and each tab will have an id, this Id will help me to query a list from room with a list of ...
0 votes
0 answers
32 views

How can I add text below my carousel image? I used View Pager for the carousel

This is what I have now <androidx.viewpager.widget.ViewPager android:id="@+id/carouselContainer" android:layout_width="match_parent" android:layout_height="200dp" ...
0 votes
0 answers
90 views

resetCancelNextUpFlag NullPointerException in viewpager touchlistener android

Touchlistener added to viewpager sometimes causes Attempt to read from field 'int android.view.View.mPrivateFlags' on a null object reference in method 'boolean android.view.ViewGroup....
0 votes
1 answer
40 views

how to change viewpager in activity intent android?

I want the ViewPagerAdapter in these to go to the activity and don't know how to get it.This format adapter.addFrag(new RssFragment(), "news"); how to change convert adapter.addFrag(new ...
5 votes
4 answers
6k views

I want to disable preloading next page in a ViewPager

How can I disable the preloading in a ViewPager? I have a ViewPager with 3 pages fragment in each page. So I don't want to load the next page and previous page. How can I disable this behaviour? I ...
3 votes
2 answers
2k views

Accompanist Nested HorizontalPager disable swipes in parent

I have a nested HorizontalPager like HorizontalPager( count = list.size ) { HorizontalPager( count = list2.size ) { //items } } is there any way to disable horizontal scrolling ...
0 votes
2 answers
75 views

Can we use ViewPage in wrap content

If I use viewpager in wrap content I always end up with the error Process: com.example.openinapp, PID: 5144 java.lang.IllegalStateException: Pages must fill the whole ViewPager2 (use match_parent)
1 vote
2 answers
1k views

Accessibility: Talkback for TabLayout

Scenario I am creating one application that has bottom navigation. For 1 bottom navigation item, I have a Fragment with a ViewPager and TabLayout Let say I have 3 bottom navigation item A, B and C For ...
0 votes
0 answers
40 views

Trying to apply StickyScroll with Viewpager

In my profile page I have StickyScrollview and viewpager in which I have two fragments each of which attach with recyclerview. Im trying to implement StickySroll and want to achive same like one ...
0 votes
1 answer
4k views

viewPager.setCurrentItem not working inside adapter

I'm using an adapter to populate view from Firebase to a CardView. I'm trying to open a new fragment with onclicklistener on an item from the cardView inside the adapter. It used to work when I was ...
5 votes
0 answers
458 views

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:...
30 votes
8 answers
69k views

ViewPager offscreen page limit

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 ...
1 vote
1 answer
238 views

Stop Another Video when Playing Current Video Viewpager 2 and Exoplayer

I'm workig on Swipable Video Player using ViewPager 2 and Exoplayer 2. In my code everything is working fine and Video is playing when showing to current visible view of ViewPager. Big problem is when ...
0 votes
2 answers
1k views

Android Zoomed Imageview Conflict Swipe Gesture with ViewPager

I have used Zoomage to implement the zoom feature on my imageview. I have a FragmentPagerAdapter that create each fragment which consist of each zoom imageview. So my problem is: While the image is ...
1 vote
1 answer
2k views

Android viewpager does not show layouts

In my Android application I'm using viewpager and FragmentActivity. But it does not show the content. My FragmentActivity is: public class DropPickup extends FragmentActivity { private DPAdapter ...
-1 votes
1 answer
34 views

Custom Android View Pager Animation

I am trying to achieve this animation using the page Transformer. Any help is highly appreciated.
0 votes
2 answers
20 views

Cannot inflate my viewNotesFragment.in viewpager

My code ViewPagerAdapter: package io.lionpswn.kodular.notepad import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentPagerAdapter ...
0 votes
0 answers
17 views

How to stop overlapping in ViewPager when change the tab

I have two fragments one is simple video and another is event video,When i call onTabSelected multiple time in very short time period, means change tab quickly then my previous tab video's sound is ...
0 votes
0 answers
253 views

React-native Android error: Invariant Violation: requireNativeComponent: "RNCViewPager" was not found in the UIManager

I just want to build top tab navigation and I followed the official documentation, I did everything to fix this error, even manually linked but It didn't work (however new versions of react-native ...
0 votes
0 answers
74 views

How to stop previous item in viewpager holder with exoplayer with user scroll

Exoplayer Inside Viewpager playing video after user scroll the pager this cause exoplayer to keep play the scrolled video and the current video which make the app buggy. For past two days i searched ...
1 vote
0 answers
22 views

FragmentPagerAdapter keeps not visible fragment menu

I'm using menu provider to create option menu specific by fragment, fragments are managed by viewpager + FragmentPagerAdapter (requireActivity() as MenuHost).addMenuProvider( object : ...
4 votes
2 answers
2k views

ViewPager with multiple PageTransformer (PageTransformers at Runtime)

I have a custom requirement with my ViewPager. What I want is my pager should have a horizontal pageTransformer like DepthPageTransformer by default. Now on the screen I have a button on press of ...
0 votes
1 answer
79 views

How to stop refreshing fragment on tab change with FragmentStateAdapter and ViewPager2?

I'm using FragementStateAdapter and ViewPager2 in my Android project. But the problem is that my fragment is being reloaded on tab change. I want to stop that how do I do that? I have tried many ...
5 votes
5 answers
2k views

How to know whether the page is selected from Swipe or Click of Tab of Viewpager

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 ...
0 votes
0 answers
64 views

Android: ViewPager2 is resetting my activity view

I have implemented ViewPager2 in an activity. It has 3 fragments only. I am running some Service (binded) for some background work that then updates the UI in Activity and one of the fragments. The ...
0 votes
0 answers
21 views

How to make a tab unfocusable[Not selectable] in TabLayout - ViewPager

I have implemented scrollable view with TabLayout, ViewPager and Fragments. What I am trying to achieve- I don't want one of the tab to receive focus[Not through scrolling or click on tab in TabLayout]...
1 vote
1 answer
2k views

How to handle horizontal scroll gesture combined with transform gestures in Jetpack Compose

Hi I want to have a zoomable image in a horizontal pager. I already implemented transform gestures and double tap but now, I can't scroll my pager with scrolling over the image. I guess panning and ...
-1 votes
1 answer
47 views

ViewPager not displaying all fragments - only visible when tapped

Fragment visibility problem inside in ViewPager I have a ViewPager, inside this multiple fragment associated and all fragment creating by for loop according to fragment list size. All fragment is ...
0 votes
0 answers
331 views

Does anyone have details on saveEnabled for ViewPager2?

So we have a ViewPager in our App that loads hundreds of fragments and we are getting a crash with TransactionTooLargeException. So here is our setup: Activity: We have the an activity that has the ...
0 votes
0 answers
19 views

Issue with RecyclerView not updating when returning to the first page after navigating to the second page of ViewPager2

My code is a program that displays ViewPager2 in the MainActivity and shows different lists on the second page using RecyclerView. When I press the Edit mode, the checkboxes and move buttons of each ...
0 votes
3 answers
2k views

Cannot resolve method 'setupWithViewPager(androidx.viewPager.widget.ViewPager)

I an learning android studio and was trying to make a simple app using fragments but I am getting the below error. error- Cannot resolve method 'setupWithViewPager(androidx.viewPager.widget.ViewPager)...
0 votes
1 answer
46 views

Activity loading after 5-6 seconds in Android

I am working on an app and here it takes 5-6 sec to load the activity when I open the app, I know it is because of the dates I have got of 10 years in the viewpager but how do I fix that and load it ...
0 votes
1 answer
56 views

ViewPager in AlertDialog showing both fragments instead of one at a time

I'm trying to display a ViewPager with multiple fragments inside an AlertDialog. The ViewPager is set up with a custom FragmentStateAdapter, and I have defined two fragments: ChatGanerelFragment and ...
1 vote
0 answers
145 views

Integration of detectTransformGestures (zoom...) with brand new ViewPager from latest Jetpack Compose libraries (v1.4.3)

With latest Jetpack compose library, view pager integration is quite straight forward. But when I add a modifier with the detectTransformGestures method, as defined in the official android ...
0 votes
0 answers
60 views

ViewPager2 as gridview calendar application

I am building a Calendar app and I want it to be like Google Calendar. As I was informed Google Calendar uses ViewPager2. The problem is that I made my adapter and everything I need to populate my ...
18 votes
4 answers
14k views

I can't find PageChangeListener in ViewPager2.?

ViewPager2 PageChangeListener is not working like normal ViewPager.?
0 votes
0 answers
21 views

How to fix Smartiest Photo slider indicator not updating after removing slide with ViewAdapter and MVVM architecture in Android?

I am using Smartiest Photo slider library . I have a remove button on each slide , whenever it is clicked that slide is removed. But in my case Slide is removed but the indicator at the bottom remains ...
0 votes
0 answers
42 views

Selected tab scrolled to center

i want tabs like in image, when tab selected it scrolled to center, You may check you own device camera screen
0 votes
0 answers
22 views

How stop recycler view scroll when reach last item in the bottom of screen that view pager inside coordinate layout with appbar layout?

I tried to setup view pager inside coordinate layout with appbar layout. And also recycler view inside the viewpager. it is scrolling. Appbar layout has top view in disply. I need to stop scrolling to ...
0 votes
1 answer
1k views

Compose HorizontalPager nested scroll problem with WebView

I am trying to use Webview with HorizontalPager (New one), if the webview content size is more than the screenWidth, it will get an internal scroll but HorizontalPager doesn’t respect that. The only ...
0 votes
1 answer
42 views

Issue with the Dynamic ViewPager -> Second layout not attahced

I am creating dynamic ViewPager as below : pls. check : /** adding gridView created to main root layout.*/ pager=new ViewPager(this); pagerAdapter = new KeyboardPagerAdapter(); ...
3 votes
2 answers
1k views

How can I forward scrolling the RecyclerView to its parent which is a BottomSheet in order to collapse it?

Basically I have a fragment with a specific layout, which has CoordinatorLayout as its parent and a static fragment with BottomSheetBehaviour(also some other views that are not related to the question)...
44 votes
9 answers
68k views

How can make my ViewPager load only one page at a time ie setOffscreenPageLimit(0);

I understand the lowest number I can give setOffscreenPageLimit(int) is 1. but I need to load one page at a time because memory problems. Am i going to have to use the old style tabhost etc? or is ...
3 votes
2 answers
6k views

Vertical 'Gridview with pages' or 'Viewpager'

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