Sora/Sora/ContentView.swift
50/50 400079f0da
May God be with you (#141)
* Minor changes

* more minor changes

* MORE MINOR CHANGES

* Fixed one singular bug

* Update SettingsViewGeneral.swift

* fuck conflicts

* fuck you and your credits

* buh buh

* Update SettingsViewAbout.swift

* What's that? What's a properly working code without unnecessary issues?

* Type shit maybe?

* Create ios.yml

* smol

* type shi

shi

* end

* Fixed system theme bug

* (hopefully) fixed sliding items in search + recent searches spam

* Fixed open keyboard in media view

* Fixed searchviewdata + fixed toggle color being too light

* fixed episode slider sensitivity

* new recent searches, not fully done but wtv WHO CARES 💯

* Add module screen fix

* Delete .github/workflows/ios.yml

* UI modifications

* Scroll to close keyboard

* Text change

* Downloadview transition

* Search cards text fixed

* Reduced header spacing + moved down a to match library

* Text change

* Small tab bar tweak for search view

* added gradient to player buttons

* reduced summary size

* IBH special 💯

* Fixed different height text?

* Removed seperator

* Some more fixes

start watching button

* MediaInfoView modifications

* Fixed settingsviewdata

* Changed x mark and fixed episode swipe for 4 items

* Delete Package.resolved

* fix

* fix

* Update Package.resolved

* Removed version lalel type shi
2025-05-31 20:56:06 +02:00

63 lines
1.9 KiB
Swift

//
// ContentView.swift
// Sora
//
// Created by Francesco on 06/01/25.
//
import SwiftUI
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.environmentObject(LibraryManager())
.environmentObject(ModuleManager())
.environmentObject(Settings())
}
}
struct ContentView: View {
@StateObject private var tabBarController = TabBarController()
@State var selectedTab: Int = 0
@State var lastTab: Int = 0
@State private var searchQuery: String = ""
let tabs: [TabItem] = [
TabItem(icon: "square.stack", title: ""),
TabItem(icon: "arrow.down.circle", title: ""),
TabItem(icon: "gearshape", title: ""),
TabItem(icon: "magnifyingglass", title: "")
]
var body: some View {
ZStack(alignment: .bottom) {
switch selectedTab {
case 0:
LibraryView()
.environmentObject(tabBarController)
case 1:
DownloadView()
.environmentObject(tabBarController)
case 2:
SettingsView()
.environmentObject(tabBarController)
case 3:
SearchView(searchQuery: $searchQuery)
.environmentObject(tabBarController)
default:
LibraryView()
.environmentObject(tabBarController)
}
TabBar(
tabs: tabs,
selectedTab: $selectedTab,
lastTab: $lastTab,
searchQuery: $searchQuery,
controller: tabBarController
)
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottom)
.ignoresSafeArea(.keyboard, edges: .bottom)
.padding(.bottom, -20)
}
}