[add] 贝塞尔曲线动画window层添加

This commit is contained in:
liujing
2020-12-30 11:24:46 +08:00
parent 7f540a14d8
commit eff01b24fb
4 changed files with 86 additions and 3 deletions

View File

@@ -73,11 +73,27 @@ public class BezierAnimationView extends RelativeLayout implements View.OnClickL
runnable.run();
}
public void bezierAnimationStart(){
runnable = new Runnable() {
@Override
public void run() {
try {
Log.d("点赞--", "");
bezierAnimation(resource);
handler.postDelayed(this, 500);
} catch (Exception e) {
e.printStackTrace();
}
}
};
runnable.run();
}
private void bezierAnimation(int resource) {
final ImageView imageView = new ImageView(context);
imageView.setBackgroundResource(animation_drawable[resource]);
RelativeLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.addRule(ALIGN_BOTTOM);
// params.addRule(ALIGN_BOTTOM);
params.addRule(CENTER_HORIZONTAL);
imageView.setLayoutParams(params);
addView(imageView);

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#890">
<com.mogo.module.common.animation.BezierAnimationView
android:id="@+id/bezier_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#7810" />
</RelativeLayout>