When trying to track every call on the UIView lifecycle (setNeedsLayout, layoutSubviews, sizeToFit etc.), I noticed many more of those calls appearing in UIKit-x version than iOS version. Removing those two setNeedsLayout calls from UIView made it much more (albeit not perfectly) consistent with the way these calls happen in iOS.
The benefit of these changes is removing unnecessary calls (and lines of code that might be extra confusing, since they don't provide value, but are in the code).
The risk is that some those calls needed to be there after all and removing them will cause some elements to stop displaying correctly. This forces us to take a look at each screen and compare to a non-changed version. Since the change is removing setNeedsDisplay commands, the problems that can be expected would be views misplaced for a brief moment of time or before some action is taken by the user. I went through all screens of Player I could think of and did not notice any differences in layout. I covered part of that (the 'SongOrSlide' flow) with screenshots, included below. There don't seem to be any differences in layout, suggesting the changes are safe to include.
When comparing screenshots:
please note that they were shot 'manually' so the screenshot itself may be a little off
use zoom in the browser to get a better view
current master (no change)
this PR (with change)
Please check if the PR fulfills these requirements
[x] Self-review: I am confident this is the simplest and clearest way to achieve the expected behaviour
[x] There are no dependencies on other PRs or I have linked dependencies through Zenhub
[x] The commit messages are clean and understandable
Related to #137
Type of change: code fix
Motivation
When trying to track every call on the UIView lifecycle (setNeedsLayout, layoutSubviews, sizeToFit etc.), I noticed many more of those calls appearing in UIKit-x version than iOS version. Removing those two
setNeedsLayout
calls fromUIView
made it much more (albeit not perfectly) consistent with the way these calls happen in iOS.The benefit of these changes is removing unnecessary calls (and lines of code that might be extra confusing, since they don't provide value, but are in the code).
The risk is that some those calls needed to be there after all and removing them will cause some elements to stop displaying correctly. This forces us to take a look at each screen and compare to a non-changed version. Since the change is removing setNeedsDisplay commands, the problems that can be expected would be views misplaced for a brief moment of time or before some action is taken by the user. I went through all screens of Player I could think of and did not notice any differences in layout. I covered part of that (the 'SongOrSlide' flow) with screenshots, included below. There don't seem to be any differences in layout, suggesting the changes are safe to include.
When comparing screenshots:
Please check if the PR fulfills these requirements