Tag: android-viewpager

OnClickListener of Child preventing the swipe of Android ViewPager

I am using a ViewPager with Dynamic Views as shown in this link. I am adding each page to the viewpager. The code to create each page and add it to the pager adapter is as follows public View createPage( ) { TableLayout table = new TableLayout(mycontext); TableRow row = new TableRow(mycontext); for(int i=0; i […]

Implementing Circular Scrolling In PagerAdapter

I am using PagerAdapter for horizontal swiping for showing newspaper pages in my app. Currently I want to implement the circular scrolling in this app.Right now what I have done is whenever I am getting on last page I try to set the currentItem to first pagei.e that functionality working for last page to first […]

Refresh/Reload/Re instantiate a Fragment in an android tab system

I have an activity with a viewpager that has 3 tabs and 3 fragments, inside each tab is a fragment. I know that the fragment manager stores the initial instances of the fragments so that if I swipe away from a tab then return to that tab, it is loaded in memory and no updates […]

Parallax Effect in Android's ViewPager

I’m trying to emulate a parallax effect when sliding through my fragments, I’ve read about beginFakeDrag and fakeDragBy but to be honest, I don’t know even if it’s the best approach to my problem. Anyone has done something similar with the ViewPager or have a hint about how should I approach this? Thank you

ViewPager disable swiping to a certain direction

I want to disable the swiping, but only to the right side. I found a working solution in this answer. Unfortunately, this copies the whole ViewPager source to achieve the goal. Is there any methods just inheriting the existing class and not duplicating?

TextView inside ViewPager intercepts touch events

I have a ViewPager that contains two fragments. In any of the fragments I can touch a place, swipe to switch to another fragment. One of the fragments contains a list. Items in the list contains one TextView and one ImageView. The issue is, if you dragging has been started from tapping the ImageView, it’s […]

Android Viewpager saving data and views

Hello stackoverflow world, Hopefully someone can help me with a slight problem/confusion I have with Viewpagers and saving data. PROBLEM: When scrolling across the four views I have, the first view has two spinners, two textviews that display a string or a selected item. if i scroll on to the third page and back to […]

How to switch automatically between viewPager pages

I have an android application that employs a ViewPager with two pages When the activity first displays i would like to present each page in turn to the user so that they know they can swipe between to two views. I have failed to find any docs describing how to do this. I have discovered […]

setCurrentItem in ViewPager not scroll immediately in the correct position

I use a PagerAdapter. I have a lot of elements so I don’t load all elements in the same time. I reload the adapter, I change the old elements by the new elements. For example I have 4 elements, when I arrive at the last element, I reload the elements and I call setCurentItem(1) to […]

Mediaplayer respond to second click to pause

Used ViewPager for images sliding, each image onclick stream different MP3. app including 50 pages(images) & 50 different mp3, all mp3 stored on app itself. ex. First-page stream MP3(one), second-page stream MP3(two) and so on till page fifty. FIRST: its work fine just only one issue which is: In any page –> clicking the image […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.