Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
76db6a74
Commit
76db6a74
authored
Jul 05, 2018
by
Soomin Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLCPlaylistCollectionViewCell: Add VLCMLMedia
parent
b780db09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
Sources/VLCPlaylistCollectionViewCell.h
Sources/VLCPlaylistCollectionViewCell.h
+2
-0
Sources/VLCPlaylistCollectionViewCell.m
Sources/VLCPlaylistCollectionViewCell.m
+19
-0
No files found.
Sources/VLCPlaylistCollectionViewCell.h
View file @
76db6a74
...
...
@@ -15,6 +15,7 @@
#import <UIKit/UIKit.h>
#import "VLCLinearProgressIndicator.h"
#import <VLCMediaLibraryKit/VLCMLMedia.h>
@interface
VLCPlaylistCollectionViewCell
:
UICollectionViewCell
...
...
@@ -28,6 +29,7 @@
@property
(
nonatomic
,
strong
)
IBOutlet
UILabel
*
metaDataLabel
;
@property
(
nonatomic
,
retain
)
NSManagedObject
*
mediaObject
;
@property
(
nonatomic
,
retain
)
VLCMLMedia
*
media
;
@property
(
nonatomic
,
weak
)
UICollectionView
*
collectionView
;
@property
(
readonly
)
BOOL
showsMetaData
;
...
...
Sources/VLCPlaylistCollectionViewCell.m
View file @
76db6a74
...
...
@@ -17,6 +17,8 @@
#import "VLCThumbnailsCache.h"
#import "NSString+SupportedMedia.h"
#import <VLCMediaLibraryKit/VLCMLFile.h>
@interface
VLCPlaylistCollectionViewCell
()
{
UIImage
*
_checkboxEmptyImage
;
...
...
@@ -198,6 +200,22 @@
[
self
_updatedDisplayedInformationForKeyPath
:
nil
];
}
-
(
void
)
setMedia
:(
VLCMLMedia
*
)
media
{
if
(
_media
!=
media
)
{
_media
=
media
;
}
[
self
_updateDisplayedInformations
];
}
-
(
void
)
_updateDisplayedInformations
{
_titleLabel
.
text
=
_media
.
title
;
_subtitleLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@ — %@"
,
[
VLCTime
timeWithNumber
:[
NSNumber
numberWithLongLong
:
_media
.
duration
]],
[
NSByteCountFormatter
stringFromByteCount
:[
_media
.
mainFile
size
]
countStyle
:
NSByteCountFormatterCountStyleFile
]];
}
-
(
void
)
_updatedDisplayedInformationForKeyPath
:(
NSString
*
)
keyPath
{
self
.
thumbnailView
.
contentMode
=
UIViewContentModeScaleAspectFill
;
...
...
@@ -526,6 +544,7 @@
-
(
void
)
prepareForReuse
{
[
super
prepareForReuse
];
self
.
media
=
nil
;
self
.
mediaObject
=
nil
;
self
.
thumbnailView
.
image
=
nil
;
self
.
titleLabel
.
text
=
@""
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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