Tag: android-viewpager

Tabs of TabLayout not showing

I have a main activity, which hosts a fragment, which in turn hosts a TabLayout (with a ViewPager). The tab bar is shown, baut the tabs themselves are not shown. Here is my code in the main activity for displaying the host fragment: Fragment fragment = new BMITabsFragment(); FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).addToBackStack(Constants.BMI_TABS_FRAGMENT).commit(); Here […]

Error including Android-DirectionalViewPager .jar in Eclipse

I am trying to implement vertical swiping in my app. (Its just like the swiping with ViewPager, but vertically). I found Jake Whartons library Android-DirectionalViewPager. It is a standalone .jar file which should be included in addition to the compatibility library. I included the file in my project. It is now under ‘Referenced Libraries’, just […]

Orientation change with viewPager inside FragmentActivity

I’m trying to build an app that shows a book in portrait and landscape mode. So obviously there’s 1 page showed in portrait and 2 in landscape. Each of the mode works pretty good but when i change the orientation from portrait to landscape the viewPager try to get 2 pages from the portrait mode […]

Viewpager not wrapping content after loading images from internet

I have a viewpager that holds images loaded by Nostra’s Universal Image Loader. This viewpager is also part of a listview as a header. Setting the height to wrap_content doesn’t work and it shows nothing but if I set it to a specific dip, it works. My suspect is that, the viewpager gets to wrap […]

insert separator between view-pager

How could i insert some padding between the pages inside view-pager like in the market app – the black line

ViewPager margin in PageTransformer transformations

I have a ViewPager in which each of it’s views is a representation of card on a deck. Each card has a shadow on the border using the ViewPager margin: cardsViewPager.setPageMargin(getResources().getDisplayMetrics().widthPixels / 20); cardsViewPager.setPageMarginDrawable(R.drawable.shadow); And it works as expected. But, if I add a PageTransformer so that the cards on the right will stack on […]

How can I put titles in ViewPager using fragments?

I am using ViewPager to allow user to swipe between fragments. How can I add a the title of each fragment to the screen? package com.multi.andres; import java.util.List; import java.util.Vector; import com.viewpagerindicator.TitlePageIndicator; import com.viewpagerindicator.TitleProvider; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; public class ViewPagerFragment extends FragmentActivity{ private PagerAdapter mPagerAdapter; //contiene […]

How to make the FAB avoid being moved in ViewPager, yet be a part of the fragment within?

Background According to the material design guidelines (here), if you use a ViewPager that has a FAB (floating action button) for the fragments within, the FAB shouldn’t move as a part of the fragments, but either disappear or be replaced by another, or animate to something else. In short, instead of this: https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B6Okdz75tqQsNVRkV3FZMktvMWc/components-buttons-fab-behavior_06_xhdpi_009.webm you should […]

Viewpager overflows the screen inside coordinator layout

I’m trying to use the design support library to implement tabs. The issue is that the viewpager overlaps the toolbar and tablayout when i remove the attribute app:layout_behavior=”@string/appbar_scrolling_view_behavior” of the viewpager. viewpager overlaps the toolbar and tablayout and when i add the attribute the viewpager overflows the screen. viewpager overflows the screen I just need […]

Where to call getChildFragmentManager()?

Problem According to the Google’s docs: You can now embed fragments inside fragments. This is useful for a variety of situations in which you want to place dynamic and re-usable UI components into a UI component that is itself dynamic and re-usable. For example, if you use ViewPager to create fragments that swipe left and […]

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