| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.android.test.hwui; |
| 18 |
|
| 19 |
import android.animation.ObjectAnimator; |
| 20 |
import android.app.Activity; |
| 21 |
import android.content.Context; |
| 22 |
import android.graphics.Bitmap; |
| 23 |
import android.graphics.BitmapFactory; |
| 24 |
import android.graphics.Camera; |
| 25 |
import android.graphics.Canvas; |
| 26 |
import android.graphics.Matrix; |
| 27 |
import android.os.Bundle; |
| 28 |
import android.view.View; |
| 29 |
import android.widget.FrameLayout; |
| 30 |
import android.widget.ImageView; |
| 31 |
|
| 32 |
@SuppressWarnings({"UnusedDeclaration"}) |
| 33 |
public class Animated3dActivity extends Activity { |
| 34 |
@Override |
| 35 |
protected void onCreate(Bundle savedInstanceState) { |
| 36 |
super.onCreate(savedInstanceState); |
| 37 |
|
| 38 |
ImageView view = new ImageView(this); |
| 39 |
view.setImageResource(R.drawable.large_photo); |
| 40 |
|
| 41 |
setContentView(view, new FrameLayout.LayoutParams( |
| 42 |
FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT |
| 43 |
)); |
| 44 |
|
| 45 |
ObjectAnimator animator = ObjectAnimator.ofFloat(view, "rotationY", 0.0f, 360.0f); |
| 46 |
animator.setDuration(4000); |
| 47 |
animator.setRepeatCount(ObjectAnimator.INFINITE); |
| 48 |
animator.setRepeatMode(ObjectAnimator.REVERSE); |
| 49 |
animator.start(); |
| 50 |
} |
| 51 |
} |