Remove unused camera components and refresh translations

This commit is contained in:
Matt Bruce 2026-01-05 09:38:02 -06:00
parent 1907ce773d
commit fa8ef4ca1a
6 changed files with 2256 additions and 2675 deletions

View File

@ -1,71 +0,0 @@
//
// ColorPickerOverlay.swift
// SelfieCam
//
// Created by Matt Bruce on 1/4/26.
//
import SwiftUI
import Bedrock
// MARK: - Color Picker Overlay
struct ColorPickerOverlay: View {
@Binding var selectedColor: Color
@Binding var isPresented: Bool
private let colors: [Color] = [
.white, .red, .orange, .yellow, .green, .blue, .purple, .pink,
.gray, .black, Color(red: 1.0, green: 0.5, blue: 0.0), // Coral
Color(red: 0.5, green: 1.0, blue: 0.5), // Mint
Color(red: 0.5, green: 0.5, blue: 1.0), // Periwinkle
Color(red: 1.0, green: 0.5, blue: 1.0), // Magenta
]
var body: some View {
ZStack {
// Semi-transparent background
Color.black.opacity(Design.Opacity.medium)
.ignoresSafeArea()
// Color picker content
VStack(spacing: Design.Spacing.medium) {
// Header
Text("Ring Light Color")
.font(.system(size: 18, weight: .semibold))
.foregroundStyle(Color.white)
// Color grid
LazyVGrid(columns: Array(repeating: GridItem(.flexible()), count: 4), spacing: Design.Spacing.small) {
ForEach(colors, id: \.self) { color in
Circle()
.fill(color)
.frame(width: 50, height: 50)
.overlay(
Circle()
.stroke(Color.white.opacity(selectedColor == color ? 1.0 : 0.3), lineWidth: selectedColor == color ? 3 : 1)
)
.onTapGesture {
selectedColor = color
isPresented = false
}
}
}
// Done button
Button("Done") {
isPresented = false
}
.font(.system(size: 16, weight: .medium))
.foregroundStyle(Color.white)
.padding(.vertical, Design.Spacing.small)
}
.padding(Design.Spacing.large)
.background(
RoundedRectangle(cornerRadius: Design.CornerRadius.large)
.fill(Color.black.opacity(Design.Opacity.strong))
)
.padding(.horizontal, Design.Spacing.large)
}
}
}

View File

@ -1,254 +0,0 @@
//
// ExpandableControlsPanel.swift
// CameraTester
//
// Created by Matt Bruce on 1/2/26.
//
import SwiftUI
import Bedrock
import MijickCamera
// MARK: - Expandable Controls Panel
struct ExpandableControlsPanel: View {
@Binding var isExpanded: Bool
// Collapsed state info
let hasActiveSettings: Bool
let activeSettingsIcons: [String]
// Control properties
let flashMode: CameraFlashMode
let flashIcon: String
let onFlashTap: () -> Void
let isFlashSyncedWithRingLight: Bool
let onFlashSyncTap: () -> Void
let hdrMode: CameraHDRMode
let hdrIcon: String
let onHDRTap: () -> Void
let isGridVisible: Bool
let gridIcon: String
let onGridTap: () -> Void
let photoQuality: PhotoQuality
let onQualityTap: () -> Void
let isCenterStageAvailable: Bool
let isCenterStageEnabled: Bool
let onCenterStageTap: () -> Void
let isFrontCamera: Bool
let onFlipCameraTap: () -> Void
let isRingLightEnabled: Bool
let onRingLightTap: () -> Void
let ringLightColor: Color
let onRingLightColorTap: () -> Void
let ringLightSize: CGFloat
let onRingLightSizeTap: () -> Void
let ringLightOpacity: Double
let onRingLightOpacityTap: () -> Void
// Layout constants
private let collapsedHeight: CGFloat = 36
private let iconSize: CGFloat = 16
private let maxVisibleIcons: Int = 3
// Grid layout
private let columns = [
GridItem(.flexible()),
GridItem(.flexible()),
GridItem(.flexible())
]
var body: some View {
VStack(spacing: 0) {
// Header row (always visible) - acts as the collapsed pill
Button(action: { isExpanded.toggle() }) {
HStack(spacing: Design.Spacing.small) {
// Chevron that rotates
Image(systemName: "chevron.down")
.font(.system(size: iconSize, weight: .semibold))
.foregroundStyle(Color.white)
.rotationEffect(.degrees(isExpanded ? 180 : 0))
// Show active setting icons when collapsed
if !isExpanded && hasActiveSettings {
HStack(spacing: Design.Spacing.xSmall) {
ForEach(activeSettingsIcons.prefix(maxVisibleIcons), id: \.self) { icon in
Image(systemName: icon)
.font(.system(size: iconSize, weight: .medium))
.foregroundStyle(Color.yellow)
}
}
}
if isExpanded {
Spacer()
}
}
.frame(height: collapsedHeight)
.frame(maxWidth: isExpanded ? .infinity : nil)
.padding(.horizontal, Design.Spacing.medium)
}
.accessibilityLabel("Camera controls")
.accessibilityHint(isExpanded ? "Tap to collapse settings" : "Tap to expand camera settings")
// Expandable content
if isExpanded {
ScrollView {
VStack(spacing: Design.Spacing.large) {
// Camera Controls Section
VStack(spacing: Design.Spacing.medium) {
// Section header
Text("Camera Controls")
.font(.system(size: 14, weight: .semibold))
.foregroundStyle(Color.white.opacity(0.8))
.frame(maxWidth: .infinity, alignment: .leading)
// Controls grid
LazyVGrid(columns: columns, spacing: Design.Spacing.medium) {
// Flash
ExpandedControlItem(
icon: flashIcon,
label: flashLabel,
isActive: flashMode != .off,
action: onFlashTap
)
// Flash Sync
ExpandedControlItem(
icon: isFlashSyncedWithRingLight ? "link" : "link.slash",
label: "SYNC",
isActive: isFlashSyncedWithRingLight,
action: onFlashSyncTap
)
// HDR
ExpandedControlItem(
icon: hdrIcon,
label: hdrLabel,
isActive: hdrMode != .off,
action: onHDRTap
)
// Grid
ExpandedControlItem(
icon: gridIcon,
label: "GRID",
isActive: isGridVisible,
action: onGridTap
)
// Quality
ExpandedControlItem(
icon: photoQuality.icon,
label: photoQuality.rawValue.uppercased(),
isActive: false,
action: onQualityTap
)
// Center Stage (if available)
if isCenterStageAvailable {
ExpandedControlItem(
icon: isCenterStageEnabled ? "person.crop.rectangle.fill" : "person.crop.rectangle",
label: "STAGE",
isActive: isCenterStageEnabled,
action: onCenterStageTap
)
}
// Flip Camera
ExpandedControlItem(
icon: "arrow.triangle.2.circlepath.camera",
label: isFrontCamera ? "FRONT" : "BACK",
isActive: false,
action: onFlipCameraTap
)
}
}
// Ring Light Section
VStack(spacing: Design.Spacing.medium) {
// Section header
Text("Ring Light")
.font(.system(size: 14, weight: .semibold))
.foregroundStyle(Color.white.opacity(0.8))
.frame(maxWidth: .infinity, alignment: .leading)
// Ring light controls grid
LazyVGrid(columns: columns, spacing: Design.Spacing.medium) {
// Ring Light Enable/Disable
ExpandedControlItem(
icon: isRingLightEnabled ? "circle.fill" : "circle",
label: "ENABLE",
isActive: isRingLightEnabled,
action: onRingLightTap
)
// Ring Color
ExpandedControlItem(
icon: "circle.fill",
label: "COLOR",
isActive: false,
action: onRingLightColorTap
)
.foregroundStyle(ringLightColor)
// Ring Size
ExpandedControlItem(
icon: "circle",
label: "SIZE",
isActive: false,
action: onRingLightSizeTap
)
// Ring Brightness
ExpandedControlItem(
icon: "circle.fill",
label: "BRIGHT",
isActive: false,
action: onRingLightOpacityTap
)
.foregroundStyle(Color.white.opacity(ringLightOpacity))
}
}
}
.padding(.top, Design.Spacing.small)
.padding(.bottom, Design.Spacing.medium)
.padding(.horizontal, Design.Spacing.small)
}
.frame(maxHeight: 400) // Limit max height to prevent excessive scrolling
.scrollIndicators(.hidden) // Hide scroll indicators for cleaner look
}
}
.padding(.horizontal, Design.Spacing.small)
.background(
RoundedRectangle(cornerRadius: isExpanded ? Design.CornerRadius.large : collapsedHeight / 2)
.fill(Color.black.opacity(isExpanded ? Design.Opacity.strong : Design.Opacity.medium))
)
.animation(.easeInOut(duration: 0.25), value: isExpanded)
}
private var flashLabel: String {
switch flashMode {
case .off: return "FLASH"
case .auto: return "AUTO"
case .on: return "ON"
}
}
private var hdrLabel: String {
switch hdrMode {
case .off: return "HDR"
case .auto: return "AUTO"
case .on: return "ON"
}
}
}

View File

@ -1,45 +0,0 @@
//
// ExpandedControlItem.swift
// CameraTester
//
// Created by Matt Bruce on 1/2/26.
//
import SwiftUI
import Bedrock
// MARK: - Expanded Control Item
struct ExpandedControlItem: View {
let icon: String
let label: String
let isActive: Bool
let action: () -> Void
// Layout constants
private let iconSize: CGFloat = 28
private let buttonSize: CGFloat = 56
private let labelFontSize: CGFloat = 10
var body: some View {
Button(action: action) {
VStack(spacing: Design.Spacing.xSmall) {
ZStack {
Circle()
.fill(isActive ? Color.yellow : Color.black.opacity(Design.Opacity.light))
.frame(width: buttonSize, height: buttonSize)
Image(systemName: icon)
.font(.system(size: iconSize, weight: .medium))
.foregroundStyle(isActive ? Color.black : Color.white)
}
Text(label)
.font(.system(size: labelFontSize, weight: .medium))
.foregroundStyle(isActive ? Color.yellow : Color.white)
}
}
.accessibilityLabel("\(label)")
.accessibilityValue(isActive ? "On" : "Off")
}
}

View File

@ -1,72 +0,0 @@
//
// OpacitySliderOverlay.swift
// SelfieCam
//
// Created by Matt Bruce on 1/4/26.
//
import SwiftUI
import Bedrock
// MARK: - Opacity Slider Overlay
struct OpacitySliderOverlay: View {
@Binding var selectedOpacity: Double
@Binding var isPresented: Bool
private let minOpacity: Double = 0.1
private let maxOpacity: Double = 1.0
var body: some View {
ZStack {
// Semi-transparent background
Color.black.opacity(Design.Opacity.medium)
.ignoresSafeArea()
// Opacity slider content
VStack(spacing: Design.Spacing.medium) {
// Header
Text("Ring Light Brightness")
.font(.system(size: 18, weight: .semibold))
.foregroundStyle(Color.white)
// Current opacity display as percentage
Text("\(Int(selectedOpacity * 100))%")
.font(.system(size: 24, weight: .bold))
.foregroundStyle(Color.white)
.frame(width: 80)
// Slider
Slider(value: $selectedOpacity, in: minOpacity...maxOpacity, step: 0.05)
.tint(Color.white)
.padding(.horizontal, Design.Spacing.medium)
// Opacity range labels
HStack {
Text("10%")
.font(.system(size: 14))
.foregroundStyle(Color.white.opacity(0.7))
Spacer()
Text("100%")
.font(.system(size: 14))
.foregroundStyle(Color.white.opacity(0.7))
}
.padding(.horizontal, Design.Spacing.medium)
// Done button
Button("Done") {
isPresented = false
}
.font(.system(size: 16, weight: .medium))
.foregroundStyle(Color.white)
.padding(.vertical, Design.Spacing.small)
}
.padding(Design.Spacing.large)
.background(
RoundedRectangle(cornerRadius: Design.CornerRadius.large)
.fill(Color.black.opacity(Design.Opacity.strong))
)
.padding(.horizontal, Design.Spacing.large)
}
}
}

View File

@ -1,72 +0,0 @@
//
// SizeSliderOverlay.swift
// SelfieCam
//
// Created by Matt Bruce on 1/4/26.
//
import SwiftUI
import Bedrock
// MARK: - Size Slider Overlay
struct SizeSliderOverlay: View {
@Binding var selectedSize: CGFloat
@Binding var isPresented: Bool
private let minSize: CGFloat = SettingsViewModel.minRingSize
private let maxSize: CGFloat = SettingsViewModel.maxRingSize
var body: some View {
ZStack {
// Semi-transparent background
Color.black.opacity(Design.Opacity.medium)
.ignoresSafeArea()
// Size slider content
VStack(spacing: Design.Spacing.medium) {
// Header
Text("Ring Light Size")
.font(.system(size: 18, weight: .semibold))
.foregroundStyle(Color.white)
// Current size display
Text("\(Int(selectedSize))")
.font(.system(size: 24, weight: .bold))
.foregroundStyle(Color.white)
.frame(width: 60)
// Slider
Slider(value: $selectedSize, in: minSize...maxSize, step: 5)
.tint(Color.white)
.padding(.horizontal, Design.Spacing.medium)
// Size range labels
HStack {
Text("\(Int(minSize))")
.font(.system(size: 14))
.foregroundStyle(Color.white.opacity(0.7))
Spacer()
Text("\(Int(maxSize))")
.font(.system(size: 14))
.foregroundStyle(Color.white.opacity(0.7))
}
.padding(.horizontal, Design.Spacing.medium)
// Done button
Button("Done") {
isPresented = false
}
.font(.system(size: 16, weight: .medium))
.foregroundStyle(Color.white)
.padding(.vertical, Design.Spacing.small)
}
.padding(Design.Spacing.large)
.background(
RoundedRectangle(cornerRadius: Design.CornerRadius.large)
.fill(Color.black.opacity(Design.Opacity.strong))
)
.padding(.horizontal, Design.Spacing.large)
}
}
}

File diff suppressed because it is too large Load Diff