diff options
Diffstat (limited to 'src/com/android/gallery3d/data/TimeClustering.java')
-rw-r--r-- | src/com/android/gallery3d/data/TimeClustering.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/data/TimeClustering.java b/src/com/android/gallery3d/data/TimeClustering.java index 35cbab1ee..87111f29d 100644 --- a/src/com/android/gallery3d/data/TimeClustering.java +++ b/src/com/android/gallery3d/data/TimeClustering.java @@ -108,6 +108,7 @@ public class TimeClustering extends Clustering { if (index < 0 || index >= total) return; SmallItem s = new SmallItem(); s.path = item.getPath(); + s.mediaType = item.getMediaType(); s.dateInMs = item.getDateInMs(); item.getLatLong(latLng); s.lat = latLng[0]; @@ -189,6 +190,19 @@ public class TimeClustering extends Clustering { mMaxClusterSize = Utils.clamp(mMaxClusterSize, MIN_MAX_CLUSTER_SIZE, MAX_MAX_CLUSTER_SIZE); } + @Override + public int getClusterImageCount(int index) { + // TODO Auto-generated method stub + return mClusters.get(index).mPhotoCount; + + } + + @Override + public int getClusterVideoCount(int index) { + // TODO Auto-generated method stub + return mClusters.get(index).mVideoCount; + } + private void compute(SmallItem currentItem) { if (currentItem != null) { int numClusters = mClusters.size(); @@ -343,12 +357,15 @@ class SmallItem { Path path; long dateInMs; double lat, lng; + int mediaType; } class Cluster { @SuppressWarnings("unused") private static final String TAG = "Cluster"; private static final String MMDDYY_FORMAT = "MMddyy"; + public int mPhotoCount = 0; + public int mVideoCount = 0; // This is for TimeClustering only. public boolean mGeographicallySeparatedFromPrevCluster = false; @@ -359,6 +376,11 @@ class Cluster { } public void addItem(SmallItem item) { + if(item.mediaType == MediaObject.MEDIA_TYPE_IMAGE) { + mPhotoCount++; + } else if(item.mediaType == MediaObject.MEDIA_TYPE_VIDEO) { + mVideoCount++; + } mItems.add(item); } |