summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/FilterUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/app/FilterUtils.java')
-rw-r--r--src/com/android/gallery3d/app/FilterUtils.java40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/com/android/gallery3d/app/FilterUtils.java b/src/com/android/gallery3d/app/FilterUtils.java
index 9b8ea2d62..c15457e7e 100644
--- a/src/com/android/gallery3d/app/FilterUtils.java
+++ b/src/com/android/gallery3d/app/FilterUtils.java
@@ -214,11 +214,6 @@ public class FilterUtils {
return "/cluster/{" + base + "}/" + kind;
}
- // Change the topmost filter to the specified type.
- public static String switchFilterPath(String base, int filterType) {
- return newFilterPath(removeOneFilterFromPath(base), filterType);
- }
-
// Change the topmost clustering to the specified type.
public static String switchClusterPath(String base, int clusterType) {
return newClusterPath(removeOneClusterFromPath(base), clusterType);
@@ -258,39 +253,4 @@ public class FilterUtils {
}
return sb.toString();
}
-
- // Remove the topmost filter (if any) from the path.
- private static String removeOneFilterFromPath(String base) {
- boolean[] done = new boolean[1];
- return removeOneFilterFromPath(base, done);
- }
-
- private static String removeOneFilterFromPath(String base, boolean[] done) {
- if (done[0]) return base;
-
- String[] segments = Path.split(base);
- if (segments[0].equals("filter") && segments[1].equals("mediatype")) {
- done[0] = true;
- return Path.splitSequence(segments[3])[0];
- }
-
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < segments.length; i++) {
- sb.append("/");
- if (segments[i].startsWith("{")) {
- sb.append("{");
- String[] sets = Path.splitSequence(segments[i]);
- for (int j = 0; j < sets.length; j++) {
- if (j > 0) {
- sb.append(",");
- }
- sb.append(removeOneFilterFromPath(sets[j], done));
- }
- sb.append("}");
- } else {
- sb.append(segments[i]);
- }
- }
- return sb.toString();
- }
}