summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2009-05-28 20:24:08 -0700
committerOwen Lin <owenlin@google.com>2009-05-29 10:45:29 -0700
commit1d5babbd38027256b0241122483c3ec8b63011d1 (patch)
treebb3d5eac0988598538e148d41bd36560b24fb4f2 /src/com/android
parentbbc2f2f15a865cf0330cd78a6ea67177c5863b3b (diff)
downloadLegacyCamera-1d5babbd38027256b0241122483c3ec8b63011d1.zip
LegacyCamera-1d5babbd38027256b0241122483c3ec8b63011d1.tar.gz
LegacyCamera-1d5babbd38027256b0241122483c3ec8b63011d1.tar.bz2
Fix the order bug in ImageListUber and add unit test for ImageListUber.
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/camera/gallery/ImageListUber.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/camera/gallery/ImageListUber.java b/src/com/android/camera/gallery/ImageListUber.java
index d5e96c5..4962094 100644
--- a/src/com/android/camera/gallery/ImageListUber.java
+++ b/src/com/android/camera/gallery/ImageListUber.java
@@ -20,6 +20,7 @@ import com.android.camera.ImageManager;
import com.android.camera.Util;
import android.net.Uri;
+import android.util.Log;
import java.io.IOException;
import java.util.Arrays;
@@ -257,8 +258,10 @@ public class ImageListUber implements IImageList {
private static class DescendingComparator implements Comparator<MergeSlot> {
public int compare(MergeSlot m1, MergeSlot m2) {
+ Log.v(TAG, String.format(
+ "compare %s : %s", m1.mDateTaken, m2.mDateTaken ));
if (m1.mDateTaken != m2.mDateTaken) {
- return m1.mDateTaken < m2.mDateTaken ? -1 : 1;
+ return m1.mDateTaken < m2.mDateTaken ? 1 : -1;
}
return m1.mListIndex - m2.mListIndex;
}
@@ -267,6 +270,8 @@ public class ImageListUber implements IImageList {
private static class AscendingComparator implements Comparator<MergeSlot> {
public int compare(MergeSlot m1, MergeSlot m2) {
+ Log.v(TAG, String.format(
+ "compare %s : %s", m1.mDateTaken, m2.mDateTaken ));
if (m1.mDateTaken != m2.mDateTaken) {
return m1.mDateTaken < m2.mDateTaken ? -1 : 1;
}