mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add a non-working sheet for changing voice
This commit is contained in:
parent
111029a3f6
commit
4b04d3bbc9
1 changed files with 27 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ public struct MiniPlayer: View {
|
|||
|
||||
@State var expanded = false
|
||||
@State var offset: CGFloat = 0
|
||||
@State var showVoiceSheet = false
|
||||
@Namespace private var animation
|
||||
|
||||
let minExpandedHeight = UIScreen.main.bounds.height / 3
|
||||
|
|
@ -284,7 +285,7 @@ public struct MiniPlayer: View {
|
|||
|
||||
Menu {
|
||||
Button("View Article", action: { viewArticle() })
|
||||
Button("Change Voice", action: {})
|
||||
Button("Change Voice", action: { showVoiceSheet = true })
|
||||
} label: {
|
||||
VStack {
|
||||
Image(systemName: "ellipsis")
|
||||
|
|
@ -305,6 +306,8 @@ public struct MiniPlayer: View {
|
|||
)
|
||||
.onTapGesture {
|
||||
withAnimation(.easeIn(duration: 0.08)) { expanded = true }
|
||||
}.sheet(isPresented: $showVoiceSheet) {
|
||||
changeVoiceView
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -326,6 +329,29 @@ public struct MiniPlayer: View {
|
|||
}
|
||||
}
|
||||
|
||||
var changeVoiceView: some View {
|
||||
NavigationView {
|
||||
VStack {
|
||||
List {
|
||||
ForEach(["Jenny", "Guy"], id: \.self) { name in
|
||||
Button(action: {}) {
|
||||
Text(name)
|
||||
}
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
}
|
||||
}
|
||||
.padding(.top, 32)
|
||||
.listStyle(.plain)
|
||||
Spacer()
|
||||
}
|
||||
.navigationBarTitle("Change Voice")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarItems(leading: Button(action: { self.showVoiceSheet = false }) {
|
||||
Image(systemName: "chevron.backward")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func onDragChanged(value: DragGesture.Value) {
|
||||
if value.translation.height > 0, expanded {
|
||||
offset = value.translation.height
|
||||
|
|
|
|||
Loading…
Reference in a new issue