material-components_materia.../MaterialComponentsSnapshotTests.podspec
Yarden Eitan 02161e4a76
[Ripple] Fix ripple layout issues with autolayout (#6588)
This fixes a long standing issue in our Ink/Ripple implementation where with auto layout the ink view doesn't fit itself correctly when there is a re-layout, as an example during an orientation change.

There were a few things needed to be fixed/added to be able to make the Ripple work correctly:

1. every time MDCRippleView lays out its view, the MDCRippleLayer sublayers need to receive the new bounds and need to lay out the ripple based on the new bounds.
2. The MDCRippleView should at all times be the size of it's superView.
2. When an MDCRippleLayer exists and needs to be laid out again, it needs to recalculate the ripple layer's position and path. This can happen as an example during a ripple animation when an orientation change occurs. This can also happen when there is a ripple overlay that isn't transient is on a surface and there is an orientation change.
3. Lastly, moving the MDCRippleLayer animations away from `removeOnCompletion = NO;` to having the final visual values be set prior to the animation, solves an issue where a `setNeedsLayout` reverts certain animations (an animation over layer.position) back to their original values and causes the ripple to be incorrectly centered.

Resolves #4533 
Resolves #4603 

Below are provided gifs showing the fix.
Before:
![beforeripplelayout](https://user-images.githubusercontent.com/4066863/52529447-c3640b00-2cbf-11e9-929b-cb69be6d3b27.gif)

After:
![afterripplelayout](https://user-images.githubusercontent.com/4066863/52529450-cb23af80-2cbf-11e9-828b-2dfd5cb2bc96.gif)
2019-02-11 17:22:26 -05:00

83 lines
3.7 KiB
Ruby

Pod::Spec.new do |s|
s.name = "MaterialComponentsSnapshotTests"
s.version = "76.1.2"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components snapshot tests."
s.homepage = "https://github.com/material-components/material-components-ios"
s.license = 'Apache 2.0'
s.source = { :git => "https://github.com/material-components/material-components-ios.git", :tag => "v#{s.version}" }
s.platform = :ios, '8.0'
s.requires_arc = true
s.dependency 'MaterialComponents'
s.dependency 'MaterialComponentsBeta'
s.subspec "BottomNavigation" do |component|
component.ios.deployment_target = '8.0'
component.test_spec 'tests' do |tests|
tests.test_spec 'snapshot' do |snapshot_tests|
snapshot_tests.requires_app_host = true
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}"
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
end
end
end
s.subspec "Cards" do |component|
component.ios.deployment_target = '8.0'
component.test_spec 'tests' do |tests|
tests.test_spec 'snapshot' do |snapshot_tests|
snapshot_tests.requires_app_host = true
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
snapshot_tests.resources = "components/#{component.base_name}/tests/snapshot/resources/*"
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
end
end
end
s.subspec "Chips" do |component|
component.ios.deployment_target = '8.0'
component.test_spec 'tests' do |tests|
tests.test_spec 'snapshot' do |snapshot_tests|
snapshot_tests.requires_app_host = true
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
snapshot_tests.resources = "components/#{component.base_name}/tests/snapshot/resources/*"
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
end
end
end
s.subspec "Ripple" do |component|
component.ios.deployment_target = '8.0'
component.test_spec 'tests' do |tests|
tests.test_spec 'snapshot' do |snapshot_tests|
snapshot_tests.requires_app_host = true
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
end
end
end
s.subspec "TextFields" do |component|
component.ios.deployment_target = '8.0'
component.test_spec 'tests' do |tests|
tests.test_spec 'snapshot' do |snapshot_tests|
snapshot_tests.requires_app_host = true
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
snapshot_tests.resources = "components/#{component.base_name}/tests/snapshot/resources/*"
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
snapshot_tests.dependency "MDFInternationalization"
end
end
end
# Private for Snapshot test helpers
s.subspec "private" do |private_spec|
private_spec.test_spec "Snapshot" do |snapshot|
snapshot.ios.deployment_target = '8.0'
snapshot.source_files = "components/private/#{snapshot.base_name}/src/*.{h,m,swift}"
snapshot.dependency 'iOSSnapshotTestCase', '2.2.0'
end
end
end