Commit bb85ff79 authored by Carola's avatar Carola

VLCRemoteBrowsingTVCell: fix crash when browsing

Using the Focusframeguide for the constraint led to an endless layoutloop.
Instead we use the thumbnail now directly and update the constraint when the cell becomes the focus
parent 30da5541
...@@ -20,6 +20,7 @@ NSString *const VLCRemoteBrowsingTVCellIdentifier = @"VLCRemoteBrowsingTVCell"; ...@@ -20,6 +20,7 @@ NSString *const VLCRemoteBrowsingTVCellIdentifier = @"VLCRemoteBrowsingTVCell";
VLCMDFBrowsingArtworkProvider *_artworkProvider; VLCMDFBrowsingArtworkProvider *_artworkProvider;
} }
@property (nonatomic) IBOutlet NSLayoutConstraint *aspectRationConstraint; @property (nonatomic) IBOutlet NSLayoutConstraint *aspectRationConstraint;
@property (nonatomic) NSLayoutConstraint *titleThumbnailConstraint;
@end @end
...@@ -32,9 +33,8 @@ NSString *const VLCRemoteBrowsingTVCellIdentifier = @"VLCRemoteBrowsingTVCell"; ...@@ -32,9 +33,8 @@ NSString *const VLCRemoteBrowsingTVCellIdentifier = @"VLCRemoteBrowsingTVCell";
[super awakeFromNib]; [super awakeFromNib];
_artworkProvider = [[VLCMDFBrowsingArtworkProvider alloc] init]; _artworkProvider = [[VLCMDFBrowsingArtworkProvider alloc] init];
_artworkProvider.artworkReceiver = self; _artworkProvider.artworkReceiver = self;
UILayoutGuide *focusedFrameGuide = self.thumbnailImageView.focusedFrameGuide; _titleThumbnailConstraint = [self.titleLabel.topAnchor constraintEqualToAnchor:self.thumbnailImageView.bottomAnchor constant:15];
NSLayoutConstraint *constraint = [self.titleLabel.topAnchor constraintEqualToAnchor:focusedFrameGuide.bottomAnchor constant:15]; [self.contentView addConstraint:_titleThumbnailConstraint];
[self.contentView addConstraint:constraint];
[self prepareForReuse]; [self prepareForReuse];
} }
...@@ -110,6 +110,7 @@ NSString *const VLCRemoteBrowsingTVCellIdentifier = @"VLCRemoteBrowsingTVCell"; ...@@ -110,6 +110,7 @@ NSString *const VLCRemoteBrowsingTVCellIdentifier = @"VLCRemoteBrowsingTVCell";
CGAffineTransform transform = context.nextFocusedView != self ? CGAffineTransformIdentity : CGAffineTransformMakeScale(1.1, 1.1); CGAffineTransform transform = context.nextFocusedView != self ? CGAffineTransformIdentity : CGAffineTransformMakeScale(1.1, 1.1);
self.titleLabel.transform = transform; self.titleLabel.transform = transform;
self.subtitleLabel.transform = transform; self.subtitleLabel.transform = transform;
self.titleThumbnailConstraint.constant = context.nextFocusedView != self ? 15 : 40;
} completion:nil]; } completion:nil];
} }
......
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