# GiftSurfaceView
**Repository Path**: ThinkingAndroid/GiftSurfaceView
## Basic Information
- **Project Name**: GiftSurfaceView
- **Description**:  直播间送礼物拼图案动画控件
- **Primary Language**: Android
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 7
- **Created**: 2019-09-21
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# GiftSurfaceView
[](https://raw.githubusercontent.com/jenly1314/GiftSurfaceView/master/app/app-release.apk)
[](https://jitpack.io/#jenly1314/GiftSurfaceView)
[](https://android-arsenal.com/api?level=15)
[](https://opensource.org/licenses/mit-license.php)
[](http://blog.csdn.net/jenly121)
[](http://shang.qq.com/wpa/qunwpa?idkey=8fcc6a2f88552ea44b1411582c94fd124f7bb3ec227e2a400dbbfaad3dc2f5ad)
GiftSurfaceView 最初出自于2014年开发HalloStar项目时所写,主要用于HalloStar项目直播间的送礼物动画。现在想来,那夕阳下的奔跑,是我逝去的青春。因高仿全民TV项目时想起,所以抽空整理了下,以此记录。
## Gif展示

## 引入
### Maven:
```maven
  com.king.view
  giftsurfaceview
  1.1.0
  pom
```
### Gradle:
```gradle
compile 'com.king.view:giftsurfaceview:1.1.0'
```
### Lvy:
```lvy
  
```
###### 如果Gradle出现compile失败的情况,可以在Project的build.gradle里面添加如下:(也可以使用上面的GitPack来complie)
```gradle
allprojects {
    repositories {
        maven { url 'https://dl.bintray.com/jenly/maven' }
    }
}
```
### 示例
```Java
    public void updateGiftSurfaceView(int type){
        frame.removeAllViews();
        GiftSurfaceView giftSurfaceView = new GiftSurfaceView(context);
        if(type == RANDOM){
            giftSurfaceView.setImageResource(R.drawable.rose);
        }else{
            giftSurfaceView.setImageBitmap(bitmap,.5f);
        }
        giftSurfaceView.setPointScale(1,width/10,(int)(height/3.8f));
        giftSurfaceView.setRunTime(10000);
        try {
            switch (type){
                case RANDOM:
                    giftSurfaceView.setRandomPoint(9);
                    break;
                case V:
                    giftSurfaceView.setListPoint(PointUtils.getListPointByResourceJson(context,ASSET_V),true);
                    break;
                case HEART:
                    giftSurfaceView.setListPoint(PointUtils.getListPointByResourceJson(context,ASSET_HEART),true);
                    break;
                case LOVE:
                    giftSurfaceView.setListPoint(PointUtils.getListPointByResourceJson(context,ASSET_LOVE));
                    break;
                case SMILE:
                    giftSurfaceView.setListPoint(PointUtils.getListPointByResourceJson(context,ASSET_SMILE));
                    break;
                case X:
                    giftSurfaceView.setListPoint(PointUtils.getListPointByResourceJson(context,ASSET_X));
                    break;
                case V520:
                    giftSurfaceView.setListPoint(PointUtils.getListPointByResourceJson(context,ASSET_V520));
                    break;
                case V1314:
                    giftSurfaceView.setRunTime(GiftSurfaceView.LONG_TIME);
                    giftSurfaceView.setListPoint(PointUtils.getListPointByResourceJson(context,ASSET_V1314));
                    break;
            }
            frame.addView(giftSurfaceView);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
```
以上为部分代码使用示例,更多详情请下载查看。
## 赞赏
如果您喜欢GiftSurfaceView,或感觉GiftSurfaceView帮助到了您,可以点右上角“Star”支持一下,您的支持就是我的动力,谢谢 :smiley:
您也可以扫描下面的二维码,请作者喝杯咖啡 :coffee:
    
## 关于我
   Name: Jenly
   Email: jenly1314#gmail.com / jenly1314#vip.qq.com
   CSDN: jenly121
   Github: jenly1314
   加入QQ群: 20867961