Git Product home page Git Product logo

nestedscrollcoordinatorlayout's Introduction

NestedScrollCoordinatorLayout

compile 'com.otaliastudios:nestedscrollcoordinatorlayout:1.0.3'

A CoordinatorLayout that implements nested scrolling and propagates scroll events to parent views. This is useful for nested Coordinators, e.g. for inner fragments in a parent activity. By default, scroll events that take place inside the inner CoordinatorLayout won't reach the outer coordinator, and thus they won't trigger scroll animations and so on.

If NestedScrollCoordinatorLayout is used, events are correctly propagated.

Usage

Just use NestedScrollCoordinatorLayout as the inner CoordinatorLayout.

<!-- parent coordinator -->
<android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    
    <!-- stuff... -->
    
    <!-- inner coordinator with stuff inside -->
    <com.otaliastudios.nestedscrollcoordinatorlayout.NestedScrollCoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>   
    
</android.support.design.widget.CoordinatorLayout>

You can have slight control over the scroll propagation behavior using NestedScrollCoordinatorLayout.setPassMode(). Specifically:

  • PASS_MODE_BOTH (default): scroll events are passed to the parent stream and, at the same time, to this Coordinator childs
  • PASS_MODE_PARENT_FIRST: scroll events are passed to the parent stream and, if not consumed, they go on to this Coordinator childs

Contributing

You are welcome to contribute with issues, PRs or suggestions.

nestedscrollcoordinatorlayout's People

Contributors

natario1 avatar sikeeoh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nestedscrollcoordinatorlayout's Issues

Not working with hide_bottom_view_on_scroll_behavior

It works fine with the appbar, all the scroll bahaviours in the parent coordinator layout work as expected for app bar. But if there is a Bottom Navigation View with @string/hide_bottom_view_on_scroll_behaviour, it does not hide when child coordinator layout views scroll.

Example

can you give us an example-sample xml file of a complex implementation

what if the only scrollable view of the parent coordinator is inside the child coordinator
RelativeLayout
--CoordinatorLayout
----AppbarLayout
-----LinearLayout(scroll behavior)
-------Framelayout
-------Framelayout
--Framelayout

and add a fragment in the firt Framelayout with
NestedScrollCoordinatorLayout
--AppbarLayout
----Recyclerview(scroll behavior)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.