Skip to content

Fixed and scrollable header and footer support for NavigationView

License

Notifications You must be signed in to change notification settings

afshinpir/NavigationView

Repository files navigation

Release

NavigationView

This Android library is designed for adding fixed and scrollable header and footer support to Android's NavigationView.

Usage

Download

This library is published on JitPack. You can add it to your project in 2 easy steps:

  1. Add the JitPack repository to your build file

Add the following to your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add dependency

Add following dependency in your project:

dependencies {
    implementation 'com.github.afshinpir:NavigationView:v1.1'
}

Note: This library uses Android X artifacts. Thus, you need to migrate to it before using this library.

Code

In order to use this library, it is enough to change your widget from:

android.support.design.widget.NavigationView

to:

com.github.afshinpir.navigationview.NavigationView

in you layout and code.

Widget

Rather than a simple app:headerLayout, this new widget provides 4 different types of header and footer:

Attribute Description
app:fixedHeaderLayout Fixed header which stay on top of NavigationView all the time.
app:scrollableHeaderLayout Scrollable header which scrolls along menu of NavigationView.
app:scrollableFooterLayout Scrollable footer which scrolls along menu of NavigationView.
app:fixedFooterLayout Fixed footer which stay on bottom of NavigationView all the time.

You can add different types of header and footer at same time. By adding all types of headers and footers, you can create layouts like this one:

Other attributes of NavigationView are also supported.

Note

Since widget is created based on Android's NavigationView, I was constrainted to its limitations. I may try to improve library adding new features later.

About

Fixed and scrollable header and footer support for NavigationView

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages