use of android.animation.ObjectAnimator in project platform_frameworks_base by android.
the class ViewLayersActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.view_layers);
setupList(R.id.list1);
setupList(R.id.list2);
setupList(R.id.list3);
getWindow().getDecorView().postDelayed(new Runnable() {
@Override
public void run() {
final View leftList = findViewById(R.id.list1);
final View middleList = findViewById(R.id.list2);
final View rightList = findViewById(R.id.list3);
final ObjectAnimator moveRight = ObjectAnimator.ofFloat(leftList, "x", 0, rightList.getLeft());
moveRight.setDuration(1500);
moveRight.setRepeatCount(ObjectAnimator.INFINITE);
moveRight.setRepeatMode(ObjectAnimator.REVERSE);
final ObjectAnimator moveLeft = ObjectAnimator.ofFloat(rightList, "x", rightList.getLeft(), 0);
moveLeft.setDuration(1500);
moveLeft.setRepeatCount(ObjectAnimator.INFINITE);
moveLeft.setRepeatMode(ObjectAnimator.REVERSE);
final ObjectAnimator rotate = ObjectAnimator.ofFloat(middleList, "rotationY", 0, 360);
rotate.setDuration(3000);
rotate.setRepeatCount(ObjectAnimator.INFINITE);
rotate.setRepeatMode(ObjectAnimator.REVERSE);
Paint p = new Paint();
p.setColorFilter(new PorterDuffColorFilter(0xffff0000, PorterDuff.Mode.MULTIPLY));
Paint p2 = new Paint();
p2.setAlpha(127);
Paint p3 = new Paint();
p3.setColorFilter(new PorterDuffColorFilter(0xff00ff00, PorterDuff.Mode.MULTIPLY));
leftList.setLayerType(View.LAYER_TYPE_SOFTWARE, p);
leftList.setAlpha(0.5f);
middleList.setLayerType(View.LAYER_TYPE_HARDWARE, p3);
middleList.setAlpha(0.5f);
middleList.setVerticalFadingEdgeEnabled(true);
rightList.setLayerType(View.LAYER_TYPE_SOFTWARE, p2);
moveRight.start();
moveLeft.start();
rotate.start();
((View) leftList.getParent()).setAlpha(0.5f);
}
}, 2000);
}
use of android.animation.ObjectAnimator in project platform_frameworks_base by android.
the class ViewPropertyAlphaActivity method startAnim.
private void startAnim(View target) {
ObjectAnimator anim = ObjectAnimator.ofFloat(target, View.ALPHA, 0);
anim.setRepeatCount(ValueAnimator.INFINITE);
anim.setRepeatMode(ValueAnimator.REVERSE);
anim.setDuration(1000);
anim.start();
}
use of android.animation.ObjectAnimator in project platform_frameworks_base by android.
the class Animated3dActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ImageView view = new ImageView(this);
view.setImageResource(R.drawable.large_photo);
setContentView(view, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
ObjectAnimator animator = ObjectAnimator.ofFloat(view, "rotationY", 0.0f, 360.0f);
animator.setDuration(4000);
animator.setRepeatCount(ObjectAnimator.INFINITE);
animator.setRepeatMode(ObjectAnimator.REVERSE);
animator.start();
}
use of android.animation.ObjectAnimator in project platform_frameworks_base by android.
the class ClipOutlineActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final RegionView group = new RegionView(this);
final TextView text = new TextView(this);
text.setText(buildText());
group.addView(text);
setContentView(group);
ObjectAnimator animator = ObjectAnimator.ofFloat(group, "clipPosition", 0.0f, 1.0f);
animator.setDuration(3000);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setRepeatMode(ValueAnimator.REVERSE);
animator.start();
}
use of android.animation.ObjectAnimator in project platform_frameworks_base by android.
the class ScaledTextActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final ScaledTextView view = new ScaledTextView(this);
setContentView(view);
ObjectAnimator animation = ObjectAnimator.ofFloat(view, "textScale", 1.0f, 10.0f);
animation.setDuration(3000);
animation.setRepeatCount(ObjectAnimator.INFINITE);
animation.setRepeatMode(ObjectAnimator.REVERSE);
animation.start();
}
Aggregations