1 |
package dk.thoerup.side9; |
2 |
|
3 |
|
4 |
import java.io.Serializable; |
5 |
import java.util.Comparator; |
6 |
|
7 |
import android.graphics.Bitmap; |
8 |
|
9 |
//Needs to be serializable do send it between PictureOverview and PictureView activities |
10 |
//btw. Bitmap objects are not serializable |
11 |
public class ImageEntry implements Serializable { |
12 |
private static final long serialVersionUID = 1L; |
13 |
|
14 |
public String path; |
15 |
transient public Bitmap thumb; //do not serialize |
16 |
public String caption; |
17 |
|
18 |
|
19 |
public static class PathComparator implements Comparator<ImageEntry> { |
20 |
@Override |
21 |
public int compare(ImageEntry object1, ImageEntry object2) { |
22 |
return object1.path.compareTo(object2.path) * -1; |
23 |
} |
24 |
} |
25 |
|
26 |
public static class CaptionComparator implements Comparator<ImageEntry> { |
27 |
@Override |
28 |
public int compare(ImageEntry object1, ImageEntry object2) { |
29 |
return object1.caption.compareTo( object2.caption ); |
30 |
} |
31 |
|
32 |
} |
33 |
|
34 |
} |