Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
591c3e99
Commit
591c3e99
authored
Jan 25, 2014
by
Carola
Browse files
GDrive:show thumbnails for files where possible
parent
eba80444
Changes
2
Hide whitespace changes
Inline
Side-by-side
Sources/VLCCloudStorageTableViewCell.m
View file @
591c3e99
...
...
@@ -12,6 +12,11 @@
*****************************************************************************/
#import "VLCCloudStorageTableViewCell.h"
@interface
VLCCloudStorageTableViewCell
()
{
NSURL
*
_iconURL
;
}
@end
@implementation
VLCCloudStorageTableViewCell
...
...
@@ -80,7 +85,10 @@
self
.
titleLabel
.
hidden
=
self
.
subtitleLabel
.
hidden
=
NO
;
self
.
folderTitleLabel
.
hidden
=
YES
;
}
if
(
_driveFile
.
thumbnailLink
!=
nil
)
{
_iconURL
=
[
NSURL
URLWithString
:
_driveFile
.
thumbnailLink
];
[
self
performSelectorInBackground
:
@selector
(
_updateIconFromURL
)
withObject
:
@""
];
}
NSString
*
iconName
=
self
.
driveFile
.
iconLink
;
if
([
iconName
isEqualToString
:
@"https://ssl.gstatic.com/docs/doclist/images/icon_11_shared_collection_list.png"
]
||
[
iconName
isEqualToString
:
@"https://ssl.gstatic.com/docs/doclist/images/icon_11_collection_list.png"
])
{
self
.
thumbnailView
.
image
=
[
UIImage
imageNamed
:
@"folder"
];
...
...
@@ -97,6 +105,13 @@
[
self
setNeedsDisplay
];
}
-
(
void
)
_updateIconFromURL
{
NSData
*
imageData
=
[[
NSData
alloc
]
initWithContentsOfURL
:
_iconURL
];
UIImage
*
image
=
[[
UIImage
alloc
]
initWithData
:
imageData
];
self
.
thumbnailView
.
image
=
image
;
}
-
(
IBAction
)
triggerDownload
:(
id
)
sender
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
triggerDownloadForCell
:)])
...
...
Sources/VLCGoogleDriveController.m
View file @
591c3e99
...
...
@@ -121,7 +121,7 @@
GTLQueryDrive
*
query
;
query
=
[
GTLQueryDrive
queryForFilesList
];
query
.
fields
=
@"items(originalFilename,title,mimeType,fileExtension,fileSize,iconLink,downloadUrl,webContentLink),nextPageToken"
;
query
.
fields
=
@"items(originalFilename,title,mimeType,fileExtension,fileSize,iconLink,downloadUrl,webContentLink
,thumbnailLink
),nextPageToken"
;
query
.
pageToken
=
_nextPageToken
;
query
.
maxResults
=
100
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment