diff options
author | ztenghui <ztenghui@google.com> | 2013-10-15 15:31:00 -0700 |
---|---|---|
committer | ztenghui <ztenghui@google.com> | 2013-10-21 10:27:55 -0700 |
commit | 56e44af257d65d730f04d1e90c87f5674abd7f26 (patch) | |
tree | 68360ebbdebaaa0c6f83ef6c7191f9932fcdc88a /src/com/android/camera/ui | |
parent | 891a80756166a8621f063c727000c9a943cf5465 (diff) | |
download | android_packages_apps_Snap-56e44af257d65d730f04d1e90c87f5674abd7f26.tar.gz android_packages_apps_Snap-56e44af257d65d730f04d1e90c87f5674abd7f26.tar.bz2 android_packages_apps_Snap-56e44af257d65d730f04d1e90c87f5674abd7f26.zip |
Don't call onCurrentDataChanged for CameraPreview when reloading.
In this case, camera preview didn't change, so there is no need to call
onCurrentDataChanged.
bug:11237255
Change-Id: I788a2ee4e7337721d0bbd6aa75e7da6d382bf282
Diffstat (limited to 'src/com/android/camera/ui')
-rw-r--r-- | src/com/android/camera/ui/FilmStripView.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java index 564dd5d13..c95f07c35 100644 --- a/src/com/android/camera/ui/FilmStripView.java +++ b/src/com/android/camera/ui/FilmStripView.java @@ -1906,10 +1906,19 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener { mController.stopScrolling(true); mController.stopScale(); mDataIdOnUserScrolling = 0; - // Remove all views from the mViewItem buffer, except the camera view. + // Reload has a side effect that after this call, it will show the + // camera preview. So we want to know whether it starts from the camera + // preview to decide whether we need to call onDataFocusChanged. + boolean stayInPreview = false; + if (mListener != null && mViewItem[mCurrentItem] != null) { - mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), false); + stayInPreview = mViewItem[mCurrentItem].getId() == 0; + if (!stayInPreview) { + mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), false); + } } + + // Remove all views from the mViewItem buffer, except the camera view. for (int i = 0; i < mViewItem.length; i++) { if (mViewItem[i] == null) { continue; @@ -1950,7 +1959,9 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener { if (mListener != null) { mListener.onReload(); - mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), true); + if (!stayInPreview) { + mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), true); + } } } |