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
protected String mMimeType;
private final long mDateTaken;
private String mTitle;
- private final String mDisplayName;
protected BaseImageList mContainer;
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;
mMimeType = mimeType;
mDateTaken = dateTaken;
mTitle = title;
- mDisplayName = displayName;
}
public String getDataPath() {
return mTitle;
}
- public String getDisplayName() {
- return mDisplayName;
- }
-
private void setupDimension() {
ParcelFileDescriptor input = null;
try {
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
return fullSizeBitmap(IImage.THUMBNAIL_TARGET_SIZE,
IImage.THUMBNAIL_MAX_NUM_PIXELS);
}
-
- @Override
- public String getDisplayName() {
- return getTitle();
- }
}
@Override
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);
}
}
public abstract int getHeight();
- public abstract String getDisplayName();
-
// Get property of the image
public abstract boolean isReadonly();
public abstract boolean isDrm();
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;
}
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);
}
}
return mUri.toString();
}
- public String getDisplayName() {
- return getTitle();
- }
-
public Bitmap thumbBitmap(boolean rotateAsNeeded) {
return fullSizeBitmap(THUMBNAIL_TARGET_SIZE, THUMBNAIL_MAX_NUM_PIXELS,
rotateAsNeeded);
Media.DATA,
Media.DATE_TAKEN,
Media.TITLE,
- Media.DISPLAY_NAME,
Media.MINI_THUMB_MAGIC,
Media.MIME_TYPE,
Media.DATE_MODIFIED};
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) {
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,
*/
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