Commit bb85ff79 authored by Carola Nitz's avatar Carola Nitz

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";
VLCMDFBrowsingArtworkProvider *_artworkProvider;
}
@property (nonatomic) IBOutlet NSLayoutConstraint *aspectRationConstraint;
@property (nonatomic) NSLayoutConstraint *titleThumbnailConstraint;
@end
......@@ -32,9 +33,8 @@ NSString *const VLCRemoteBrowsingTVCellIdentifier = @"VLCRemoteBrowsingTVCell";
[super awakeFromNib];
_artworkProvider = [[VLCMDFBrowsingArtworkProvider alloc] init];
_artworkProvider.artworkReceiver = self;
UILayoutGuide *focusedFrameGuide = self.thumbnailImageView.focusedFrameGuide;
NSLayoutConstraint *constraint = [self.titleLabel.topAnchor constraintEqualToAnchor:focusedFrameGuide.bottomAnchor constant:15];
[self.contentView addConstraint:constraint];
_titleThumbnailConstraint = [self.titleLabel.topAnchor constraintEqualToAnchor:self.thumbnailImageView.bottomAnchor constant:15];
[self.contentView addConstraint:_titleThumbnailConstraint];
[self prepareForReuse];
}
......@@ -110,6 +110,7 @@ NSString *const VLCRemoteBrowsingTVCellIdentifier = @"VLCRemoteBrowsingTVCell";
CGAffineTransform transform = context.nextFocusedView != self ? CGAffineTransformIdentity : CGAffineTransformMakeScale(1.1, 1.1);
self.titleLabel.transform = transform;
self.subtitleLabel.transform = transform;
self.titleThumbnailConstraint.constant = context.nextFocusedView != self ? 15 : 40;
} 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