Tag: android-viewpager

Android: RecyclerView within vertical viewpager

I want to implement a recyclerview within a vertical viewpager. My current layout looks like the following VerticalViewpager – Fragment1 – ImageView – Fragment2 – RecyclerView If I swipe from Fragment1 to Fragment2 everything works fine. I am able to scroll within the recyclerview up and down. The problem occurs if I try to swipe/scroll […]

Simultaneous touch events handling on multiple views in Android

Considering the example from the below image, I’m looking for a solution to pass the touch events from the canvas View to the Viewpager. This is necessary for applying the same amount of zoom on both views at the same time. Here’s the technical description of what’s going on, (Lets consider the view as A, […]

PagerTabStrip position within ViewPager

I have the following code: <android.support.v4.view.ViewPager android:id=”@+id/main_pager” android:layout_width=”match_parent” android:layout_height=”match_parent” > <android.support.v4.view.PagerTabStrip android:id=”@+id/pager_tab_strip” android:layout_width=”match_parent” android:layout_height=”wrap_content” /> </android.support.v4.view.ViewPager> and everything gets layouted like it should. What I want now is that the PagerTabStrip overlays the ViewPager. It should be rendered on top without taking up any layouting space. Basically the fragments in the ViewPager should start at […]

ViewPager and OnItemClickListener in ListView

I’m working on creating a swipe-to-dismiss list view adapter. My basic methodology is to wrap the list item’s view as the second view in a ViewPager and provide the necessary callbacks in the item change listener of the ViewPager. Through much pain I’ve got the View recycler working as intended, as well as ViewHolder and […]

Android ViewPager not calling onDetach/onDestroy/onDestroyView for when being replaced in a container

I have a FrameLayout container in which I use the replace method to put a fragment when an item is selected from the navigation drawer. getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment, fragment.getFragmentTag()).commit(); I have a fragment which has a ViewPager within it. I have 3 fragments which are displayed in a tab layout with the ViewPager. When I select […]

Hide Soft Keyboard In Android App From ViewPager Fragments

I have an Android app that contains a ViewPager with 2 fragments. The first fragment contains an EditText field. When the app launches, that field immediately takes focus and the soft keyboard is launched (which I want to happen). The second fragment only contains a list (no editable text fields). When I swipe from fragment […]

ViewPager inside Fragment loses content when returning to it

I am implementing tabhost using FragmentActivity , under the first tab i load a welcome fragment that contains a Viewpager and CirclePageIndIcator, I need to load 4 views in side that WelcomeFragment this is my WelcomeFragment public class WelcomeFragment extends Fragment { PageAdapter mAdapter; ViewPager mPager; CirclePageIndicator mIndicator; List<Fragment> fragments; @Override public View onCreateView(LayoutInflater inflater, […]

Design a HorizontalScrollView inside of ViewPager or use fragments:

I need to design the following screen, and I need your advice: Explanation: The title is static/fixed and I don’t need to do anything with it. Yellow: this is the interesting part, I need to design a ViewPager like screen that has the capability to scroll left/right for Max 4 screens. Red: In every screen […]

Android ViewPager dimension

Does the ViewPager have to be the only object present inside the activity layout? I’m trying to implement something like this: <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/reader_layout” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” > <android.support.v4.view.ViewPager android:id=”@+id/page_viewer” android:layout_width=”match_parent” android:layout_height=”wrap_content” /> <Gallery android:id=”@+id/miniatures_gallery” android:layout_width=”match_parent” android:layout_height=”wrap_content” /></LinearLayout> Where should I have a big pager scrolling in the top (and I have it) and a […]

AdMob AdView and ViewPager?

I have Android application with ViewPager implemented like this : I don’t know how to implement AdView below the ViewPager. I have tried to put AdView below the ViewPager programmatically and in xml. There is no errors but ads are not showing. My xml: <RelativeLayout 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/pager” android:layout_width=”match_parent” android:layout_alignParentBottom=”top” android:layout_height=”0dp” android:layout_weight=”1″/> […]

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