[ADD] WIP: Add My Apps view with support for sideloading new apps, refreshing installed apps and much more

This commit is contained in:
Fabian Thies
2022-12-21 17:45:44 +01:00
committed by Joe Mattiello
parent a0eb30f98e
commit 02e48a207f
10 changed files with 797 additions and 25 deletions

View File

@@ -60,7 +60,11 @@ struct AppPillButton: View {
func handleButton() {
if let installedApp {
self.openApp(installedApp)
if showRemainingDays {
self.refreshApp(installedApp)
} else {
self.openApp(installedApp)
}
} else if let storeApp {
self.installApp(storeApp)
}
@@ -70,6 +74,10 @@ struct AppPillButton: View {
UIApplication.shared.open(installedApp.openAppURL)
}
func refreshApp(_ installedApp: InstalledApp) {
}
func installApp(_ storeApp: StoreApp) {
let previousProgress = AppManager.shared.installationProgress(for: storeApp)
guard previousProgress == nil else {

View File

@@ -16,6 +16,8 @@ struct AppRowView: View {
(app as? StoreApp) ?? (app as? InstalledApp)?.storeApp
}
var showRemainingDays: Bool = false
var body: some View {
HStack(alignment: .center, spacing: 12) {
AppIconView(iconUrl: storeApp?.iconURL)
@@ -36,11 +38,10 @@ struct AppRowView: View {
Spacer()
AppPillButton(app: app)
AppPillButton(app: app, showRemainingDays: showRemainingDays)
}
.padding()
.blurBackground(.systemUltraThinMaterialLight)
.background(Color(storeApp?.tintColor ?? UIColor.black).opacity(0.4))
.tintedBackground(Color(storeApp?.tintColor ?? UIColor(Color.accentColor)))
.clipShape(RoundedRectangle(cornerRadius: 30, style: .circular))
}
}