Compare commits

..

2 Commits

Author SHA1 Message Date
Arkadiusz Fal
37a315e75a iOS 14/macOS Big Sur Support 2021-11-30 18:43:21 +01:00
Arkadiusz Fal
f47d8ed752 Remove alpha channel from iOS icons 2021-11-28 11:21:11 +01:00
7 changed files with 99 additions and 119 deletions

View File

@@ -42,6 +42,9 @@ struct FavoritesView: View {
.redrawOn(change: favoritesChanged) .redrawOn(change: favoritesChanged)
#if os(tvOS) #if os(tvOS)
.sheet(isPresented: $presentingEditFavorites) {
EditFavorites()
}
.edgesIgnoringSafeArea(.horizontal) .edgesIgnoringSafeArea(.horizontal)
#else #else
.onDrop(of: [UTType.text], delegate: DropFavoriteOutside(current: $dragging)) .onDrop(of: [UTType.text], delegate: DropFavoriteOutside(current: $dragging))

View File

@@ -72,39 +72,34 @@ struct AppTabNavigation: View {
} }
.tag(TabSelection.search) .tag(TabSelection.search)
} }
.id(accounts.current?.id ?? "")
.environment(\.navigationStyle, .tab) .environment(\.navigationStyle, .tab)
.background( .sheet(isPresented: $navigation.presentingChannel, onDismiss: {
EmptyView().sheet(isPresented: $navigation.presentingChannel, onDismiss: { if let channel = recents.presentedChannel {
if let channel = recents.presentedChannel { recents.close(RecentItem(from: channel))
recents.close(RecentItem(from: channel)) }
} }) {
}) { if let channel = recents.presentedChannel {
if let channel = recents.presentedChannel { NavigationView {
NavigationView { ChannelVideosView(channel: channel)
ChannelVideosView(channel: channel) .environment(\.inChannelView, true)
.environment(\.inChannelView, true) .environment(\.inNavigationView, true)
.environment(\.inNavigationView, true) .background(playerNavigationLink)
.background(playerNavigationLink)
}
} }
} }
) }
.background( .sheet(isPresented: $navigation.presentingPlaylist, onDismiss: {
EmptyView().sheet(isPresented: $navigation.presentingPlaylist, onDismiss: { if let playlist = recents.presentedPlaylist {
if let playlist = recents.presentedPlaylist { recents.close(RecentItem(from: playlist))
recents.close(RecentItem(from: playlist)) }
} }) {
}) { if let playlist = recents.presentedPlaylist {
if let playlist = recents.presentedPlaylist { NavigationView {
NavigationView { ChannelPlaylistView(playlist: playlist)
ChannelPlaylistView(playlist: playlist) .environment(\.inNavigationView, true)
.environment(\.inNavigationView, true) .background(playerNavigationLink)
.background(playerNavigationLink)
}
} }
} }
) }
} }
private var subscriptionsVisible: Bool { private var subscriptionsVisible: Bool {

View File

@@ -24,7 +24,7 @@ struct ContentView: View {
#endif #endif
var body: some View { var body: some View {
Group { Section {
#if os(iOS) #if os(iOS)
if horizontalSizeClass == .compact { if horizontalSizeClass == .compact {
AppTabNavigation() AppTabNavigation()
@@ -49,66 +49,55 @@ struct ContentView: View {
.environmentObject(subscriptions) .environmentObject(subscriptions)
.environmentObject(thumbnailsModel) .environmentObject(thumbnailsModel)
// iOS 14 has problem with multiple sheets in one view .sheet(isPresented: $navigation.presentingWelcomeScreen) {
// but it's ok when it's in background WelcomeScreen()
.background( .environmentObject(accounts)
EmptyView().sheet(isPresented: $navigation.presentingWelcomeScreen) { .environmentObject(navigation)
WelcomeScreen() }
.environmentObject(accounts)
.environmentObject(navigation)
}
)
#if os(iOS) #if os(iOS)
.background( .fullScreenCover(isPresented: $player.presentingPlayer) {
EmptyView().fullScreenCover(isPresented: $player.presentingPlayer) { VideoPlayerView()
videoPlayer .environmentObject(accounts)
} .environmentObject(instances)
) .environmentObject(navigation)
.environmentObject(player)
.environmentObject(playlists)
.environmentObject(subscriptions)
.environmentObject(thumbnailsModel)
}
#elseif os(macOS) #elseif os(macOS)
.background( .sheet(isPresented: $player.presentingPlayer) {
EmptyView().sheet(isPresented: $player.presentingPlayer) { VideoPlayerView()
videoPlayer .frame(minWidth: 900, minHeight: 800)
.frame(minWidth: 900, minHeight: 800) .environmentObject(accounts)
} .environmentObject(instances)
) .environmentObject(navigation)
.environmentObject(player)
.environmentObject(playlists)
.environmentObject(subscriptions)
.environmentObject(thumbnailsModel)
}
#endif #endif
#if !os(tvOS) #if !os(tvOS)
.handlesExternalEvents(preferring: Set(["*"]), allowing: Set(["*"])) .handlesExternalEvents(preferring: Set(["*"]), allowing: Set(["*"]))
.onOpenURL(perform: handleOpenedURL) .onOpenURL(perform: handleOpenedURL)
.background( .sheet(isPresented: $navigation.presentingAddToPlaylist) {
EmptyView().sheet(isPresented: $navigation.presentingAddToPlaylist) { AddToPlaylistView(video: navigation.videoToAddToPlaylist)
AddToPlaylistView(video: navigation.videoToAddToPlaylist) .environmentObject(playlists)
.environmentObject(playlists) }
} .sheet(isPresented: $navigation.presentingPlaylistForm) {
) PlaylistFormView(playlist: $navigation.editedPlaylist)
.background( .environmentObject(accounts)
EmptyView().sheet(isPresented: $navigation.presentingPlaylistForm) { .environmentObject(playlists)
PlaylistFormView(playlist: $navigation.editedPlaylist) }
.environmentObject(accounts) .sheet(isPresented: $navigation.presentingSettings, onDismiss: openWelcomeScreenIfAccountEmpty) {
.environmentObject(playlists) SettingsView()
} .environmentObject(accounts)
) .environmentObject(instances)
.background( }
EmptyView().sheet(isPresented: $navigation.presentingSettings, onDismiss: openWelcomeScreenIfAccountEmpty) {
SettingsView()
.environmentObject(accounts)
.environmentObject(instances)
}
)
#endif #endif
} }
private var videoPlayer: some View {
VideoPlayerView()
.environmentObject(accounts)
.environmentObject(instances)
.environmentObject(navigation)
.environmentObject(player)
.environmentObject(playlists)
.environmentObject(subscriptions)
.environmentObject(thumbnailsModel)
}
func configure() { func configure() {
SiestaLog.Category.enabled = .common SiestaLog.Category.enabled = .common
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared) SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)

View File

@@ -16,10 +16,13 @@ struct PlaybackBar: View {
if player.currentItem != nil { if player.currentItem != nil {
HStack { HStack {
Text(playbackStatus) Text(playbackStatus)
Text("") Text("")
rateMenu rateMenu
} }
.font(.caption2) .font(.caption2)
.foregroundColor(.gray)
Spacer() Spacer()
@@ -56,12 +59,12 @@ struct PlaybackBar: View {
#endif #endif
} }
.transaction { t in t.animation = .none } .transaction { t in t.animation = .none }
.foregroundColor(.gray)
.font(.caption2) .font(.caption2)
} else { } else {
Spacer() Spacer()
} }
} }
.foregroundColor(colorScheme == .dark ? .gray : .black)
.alert(isPresented: $player.presentingErrorDetails) { .alert(isPresented: $player.presentingErrorDetails) {
Alert( Alert(
title: Text("Error"), title: Text("Error"),

View File

@@ -318,21 +318,17 @@ struct VideoDetails: View {
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
} }
.background( .sheet(isPresented: $presentingAddToPlaylist) {
EmptyView().sheet(isPresented: $presentingAddToPlaylist) { if let video = video {
if let video = video { AddToPlaylistView(video: video)
AddToPlaylistView(video: video)
}
} }
) }
#if os(iOS) #if os(iOS)
.background( .sheet(isPresented: $presentingShareSheet) {
EmptyView().sheet(isPresented: $presentingShareSheet) { if let shareURL = shareURL {
if let shareURL = shareURL { ShareSheet(activityItems: [shareURL])
ShareSheet(activityItems: [shareURL])
}
} }
) }
#endif #endif
} }

View File

@@ -58,20 +58,14 @@ struct PlaylistsView: View {
.environmentObject(accounts) .environmentObject(accounts)
} }
#else #else
.background( .sheet(isPresented: $showingNewPlaylist, onDismiss: selectCreatedPlaylist) {
EmptyView() PlaylistFormView(playlist: $createdPlaylist)
.sheet(isPresented: $showingNewPlaylist, onDismiss: selectCreatedPlaylist) { .environmentObject(accounts)
PlaylistFormView(playlist: $createdPlaylist) }
.environmentObject(accounts) .sheet(isPresented: $showingEditPlaylist, onDismiss: selectEditedPlaylist) {
} PlaylistFormView(playlist: $editedPlaylist)
) .environmentObject(accounts)
.background( }
EmptyView()
.sheet(isPresented: $showingEditPlaylist, onDismiss: selectEditedPlaylist) {
PlaylistFormView(playlist: $editedPlaylist)
.environmentObject(accounts)
}
)
#endif #endif
.toolbar { .toolbar {
ToolbarItemGroup { ToolbarItemGroup {

View File

@@ -2217,7 +2217,7 @@
CODE_SIGN_ENTITLEMENTS = "Open in Yattee/Open in Yattee.entitlements"; CODE_SIGN_ENTITLEMENTS = "Open in Yattee/Open in Yattee.entitlements";
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES; ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
@@ -2229,7 +2229,7 @@
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks", "@executable_path/../../../../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 11.0; MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.2; MARKETING_VERSION = 1.2;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"-framework", "-framework",
@@ -2251,7 +2251,7 @@
CODE_SIGN_ENTITLEMENTS = "Open in Yattee/Open in Yattee.entitlements"; CODE_SIGN_ENTITLEMENTS = "Open in Yattee/Open in Yattee.entitlements";
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES; ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
@@ -2263,7 +2263,7 @@
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks", "@executable_path/../../../../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 11.0; MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.2; MARKETING_VERSION = 1.2;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"-framework", "-framework",
@@ -2283,7 +2283,7 @@
buildSettings = { buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Open in Yattee/Info.plist"; INFOPLIST_FILE = "Open in Yattee/Info.plist";
@@ -2315,7 +2315,7 @@
buildSettings = { buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Open in Yattee/Info.plist"; INFOPLIST_FILE = "Open in Yattee/Info.plist";
@@ -2478,7 +2478,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 = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
@@ -2509,7 +2509,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 = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
@@ -2544,7 +2544,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_APP_SANDBOX = YES; ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES; ENABLE_HARDENED_RUNTIME = YES;
@@ -2577,7 +2577,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_APP_SANDBOX = YES; ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES; ENABLE_HARDENED_RUNTIME = YES;
@@ -2708,7 +2708,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
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 = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
@@ -2740,7 +2740,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
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 = 4; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;