Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add needed assets for Klima brølet * Initial implementation of the Klima Brølet view This is a new campaign at the style of Earth Hour. I initially copied and modified the earth hour views and adapted them to this current use case, without the custom header animation. One of the extensions from this view in relation to the Earth Hour one is the support for dynamic type and scrollable content. An extension to this view is to make it a more reusable component as a campaign card component. The main reason I didn't do it right now is because time-to-ship is fairly limited, together with I am not sure how to solve the potential injection of a view as the scrollable content of the campaign card. * Show shadow on top of action buttons when there is more content * Expose delegate methods for KlimabroletView * Replace demo view with demo view controller In order to be able to use the nested navigation controller and the table view controller * Use a KVO observation to set the initial shadow of the action view Initially I was trying to check if the content was bigger than the scroll view in `layoutSubviews`, but the content view didn't have a resolved frame _for some reeason_. So in order to determine if the action view needed to have an initial shadow if the user can scroll, I opted for use a `KeyValueObservation` to detect when the scrollView's content size changes. * Add screenshot test for the Klimabrølet view * Fix naming of local variable * Rename `newClose` to `cross` * Add `weak` to delegates * Mark methods private * Remove unnecessary text * Rename item in asset catalog to be `cross` instead of `newCross` Otherwise the naming will get out of sync * Use a configure method to set the KlimabroletView data * Use configure methods to set the content of Klimabrolet subviews In the case of `KlimabroletContentView` I decided to pass the full view model for the amount of properties, also i felt it's not necessary to create a custom view model for this nested view as it's intended to work as a nested view of `KlimabroletView`. * Favor setting constraint constants over using margins guide Creating constraints towards the `layoutMarginGuide` reads better, but the behavior is different for iOS 10 (I am not sure exactly why, it's not mentioned in the docs). The result in iOS 10 would be like to set a constraint to the actual border of the view, not considering its margins. Then to ensure the layout works as intended for all of our supported iOS versions, I set the constants instead. * Ensure close button is visible for iOS 10 For some reason, the button was resolving auto layout with dimensions equal to 0, then the close button wasn't visibile on iOS 10 * Improve demo data used * Do not cut the text on EarthHourTagView The image has a fixed heigh of `14`, then with the `.fill` alignment, the text will be restricted to be 14 points. * Ensure ReadMore button is big enough to tap * Allow touches to go immediately to the content of the scroll view So there is no delay when tapping a button inside the scroll view * Update Klimabrolet snapshot reference * Override stack view aligment outside of EarthHourTagView I do this as I don't want to change the behavior of the `EarthHourTagView` for its original uses, but as i want to reuse it, i can just allow to override the stack view alignment in order not to clip the text * Fix Feedback Demo View reference It got lost within rebasing with master due to the conflicts in FinniversKit.xcodeproj * Hide getters for buttons in actions view * Redefine how to express the scroll view content constraints * Adjust demo event url
- Loading branch information