Giter Site home page Giter Site logo

scrolllayout's Introduction

ScrollLayout

Abstract 摘要

在ScrollView或者ListView里面使用ViewPager.支持手势上拉滑出,中途停顿,下滑退出页面,类似百度地图内场景抽屉拖拽效果效果

Gif 动画

1

Similar 类似使用

1 2 3

Demo 下载APK体验

Download Demo

Usage 使用方法

Step 1

Gradle 配置

dependencies {
    compile 'com.yinglan.scrolllayout:scrolllayout:1.0.2'
}

Step 2

Function and parameter definitions 功能与参数定义

ScrollLayout
ContentRecyclerView
ContentListView
ContentScrollView
配置参数 参数含义
allowHorizontalScroll 是否支持横向滚动
exitOffset 最低部退出状态时可看到的高度,0为不可见
isSupportExit 是否支持下滑退出,支持会有下滑到最底部时的回调
maxOffset 打开状态时内容显示区域的高度
minOffset 关闭状态时最上方预留高度
mode 位置状态,关闭、打开、底部

In layout

	    <com.yinglan.scrolllayout.ScrollLayout
	        xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/scroll_down_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#000000"

            app:allowHorizontalScroll="true"  //是否支持横向滚动
            app:exitOffset="0dp"              //最低部退出状态时可看到的高度,0为不可见
            app:isSupportExit="true"	      //是否支持下滑退出,支持会有下滑到最底部时的回调
            app:maxOffset="260dp"             //打开状态时内容显示区域的高度
            app:minOffset="50dp"              //关闭状态时最上方预留高度
            app:mode="open">                  //默认位置状态,关闭、打开、底部

or

In Java Code

	{
	    mScrollLayout.setMinOffset(0);
        mScrollLayout.setMaxOffset(800);
        mScrollLayout.setExitOffset(500);
        mScrollLayout.setToOpen();
        mScrollLayout.setIsSupportExit(true);
        mScrollLayout.setAllowHorizontalScroll(true);
        mScrollLayout.setOnScrollChangedListener(mOnScrollChangedListener);
    }

Other 其它

依赖内包含重写的ContentScrollView、ContentListView与ContentRecyclerView 可在ScrollLayout里面里面使用ViewPager等功能,配合使用效果更佳。 感谢Ted的库给的方向。

License

The work done has been licensed under Apache License 2.0. The license file can be found here. You can find out more about the license at:

http://www.apache.org/licenses/LICENSE-2.0

scrolllayout's People

Contributors

yinglannull avatar

Watchers

 avatar  avatar

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.