FloatingPanel icon indicating copy to clipboard operation
FloatingPanel copied to clipboard

Doubt on FloatingPanel.layoutAdapter.layout.initialPosition ?

Open DiwakarThapa opened this issue 5 years ago • 1 comments

When app launches floatingPanel.layoutAdapter.layout.initialPosition is half. After removing the panel from the parent using removePanelFromParent and adding same panel, the floatingPanel.layoutAdapter.layout.initialPosition is hidden . How could not figure out why is this happening ?

Custom Layout

class SearchIntrinsicLayout: FloatingPanelLayout {
    var topInteractionBuffer: CGFloat { return 0.0 }
    var bottomInteractionBuffer: CGFloat { return 0.0 }
    
    func backdropAlphaFor(position: FloatingPanelPosition) -> CGFloat {
        return 0.0
    }
    var initialPosition: FloatingPanelPosition {
        return .half
    }
    
    
    var supportedPositions: Set<FloatingPanelPosition> {
        return [.half,.full]
    }
    
    func insetFor(position: FloatingPanelPosition) -> CGFloat? {
        switch position {
        case .full: return 0
        case .half: return 281
        default: return nil
        }
    }
    
}

DiwakarThapa avatar Nov 19 '20 09:11 DiwakarThapa

I'm sorry I don't know, but it's strange because SearchIntrinsicLayout.initialPosition is a readonly property so it's not possible for it to become hidden.

scenee avatar Dec 12 '20 02:12 scenee