Giter Club home page Giter Club logo

gjeffectsample's Introduction

#GJEffectLib

某大型直播平台特效礼物动效引擎项目

#Features:

 支持Json动画格式解析
 支持动画数据网络下发,动态显示动画
支持图片的属性动画属性PropertyValuesHolder Keyframe
 支持Gif动画
 支持粒子重力动画

 三者结合实现复杂、绚丽的动画效果

#Using:

 动画实现使用GJEffectView控件实现。
 

GJEffectView mGJEffect = (GJEffectView) findViewById(R.id.live_gift_effect)

//加载网络动画数据
EffectGiftLoader.getInstance(this).loadDataForComposition("http://",
  	new EffectComposition.OnCompositionLoadedListener() {
  		@Override
  		public void onCompositionLoaded(EffectComposition composition) {
  			Log.e(TAG, "showGifEffect...loading EffectComposition:" + composition);
  			//开始显示动画
  			if (composition != null) {
  				//显示大额礼物动效
  				mGJEffect.setComposition(composition);
  				mGJEffect.setVisibility(View.VISIBLE);
  				mGJEffect.startAnimation(animatorListenerAdapter);
  			}
  		}
  	});


//加载sd卡动画数据
CompositionLoader compositionLoader = new CompositionLoader(this, 
		new EffectComposition.OnCompositionLoadedListener() {
  		@Override
  		public void onCompositionLoaded(EffectComposition composition) {
  			Log.e(TAG, "showGifEffect...loading EffectComposition:" + composition);
  			//开始显示动画
  			if (composition != null) {
  				//显示大额礼物动效
  				mGJEffect.setComposition(composition);
  				mGJEffect.setVisibility(View.VISIBLE);
  				mGJEffect.startAnimation(animatorListenerAdapter);
  			}
  		}
  	});
 compositionLoader.execute("/storage/emulated/0/Android/data/com.gj.effectsample/effect/yacht.zip");
  ```
 GJEffectSample 项目有示例动画压缩包"yacht.zip"文件

gjeffectsample's People

Contributors

lizheng98 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.