GiftRainView

by xujinyang

xujinyang / GiftRainView

还记得有一招从天而降的功夫?GiftRainView,一个用来下金币,下红包的View

126 Stars 33 Forks Last release: Not found 11 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

GiftRainView

还记得有一招从天而降的功夫?GiftRainView,一个用来下金币,下红包的View

直接看效果

Usage

Step 1

Install with gradle
    dependencies {
        compile 'com.xujinyang.GiftRainView:library:1.3.0'
    }

Step 2

  

attrs:

| 参数 | 类型 |含义| |--------|--------|--------| |giftbackground|color|背景颜色| |giftcount|integer|屏幕内物体数量| |giftspeed|integer|物体移动最小速度| |giftmaxsize|float|最大的物体比例| |giftmin_size|float|最小的物体比例|

Step 3

public class MainActivity extends Activity {
    private GiftRainView giftRainView;
    private boolean isStart;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    giftRainView = (GiftRainView) findViewById(R.id.dropview);
    giftRainView.setImages(R.mipmap.ico_money, R.mipmap.ico_gold_money);
    startRain();

}

如果想要动画停止有俩个方式
  1. 等界面上所有的物体掉落完了之后,停止。 giftRainView.stopRainDely();
  2. 立马停止动画,清空界面 giftRainView.stiopRainNow();

License

GiftRainView is opensource, contribution and feedback are welcomed

Apache Version 2.0

Copyright 2015 Supercharge

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About me

CSDN

weibo

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.