Tag: android-viewpager

How to disable behind view click event Framelayout

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 view pager’s imageview first time = show top and bottom rectangle overlaybar. 2) single tap on view pager’s imageview […]

Fragment in ViewPager not restored after popBackStack

Problem A Fragment is not reattached to its hosting ViewPager after returning from another fragment. Situation One Activity hosting a Fragment whose layout holds a ViewPager (PageListFragment in the example below). The ViewPager is populated by a FragmentStateViewPagerAdapter. The single Fragments hosted inside the pager (PageFragment in the example below) can open sub page lists, […]

PagerAdapter start position

I’m using the following example to impliment my viewPager: http://code.google.com/p/viewpagerexample/issues/list The problem with this example is that I can’t figure out how to set my starting position, the default starting position is 0. Basically I wan’t to be able to control if there is an available view on its left or the right. Is there […]

ViewPager – get a partial view of the next page

I am trying to achieve this in a ViewPager The first fragment (blue) is displayed and the beginning of the next fragment must be displayed as well, so the user understands he can swipe to switch views. The idea is scroll 20% of the screen programmatically to the left. Any thoughts are welcome EDIT: This […]

Can ViewPager have multiple views in per page?

After trying out the Gallery and Horizontal Scroll View, I found that the View Pager does what I need but with one minor thing missing. Can the View Pager have multiple views per page? I know that View Pager shows only 1 view/page per swipe. I was wondering if I can limit my views width […]

Android ViewPager get the current View

I have a ViewPager, and I’d like to get the current selected and VISIBLE VIEW, not just a NUMBER. getChildAt(getCurrentItem) returns wrong View @Override public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if (isVisibleToUser == true) { mFocusedListView = ListView; } } this is the second code, this is not working all the time sadly. sometimes returns […]

Fragment shared element transitions don't work with ViewPager

My app contains a view which consists of a ViewPager consisting of a handful of fragments. When you click on an item in one of these fragments, the expected behavior is for the shared element (in this case an image) to transition to the fragment which displays more information about the clicked content. Here is […]

How to add a Fragment inside a ViewPager using Nested Fragment (Android 4.2)

I have a ViewPager with three Fragments, each one shows a List (or Grid). In the new Android API level 17 (Jelly Bean 4.2), one of the features is Nested Fragments. The new functionality description says: if you use ViewPager to create fragments that swipe left and right and consume a majority of the screen […]

Replace one Fragment with another in ViewPager

I’m having some problems when I try to replace one Fragment with another one in a ViewPager. Current situation I have a ViewPager with 3 pages, each one is a Fragment. In first page, I have a ListView inside a ListFragment (“FacturasFragment”). When I click on an item of that list, I use onListItemClick method […]

Android ViewPager padding/margin between page fragments

Android Market/Google Music seem to be able to have a gap of some sort between the different fragments that are contained in the ViewPager. Any idea how this is done? Adding margin/padding to the actual fragment view doesn’t work, because the view still needs to occupy the entire width of the screen. The ‘gap’ is […]

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