Skip to content

FrakSharing

class FrakSharing

The Frak sharing sheet. Build it once per screen, warm it when a share affordance becomes visible, then present on the tap.

A sheet that is up survives a configuration change, but not process death. Use one instance per Activity: two share a warm web view and a “one sheet at a time” guard, and after a configuration change a live session reports to whichever was built first, not whichever presented.

NameSummary
Builderclass Builder(callback: FrakSharing.ResultCallback)
Builds a FrakSharing against a hosting Activity.
ResultCallbackfun interface ResultCallback
How a sharing session ended. Always invoked on the main thread, and it can arrive after the hosting Activity is destroyed, so write it defensively. Should be a stable reference.
NameSummary
presentfun present(request: SharingRequest)
Opens the sheet. No-op if the hosting Activity is finishing, destroyed, or not at least STARTED.
warmfun warm()
Starts warming the pooled web view and the identity/config reads. Call when a share affordance becomes visible; cheap to call repeatedly, and present implies it.