Skip to content

Commit

Permalink
Merge pull request #351 from Darock-Studio/feat/largesugg
Browse files Browse the repository at this point in the history
feat: Large suggestion view, fix: storage may crash
  • Loading branch information
Mark Chan authored Apr 14, 2024
2 parents 45e9da8 + 843f346 commit 4f238b4
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 207 deletions.
36 changes: 18 additions & 18 deletions DarockBili.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SafariExtension/Info.plist;
Expand Down Expand Up @@ -1650,7 +1650,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SafariExtension/Info.plist;
Expand Down Expand Up @@ -1747,7 +1747,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBiliAlternative.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B38QUJMY47;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -1792,7 +1792,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\"";
DEVELOPMENT_TEAM = B38QUJMY47;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -1832,7 +1832,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Vision App.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -1868,7 +1868,7 @@
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Mac App.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -1897,7 +1897,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
Expand All @@ -1921,7 +1921,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_TEAM = B38QUJMY47;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SafariExtension/Info.plist;
Expand Down Expand Up @@ -1988,7 +1988,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Vision App.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2023,7 +2023,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Vision App.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2060,7 +2060,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBili.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2107,7 +2107,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBili.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2152,7 +2152,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2188,7 +2188,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2228,7 +2228,7 @@
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Mac App.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -2261,7 +2261,7 @@
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Mac App.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -2290,7 +2290,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
Expand All @@ -2313,7 +2313,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1108;
CURRENT_PROJECT_VERSION = 1130;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
Expand Down
25 changes: 15 additions & 10 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -8255,6 +8255,9 @@
},
"分析与改进" : {

},
"列表视图" : {

},
"加群248036605查看群公告以申请解封" : {

Expand Down Expand Up @@ -8599,6 +8602,9 @@
}
}
}
},
"大图视图" : {

},
"如不希望显示来自 Darock 的推荐,可前往%@关闭" : {

Expand Down Expand Up @@ -8664,15 +8670,8 @@
}
}
},
"已使用 %@ MB/%@ GB" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "new",
"value" : "已使用 %1$@ MB/%2$@ GB"
}
}
}
"已使用 %@ MB" : {

},
"已选择的图片" : {
"localizations" : {
Expand Down Expand Up @@ -8885,6 +8884,12 @@
}
}
}
},
"推荐视图" : {

},
"推荐视图样式" : {

},
"搜索" : {

Expand Down Expand Up @@ -9261,7 +9266,7 @@
}
}
},
"缓存" : {
"缓存数据" : {

},
"编辑" : {
Expand Down
43 changes: 43 additions & 0 deletions MeowBili/Extension/UIExt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,49 @@ struct SegmentedPicker: View {
}
#endif

@ViewBuilder
func LargeVideoCard(_ videoDetails: [String: String]) -> some View {
#if os(watchOS)
NavigationLink(destination: { VideoDetailView(videoDetails: videoDetails) }, label: {
VStack {
WebImage(url: URL(string: videoDetails["Pic"]! + "@400w")!, options: [.progressiveLoad, .scaleDownLargeImages])
.placeholder {
RoundedRectangle(cornerRadius: 7)
.frame(width: WKInterfaceDevice.current().screenBounds.width - 20, height: 80)
.foregroundColor(Color(hex: 0x3D3D3D))
.redacted(reason: .placeholder)
}
.resizable()
.cornerRadius(7)
.scaledToFit()
.frame(width: WKInterfaceDevice.current().screenBounds.width - 20)
HStack {
Text(videoDetails["Title"]!)
.font(.system(size: 14, weight: .bold))
.lineLimit(2)
.multilineTextAlignment(.leading)
Spacer()
}
HStack {
Image(systemName: "play.circle")
Text(videoDetails["View"]!.shorter())
.offset(x: -3)
Image(systemName: "person")
Text(videoDetails["UP"]!)
.offset(x: -3)
Spacer()
}
.lineLimit(1)
.font(.system(size: 11))
.foregroundColor(.gray)
}
})
.buttonBorderShape(.roundedRectangle(radius: 14))
#else
VideoCard(videoDetails)
#endif
}

// swiftlint:disable unused_closure_parameter
#if !os(visionOS)
extension Indicator where T == ProgressView<EmptyView, EmptyView> {
Expand Down
Loading

0 comments on commit 4f238b4

Please sign in to comment.