Code Monkey home page Code Monkey logo

fallingview's Introduction

FallingView

FallingView可以实现碎片飘落效果的控件,默认的碎片是雪花图片,可以自定义碎片的图片,支持飘落的速度、碎片大小、碎片密度。Enjoy it O(∩_∩)O

image image2

build.gradle中引用

	compile 'com.dingmouren.fallingview:fallingview:1.0.2'

使用

xml中使用

   <com.dingmouren.fallingview.FallingView
        android:layout_width="match_parent"
        android:layout_height="300dp"
        app:fallingDelay="10"
        app:flakeDensity="100"
        app:flakeScale="3"
        app:flakeSrc="@drawable/img1"
        />

代码中使用

   mFallingView.setImageResource(R.drawable.img1);//设置碎片的图片,默认的图片是雪花
   mFallingView.setDensity(progress);//设置密度,数值越大,碎片越密集,默认值是80
   mFallingView.setScale(progress);//设置碎片的大小,数值越大,碎片越小,默认值是3
   mFallingView.setDelay(progress);//设置碎片飘落的速度,数值越大,飘落的越慢,默认值是10

FallingView可以单个使用,也可以包裹其他控件,比如:

   <com.dingmouren.fallingview.FallingView
        android:id="@+id/falling_view"
        android:layout_width="match_parent"
        android:layout_height="300dp"
       >
        <ImageView
            android:id="@+id/img"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            />
    </com.dingmouren.fallingview.FallingView>

欢迎大家提Issues.

fallingview's People

Contributors

dingmouren avatar

Watchers

James Cloos 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.