Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MainasuK opened this issue Sep 12, 2018 · 1 comment

Comments

@MainasuK
Copy link

MainasuK commented Sep 12, 2018

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
}
@wltrup
Copy link
Contributor

wltrup commented Oct 11, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants