Skip to content

Commit 23e573a

Browse files
committed
reuse ProgressOverlay in GenerativeAIUIComponents
1 parent 2445a88 commit 23e573a

File tree

2 files changed

+46
-25
lines changed

2 files changed

+46
-25
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import SwiftUI
16+
17+
public struct ProgressOverlay: View {
18+
public init() {}
19+
20+
public var body: some View {
21+
ZStack {
22+
Color.black.opacity(0.3)
23+
.ignoresSafeArea()
24+
25+
ZStack {
26+
RoundedRectangle(cornerRadius: 16)
27+
.fill(Material.ultraThinMaterial)
28+
.frame(width: 120, height: 100)
29+
.shadow(radius: 8)
30+
31+
VStack(spacing: 12) {
32+
ProgressView()
33+
.scaleEffect(1.5)
34+
35+
Text("Loading...")
36+
.font(.subheadline)
37+
.foregroundColor(.secondary)
38+
}
39+
}
40+
}
41+
}
42+
}
43+
44+
#Preview {
45+
ProgressOverlay()
46+
}

firebaseai/ImagenScreen/ImagenScreen.swift

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,31 +90,6 @@ struct ImagenScreen: View {
9090
}
9191
}
9292

93-
struct ProgressOverlay: View {
94-
var body: some View {
95-
ZStack {
96-
Color.black.opacity(0.3)
97-
.ignoresSafeArea()
98-
99-
ZStack {
100-
RoundedRectangle(cornerRadius: 16)
101-
.fill(Material.ultraThinMaterial)
102-
.frame(width: 120, height: 100)
103-
.shadow(radius: 8)
104-
105-
VStack(spacing: 12) {
106-
ProgressView()
107-
.scaleEffect(1.5)
108-
109-
Text("Loading...")
110-
.font(.subheadline)
111-
.foregroundColor(.secondary)
112-
}
113-
}
114-
}
115-
}
116-
}
117-
11893
#Preview {
11994
ImagenScreen(firebaseService: FirebaseAI.firebaseAI())
12095
}

0 commit comments

Comments
 (0)