diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2013-08-04 03:31:13 +0200 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2013-08-04 03:31:13 +0200 |
commit | 9a4d4f244d9e2d24295bf89c2bbb01610aa33899 (patch) | |
tree | 414a960db501ce996fdbbfa5adfdd0b609009d8b /src/org/cyanogenmod/wallpapers/photophase/model | |
parent | 434604db80a43302c96cca812928234528518117 (diff) | |
download | android_packages_wallpapers_PhotoPhase-9a4d4f244d9e2d24295bf89c2bbb01610aa33899.tar.gz android_packages_wallpapers_PhotoPhase-9a4d4f244d9e2d24295bf89c2bbb01610aa33899.tar.bz2 android_packages_wallpapers_PhotoPhase-9a4d4f244d9e2d24295bf89c2bbb01610aa33899.zip |
Disposition Preference Layout (#1)
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/org/cyanogenmod/wallpapers/photophase/model')
-rw-r--r-- | src/org/cyanogenmod/wallpapers/photophase/model/Disposition.java | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/model/Disposition.java b/src/org/cyanogenmod/wallpapers/photophase/model/Disposition.java index d1b798a..35cc0e9 100644 --- a/src/org/cyanogenmod/wallpapers/photophase/model/Disposition.java +++ b/src/org/cyanogenmod/wallpapers/photophase/model/Disposition.java @@ -21,7 +21,7 @@ import org.cyanogenmod.wallpapers.photophase.PhotoFrame; /** * A class that holds a {@link PhotoFrame} disposition. */ -public class Disposition { +public class Disposition implements Comparable<Disposition> { /** * Column */ @@ -83,4 +83,36 @@ public class Disposition { public String toString() { return "Disposition [x=" + x + ", y=" + y + ", w=" + w + ", h=" + h + "]"; } + + /** + * {@inheritDoc} + */ + @Override + public int compareTo(Disposition another) { + if (x == another.x && y == another.y && w == another.w && h == another.h) { + return 0; + } + if (x < another.x) { + return -1; + } + if (x > another.x) { + return 1; + } + if (y < another.y) { + return -1; + } + if (y > another.y) { + return 1; + } + if (w < another.w) { + return -1; + } + if (w > another.w) { + return 1; + } + if (h < another.h) { + return -1; + } + return 1; + } } |