diff options
-rw-r--r-- | res/anim/slide_in_from_right.xml | 22 | ||||
-rw-r--r-- | res/anim/slide_out_to_right.xml | 22 | ||||
-rw-r--r-- | src/com/android/camera/panorama/PanoramaActivity.java | 9 |
3 files changed, 53 insertions, 0 deletions
diff --git a/res/anim/slide_in_from_right.xml b/res/anim/slide_in_from_right.xml new file mode 100644 index 0000000..567c2a1 --- /dev/null +++ b/res/anim/slide_in_from_right.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<translate xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:anim/decelerate_interpolator" + android:fromXDelta="100%" + android:toXDelta="0%" + android:duration="300"> +</translate> diff --git a/res/anim/slide_out_to_right.xml b/res/anim/slide_out_to_right.xml new file mode 100644 index 0000000..01a321b --- /dev/null +++ b/res/anim/slide_out_to_right.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<translate xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:anim/decelerate_interpolator" + android:fromXDelta="0%" + android:toXDelta="100%" + android:duration="300"> +</translate> diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java index f58b34d..a36ebc5 100644 --- a/src/com/android/camera/panorama/PanoramaActivity.java +++ b/src/com/android/camera/panorama/PanoramaActivity.java @@ -48,6 +48,8 @@ import android.os.Message; import android.util.Log; import android.view.View; import android.view.WindowManager; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; @@ -91,6 +93,7 @@ public class PanoramaActivity extends Activity implements private CaptureView mCaptureView; private MosaicRendererSurfaceView mMosaicView; private TextView mTooFastPrompt; + private Animation mSlideIn, mSlideOut; private ProgressDialog mProgressDialog; private String mPreparePreviewString; @@ -136,6 +139,10 @@ public class PanoramaActivity extends Activity implements mGeneratePanoramaString = getResources().getString(R.string.pano_dialog_generate_panorama); + Context context = getApplicationContext(); + mSlideIn = AnimationUtils.loadAnimation(context, R.anim.slide_in_from_right); + mSlideOut = AnimationUtils.loadAnimation(context, R.anim.slide_out_to_right); + mMainHandler = new Handler() { @Override public void handleMessage(Message msg) { @@ -345,6 +352,7 @@ public class PanoramaActivity extends Activity implements mStopCaptureButton.setVisibility(View.VISIBLE); mCaptureView.setVisibility(View.VISIBLE); mMosaicView.setVisibility(View.VISIBLE); + mPanoControlLayout.startAnimation(mSlideOut); mPanoControlLayout.setVisibility(View.GONE); } @@ -472,6 +480,7 @@ public class PanoramaActivity extends Activity implements mStopCaptureButton.setVisibility(View.GONE); mCaptureView.setVisibility(View.GONE); mPanoControlLayout.setVisibility(View.VISIBLE); + mPanoControlLayout.startAnimation(mSlideIn); mCaptureLayout.setVisibility(View.VISIBLE); mMosaicFrameProcessor.reset(); |