Tag: android-viewpager

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 […]

Set View Pager Height Dynamically

I have View Pager as a List Item row, and I am setting data to the pager’s adapter to show in the list view.Here is my code : Pager_Item Layout <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/inner_layout” android:layout_width=”match_parent” android:layout_height=”match_parent” android:gravity=”center” android:orientation=”horizontal” > <ImageView android:id=”@+id/icon” android:layout_width=”wrap_content” android:layout_height=”fill_parent” android:layout_marginRight=”6.0dip” android:src=”@drawable/ic_launcher” /> <TextView android:id=”@+id/text” android:layout_width=”wrap_content” android:layout_height=”fill_parent” android:gravity=”center_vertical” android:text=”Example Value” […]

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