Giter VIP home page Giter VIP logo

scrollinglayout's Introduction

ScrollingLayout

垂直方向支持多个子视图持续连贯滚动的容器,并且支持吸顶功能。

  • 支持多个子视图(ScrollView/NestedScrollView仅支持一个子视图)
  • 支持连贯滚动,ScrollingView/ScrollView/WebView 可以依次消费滚动距离
  • 支持嵌套滚动,实现了 NestedScrollingParent3, NestedScrollingChild3
  • 支持吸顶,普通吸顶和常驻吸顶
  • 子视图为 RecyclerView 时,不会导致其缓存机制失效
  • 子视图为 ViewPager2 时,自动从当前页中获取 ScrollingView
demo.mp4

Gradle

repositories {
    maven { url "https://gitee.com/ezy/repo/raw/cosmo/"}
}
dependencies {
    implementation "me.reezy.cosmo:scrollinglayout:0.8.0"
}

布局属性

<declare-styleable name="ScrollingLayout_Layout">
    <!-- 对齐 -->
    <attr name="layout_gravity" format="enum">
        <enum name="left" value="1" />
        <enum name="right" value="2" />
        <enum name="center" value="3" />
    </attr>
    <!-- 吸顶模式 -->
    <attr name="layout_sticky" format="enum">
        <enum name="none" value="0" />
        <enum name="sticky" value="1" />
        <enum name="permanent" value="2" />
    </attr>
    <!-- 是否允许消费滚动距离,默认为 true -->
    <attr name="layout_allowScrolling" format="boolean" />
    <!-- 是否允许拦截触摸事件,默认为 true -->
    <attr name="layout_allowIntercept" format="boolean" />
    <!-- 是否允许接受嵌套滚动,默认为 true -->
    <attr name="layout_allowNestedScrolling" format="boolean" />
    <!-- 指定消费滚动距离的ScrollingView的视图 -->
    <attr name="layout_scrollingViewId" format="reference">
        <!-- 先找子视图,然后判断自己 -->
        <enum name="auto" value="0" />
        <!-- 仅判断自己 -->
        <enum name="self" value="-1" />
    </attr>
    <attr name="layout_scrollingViewResolver" format="string" />
</declare-styleable>

LICENSE

The Component is open-sourced software licensed under the Apache license.

scrollinglayout's People

Contributors

czy1121 avatar

Stargazers

Bill avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cybkw

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.