Skip to content

Commit

Permalink
Use latest LNPopupController
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoNatan committed Sep 25, 2023
1 parent e720de2 commit babc589
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ extension View {
}
}

func popupDemo(demoContent: DemoContent, isBarPresented: Binding<Bool>, isPopupOpen: Binding<Bool>? = nil, includeContextMenu: Bool = false, includeCustomTextLabels: Bool = false) -> some View {
func popupDemo(demoContent: DemoContent, isBarPresented: Binding<Bool>, isPopupOpen: Binding<Bool>? = nil, includeContextMenu: Bool = true, includeCustomTextLabels: Bool = false) -> some View {
return self.popup(isBarPresented: isBarPresented, isPopupOpen: isPopupOpen, onOpen: { print("Opened") }, onClose: { print("Closed") }) {
SafeAreaDemoView(colorSeed: "Popup", offset: true, isPopupOpen: isPopupOpen)
.if(includeCustomTextLabels) { view in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ import LNPopupUI
struct ViewDemoView : View {
@State private var isBarPresented: Bool = true
let onDismiss: () -> Void
let contextMenu: Bool
let demoContent: DemoContent

init(demoContent: DemoContent, contextMenu: Bool = false, onDismiss: @escaping () -> Void) {
self.contextMenu = contextMenu
init(demoContent: DemoContent, onDismiss: @escaping () -> Void) {
self.onDismiss = onDismiss
self.demoContent = demoContent
}

var body: some View {
InnerView(onDismiss: onDismiss)
.popupDemo(demoContent:demoContent, isBarPresented: $isBarPresented, includeContextMenu: contextMenu)
.popupDemo(demoContent:demoContent, isBarPresented: $isBarPresented, includeContextMenu: true)
}
}

Expand Down
3 changes: 0 additions & 3 deletions LNPopupUIExample/LNPopupUIExample/MusicScene/MusicView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ struct MusicView: View {
PlayerView(song: currentSong)
}
}
// .popupInteractionStyle(.drag)
.popupBarStyle(.prominent)
.popupBarProgressViewStyle(.top)
.popupBarMarqueeScrollEnabled(true)
}
}

Expand Down
9 changes: 0 additions & 9 deletions LNPopupUIExample/LNPopupUIExample/SceneSelection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ struct SceneSelection: View {
viewPresented.toggle()
}
})
Button("View + Context Menu Interaction") {
viewPresented.toggle()
}
.foregroundColor(Color(.label))
.fullScreenCover(isPresented: $viewPresented, content: {
ViewDemoView(demoContent: DemoContent(), contextMenu: true) {
viewPresented.toggle()
}
})
}
Section(header: Text("Demo App")) {
Button("Apple Music") {
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
],
dependencies: [
// .package(path: "../LNPopupController")
.package(url: "https://github.com/LeoNatan/LNPopupController.git", from: Version(stringLiteral: "2.15.2"))
.package(url: "https://github.com/LeoNatan/LNPopupController.git", from: Version(stringLiteral: "2.15.7"))
],
targets: [
.target(
Expand Down
Binary file modified Supplements/floating_bar_style.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Supplements/floating_custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Supplements/floating_no_scroll.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Supplements/open_floating_popup.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit babc589

Please sign in to comment.