diff options
author | Chih-Chung Chang <chihchung@google.com> | 2010-01-05 14:34:36 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2010-01-05 14:35:58 +0800 |
commit | 6d08c5d4cb3925a11a1adbfdb0e463ca6f5dca5a (patch) | |
tree | 6a8ccb28a762df94eb6b6d4d69ece393d3aa4e08 /src | |
parent | 6dfb03741e9ed0821fbd7fa6912f44bf76bebca6 (diff) | |
download | LegacyCamera-6d08c5d4cb3925a11a1adbfdb0e463ca6f5dca5a.zip LegacyCamera-6d08c5d4cb3925a11a1adbfdb0e463ca6f5dca5a.tar.gz LegacyCamera-6d08c5d4cb3925a11a1adbfdb0e463ca6f5dca5a.tar.bz2 |
Remove "display name" and always use "title" field in display (same as Gallery).
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/MenuHelper.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/gallery/BaseImage.java | 8 | ||||
-rw-r--r-- | src/com/android/camera/gallery/DrmImageList.java | 11 | ||||
-rw-r--r-- | src/com/android/camera/gallery/IImage.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/gallery/Image.java | 4 | ||||
-rw-r--r-- | src/com/android/camera/gallery/ImageList.java | 3 | ||||
-rw-r--r-- | src/com/android/camera/gallery/UriImage.java | 4 | ||||
-rw-r--r-- | src/com/android/camera/gallery/VideoList.java | 17 | ||||
-rw-r--r-- | src/com/android/camera/gallery/VideoObject.java | 4 |
9 files changed, 18 insertions, 37 deletions
diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java index 1e1518b..6592f5c 100644 --- a/src/com/android/camera/MenuHelper.java +++ b/src/com/android/camera/MenuHelper.java @@ -385,7 +385,7 @@ public class MenuHelper { TextView textView = (TextView) d.findViewById( R.id.details_image_title); - textView.setText(image.getDisplayName()); + textView.setText(image.getTitle()); long length = getImageFileSize(image); String lengthString = length < 0 diff --git a/src/com/android/camera/gallery/BaseImage.java b/src/com/android/camera/gallery/BaseImage.java index fd41ab4..b0eab7a 100644 --- a/src/com/android/camera/gallery/BaseImage.java +++ b/src/com/android/camera/gallery/BaseImage.java @@ -49,7 +49,6 @@ public abstract class BaseImage implements IImage { protected String mMimeType; private final long mDateTaken; private String mTitle; - private final String mDisplayName; protected BaseImageList mContainer; @@ -58,7 +57,7 @@ public abstract class BaseImage implements IImage { protected BaseImage(BaseImageList container, ContentResolver cr, long id, int index, Uri uri, String dataPath, long miniThumbMagic, - String mimeType, long dateTaken, String title, String displayName) { + String mimeType, long dateTaken, String title) { mContainer = container; mContentResolver = cr; mId = id; @@ -68,7 +67,6 @@ public abstract class BaseImage implements IImage { mMimeType = mimeType; mDateTaken = dateTaken; mTitle = title; - mDisplayName = displayName; } public String getDataPath() { @@ -139,10 +137,6 @@ public abstract class BaseImage implements IImage { return mTitle; } - public String getDisplayName() { - return mDisplayName; - } - private void setupDimension() { ParcelFileDescriptor input = null; try { diff --git a/src/com/android/camera/gallery/DrmImageList.java b/src/com/android/camera/gallery/DrmImageList.java index f745977..99a6ed6 100644 --- a/src/com/android/camera/gallery/DrmImageList.java +++ b/src/com/android/camera/gallery/DrmImageList.java @@ -60,9 +60,9 @@ public class DrmImageList extends ImageList implements IImageList { protected DrmImage(BaseImageList container, ContentResolver cr, long id, int index, Uri uri, String dataPath, long miniThumbMagic, String mimeType, long dateTaken, - String title, String displayName, int rotation) { + String title, int rotation) { super(container, cr, id, index, uri, dataPath, miniThumbMagic, - mimeType, dateTaken, title, displayName, rotation); + mimeType, dateTaken, title, rotation); } @Override @@ -91,11 +91,6 @@ public class DrmImageList extends ImageList implements IImageList { return fullSizeBitmap(IImage.THUMBNAIL_TARGET_SIZE, IImage.THUMBNAIL_MAX_NUM_PIXELS); } - - @Override - public String getDisplayName() { - return getTitle(); - } } @Override @@ -105,6 +100,6 @@ public class DrmImageList extends ImageList implements IImageList { String mimeType = cursor.getString(INDEX_MIME_TYPE); return new DrmImage(this, mContentResolver, id, cursor.getPosition(), contentUri(id), dataPath, 0, mimeType, 0, "DrmImage-" + id, - "DrmImage-" + id, 0); + 0); } } diff --git a/src/com/android/camera/gallery/IImage.java b/src/com/android/camera/gallery/IImage.java index 8b443d6..22e1228 100644 --- a/src/com/android/camera/gallery/IImage.java +++ b/src/com/android/camera/gallery/IImage.java @@ -64,8 +64,6 @@ public interface IImage { public abstract int getHeight(); - public abstract String getDisplayName(); - // Get property of the image public abstract boolean isReadonly(); public abstract boolean isDrm(); diff --git a/src/com/android/camera/gallery/Image.java b/src/com/android/camera/gallery/Image.java index 78ec382..df6516a 100644 --- a/src/com/android/camera/gallery/Image.java +++ b/src/com/android/camera/gallery/Image.java @@ -44,10 +44,10 @@ public class Image extends BaseImage implements IImage { public Image(BaseImageList container, ContentResolver cr, long id, int index, Uri uri, String dataPath, long miniThumbMagic, - String mimeType, long dateTaken, String title, String displayName, + String mimeType, long dateTaken, String title, int rotation) { super(container, cr, id, index, uri, dataPath, miniThumbMagic, - mimeType, dateTaken, title, displayName); + mimeType, dateTaken, title); mRotation = rotation; } diff --git a/src/com/android/camera/gallery/ImageList.java b/src/com/android/camera/gallery/ImageList.java index bc9d7ca..20f9946 100644 --- a/src/com/android/camera/gallery/ImageList.java +++ b/src/com/android/camera/gallery/ImageList.java @@ -109,9 +109,8 @@ public class ImageList extends BaseImageList implements IImageList { if (title == null || title.length() == 0) { title = dataPath; } - String displayName = title; return new Image(this, mContentResolver, id, cursor.getPosition(), contentUri(id), dataPath, miniThumbMagic, mimeType, dateTaken, - title, displayName, orientation); + title, orientation); } } diff --git a/src/com/android/camera/gallery/UriImage.java b/src/com/android/camera/gallery/UriImage.java index 0f27b24..1d04257 100644 --- a/src/com/android/camera/gallery/UriImage.java +++ b/src/com/android/camera/gallery/UriImage.java @@ -116,10 +116,6 @@ class UriImage implements IImage { return mUri.toString(); } - public String getDisplayName() { - return getTitle(); - } - public Bitmap thumbBitmap(boolean rotateAsNeeded) { return fullSizeBitmap(THUMBNAIL_TARGET_SIZE, THUMBNAIL_MAX_NUM_PIXELS, rotateAsNeeded); diff --git a/src/com/android/camera/gallery/VideoList.java b/src/com/android/camera/gallery/VideoList.java index 375de15..4c4bbd9 100644 --- a/src/com/android/camera/gallery/VideoList.java +++ b/src/com/android/camera/gallery/VideoList.java @@ -35,7 +35,6 @@ public class VideoList extends BaseImageList { Media.DATA, Media.DATE_TAKEN, Media.TITLE, - Media.DISPLAY_NAME, Media.MINI_THUMB_MAGIC, Media.MIME_TYPE, Media.DATE_MODIFIED}; @@ -44,10 +43,9 @@ public class VideoList extends BaseImageList { private static final int INDEX_DATA_PATH = 1; private static final int INDEX_DATE_TAKEN = 2; private static final int INDEX_TITLE = 3; - private static final int INDEX_DISPLAY_NAME = 4; - private static final int INDEX_MIMI_THUMB_MAGIC = 5; - private static final int INDEX_MIME_TYPE = 6; - private static final int INDEX_DATE_MODIFIED = 7; + private static final int INDEX_MIMI_THUMB_MAGIC = 4; + private static final int INDEX_MIME_TYPE = 5; + private static final int INDEX_DATE_MODIFIED = 6; @Override protected long getImageId(Cursor cursor) { @@ -62,14 +60,15 @@ public class VideoList extends BaseImageList { if (dateTaken == 0) { dateTaken = cursor.getLong(INDEX_DATE_MODIFIED) * 1000; } - String title = cursor.getString(INDEX_TITLE); - String displayName = cursor.getString(INDEX_DISPLAY_NAME); long miniThumbMagic = cursor.getLong(INDEX_MIMI_THUMB_MAGIC); + String title = cursor.getString(INDEX_TITLE); String mimeType = cursor.getString(INDEX_MIME_TYPE); - + if (title == null || title.length() == 0) { + title = dataPath; + } return new VideoObject(this, mContentResolver, id, cursor.getPosition(), contentUri(id), dataPath, - miniThumbMagic, mimeType, dateTaken, title, displayName); + miniThumbMagic, mimeType, dateTaken, title); } public VideoList(ContentResolver resolver, Uri uri, int sort, diff --git a/src/com/android/camera/gallery/VideoObject.java b/src/com/android/camera/gallery/VideoObject.java index 31c6e30..d6aa445 100644 --- a/src/com/android/camera/gallery/VideoObject.java +++ b/src/com/android/camera/gallery/VideoObject.java @@ -43,9 +43,9 @@ public class VideoObject extends BaseImage implements IImage { */ protected VideoObject(BaseImageList container, ContentResolver cr, long id, int index, Uri uri, String dataPath, long miniThumbMagic, - String mimeType, long dateTaken, String title, String displayName) { + String mimeType, long dateTaken, String title) { super(container, cr, id, index, uri, dataPath, miniThumbMagic, - mimeType, dateTaken, title, displayName); + mimeType, dateTaken, title); } @Override |