代码:
- package com.android.shake; import android.app.Activity;
- import android.os.Bundle; import android.util.DisplayMetrics;
- import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener;
- import android.view.animation.RotateAnimation; import android.widget.TextView;
- import android.view.View; import android.view.Window;
- public class ShakeTestActivity extends Activity implements View.OnClickListener { private TextView mtv0;
- private TextView mtv1; private TextView mtv2;
- private TextView mtv3; private TextView mtv4;
- private TextView mtv5; private TextView mtv6;
- private TextView mtv7; private TextView mtv8;
- private TextView mtv9; private TextView mtv10;
- private TextView mtv11; private TextView mtv12;
- private TextView mtv13; private TextView mtv14;
- private TextView mtv15; private TextView mtv16;
- private TextView mtv17; private TextView mtv18;
- private TextView mtv19; private boolean mNeedShake = false;
- private boolean mStartShake = false; private static final int ICON_WIDTH = 80;
- private static final int ICON_HEIGHT = 94; private static final float DEGREE_0 = 1.8f;










