GithubHelp home page GithubHelp logo

sheetbehavior's Introduction

SheetBehavior

在BottomSheetBehavior(version 27.1.1)的基础上扩展支持上下左右四个方向

实现效果

##SheetBehavior的使用 SheetBehavior 使用需要CoordinatorLayout作为父布局,SheetBehavior 的布局作为CoordinatorLayout 的子布局,并且加上app:behavior=”com.android.sheetbehavior.SheetBehavior”

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/coordinator"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <FrameLayout
        android:id="@+id/design_sheet"
        app:layout_behavior="com.android.sheetbehavior.SheetBehavior"
        app:peekHeight="50dp"
        app:slideMode="right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</android.support.design.widget.CoordinatorLayout

SheetBehavior 在Dialog中的使用,实现可拖动关闭的Dailog:

只需要将你的dialog 继承自BaseSheetDialog即可,实现滑动方向即可

SheetBehavior 在Dialog中的使用,实现可拖动关闭的Dailog:

如果你想让你的Avtivity 实现类似IOS滑动关闭Activity, 只需要继承BaseSheetActivity 即可, 指定滑动方向。

sheetbehavior's People

Contributors

renshuangbiao avatar

Stargazers

 avatar Ming Wang avatar  avatar  avatar

Watchers

 avatar

Forkers

jamine66 mflisar

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.