class UI::ActivityView

Overview

UI::ActivityView — share sheet / activity view component.

HIG abstract: "An activity view — often called a share sheet — presents a range of tasks that people can perform in the current context."

Layout (four zones, top-to-bottom):

  1. Header: HStack(thumbnail, VStack(title, subtitle))
  2. Destinations: horizontal ScrollView of circular destination glyphs (~60pt) with labels below each.
  3. Actions: two-column grid of action tiles (icon + label).
  4. Cancel: full-width semibold Cancel button at bottom.

HIG Platform considerations: "Not supported in macOS, tvOS, or watchOS." On macOS the renderer emits an NSVisualEffectView popover approximation with all four zones rendered inline for validation, while runtime sharing can present NSSharingServicePicker from the same view model. On iOS the visitor renders inline for the validation capture path and presents UIActivityViewController when #is_presented is true and a share payload is present.

Glass material: NSVisualEffectMaterialPopover (6) on macOS; UIBlurEffect(systemChromeMaterial) / UIGlassEffect on iOS 26.

Defined in:

ui/views/activity_view.cr

Constructors

Instance Method Summary

Instance methods inherited from class UI::View

accept(visitor : PlatformVisitor) accept, accessibility_label : String | Nil accessibility_label, accessibility_label=(accessibility_label : String | Nil) accessibility_label=, background : Color | Nil background, background=(background : Color | Nil) background=, blur_radius : Float64 blur_radius, blur_radius=(blur_radius : Float64) blur_radius=, border_color : Color | Nil border_color, border_color=(border_color : Color | Nil) border_color=, border_width : Float64 border_width, border_width=(border_width : Float64) border_width=, clip_to_bounds : Bool clip_to_bounds, clip_to_bounds=(clip_to_bounds : Bool) clip_to_bounds=, container_query(name : String) : self container_query, container_query_name : String | Nil container_query_name, container_query_name=(container_query_name : String | Nil) container_query_name=, corner_radius : Float64 corner_radius, corner_radius=(corner_radius : Float64) corner_radius=, fill_screen! : self fill_screen!, fluid_height(min : String | Number, ideal : String | Number, max : String | Number) : self
fluid_height : UI::Fluid | Nil
fluid_height
, fluid_height=(fluid_height : UI::Fluid | Nil) fluid_height=, fluid_width(min : String | Number, ideal : String | Number, max : String | Number) : self
fluid_width : UI::Fluid | Nil
fluid_width
, fluid_width=(fluid_width : UI::Fluid | Nil) fluid_width=, hidden : Bool hidden, hidden=(hidden : Bool) hidden=, id : String | Nil id, id=(id : String | Nil) id=, maximum_height : Float64 | Nil maximum_height, maximum_height=(maximum_height : Float64 | Nil) maximum_height=, maximum_width : Float64 | Nil maximum_width, maximum_width=(maximum_width : Float64 | Nil) maximum_width=, minimum_height : Float64 | Nil minimum_height, minimum_height=(minimum_height : Float64 | Nil) minimum_height=, minimum_width : Float64 | Nil minimum_width, minimum_width=(minimum_width : Float64 | Nil) minimum_width=, opacity : Float64 opacity, opacity=(opacity : Float64) opacity=, padding : EdgeInsets padding, padding=(padding : EdgeInsets) padding=, root_fill : Bool root_fill, root_fill=(root_fill : Bool) root_fill=, shadow_color : Color | Nil shadow_color, shadow_color=(shadow_color : Color | Nil) shadow_color=, shadow_offset_x : Float64 shadow_offset_x, shadow_offset_x=(shadow_offset_x : Float64) shadow_offset_x=, shadow_offset_y : Float64 shadow_offset_y, shadow_offset_y=(shadow_offset_y : Float64) shadow_offset_y=, shadow_radius : Float64 shadow_radius, shadow_radius=(shadow_radius : Float64) shadow_radius=, swiftkit_state_handle : Pointer(Void) | Nil swiftkit_state_handle, swiftkit_state_handle=(swiftkit_state_handle : Pointer(Void) | Nil) swiftkit_state_handle=, test_id : String | Nil test_id, test_id=(test_id : String | Nil) test_id=

Constructor Detail

def self.new(title : String, subtitle : String | Nil = nil, thumbnail : View | Nil = nil, destinations : Array(ActivityDestination) = [] of ActivityDestination, actions : Array(ActivityAction) = [] of ActivityAction, on_cancel : Proc(Nil) | Nil = nil) #

[View source]

Instance Method Detail

def accept(visitor : PlatformVisitor) #
Description copied from class UI::View

Accept a platform visitor for rendering dispatch. Each concrete view type calls visitor.visit(self).


[View source]
def actions : Array(ActivityAction) #

Zone 3 — Action tile grid


[View source]
def actions=(actions : Array(ActivityAction)) #

Zone 3 — Action tile grid


[View source]
def destinations : Array(ActivityDestination) #

Zone 2 — Horizontal destination row


[View source]
def destinations=(destinations : Array(ActivityDestination)) #

Zone 2 — Horizontal destination row


[View source]
def is_presented : Bool #

Presentation state. When true and share payload is present, native renderers present the platform share UI in addition to the inline validation layout used for previews.


[View source]
def is_presented=(is_presented : Bool) #

Presentation state. When true and share payload is present, native renderers present the platform share UI in addition to the inline validation layout used for previews.


[View source]
def on_cancel : Proc(Nil) | Nil #

Zone 4 — Cancel


[View source]
def on_cancel=(on_cancel : Proc(Nil) | Nil) #

Zone 4 — Cancel


[View source]
def share_subject : String | Nil #

[View source]
def share_subject=(share_subject : String | Nil) #

[View source]
def share_text : String | Nil #

Optional native share payload. These values power UIActivityViewController / NSSharingServicePicker for real app flows.


[View source]
def share_text=(share_text : String | Nil) #

Optional native share payload. These values power UIActivityViewController / NSSharingServicePicker for real app flows.


[View source]
def share_url : String | Nil #

[View source]
def share_url=(share_url : String | Nil) #

[View source]
def subtitle : String | Nil #

[View source]
def subtitle=(subtitle : String | Nil) #

[View source]
def thumbnail : View | Nil #

[View source]
def thumbnail=(thumbnail : View | Nil) #

[View source]
def title : String #

Zone 1 — Header


[View source]
def title=(title : String) #

Zone 1 — Header


[View source]