summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/FilmStripView.java
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2013-10-13 19:26:02 -0700
committerAngus Kong <shkong@google.com>2013-10-13 19:26:02 -0700
commit02cafdfb92a2d53b76c2bb180ee5289a80f4f4ac (patch)
tree69f4f95615b05fc844db684ee299c13932b5751c /src/com/android/camera/ui/FilmStripView.java
parent2d5c74785d19f1944cab92948a6fa8233086ebc1 (diff)
downloadandroid_packages_apps_Snap-02cafdfb92a2d53b76c2bb180ee5289a80f4f4ac.tar.gz
android_packages_apps_Snap-02cafdfb92a2d53b76c2bb180ee5289a80f4f4ac.tar.bz2
android_packages_apps_Snap-02cafdfb92a2d53b76c2bb180ee5289a80f4f4ac.zip
Workaround to prevent the data focus callback.
bug:11205669 Change-Id: I5b2d33422ec5f6fe21c81e39d24f36ec8b61ce4e
Diffstat (limited to 'src/com/android/camera/ui/FilmStripView.java')
-rw-r--r--src/com/android/camera/ui/FilmStripView.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java
index 19ff4d2ad..5de2d7cff 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -343,10 +343,10 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
* The callback when the item is centered/off-centered.
*
* @param dataID The ID of the image data.
- * @param current {@code true} if the data is the current one.
+ * @param focused {@code true} if the data is focused.
* {@code false} otherwise.
*/
- public void onCurrentDataChanged(int dataID, boolean current);
+ public void onDataFocusChanged(int dataID, boolean focused);
/**
* Toggles the visibility of the ActionBar.
@@ -894,7 +894,7 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
// Going to change the current item, notify the listener.
if (mListener != null) {
- mListener.onCurrentDataChanged(mViewItem[mCurrentItem].getId(), false);
+ mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), false);
}
final int adjust = nearest - mCurrentItem;
if (adjust > 0) {
@@ -927,7 +927,7 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
}
invalidate();
if (mListener != null) {
- mListener.onCurrentDataChanged(mViewItem[mCurrentItem].getId(), true);
+ mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), true);
}
}
@@ -1056,6 +1056,13 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
// If this is a photo sphere, show the button to view it. If it's a full
// 360 photo sphere, show the tiny planet button.
+ if (data.getViewType() == ImageData.VIEW_TYPE_STICKY) {
+ // This is a workaround to prevent an unnecessary update of
+ // PhotoSphere metadata which fires a data focus change callback
+ // at a weird timing.
+ return;
+ }
+ // TODO: Remove this from FilmstripView as it breaks the design.
data.isPhotoSphere(mActivity, new PanoramaSupportCallback() {
@Override
public void panoramaInfoAvailable(final boolean isPanorama,
@@ -1063,7 +1070,9 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
// Make sure the returned data is for the current image.
if (requestId == getCurrentId()) {
if (mListener != null) {
- mListener.onCurrentDataChanged(requestId, true);
+ // TODO: Remove this hack since there is no data focus
+ // change actually.
+ mListener.onDataFocusChanged(requestId, true);
}
mBottomControls.setViewPhotoSphereButtonVisibility(isPanorama);
mBottomControls.setTinyPlanetButtonVisibility(isPanorama360);
@@ -1833,7 +1842,7 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
mDataIdOnUserScrolling = 0;
// Remove all views from the mViewItem buffer, except the camera view.
if (mListener != null && mViewItem[mCurrentItem] != null) {
- mListener.onCurrentDataChanged(mViewItem[mCurrentItem].getId(), false);
+ mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), false);
}
for (int i = 0; i < mViewItem.length; i++) {
if (mViewItem[i] == null) {
@@ -1874,7 +1883,7 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
invalidate();
if (mListener != null) {
- mListener.onCurrentDataChanged(mViewItem[mCurrentItem].getId(), true);
+ mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), true);
}
}