seekbar 拖动改变图片透明度,到达最大值时,执行旋转动画。
mSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
float pro = (float) (progress / 360.0);
mImageview.setAlpha(pro);
if (progress == 360) {
Animator rotationYAnimator = ObjectAnimator.ofFloat(mImageview, "rotationY", 0, 360);
rotationYAnimator.setDuration(3333);
rotationYAnimator.start();
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
最终效果