-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
9 changed files
with
334 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// LensFlare.swift | ||
// | ||
// | ||
// Created by Tatsuya Tanaka on 2022/03/22. | ||
// | ||
|
||
import Foundation | ||
import VCamLocalization | ||
|
||
public enum LensFlare: Int32, CaseIterable, Identifiable, CustomStringConvertible { | ||
case none, type1, type2, type3, type4 | ||
|
||
public var id: Self { self } | ||
|
||
public static func initOrNone(_ value: Int32) -> Self { | ||
.init(rawValue: value) ?? .none | ||
} | ||
|
||
public var description: String { | ||
switch self { | ||
case .none: | ||
return L10n.none.text | ||
case .type1: | ||
return L10n.typeNo("1").text | ||
case .type2: | ||
return L10n.typeNo("2").text | ||
case .type3: | ||
return L10n.typeNo("3").text | ||
case .type4: | ||
return L10n.typeNo("4").text | ||
} | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
app/xcode/Sources/VCamUI/UIComponent/UniFloatEditField.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,33 @@ | ||
// | ||
// UniFloatEditField.swift | ||
// | ||
// | ||
// Created by Tatsuya Tanaka on 2023/02/22. | ||
// | ||
|
||
import SwiftUI | ||
import VCamBridge | ||
|
||
public struct UniFloatEditField: View { | ||
public init(_ label: LocalizedStringKey, type: UniBridge.FloatType, format: String = "%.1f", range: ClosedRange<CGFloat>) { | ||
self.label = label | ||
_value = ExternalStateBinding(type) | ||
self.format = format | ||
self.range = range | ||
} | ||
|
||
private let label: LocalizedStringKey | ||
@ExternalStateBinding private var value: CGFloat | ||
private let format: String | ||
private let range: ClosedRange<CGFloat> | ||
|
||
public var body: some View { | ||
ValueEditField(label, value: $value, format: format, type: .slider(range)) | ||
} | ||
} | ||
|
||
extension UniFloatEditField: Equatable { | ||
public static func == (lhs: Self, rhs: Self) -> Bool { | ||
lhs.value == rhs.value && lhs.range == rhs.range && lhs.label == rhs.label | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// VCamContentView.swift | ||
// | ||
// | ||
// Created by Tatsuya Tanaka on 2022/04/09. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
public struct VCamContentView: View { | ||
public init() {} | ||
|
||
@EnvironmentObject var state: VCamUIState | ||
|
||
public var body: some View { | ||
content() | ||
.frame(maxWidth: .infinity) | ||
.padding(8) | ||
.background(.thinMaterial) | ||
} | ||
|
||
@ViewBuilder | ||
func content() -> some View { | ||
switch state.currentMenu { | ||
case .main: | ||
VCamMainView() | ||
case .screenEffect: | ||
VCamDisplayView() | ||
case .recording: | ||
VCamRecordingView() | ||
} | ||
} | ||
} | ||
|
||
struct VCamUI_Preview: PreviewProvider { | ||
static var previews: some View { | ||
return VCamContentView() | ||
.frame(width: 500, height: 300) | ||
.background(Color.white) | ||
} | ||
} |
Oops, something went wrong.