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
7b68b27f
Commit
7b68b27f
authored
Sep 27, 2015
by
Tobias
Browse files
fix watch table background image flickering on DB and thumbnail updates
parent
89d055fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Sources/VLCThumbnailsCache.m
View file @
7b68b27f
...
...
@@ -112,9 +112,10 @@
{
UIImage
*
rawThumbnail
=
[
self
thumbnailForManagedObject
:
object
refreshCache
:
refreshCache
];
CGSize
rawSize
=
rawThumbnail
.
size
;
CGFloat
rawScale
=
rawThumbnail
.
scale
;
/* scaling is potentially expensive, so we should avoid re-doing it for the same size over and over again */
if
(
rawSize
.
width
<=
rect
.
size
.
width
&&
rawSize
.
height
<=
rect
.
size
.
height
)
if
(
rawSize
.
width
*
rawScale
<=
rect
.
size
.
width
*
scale
&&
rawSize
.
height
*
rawScale
<=
rect
.
size
.
height
*
scale
)
return
rawThumbnail
;
UIImage
*
scaledImage
=
[
UIImage
scaleImage
:
rawThumbnail
toFitRect
:
rect
scale
:
scale
];
...
...
VLC WatchKit Native Extension/Classes/VLCRowController.h
View file @
7b68b27f
...
...
@@ -20,8 +20,8 @@
@property
(
nonatomic
,
copy
)
NSString
*
mediaTitle
;
@property
(
nonatomic
)
CGFloat
playbackProgress
;
@property
(
nonatomic
,
weak
,
readonly
)
id
mediaLibraryObject
;
@property
(
nonatomic
,
weak
,
readonly
)
NSManagedObject
*
mediaLibraryObject
;
-
(
void
)
configureWithMediaLibraryObject
:(
id
)
object
;
-
(
void
)
configureWithMediaLibraryObject
:(
NSManagedObject
*
)
object
;
@end
VLC WatchKit Native Extension/Classes/VLCRowController.m
View file @
7b68b27f
...
...
@@ -17,7 +17,7 @@
#import <WatchConnectivity/WatchConnectivity.h>
@interface
VLCRowController
()
@property
(
nonatomic
,
weak
,
readwrite
)
id
mediaLibraryObject
;
@property
(
nonatomic
,
weak
,
readwrite
)
NSManagedObject
*
mediaLibraryObject
;
@property
(
nonatomic
,
readonly
)
CGRect
thumbnailSize
;
@property
(
nonatomic
,
readonly
)
CGFloat
rowWidth
;
@property
(
nonatomic
,
readonly
)
CGFloat
scale
;
...
...
@@ -51,7 +51,7 @@
_scale
=
screenScale
;
}
-
(
void
)
configureWithMediaLibraryObject
:(
id
)
storageObject
-
(
void
)
configureWithMediaLibraryObject
:(
NSManagedObject
*
)
storageObject
{
NSString
*
title
=
nil
;
float
playbackProgress
=
0
.
0
;
...
...
@@ -88,7 +88,7 @@
/* FIXME: add placeholder image once designed */
if
(
storageObject
!=
self
.
mediaLibraryObject
)
{
if
(
!
[
storageObject
.
objectID
.
URIRepresentation
isEqual
:
self
.
mediaLibraryObject
.
objectID
.
URIRepresentation
]
)
{
self
.
group
.
backgroundImage
=
[
UIImage
imageNamed
:
@"tableview-gradient"
];
}
...
...
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