remove transition from image view (#1044)
This commit is contained in:
parent
384e80805e
commit
817f6decd6
|
@ -25,6 +25,12 @@ private let imagePipeline = {
|
||||||
// - instead of removing first source on failure, just safe index into sources
|
// - instead of removing first source on failure, just safe index into sources
|
||||||
// TODO: currently SVGs are only supported for logos, which are only used in a few places.
|
// TODO: currently SVGs are only supported for logos, which are only used in a few places.
|
||||||
// make it so when displaying an SVG there is a unified `image` caller modifier
|
// make it so when displaying an SVG there is a unified `image` caller modifier
|
||||||
|
// TODO: `LazyImage` uses a transaction for view swapping, which will fade out old views
|
||||||
|
// and fade in new views, causing a black "flash" between the placeholder and final image.
|
||||||
|
// Since we use blur hashes, we actually just want the final image to fade in on top while
|
||||||
|
// the blur hash view is at full opacity.
|
||||||
|
// - refactor for option
|
||||||
|
// - take a look at `RotateContentView`
|
||||||
struct ImageView: View {
|
struct ImageView: View {
|
||||||
|
|
||||||
@State
|
@State
|
||||||
|
|
|
@ -44,7 +44,7 @@ extension ItemView {
|
||||||
usePrimaryImage ? .primary : .backdrop,
|
usePrimaryImage ? .primary : .backdrop,
|
||||||
maxWidth: UIScreen.main.bounds.width
|
maxWidth: UIScreen.main.bounds.width
|
||||||
))
|
))
|
||||||
.aspectRatio(contentMode: .fill)
|
.aspectRatio(usePrimaryImage ? (2 / 3) : 1.77, contentMode: .fill)
|
||||||
.frame(height: UIScreen.main.bounds.height * 0.6)
|
.frame(height: UIScreen.main.bounds.height * 0.6)
|
||||||
.bottomEdgeGradient(bottomColor: blurHashBottomEdgeColor)
|
.bottomEdgeGradient(bottomColor: blurHashBottomEdgeColor)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
|
|
@ -29,7 +29,7 @@ extension ItemView {
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var headerView: some View {
|
private var headerView: some View {
|
||||||
ImageView(viewModel.item.imageSource(.backdrop, maxHeight: UIScreen.main.bounds.height * 0.35))
|
ImageView(viewModel.item.imageSource(.backdrop, maxHeight: UIScreen.main.bounds.height * 0.35))
|
||||||
.aspectRatio(contentMode: .fill)
|
.aspectRatio(1.77, contentMode: .fill)
|
||||||
.frame(height: UIScreen.main.bounds.height * 0.35)
|
.frame(height: UIScreen.main.bounds.height * 0.35)
|
||||||
.bottomEdgeGradient(bottomColor: blurHashBottomEdgeColor)
|
.bottomEdgeGradient(bottomColor: blurHashBottomEdgeColor)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
|
|
@ -37,7 +37,7 @@ extension ItemView {
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var headerView: some View {
|
private var headerView: some View {
|
||||||
ImageView(viewModel.item.imageSource(.backdrop, maxWidth: UIScreen.main.bounds.width))
|
ImageView(viewModel.item.imageSource(.backdrop, maxWidth: UIScreen.main.bounds.width))
|
||||||
.aspectRatio(contentMode: .fill)
|
.aspectRatio(1.77, contentMode: .fill)
|
||||||
.frame(height: UIScreen.main.bounds.height * 0.35)
|
.frame(height: UIScreen.main.bounds.height * 0.35)
|
||||||
.bottomEdgeGradient(bottomColor: blurHashBottomEdgeColor)
|
.bottomEdgeGradient(bottomColor: blurHashBottomEdgeColor)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
|
Loading…
Reference in New Issue