Commit 7b68b27f authored by Tobias's avatar Tobias

fix watch table background image flickering on DB and thumbnail updates

parent 89d055fe
......@@ -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];
......
......@@ -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
......@@ -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"];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment