-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathActivityAnimation9.java
44 lines (35 loc) · 1.23 KB
/
ActivityAnimation9.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.xibei.personaldesign.itemDemo;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import com.xibei.personaldesign.R;
import com.xibei.personaldesign.itemDemoHelper.SetCircleView;
public class ActivityAnimation9 extends Activity implements View.OnClickListener {
SetCircleView setCircleView;
ObjectAnimator animator;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_item_animation_9);
setCircleView = findViewById(R.id.setCircleView);
findViewById(R.id.btn_01).setOnClickListener(this);
findViewById(R.id.btn_02).setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_01:
animator = ObjectAnimator.ofInt(setCircleView,"PointRadius",0,300,100);
animator.setDuration(2000);
animator.start();
break;
case R.id.btn_02:
if (animator!=null){
animator.cancel();
}
break;
default:
}
}
}