https://github.com/jenly1314/giftsurfaceview
🌷 直播间送礼物拼图案动画控件
https://github.com/jenly1314/giftsurfaceview
android animation effects gift giftview give hallostar holder live move room rose surface surfaceview
Last synced: about 1 month ago
JSON representation
🌷 直播间送礼物拼图案动画控件
- Host: GitHub
- URL: https://github.com/jenly1314/giftsurfaceview
- Owner: jenly1314
- Created: 2017-03-29T10:13:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-27T08:27:19.000Z (over 1 year ago)
- Last Synced: 2025-04-09T18:19:33.582Z (about 1 month ago)
- Topics: android, animation, effects, gift, giftview, give, hallostar, holder, live, move, room, rose, surface, surfaceview
- Language: Java
- Homepage:
- Size: 8.36 MB
- Stars: 239
- Watchers: 5
- Forks: 43
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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)GiftSurfaceView 最初出自于2014年开发HalloStar项目时所写,主要用于HalloStar项目直播间的送礼物动画。现在想来,那夕阳下的奔跑,是我逝去的青春。因高仿全民TV项目时想起,所以抽空整理了下,以此记录。
## Gif展示

> 你也可以直接下载 [演示App](https://raw.githubusercontent.com/jenly1314/GiftSurfaceView/master/app/app-release.apk) 体验效果
## 引入
### Gradle:
1. 在Project的 **build.gradle** 或 **setting.gradle** 中添加远程仓库
```gradle
repositories {
//...
mavenCentral()
maven { url 'https://jitpack.io' }
}
```2. 在Module的 **build.gradle** 里面添加引入依赖项
```gradle
implementation 'com.github.jenly1314:GiftSurfaceView:1.1.0'
```## 使用
代码示例
```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();
}}
```更多使用详情,请查看[app](app)中的源码使用示例或直接查看[API帮助文档](https://jitpack.io/com/github/jenly1314/GiftSurfaceView/latest/javadoc/)
## 赞赏
如果您喜欢GiftSurfaceView,或感觉GiftSurfaceView帮助到了您,可以点右上角“Star”支持一下,您的支持就是我的动力,谢谢 :smiley:您也可以扫描下面的二维码,请作者喝杯咖啡 :coffee:
![]()
## 关于我
| 我的博客 | GitHub | Gitee | CSDN | 博客园 |
|:------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------|
| Jenly's Blog | jenly1314 | jenly1314 | jenly121 | jenly |## 联系我
| 微信公众号 | Gmail邮箱 | QQ邮箱 | QQ群 | QQ群 |
|:-------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------|
| [Jenly666](http://weixin.qq.com/r/wzpWTuPEQL4-ract92-R) | jenly1314 | jenly1314 | 20867961 | 64020761 |
![]()