florent37 / MaterialViewPager

A Material Design ViewPager easy to use library
https://www.fiches-plateau-moto.fr
Apache License 2.0
8.13k stars 1.48k forks source link

ViewPager become unstable and has offset when wrap the ScrollView in SwipeRefreshView #137

Open lusccc opened 9 years ago

lusccc commented 9 years ago

Here is the video:https://youtu.be/qkf9QZGre_M In your sample,I modified the fragment_scroll.xml ,I wrapped the ScrollView in SwipeRefreshView . then I ran the app,the viewpager had weird offset when I scrolled to the last page,and is also hard to pull to refresh, please help me,thanks. here is the code:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/swipeRefreshLayout">
    <com.github.ksoichiro.android.observablescrollview.ObservableScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <include layout="@layout/material_view_pager_placeholder"/>

            <android.support.v7.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/cardMarginVertical"
                android:layout_marginLeft="@dimen/cardMarginHorizontal"
                android:layout_marginRight="@dimen/cardMarginHorizontal"
                android:layout_marginTop="@dimen/cardMarginVertical"
                android:background="@android:color/white"
                app:cardElevation="4dp">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="1000dp"
                    android:orientation="vertical">

                </LinearLayout>

            </android.support.v7.widget.CardView>
        </LinearLayout>

    </com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
</android.support.v4.widget.SwipeRefreshLayout>

Thank you~

ghost commented 9 years ago

I am having the same issue too. Please help

chnouman commented 6 years ago

same issue