From 1f982312e1e860547111652c38f5584d82baf257 Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Sat, 14 Sep 2024 22:10:02 +0200 Subject: [PATCH] Loading and LogoViews --- Views/BuildingBlocks/LoadingView.swift | 29 +++++++++++++++++++++++++- Views/Welcome.swift | 4 +++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Views/BuildingBlocks/LoadingView.swift b/Views/BuildingBlocks/LoadingView.swift index 0a7e43b0..6d3f7d16 100644 --- a/Views/BuildingBlocks/LoadingView.swift +++ b/Views/BuildingBlocks/LoadingView.swift @@ -15,7 +15,7 @@ import SwiftUI -struct LoadingView: View { +struct LogoView: View { var body: some View { GeometryReader { geometry in Image("kiwix-full") @@ -29,6 +29,33 @@ struct LoadingView: View { } } +struct LoadingProgressView: View { + var body: some View { + GeometryReader { geometry in + ProgressView() + .progressViewStyle(.circular) + .tint(Color.primary) + .frame( + width: geometry.size.width * 0.618, + height: geometry.size.height * 0.191 + ) + .position( + x: geometry.size.width * 0.5, + y: geometry.size.height * 0.809 + ) + } + } +} + +struct LoadingView: View { + var body: some View { + ZStack { + LogoView() + LoadingProgressView() + }.ignoresSafeArea() + } +} + #Preview { LoadingView() } diff --git a/Views/Welcome.swift b/Views/Welcome.swift index 087eb5bc..f71200bb 100644 --- a/Views/Welcome.swift +++ b/Views/Welcome.swift @@ -34,7 +34,9 @@ struct Welcome: View { var body: some View { if zimFiles.isEmpty { - LoadingView().ignoresSafeArea() + ZStack { + LogoView() + }.ignoresSafeArea() // ZStack { // LoadingView() // HStack {