Git Product home page Git Product logo

curtainview's Introduction

CurtainView

The CurtainView is much like a layer on the top level of your layout. It's also a container which can wrap other Views.

And it will not block the actions of the child view unless you make a standard pull event.

The MotionEvent handling is base on chrisbanes' library : https://github.com/chrisbanes/Android-PullToRefresh.

image

image

How to Use

Some simple configs:

<com.movitech.aicaprio.CurtainView
    xmlns:curtainView="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="top"
    curtainView:curtainGravity="top"
    curtainView:curtainStatus="closed"
    curtainView:reboundMode="half"
    curtainView:scrollDuration="1300" >

    <ImageView
        android:id="@id/iv1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:src="@drawable/ic_pull" />
</com.movitech.aicaprio.CurtainView>

"curtainView:curtainGravity": The visual gravity of CurtainView.

"curtainView:curtainStatus": Whether the CurtainView is opend or closed.

"curtainView:reboundMode": After lift the finger off the CurtainView,how will it scroll to.

"curtainView:scrollDuration:": The scrolling duration after lift the finger off CurtainView.

There is one noteworthy attribute:"curtainView:fixedValue",which determines the minimum hegiht or width appears on scrren,and it's default value is one third of the CurtainView's width or height(depends on current gravity).

Usually we set this in codes.For example in upper case, I want only the ImageView appears when the CurtainView is closed,so we just need to set the fixedValue to be the ImageView's height:

curtainView.post(new Runnable() {
@Override
	public void run() {
		curtainView.setCurtainGravityAndFixedValue(null,imageView.getHeight());
	}
});

curtainview's People

Contributors

aicaprio avatar

Watchers

 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.