From ccb7f0cd98d431bda93abf9ed6427f0d18dc01d1 Mon Sep 17 00:00:00 2001 From: Chao Zhang Date: Tue, 22 Mar 2016 14:12:44 +0800 Subject: Gallery2: fix actionbar display abnormal return from photo edit. PhotoPage start a new activity state after edit a photo and return in TimeLinePage, Add a judgement to avoid it. Change-Id: Ic0f9cbdcdaa9e5d15cbd55d75423e0d761b8cd89 CRs-Fixed: 981010 --- src/com/android/gallery3d/app/FilterUtils.java | 4 ++++ src/com/android/gallery3d/app/PhotoPage.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/gallery3d/app/FilterUtils.java b/src/com/android/gallery3d/app/FilterUtils.java index bc28a9cc1..430f83b34 100644 --- a/src/com/android/gallery3d/app/FilterUtils.java +++ b/src/com/android/gallery3d/app/FilterUtils.java @@ -215,6 +215,10 @@ public class FilterUtils { return "/cluster/{" + base + "}/" + kind; } + public static boolean isClusterPath(String path) { + return path != null && path.startsWith("/cluster/{"); + } + // Change the topmost clustering to the specified type. public static String switchClusterPath(String base, int clusterType) { return newClusterPath(removeOneClusterFromPath(base), clusterType); diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index f31e188a1..64df1ea64 100755 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -1326,7 +1326,8 @@ public abstract class PhotoPage extends ActivityState implements if (albumPath == null) { return; } - if (!albumPath.equalsIgnoreCase(mOriginalSetPathString)) { + boolean isClusterType = FilterUtils.isClusterPath(mOriginalSetPathString); + if (!albumPath.equalsIgnoreCase(mOriginalSetPathString) && !isClusterType) { // If the edited image is stored in a different album, we need // to start a new activity state to show the new image Bundle data = new Bundle(getData()); -- cgit v1.2.3