DrawerKit icon indicating copy to clipboard operation
DrawerKit copied to clipboard

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

Open MainasuK opened this issue 6 years ago • 1 comments

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
}

MainasuK avatar Sep 12 '18 08:09 MainasuK

Hello, and thanks for using DrawerKit. I will take a closer look and get back to you soon.

wltrup avatar Oct 11 '18 09:10 wltrup