-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0de6070
commit 97135fe
Showing
10 changed files
with
383 additions
and
54 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
68 changes: 68 additions & 0 deletions
68
AppliverySDK/Applivery/Modules/Screenshoot/Screens/VideoPreviewScreen.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,68 @@ | ||
// | ||
// VideoPreviewScreen.swift | ||
// | ||
// | ||
// Created by Fran Alarza on 12/9/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct VideoPreviewScreen: View { | ||
let viewModel = ScreenshootViewModel() | ||
@Environment(\.dismiss) var dismiss | ||
@State var url: URL? | ||
@State var user: String = "" | ||
@State var description: String = "" | ||
@State var reportType: FeedbackType = .feedback | ||
@State var imageLines: [Line] = [] | ||
@FocusState var focused: Bool | ||
|
||
var body: some View { | ||
NavigationView { | ||
VStack(spacing: 12) { | ||
Divider() | ||
ReportTypeView(reportType: $reportType) | ||
Divider() | ||
EmailTextFieldView(user: $user) { | ||
focused = true | ||
} | ||
Divider() | ||
TextEditor(text: $description) | ||
.frame(maxHeight: .infinity) | ||
.lineLimit(0) | ||
.focused($focused) | ||
Spacer() | ||
VideoPreviewRow(videoURL: $url) | ||
.frame(height: 64) | ||
} | ||
.padding() | ||
.navigationBarTitleDisplayMode(.inline) | ||
.navigationTitle("Send \(reportType.rawValue.capitalized)") | ||
.toolbar(content: { | ||
ToolbarItem(placement: .topBarLeading) { | ||
Button(action: { | ||
dismiss.callAsFunction() | ||
}, label: { | ||
Text("X") | ||
.font(.system(size: 20)) | ||
.foregroundColor(.black) | ||
}) | ||
} | ||
|
||
ToolbarItem(placement: .topBarTrailing) { | ||
Button(action: { | ||
|
||
}, label: { | ||
Image(systemName: "location.fill") | ||
.foregroundColor(.blue) | ||
.rotationEffect(.degrees(10)) | ||
}) | ||
} | ||
}) | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
VideoPreviewScreen() | ||
} |
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
36 changes: 36 additions & 0 deletions
36
AppliverySDK/Applivery/Modules/Screenshoot/Views/ColorPickerView.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,36 @@ | ||
// | ||
// ColorPickerView.swift | ||
// | ||
// | ||
// Created by Fran Alarza on 12/9/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ColorPickerView: View { | ||
@Binding var selectedColor: Color | ||
let colors: [Color] = [.blue, .red, .black, .pink, .yellow, .green] | ||
var body: some View { | ||
HStack { | ||
ForEach(colors, id: \.description) { color in | ||
buildColorSelector(color: color) | ||
} | ||
} | ||
} | ||
|
||
func buildColorSelector(color: Color) -> some View { | ||
Image(systemName: selectedColor == color ? "smallcircle.filled.circle.fill" : "circle.fill") | ||
.foregroundColor(color) | ||
.font(.system(size: 16)) | ||
.clipShape(Circle()) | ||
.frame(maxWidth: .infinity) | ||
.onTapGesture { | ||
selectedColor = color | ||
} | ||
} | ||
|
||
} | ||
|
||
#Preview { | ||
return ColorPickerView(selectedColor: .constant(.blue)) | ||
} |
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
31 changes: 31 additions & 0 deletions
31
AppliverySDK/Applivery/Modules/Screenshoot/Views/EmailTextFieldView.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,31 @@ | ||
// | ||
// EmailTextFieldView.swift | ||
// | ||
// | ||
// Created by Fran Alarza on 12/9/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct EmailTextFieldView: View { | ||
@Binding var user: String | ||
let onSubmit: () -> Void | ||
|
||
var body: some View { | ||
HStack(spacing: 16) { | ||
Text("From:") | ||
TextField("Introduce your email", text: $user) | ||
.textContentType(.emailAddress) | ||
.keyboardType(.emailAddress) | ||
.submitLabel(.next) | ||
.onSubmit { | ||
onSubmit() | ||
} | ||
Spacer() | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
EmailTextFieldView(user: .constant("[email protected]"), onSubmit: {}) | ||
} |
Oops, something went wrong.