本文写的这个特效,是关于聊天的,你肯定遇到过,就是你跟人家聊天的时候,比如发送应(么么哒),然后屏幕上全部就是表情了,今天我们就是做这个,撒花的特效,感兴趣的小伙伴们可以参考一下
先看看效果图吧

实现这样的效果,你要知道贝塞尔曲线,何谓贝塞尔曲线?先在这里打个问号
下面就直接写了
1.activity_main.xml
<RelativeLayout xmlns:android="http://www.easck.com/apk/res/android" xmlns:tools="http://www.easck.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > //撒花的区域 <RelativeLayout android:id="@+id/rlt_animation_layout" android:layout_width="match_parent" android:layout_height="match_parent" > </RelativeLayout> <Button android:id="@+id/btn_start" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="23dp" android:text="开始撒花" /> </RelativeLayout>
2.Fllower
传参类
package com.lgl.test;
import android.graphics.Bitmap;
import android.graphics.Path;
import java.io.Serializable;
public class Fllower implements Serializable {
private static final long serialVersionUID = 1L;
private Bitmap image;
private float x;
private float y;
private Path path;
private float value;
public Bitmap getResId() {
return image;
}
public void setResId(Bitmap img) {
this.image = img;
}
public float getX() {
return x;
}
public void setX(float x) {
this.x = x;
}
public float getY() {
return y;
}
public void setY(float y) {
this.y = y;
}
public Path getPath() {
return path;
}
public void setPath(Path path) {
this.path = path;
}
public float getValue() {
return value;
}
public void setValue(float value) {
this.value = value;
}
@Override
public String toString() {
return "Fllower [ x=" + x + ", y=" + y + ", path=" + path + ", value="
+ value + "]";
}
}










