Tag: android-viewpager

Error inflating class android.support.v4.view.ViewPager

I’ve been trying to create a Pager for my application that runs on <uses-sdk android:minSdkVersion=”10″ android:targetSdkVersion=”15″ /> I wrote my code according to this blog post. XML for Pager activity: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” > <android.support.v4.view.ViewPager android:id=”@+id/instructionsViewPager” android:layout_width=”match_parent” android:layout_height=”match_parent” /> </LinearLayout> Code for adapter: public class MyPagerAdapter extends PagerAdapter { @Override […]

Slideshow in android viewpager?

I have problem with android viewpager slideshow. I want to show the viewpager layout after a minimum time period. Here is my code sample. My main class: public class MainActivity extends Activity { private ViewPager mViewPager; private SwipeAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mViewPager = (ViewPager) findViewById(R.id.pager); // set the adapter […]

MapView (android maps api v2) inside fragment layout doesnt show

I am using viewpager to swipe between 2 action bar tabs (used eclipse wizard for this kind of navigation). I am using android maps v2 api. I want to have mapview, button and textview inside one of my tabs (i guess having mapfragment is not possible). I inflate layout for my fragment from xml like […]

Failed to build Android app (refer to both ActionBarSherlock & ViewPagerTabs) with Ant

I have one Android app which uses ActionBarSherlock & ViewPagerTabs. I use Eclipse to write and build it, and it just works well until I try to build it with Ant. Here’s what I did: go to ActionBarSherlock folder, run “android update lib-project –path .” go to ViewPagerTabs folder, run “android update lib-project –path .” […]

Adding titles to ViewPager

I have set up a ViewPager for swipeable tabs and now I want to add titles at the top of the page to indicate what fragment is being shown. This is the code so far: activity_main.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” > <android.support.v4.view.ViewPager android:id=”@+android:id/viewpager” android:layout_width=”fill_parent” android:layout_height=”fill_parent” /> </LinearLayout> MainActivity.java public class MainActivity […]

2 ViewPager not scrolling in Android 2.3

I am using Navigation Drawer in my app, that contains some Fragments just like in the below picture. Every Fragment Contains another ViewPager that is an ImageSlider, and below that is a Listview and at the top I am using the SwipeRefreshLayout. My problem is the image slider works well on devices that has Android […]

Page curl with view pager

I have to implement page curl with Viewpager so that when user swipe the layouts added to the view pager have the page curling effect. I have downloaded github.com/harism/android_page_curl but it seems like it works only for images as do most of the other implementations.. Can anyone please tell me a workaround of it so […]

How to let only specific fragments scroll inside a ViewPager of CoordinatorLayout?

Background I have a viewPager, with 3 fragments and tabs for them. Each fragment has an intro phase (of its own) that doesn’t have any scrollable content. After leaving the intro phase, there is a recyclerView that the user can scroll in. The problem I need to use the new design library, so that when […]

Recycler view + View Pager + Nested ScrollView + CoordinatorLayout

I am working on a layout such that the ViewPager holding a fragment that contains recycler view is placed in a nester scrollView of Coordinator Layout. The problem is once i clicked on the recycler view the nested scroll view is not working.. Is there any possible way to have a layout like these that […]

PageCurl animations on ViewPager transitions?

Here’s a demo of what a page curl animation looks like: http://www.youtube.com/watch?v=aVZHN_o45sg There are a couple of page curl animation libraries: https://github.com/harism/android_page_curl https://github.com/MysticTreeGames/android-page-curl They are meant to work with Bitmap Drawables and not necessarily ViewGroups. If was wondering if anyone has come up with a similar page curl transition for ViewPagers.

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