-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bookmarks view #59: Select/deselect all bookmarks
- Loading branch information
Showing
6 changed files
with
88 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ator/Views/ReaderView/Modes/Bookmarks/BookmarksView_Controls/BookmarksView_Controls.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// BookmarksView_List.swift | ||
// ReaderTranslator | ||
// | ||
// Created by Viktor Kushnerov on 6/12/19. | ||
// Copyright © 2019 Viktor Kushnerov. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct BookmarksView_Controls: View { | ||
@ObservedObject var store = Store.shared | ||
|
||
private var audioRateString: String { | ||
String(format: "%.1f", arguments: [self.store.longmanAudioRate]) | ||
} | ||
|
||
var body: some View { | ||
VStack { | ||
HStack { | ||
Text("\(store.bookmarks.checked.count)/\(store.bookmarks.count)") | ||
BookmarksView_Controls_ActionMenu() | ||
} | ||
audioRateButtonsView | ||
} | ||
} | ||
|
||
private var audioRateButtonsView: some View { | ||
HStack { | ||
Button(action: { self.store.longmanAudioRate = 0.2 }, label: { Text(".2") }) | ||
Button(action: { self.store.longmanAudioRate = 0.5 }, label: { Text(".5") }) | ||
Button(action: { self.store.longmanAudioRate -= 0.1 }, label: { Text("-") }) | ||
Text(audioRateString) | ||
Button(action: { self.store.longmanAudioRate += 0.1 }, label: { Text("+") }) | ||
Button(action: { self.store.longmanAudioRate = 1 }, label: { Text("1") }) | ||
} | ||
} | ||
} | ||
|
||
struct BookmarksView_Controls_Previews: PreviewProvider { | ||
static var previews: some View { | ||
BookmarksView_Controls() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters