amarjain07 / StickyScrollView

Sticky header and footer for android ScrollView.
MIT License
533 stars 86 forks source link

vewpager #4

Closed xellDart closed 2 years ago

xellDart commented 7 years ago

with viewpager not work.... view pager have 0 dep and not show her my code layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout 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:orientation="vertical">

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="70dp"
    android:background="#3c3c3b">

    <ImageView
        android:id="@+id/home"
        style="@style/ClickableImageView"
        android:layout_width="37dp"
        android:layout_height="37dp"
        android:layout_marginTop="27dp"
        android:padding="8dp"
        android:tint="@color/md_white_1000"
        app:srcCompat="@drawable/ic_back_button" />

    <TextView
        android:id="@+id/toolbar_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="30dp"
        android:text="estudiapp"
        android:textAllCaps="false"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="#fff" />

    <ImageView
        android:id="@+id/more"
        style="@style/ClickableImageView"
        android:layout_width="37dp"
        android:layout_height="37dp"
        android:layout_marginTop="30dp"
        android:padding="10dp"
        android:layout_gravity="end"
        android:tint="@color/md_white_1000"
        app:srcCompat="@drawable/more_dots" />

    <com.github.ivbaranov.mfb.MaterialFavoriteButton
        android:layout_width="37dp"
        android:layout_height="37dp"
        android:layout_marginTop="25dp"
        android:layout_gravity="end"
        app:mfb_animate_favorite="true"
        app:mfb_animate_unfavorite="false"
        app:mfb_bounce_duration="300"
        app:mfb_favorite_image="@drawable/favorite_icon"
        app:mfb_not_favorite_image="@drawable/favorite_icon_off"
        app:mfb_padding="14"
        app:mfb_rotation_angle="360"
        app:mfb_rotation_duration="400"
        app:mfb_size="48" />
</android.support.v7.widget.Toolbar>

<com.amar.library.ui.StickyScrollView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:stickyHeader="@+id/titleLayout"
    app:stickyFooter="@+id/buttonLayout">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <LinearLayout
            android:id="@+id/titleLayout"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <cn.jzvd.JZVideoPlayerStandard
                android:id="@+id/videoplayer"
                android:layout_width="match_parent"
                android:layout_height="180dp" />

            <TextView
                android:id="@+id/titulo_video"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="8dp"
                android:textColor="#3c3c3b"
                android:text="El día D - Segunda Guerra Mundial"/>

            <TextView
                android:id="@+id/resumen_video"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingStart="8dp"
                android:textSize="12sp"
                android:textColor="#3c3c3b"
                android:text="Resumen del video actual, datos interesantes, etc, sefunda guerra mundia, segunda guerra mundial, segunda guerra mundial,segunda guerra mundial,segunda guerra mundial."/>

            <TextView
                android:id="@+id/profesor_video"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingTop="5dp"
                android:textSize="12sp"
                android:paddingStart="8dp"
                android:textStyle="bold"
                android:textColor="#3c3c3b"
                android:text="Prof. Alejando Pérez"/>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/buttonLayout"
            android:layout_width="match_parent"
            android:orientation="vertical"
            android:layout_height="wrap_content">
            <com.gigamole.navigationtabstrip.NavigationTabStrip
                android:id="@+id/nts_top"
                android:layout_width="match_parent"
                android:layout_height="56dp"
                android:layout_gravity="center"
                app:nts_active_color="@color/colorPrimary"
                app:nts_color="@color/colorPrimary"
                app:nts_corners_radius="1dp"
                app:nts_inactive_color="#ff1a1e23"
                app:nts_size="12sp"
                app:nts_titles="@array/tabs_menu"
                app:nts_weight="3dp" />

            <android.support.v4.view.ViewPager
                android:id="@+id/pager"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginBottom="50dp" />
        </LinearLayout>
    </LinearLayout>

</com.amar.library.ui.StickyScrollView>

OneXeor commented 7 years ago

There is news on this issue?

amarjain07 commented 7 years ago

@OneXeor @xperiafan13-rom I am working on it! Will be able to fix it soon

yura-f commented 6 years ago

@amarjain07 hi) How you can fix the problem with ViewPager? Example, if for ScrollView set fillViewport=true then ScrollView don't work/scroll.

mdnaseem33 commented 6 years ago

in StickyScrollView class a method called freeFooter() make a small change then that will work fine @Override public void freeFooter() { Log.e("freeFooter", String.valueOf(stickyFooterView)); if (stickyFooterView != null) {

     //   stickyFooterView.setTranslationY(0);
    }
}

try this out

saperman commented 6 years ago

Any news on the issue? Still not work with ViewPager

amarjain07 commented 2 years ago

Fixed in v1.0.3