diff options
author | Doris Liu <tianliu@google.com> | 2013-12-06 18:11:51 -0800 |
---|---|---|
committer | Doris Liu <tianliu@google.com> | 2013-12-06 18:16:34 -0800 |
commit | b7d3ce145dd7b1cf0ac51f53d5bc73dbbf35f6e6 (patch) | |
tree | 3f867bb9272d05d026f6a087eee885b3f3e243f0 | |
parent | b15eb56aefa6dc6a185aa62cba408d853ff4e6bb (diff) | |
download | android_packages_apps_Camera2-b7d3ce145dd7b1cf0ac51f53d5bc73dbbf35f6e6.tar.gz android_packages_apps_Camera2-b7d3ce145dd7b1cf0ac51f53d5bc73dbbf35f6e6.tar.bz2 android_packages_apps_Camera2-b7d3ce145dd7b1cf0ac51f53d5bc73dbbf35f6e6.zip |
Refining shimmy
Bug: 11858581
Change-Id: I7eefc5189caefc6d23d2dbbca243632db716b0c3
-rw-r--r-- | res/layout/activity_main.xml | 1 | ||||
-rw-r--r-- | res/layout/camera.xml | 8 | ||||
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 3 | ||||
-rw-r--r-- | src/com/android/camera/ui/ModeListView.java | 14 |
4 files changed, 23 insertions, 3 deletions
diff --git a/res/layout/activity_main.xml b/res/layout/activity_main.xml index 1617750a8..dc27eb244 100644 --- a/res/layout/activity_main.xml +++ b/res/layout/activity_main.xml @@ -31,6 +31,5 @@ android:visibility="gone" android:layout_width="match_parent" android:layout_height="match_parent" /> - <include layout="@layout/mode_list_layout" /> </com.android.camera.ui.MainActivityLayout> diff --git a/res/layout/camera.xml b/res/layout/camera.xml index 6f1c11143..90060c743 100644 --- a/res/layout/camera.xml +++ b/res/layout/camera.xml @@ -13,9 +13,15 @@ See the License for the specific language governing permissions and limitations under the License. --> +<!-- TODO: Now camera root gets cleared during mode switch. We need to move mode + switcher into camera root when refactor is finished. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/camera_app_root" android:layout_width="match_parent" android:layout_height="match_parent" > + <FrameLayout + android:id="@+id/camera_app_root" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + <include layout="@layout/mode_list_layout" /> </FrameLayout> diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index 14a55b00f..0735d2091 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -149,6 +149,7 @@ public class CameraActivity extends Activity private static final int MSG_CLEAR_SCREEN_ON_FLAG = 2; private static final long SHOW_ACTION_BAR_TIMEOUT_MS = 3000; private static final long SCREEN_DELAY_MS = 2 * 60 * 1000; // 2 mins. + private static final int SHIMMY_DELAY_MS = 1000; /** * Whether onResume should reset the view to the preview. @@ -1377,6 +1378,7 @@ public class CameraActivity extends Activity if (mResetToPreviewOnResume) { // Go to the preview on resume. mFilmstripController.goToFirstItem(); + mModeListView.startAccordionAnimationWithDelay(SHIMMY_DELAY_MS); } // Default is showing the preview, unless disabled by explicitly // starting an activity we want to return from to the filmstrip rather @@ -1396,7 +1398,6 @@ public class CameraActivity extends Activity keepScreenOnForAWhile(); - mModeListView.startAccordionAnimation(); } @Override diff --git a/src/com/android/camera/ui/ModeListView.java b/src/com/android/camera/ui/ModeListView.java index 17952185e..edc0d1780 100644 --- a/src/com/android/camera/ui/ModeListView.java +++ b/src/com/android/camera/ui/ModeListView.java @@ -400,6 +400,20 @@ public class ModeListView extends ScrollView { } /** + * This starts the accordion animation with a delay. + * + * @param delay delay in milliseconds before starting animation + */ + public void startAccordionAnimationWithDelay(int delay) { + postDelayed(new Runnable() { + @Override + public void run() { + startAccordionAnimation(); + } + }, delay); + } + + /** * Resets the visible width of all the mode selectors to 0. */ private void resetModeSelectors() { |