Skip to content

Content size awareness #102

@ilyapuchka

Description

@ilyapuchka

Similarly to the issues described in #101 there seems to be no good way to consider content size of the view presented in the drawer for it's partially expanded state (as well as for fully expanded).
I've tried to solve that by adopting DrawerPresentable and return the content size from its heightOfPartiallyExpandedDrawer like this:

extension DrawerMapPlaceDetailsViewController: DrawerPresentable, DrawerAnimationParticipant {
    public var heightOfPartiallyExpandedDrawer: CGFloat {
        return self.tableView.contentSize.height + (view.window?.safeAreaInsets.bottom ?? 0)
    }
}

This seems to work visually without issues but internally the state of the drawer changes and it is not in the partially expanded state because during transition the value returned by this method changes from 0 to final value (for some reason it changes one more time adding 4 pixels, but that's probably for reasons unrelated to DrawerKit) and as a result drawer is in the transitioning state, which breaks interactions with background view a they are only considering "final" states (collapsed, partially expanded and fully expanded).
One fix for that might be to consider transition state while detecting touches, but that does not seem like a solution of underlying problem.

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