Skip to content

Drawer top corner always set to 0 even when .fullExpansionBehaviour set to leavesCustomGap(gap:) #72

@MainasuK

Description

@MainasuK

I set drawer not cover the whole screen when full expansion. However, top corner mask disappeared. But I really want the corner exist when drawer not modal fully.

configuration.fullExpansionBehaviour to .leavesCustomGap(gap: 135)
configuration.cornerAnimationOption = .alwaysShowBelowStatusBar

I have skimmed the Internal API. This may be caused cornerRadius set to 0 in animator's completionHandler.

// PresentationController+Animation.swift
let shouldSetCornerRadiusToZero =
    (isEndingStateCollapsedOrFullyExpanded && endingPosition == .end) ||
    (isStartingStateCollapsedOrFullyExpanded && endingPosition == .start)
self.currentDrawerCornerRadius = 0

Not sure this behavior indeed we want. And I temporary change that to get AppleMusic.app likely behavior. Please let me know If another configuration option could get the same behavior I want. 😃

// PresentationController+Animation.swift
if case DrawerConfiguration.FullExpansionBehaviour.leavesCustomGap(gap: _) = self.configuration.fullExpansionBehaviour {
    self.currentDrawerCornerRadius = maxCornerRadius
} else if maxCornerRadius != 0 && shouldSetCornerRadiusToZero {
    self.currentDrawerCornerRadius = 0
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions