Skip to content

Commit

Permalink
Improved visionOS experience
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddevdploeg committed Nov 26, 2024
1 parent a287664 commit 5c90047
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
23 changes: 17 additions & 6 deletions Sources/Views/BillboardBannerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public struct BillboardBannerView : View {
.contentShape(Rectangle())
}
.buttonStyle(.plain)
Spacer()

Group {
if !hideDismissButtonAndTimer {
Expand All @@ -90,16 +89,28 @@ public struct BillboardBannerView : View {
#endif
showAdvertisement = false
} label: {
Label("Dismiss advertisement", systemImage: "xmark.circle.fill")
.labelStyle(.iconOnly)
.font(.system(.title2, design: .rounded, weight: .bold))
.symbolRenderingMode(.hierarchical)
.imageScale(.large)
#if os(visionOS)
Label("Dismiss advertisement", systemImage: "xmark")
.labelStyle(.iconOnly)
.font(.system(.title3, design: .rounded, weight: .bold))
.symbolRenderingMode(.hierarchical)
#else
Label("Dismiss advertisement", systemImage: "xmark.circle.fill")
.labelStyle(.iconOnly)
.font(.system(.title2, design: .rounded, weight: .bold))
.symbolRenderingMode(.hierarchical)
.imageScale(.large)
#endif
}
#if !os(tvOS)
.controlSize(.large)
#endif
#if os(visionOS)

#else
.tint(advert.tint)

#endif
} else {
BillboardCountdownView(advert:advert,
totalDuration: config.duration,
Expand Down
8 changes: 2 additions & 6 deletions Sources/Views/BillboardTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ struct BillboardTextView : View {
}
}

struct BillboardTextView_Previews: PreviewProvider {
static var previews: some View {
DefaultAdView(advert: BillboardSamples.sampleDefaultAd)
}
#Preview {
BillboardTextView(advert: BillboardSamples.sampleDefaultAd)
}


10 changes: 10 additions & 0 deletions Sources/Views/BillboardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,13 @@ public struct BillboardView<Content:View>: View {
#endif
}


#Preview {
BillboardView(advert: BillboardSamples.sampleDefaultAd) {
VStack {
Spacer()
BillboardBannerView(advert: BillboardSamples.sampleDefaultAd)
Spacer()
}
}
}
10 changes: 8 additions & 2 deletions Sources/Views/DefaultAdView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ struct DefaultAdView : View {
}

}
.background(backgroundView)
.background {
backgroundView
}
}


Expand All @@ -45,6 +47,9 @@ struct DefaultAdView : View {
ZStack {
advert.background
.ignoresSafeArea()
#if os(visionOS)
.opacity(0.75)
#endif
image
.resizable()
.opacity(0.1)
Expand All @@ -55,8 +60,9 @@ struct DefaultAdView : View {


default:
Color(hex: advert.backgroundColor)
advert.background
.ignoresSafeArea()

}
})
}
Expand Down

0 comments on commit 5c90047

Please sign in to comment.