|
| 1 | +#if canImport(AndroidSwiftUI) |
| 2 | +import AndroidSwiftUI |
| 3 | +#else |
| 4 | +import SwiftUI |
| 5 | +#endif |
| 6 | + |
| 7 | +struct GraphicsPlayground: View { |
| 8 | + var body: some View { |
| 9 | + ScrollView { |
| 10 | + VStack(alignment: .leading, spacing: 0) { |
| 11 | + Example("Shapes") { |
| 12 | + HStack(spacing: 12) { |
| 13 | + Rectangle().fill(.blue).frame(width: 60, height: 60) |
| 14 | + Circle().fill(.green).frame(width: 60, height: 60) |
| 15 | + Capsule().fill(.orange).frame(width: 90, height: 40) |
| 16 | + RoundedRectangle(cornerRadius: 12).fill(.purple).frame(width: 60, height: 60) |
| 17 | + } |
| 18 | + } |
| 19 | + Example("Linear gradient (horizontal)") { |
| 20 | + LinearGradient(colors: [.blue, .purple], startPoint: .leading, endPoint: .trailing) |
| 21 | + .frame(height: 60) |
| 22 | + .cornerRadius(8) |
| 23 | + } |
| 24 | + Example("Linear gradient (vertical)") { |
| 25 | + LinearGradient(colors: [.orange, .red, .pink], startPoint: .top, endPoint: .bottom) |
| 26 | + .frame(height: 80) |
| 27 | + .cornerRadius(8) |
| 28 | + } |
| 29 | + Example("SF Symbols") { |
| 30 | + HStack(spacing: 16) { |
| 31 | + Image(systemName: "star.fill").foregroundColor(.yellow) |
| 32 | + Image(systemName: "heart.fill").foregroundColor(.red) |
| 33 | + Image(systemName: "trash").foregroundColor(.gray) |
| 34 | + Image(systemName: "gear") |
| 35 | + Image(systemName: "bell.fill").foregroundColor(.blue) |
| 36 | + } |
| 37 | + } |
| 38 | + Example("Symbols sized") { |
| 39 | + HStack(spacing: 16) { |
| 40 | + Image(systemName: "star.fill").frame(width: 40, height: 40).foregroundColor(.orange) |
| 41 | + Image(systemName: "cart.fill").frame(width: 40, height: 40).foregroundColor(.green) |
| 42 | + Image(systemName: "person.fill").frame(width: 40, height: 40).foregroundColor(.blue) |
| 43 | + } |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | + } |
| 48 | +} |
0 commit comments