change explore page fit to fill
This commit is contained in:
1 parent
7434897eac
commit
d35636c0be
2 files changed
+21
-19
No files matched your search
@@ -272,7 +272,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 5;
|
CURRENT_PROJECT_VERSION = 6;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"Pocket Poster/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"Pocket Poster/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = 2P4CP47H76;
|
DEVELOPMENT_TEAM = 2P4CP47H76;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
@@ -304,7 +304,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 5;
|
CURRENT_PROJECT_VERSION = 6;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"Pocket Poster/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"Pocket Poster/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = 2P4CP47H76;
|
DEVELOPMENT_TEAM = 2P4CP47H76;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import SwiftUI
|
|||||||
import CachedAsyncImage
|
import CachedAsyncImage
|
||||||
|
|
||||||
let MIN_SIZE: CGFloat = 165
|
let MIN_SIZE: CGFloat = 165
|
||||||
|
let CORNER_RADIUS: CGFloat = 12
|
||||||
|
|
||||||
struct ExploreView: View {
|
struct ExploreView: View {
|
||||||
@ObservedObject var cowabungaAPI = CowabungaAPI.shared
|
@ObservedObject var cowabungaAPI = CowabungaAPI.shared
|
||||||
@@ -55,25 +56,26 @@ struct ExploreView: View {
|
|||||||
DownloadManager.shared.startTendiesDownload(for: cowabungaAPI.getDownloadURLForWallpaper(wallpaper: wallpaper))
|
DownloadManager.shared.startTendiesDownload(for: cowabungaAPI.getDownloadURLForWallpaper(wallpaper: wallpaper))
|
||||||
}) {
|
}) {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
if wallpaper.previewIsGif() {
|
ZStack {
|
||||||
GIFImage(url: cowabungaAPI.getPreviewURLForWallpaper(wallpaper: wallpaper), animate: true, loop: true)
|
Color.gray.opacity(0.4)
|
||||||
.aspectRatio(contentMode: .fill)
|
if wallpaper.previewIsGif() {
|
||||||
.frame(maxWidth: .infinity)
|
GIFImage(url: cowabungaAPI.getPreviewURLForWallpaper(wallpaper: wallpaper), animate: true, loop: true)
|
||||||
.cornerRadius(10, corners: .topLeft)
|
.aspectRatio(contentMode: .fit)
|
||||||
.cornerRadius(10, corners: .topRight)
|
|
||||||
} else {
|
|
||||||
CachedAsyncImage(url: cowabungaAPI.getPreviewURLForWallpaper(wallpaper: wallpaper), urlCache: .imageCache) { image in
|
|
||||||
image
|
|
||||||
.resizable()
|
|
||||||
.aspectRatio(contentMode: .fill)
|
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
.cornerRadius(10, corners: .topLeft)
|
} else {
|
||||||
.cornerRadius(10, corners: .topRight)
|
CachedAsyncImage(url: cowabungaAPI.getPreviewURLForWallpaper(wallpaper: wallpaper), urlCache: .imageCache) { image in
|
||||||
} placeholder: {
|
image
|
||||||
Color.gray
|
.resizable()
|
||||||
.frame(height: MIN_SIZE)
|
.aspectRatio(contentMode: .fit)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
} placeholder: {
|
||||||
|
Color.gray
|
||||||
|
.frame(height: MIN_SIZE)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.cornerRadius(CORNER_RADIUS, corners: .topLeft)
|
||||||
|
.cornerRadius(CORNER_RADIUS, corners: .topRight)
|
||||||
HStack {
|
HStack {
|
||||||
VStack(spacing: 4) {
|
VStack(spacing: 4) {
|
||||||
HStack {
|
HStack {
|
||||||
@@ -104,7 +106,7 @@ struct ExploreView: View {
|
|||||||
}
|
}
|
||||||
.frame(minWidth: MIN_SIZE)
|
.frame(minWidth: MIN_SIZE)
|
||||||
.background(Color(uiColor: .secondarySystemBackground))
|
.background(Color(uiColor: .secondarySystemBackground))
|
||||||
.cornerRadius(10)
|
.cornerRadius(CORNER_RADIUS)
|
||||||
.padding(4)
|
.padding(4)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user