Add a FABFullScreenTransition component.
ClosedPublic

Authored by featherless on Tue, May 16, 3:16 PM.

Details

Summary

This component makes it possible to present a view controller using a masked reveal transition from a contextual fab button.

The presenting view controller is expected to implement TransitionContextViewRetriever. This isn't enforced at compile time in any way unfortunately, so we may want to explore alternative APIs for ensuring that the context view can be retrieved. Now that we are providing instances to the transition controller it may be reasoanble to simply provide the context view to the transition object. We may still find value in the context view retrieval APIs for app state restoration, but this can be an optional API that an app chooses to opt in to.

Diff Detail

Repository
R50 material-motion-components-swift
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
featherless created this revision.Tue, May 16, 3:16 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptTue, May 16, 3:16 PM
Restricted Application added a project: Material Motion. · View Herald Transcript
Restricted Application added a reviewer: O4: Material Apple platform reviewers. · View Herald Transcript
Restricted Application added a reviewer: Material Motion. · View Herald Transcript
  • Provide the fab as an argument.
This revision is now accepted and ready to land.Tue, May 16, 3:32 PM
markwei accepted this revision.Tue, May 16, 3:58 PM
markwei added a subscriber: markwei.
markwei added inline comments.
src/transitions/fab-fullscreen/FABFullScreenTransition.swift
54

Is the idea that the fallback transition will be used for going backwards?

featherless added inline comments.Tue, May 16, 4:43 PM
src/transitions/fab-fullscreen/FABFullScreenTransition.swift
54

Yep - Line 35 has that logic.

Tweak the implementation to match spec and improve animation timings.

markwei accepted this revision.Tue, May 16, 6:26 PM
markwei added inline comments.
src/transitions/fab-fullscreen/FABFullScreenTransition.swift
136

just curious - when do you parameterize Tween vs not?

featherless added inline comments.Tue, May 16, 6:30 PM
src/transitions/fab-fullscreen/FABFullScreenTransition.swift
136

Integer values default to the Int type which conflicts with our property type of CGFloat, so we have to be explicit here.

I made an override for createProperty that turns Int properties into CGFloat properties by default and may do the same for Tween to simplify their use.

  • Remove context retreiver APIs.
  • Add todo.
This revision was automatically updated to reflect the committed changes.