All Projects → hidaron → HiPraiseAnimation

hidaron / HiPraiseAnimation

Licence: other
直播点赞动画实现,异步线程绘制动画,妈妈再也不担心UI卡顿了

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to HiPraiseAnimation

AstroSmash
Port the AstroSmash game from Java ME (J2ME) MIDlet to Android OS using SurfaceView Canvas drawing.
Stars: ✭ 19 (-79.79%)
Mutual labels:  surfaceview
Meiwidgetview
🔥一款汇总了郭霖,鸿洋,以及自己平时收集的自定义控件集合库(小红书)
Stars: ✭ 2,060 (+2091.49%)
Mutual labels:  surfaceview
Smartopencv
🔥 🔥 🔥 SmartOpenCV是一个OpenCV在Android端的增强库,解决了OpenCV Android SDK在图像预览方面存在的诸多问题,且无需修改OpenCV SDK源码,与OpenCV的SDK解耦
Stars: ✭ 1,869 (+1888.3%)
Mutual labels:  surfaceview
Yjplay
一个支持自定义UI布局,流式API, 加密,直播 ,亮度,音量,快进等手势 ,广告视频预览,多种加载模式 ,多种分辨率切换 ,多种封面图, 自定义数据源,列表播放,倍数播放,边播变缓存<font color="red">不是使用AndroidVideoCache</font>,离线播放,神奇的播放器
Stars: ✭ 1,700 (+1708.51%)
Mutual labels:  surfaceview
Playerbase
The basic library of Android player will process complex business components. The access is simple。Android播放器基础库,专注于播放视图组件的高复用性和组件间的低耦合,轻松处理复杂业务。
Stars: ✭ 2,814 (+2893.62%)
Mutual labels:  surfaceview
PulseInstrument
脉象仪 波形实时绘制 Demo
Stars: ✭ 30 (-68.09%)
Mutual labels:  surfaceview
FrameSurfaceView
play frame animation by SurfaceView. Get rid of OOM due to complex frame animation and could play frame animation smoothly with huge frame image(1MB)
Stars: ✭ 80 (-14.89%)
Mutual labels:  surfaceview
AnimCubeAndroid
Rubik's Cube rendering and interaction library for Android.
Stars: ✭ 57 (-39.36%)
Mutual labels:  surfaceview

HiPraiseAnimation

一个可以在异步线程绘制点赞动画(不仅是)的库,可以实现映客直播直播间的点赞效果,它支持使用SurfaceView或者TextureView来绘制,当然,也可以是用View在UI线程绘制动画
。动画的绘制和绘制的过程分离,可以支持任意的动画实现。这里还附带点小福利,这里包含了一个点赞动画的实现,使用了三阶赛贝尔曲线来描述动画的运行 轨迹。

image

怎么使用(超级简单)

1.首先把View添加到布局中

  <org.limlee.hipraiseanimationlib.HiPraiseAnimationView
        android:id="@+id/praise_animation"
        android:layout_width="200dp"
        android:layout_height="400dp"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"/>

2.要在适当的时机启动动画的绘制,例如在Activity的OnResume()和OnStop()中开启和关闭动画的绘制

    @Override
    protected void onResume() {
        super.onResume();
        mHiPraiseAnimationView.start(); //添加点赞动画之前要先开始启动绘制,如果没有,是添加不了任何的动画对象
    }

    @Override
    protected void onStop() {
        super.onStop();
        mHiPraiseAnimationView.stop(); //停止绘制点赞动画,停止后会clear掉整个画布和清空掉所有绘制的对象
    }

3.最后,可以添加动画(点赞)对象了,支持下面两个方式

1.普通的添加方法

    /**
     * 添加点赞动画,没有绘制结果的回调
     */
    private void addPraise() {
        final IPraise hiPraise = new HiPraise(getHeartBitmap());
        mHiPraiseAnimationView.addPraise(hiPraise);
    }

2.带有动画绘制结束回调的添加方法

    /**
     * 添加具有回调的点赞动画
     */
    private void addPraiseWithCallback() {
        final IPraise hiPraiseWithCallback = new HiPraiseWithCallback(getHeartBitmap(),
                new OnDrawCallback() {
                    @Override
                    public void onFinish() {
                        Log.d(TAG, "绘制完成了!");
                    }
                });
        mHiPraiseAnimationView.addPraise(hiPraiseWithCallback);
    }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].