Skip to content

didikk/sticky-nestedscrollview

Repository files navigation

StickyNestedScrollView

Upgraded version from StickyScrollView

Installing

Add the following gradle dependency

repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.didikk:sticky-nestedscrollview:1.0.1'
}

Usage

Add android:tag="sticky" to your desired view.

<me.didik.component.StickyNestedScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="me.didik.stickynestedscrollview.MainActivity"
    tools:showIn="@layout/activity_main">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="@dimen/activity_horizontal_margin">

        <TextView
            android:id="@+id/tv_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/white"
            android:paddingBottom="10dp"
            android:paddingTop="10dp"
            android:tag="sticky"
            android:text="@string/sample"
            android:textColor="@color/colorAccent"
            android:textSize="18sp"/>

        // Other view

    </LinearLayout>

</me.didik.component.StickyNestedScrollView>

About

Upgraded version from StickyScrollView

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages