@Override public void bindView(View view, Context context, Cursor cursor) { // TODO Auto-generated method stub FileInfo fileInfo = getFileItem(cursor.getPosition()); if (fileInfo == null) { // file is not existing, create a fake info fileInfo = new FileInfo(); fileInfo.dbId = cursor.getLong(FileCategoryHelper.COLUMN_ID); fileInfo.filePath = cursor.getString(FileCategoryHelper.COLUMN_PATH); fileInfo.fileName = FileUtil.getNameFromFilepath(fileInfo.filePath); fileInfo.fileSize = cursor.getLong(FileCategoryHelper.COLUMN_SIZE); fileInfo.ModifiedDate = cursor.getLong(FileCategoryHelper.COLUMN_DATE); } FileListItem.setupFileListItemInfo(mContext, view, fileInfo, mFileIconHelper); }
private FileInfo getFileInfo(Cursor cursor) { return (cursor == null || cursor.getCount() == 0) ? null : FileUtil.GetFileInfo(cursor.getString(FileCategoryHelper.COLUMN_PATH)); }