All Projects → kfrozen → Headercollapsiblelayout

kfrozen / Headercollapsiblelayout

Licence: apache-2.0
A wrapper layout that can easily split your current layout into header and body, and provides smooth header collapsing action with related event callbacks.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Headercollapsiblelayout

Materialdrawerkt
A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.
Stars: ✭ 508 (+2016.67%)
Mutual labels:  wrapper, android-ui
Wykop Es6
Wykop.pl API library
Stars: ✭ 17 (-29.17%)
Mutual labels:  wrapper
Androidveil
🎭 An easy, flexible way to implement veil skeletons and shimmering effect for Android.
Stars: ✭ 792 (+3200%)
Mutual labels:  android-ui
Giantbomb
A PHP wrapper for GiantBomb API
Stars: ✭ 5 (-79.17%)
Mutual labels:  wrapper
Polygondrawingutil
A compact Android utility for constructing and drawing rounded regular polygons.
Stars: ✭ 805 (+3254.17%)
Mutual labels:  android-ui
F32 For Android
Android library for temperature conversions and weather forecasts. Includes wrapper for OpenWeatherMap API
Stars: ✭ 16 (-33.33%)
Mutual labels:  wrapper
Slidetoact
A simple 'Slide to Unlock' Material widget for Android, written in Kotlin 📱🎨🦄
Stars: ✭ 783 (+3162.5%)
Mutual labels:  android-ui
Swaddle
Automagically create API clients/wrappers in JavaScript
Stars: ✭ 23 (-4.17%)
Mutual labels:  wrapper
Sandal2
SDL2 wrapper in C
Stars: ✭ 17 (-29.17%)
Mutual labels:  wrapper
Tensorflow.jl
A Julia wrapper for TensorFlow
Stars: ✭ 822 (+3325%)
Mutual labels:  wrapper
Kodirpc
Kodi JSON-RPC API/v6 Wrapper in C#
Stars: ✭ 5 (-79.17%)
Mutual labels:  wrapper
Morphing Material Dialogs
Material dialog ❤️ morphing animation. An android kotlin UI library for building beautiful animations for converting a floating action button into a material dialog.
Stars: ✭ 806 (+3258.33%)
Mutual labels:  android-ui
Laravel Bigbluebutton
A BigBlueButton API wrapper for Laravel 5
Stars: ✭ 17 (-29.17%)
Mutual labels:  wrapper
Animatedbottombar
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.
Stars: ✭ 797 (+3220.83%)
Mutual labels:  android-ui
Go Git Cmd Wrapper
A simple wrapper around git command in Go.
Stars: ✭ 22 (-8.33%)
Mutual labels:  wrapper
Scintillanet
A Windows Forms control, wrapper, and bindings for the Scintilla text editor.
Stars: ✭ 781 (+3154.17%)
Mutual labels:  wrapper
Moyasar Php
Moyasar PHP client library
Stars: ✭ 5 (-79.17%)
Mutual labels:  wrapper
Recyclerviewinjectoradapter
RecyclerView.Adapter on steroids
Stars: ✭ 16 (-33.33%)
Mutual labels:  android-ui
Android Customtoast
Easy to use Custom Toast Library for Android
Stars: ✭ 24 (+0%)
Mutual labels:  android-ui
Automatic Client
Client wrapper for the Automatic Link
Stars: ✭ 22 (-8.33%)
Mutual labels:  wrapper

Description

A wrapper layout that can easily split your current layout into header and body, and provides smooth header collapsing action with related event callbacks.

Demo

Usage

dependencies {
    compile 'com.troy.collapsibleheaderlayout:collapsibleheaderlayout:2.0.4'
}

Basic steps to wrap your original layout to obtain a collapsible header layout

  1. Split the original layout to header and body, then put them in separate layout files, for example:

     comp_collapsible_layout_header.xml
     comp_collapsible_layout_body.xml
    
  2. Apply the HeaderCollapsibleLayout to your layout file, and link the above two parts in, like this:

    <com.troy.collapsibleheaderlayout.HeaderCollapsibleLayout
        android:id="@+id/default_header_collapsible_layout_id"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:topPanelLayoutId="@layout/comp_collapsible_layout_header"
        app:bottomPanelLayoutId="@layout/comp_collapsible_layout_body"
        app:overlayFooterLayoutId="@+id/demo_bottom_overlay"
        app:overshootDistance="5000" />
    
  3. You are all set! Ready to soar ---

WHAT'S NEW IN 2.0.X:

  1. Support overscroll action. When the header view has been expanded, if user kept scrolling down, the header view would be stretched to response to the overscroll action, and then bounce back when user released. To enable the overscroll effect, just give a positive integer to the attribute app:overshootDistance, which means the max overscroll distance in pixel.

  2. The params of the event callback onHeaderOffsetChanged has been changed from void onHeaderOffsetChanged(int verticalOffset, float headerCollapsedPercentage) to void onHeaderOffsetChanged(int verticalOffset, int headerHeight, float headerCollapsedPercentage, boolean isScrollingDown). For the details of the params, please see below.

  3. Deprecated the previous setOnHeaderStatusChangedListener(OnHeaderStatusChangedListener callback) method, please use addOnHeaderStatusChangedListener(OnHeaderStatusChangedListener callback) as the replacement.

  4. Added a new callback OnViewFinishInflateListener, which would be invoked when the HeaderCollapsibleLayout has been totally inflated. Please see the details about this below.

Note that:

  1. If there was NOT a view in your child layout that implemented the NestedScrollingChild, please wrap your header/body layout with a NestedScrollView.

  2. Setting app:supportAutoExpand="false" means the header will not automatically expand when user perform a fling action, instead of which the header will move with user's finger until totally expanded.

  3. We also provide a set of event callbacks:

    public interface OnHeaderStatusChangedListener {
        void onHeaderStartCollapsing();
    
        void onHeaderCollapsed();
    
        void onHeaderStartExpanding();
    
        void onHeaderExpanded();
    
        /**
         * Called when the {@link HeaderCollapsibleLayout}'s layout offset has been changed. This allows
         * child views to implement custom behavior based on the offset (for instance pinning a
         * view at a certain y value).
         *
         * @param verticalOffset            the vertical offset for the parent {@link HeaderCollapsibleLayout}, in px
         * @param headerHeight              the total collapsible offset, in px
         * @param headerCollapsedPercentage the latest percentage of the collapsed part of the header view.
         * @param isScrollingDown           whether the layout is scrolling down
         */
        void onHeaderOffsetChanged(int verticalOffset, int headerHeight, float headerCollapsedPercentage, boolean isScrollingDown);
    }
    

    Add this to your HeaderCollapsibleLayout instance by calling the below method in case you wanna do something response to the collapsing events. Please remember to remove it when not needed anymore.

    public void addOnHeaderStatusChangedListener(OnHeaderStatusChangedListener callback)
    
    public void removeOnHeaderStatusChangedListener(OnHeaderStatusChangedListener listener)
    

    Also, we provide a callback when the wrapper view has been inflated, where you may need to do some initialize actions. Apply the below callbacks:

    public void setOnViewFinishInflateListener(OnViewFinishInflateListener listener)
    
    public void removeOnViewFinishInflateListener()
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].