blob: f632c8372c35310810e25e77bb49a62650eaaced [file] [log] [blame]
Romain Guy47b8ade2011-02-23 19:46:33 -08001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.test.hwui;
18
19import android.animation.ObjectAnimator;
20import android.app.Activity;
21import android.content.Context;
22import android.graphics.Bitmap;
23import android.graphics.BitmapFactory;
24import android.graphics.Camera;
25import android.graphics.Canvas;
26import android.graphics.Matrix;
27import android.os.Bundle;
28import android.view.View;
29import android.widget.FrameLayout;
30import android.widget.ImageView;
31
32@SuppressWarnings({"UnusedDeclaration"})
33public 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}