change explore page fit to fill

This commit is contained in:
leminlimez committed 2025-07-19 10:22:01 -04:00
1 parent 7434897eac
commit d35636c0be
2 files changed
+21 -19

No files matched your search

+2 -2
View File
@@ -272,7 +272,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_ASSET_PATHS = "\"Pocket Poster/Preview Content\"";
DEVELOPMENT_TEAM = 2P4CP47H76;
ENABLE_PREVIEWS = YES;
@@ -304,7 +304,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_ASSET_PATHS = "\"Pocket Poster/Preview Content\"";
DEVELOPMENT_TEAM = 2P4CP47H76;
ENABLE_PREVIEWS = YES;
@@ -9,6 +9,7 @@ import SwiftUI
import CachedAsyncImage
let MIN_SIZE: CGFloat = 165
let CORNER_RADIUS: CGFloat = 12
struct ExploreView: View {
@ObservedObject var cowabungaAPI = CowabungaAPI.shared
@@ -55,25 +56,26 @@ struct ExploreView: View {
DownloadManager.shared.startTendiesDownload(for: cowabungaAPI.getDownloadURLForWallpaper(wallpaper: wallpaper))
}) {
VStack(spacing: 0) {
if wallpaper.previewIsGif() {
GIFImage(url: cowabungaAPI.getPreviewURLForWallpaper(wallpaper: wallpaper), animate: true, loop: true)
.aspectRatio(contentMode: .fill)
.frame(maxWidth: .infinity)
.cornerRadius(10, corners: .topLeft)
.cornerRadius(10, corners: .topRight)
} else {
CachedAsyncImage(url: cowabungaAPI.getPreviewURLForWallpaper(wallpaper: wallpaper), urlCache: .imageCache) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
ZStack {
Color.gray.opacity(0.4)
if wallpaper.previewIsGif() {
GIFImage(url: cowabungaAPI.getPreviewURLForWallpaper(wallpaper: wallpaper), animate: true, loop: true)
.aspectRatio(contentMode: .fit)
.frame(maxWidth: .infinity)
.cornerRadius(10, corners: .topLeft)
.cornerRadius(10, corners: .topRight)
} placeholder: {
Color.gray
.frame(height: MIN_SIZE)
} else {
CachedAsyncImage(url: cowabungaAPI.getPreviewURLForWallpaper(wallpaper: wallpaper), urlCache: .imageCache) { image in
image
.resizable()
.aspectRatio(contentMode: .fit)
.frame(maxWidth: .infinity)
} placeholder: {
Color.gray
.frame(height: MIN_SIZE)
}
}
}
.cornerRadius(CORNER_RADIUS, corners: .topLeft)
.cornerRadius(CORNER_RADIUS, corners: .topRight)
HStack {
VStack(spacing: 4) {
HStack {
@@ -104,7 +106,7 @@ struct ExploreView: View {
}
.frame(minWidth: MIN_SIZE)
.background(Color(uiColor: .secondarySystemBackground))
.cornerRadius(10)
.cornerRadius(CORNER_RADIUS)
.padding(4)
}
}