Skip to content

Commit

Permalink
tvOS - Remove last CollectionView (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
LePips authored Apr 19, 2024
1 parent 16303c9 commit 58190d7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 44 deletions.
18 changes: 11 additions & 7 deletions Swiftfin tvOS/Components/UserProfileButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ struct UserProfileButton: View {
Button {
action()
} label: {
ImageView(user.profileImageSource(client: userSession.client, maxWidth: 250, maxHeight: 250))
.failure {
Image(systemName: "person.fill")
.resizable()
.padding2()
}
.frame(width: 200, height: 200)
ZStack {
Color.clear

ImageView(user.profileImageSource(client: userSession.client, maxWidth: 250, maxHeight: 250))
.failure {
Image(systemName: "person.fill")
.resizable()
.edgePadding()
}
}
.aspectRatio(1, contentMode: .fill)
}
.buttonStyle(.card)
.focused($isFocused)
Expand Down
16 changes: 5 additions & 11 deletions Swiftfin tvOS/Views/UserSignInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2024 Jellyfin & Jellyfin Contributors
//

import CollectionView
import CollectionVGrid
import JellyfinAPI
import Stinsen
import SwiftUI
Expand Down Expand Up @@ -110,22 +110,16 @@ struct UserSignInView: View {
.frame(maxWidth: .infinity, maxHeight: .infinity)
.offset(y: -50)
} else {
CollectionView(items: viewModel.publicUsers) { _, user, _ in
CollectionVGrid(
viewModel.publicUsers,
layout: .minWidth(250, insets: .init(20), itemSpacing: 20, lineSpacing: 20)
) { user in
UserProfileButton(user: user)
.onSelect {
username = user.name ?? ""
focusedField = .password
}
}
.layout { _, layoutEnvironment in
.grid(
layoutEnvironment: layoutEnvironment,
layoutMode: .adaptive(withMinItemSize: 250),
itemSpacing: 20,
lineSpacing: 20,
sectionInsets: .init(top: 20, leading: 20, bottom: 20, trailing: 20)
)
}
}
}
}
Expand Down
16 changes: 0 additions & 16 deletions Swiftfin.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,6 @@
E1DC9814296DC06200982F06 /* PulseLogHandler in Frameworks */ = {isa = PBXBuildFile; productRef = E1DC9813296DC06200982F06 /* PulseLogHandler */; };
E1DC9819296DD1CD00982F06 /* CinematicBackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1DC9818296DD1CD00982F06 /* CinematicBackgroundView.swift */; };
E1DC981A296DD1CD00982F06 /* CinematicBackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1DC9818296DD1CD00982F06 /* CinematicBackgroundView.swift */; };
E1DC981E296DD91900982F06 /* CollectionView in Frameworks */ = {isa = PBXBuildFile; productRef = E1DC981D296DD91900982F06 /* CollectionView */; };
E1DC983D296DEB9B00982F06 /* UnwatchedIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1DC983C296DEB9B00982F06 /* UnwatchedIndicator.swift */; };
E1DC983E296DEB9B00982F06 /* UnwatchedIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1DC983C296DEB9B00982F06 /* UnwatchedIndicator.swift */; };
E1DC9841296DEBD800982F06 /* WatchedIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1DC9840296DEBD800982F06 /* WatchedIndicator.swift */; };
Expand Down Expand Up @@ -1380,7 +1379,6 @@
E1575E56293E7650001665B1 /* VLCUI in Frameworks */,
62666E1727E501CC00EC0ECD /* CFNetwork.framework in Frameworks */,
62666DFA27E5013700EC0ECD /* TVVLCKit.xcframework in Frameworks */,
E1DC981E296DD91900982F06 /* CollectionView in Frameworks */,
62666E3227E5021E00EC0ECD /* UIKit.framework in Frameworks */,
62666E2A27E5020A00EC0ECD /* OpenGLES.framework in Frameworks */,
E1002B6B2793E36600E47059 /* Algorithms in Frameworks */,
Expand Down Expand Up @@ -3199,7 +3197,6 @@
E1B5F7A829577BCE004B26CF /* PulseLogHandler */,
E1B5F7AA29577BCE004B26CF /* PulseUI */,
E1B5F7AC29577BDD004B26CF /* OrderedCollections */,
E1DC981D296DD91900982F06 /* CollectionView */,
E18443CA2A037773002DDDC8 /* UDPBroadcast */,
E14CB6872A9FF71F001586C6 /* JellyfinAPI */,
E1A7B1642B9A9F7800152546 /* PreferencesView */,
Expand Down Expand Up @@ -3327,7 +3324,6 @@
E15210522946DF1B00375CC2 /* XCRemoteSwiftPackageReference "Pulse" */,
E19DDEC52948EF9900954E10 /* XCRemoteSwiftPackageReference "swift-collections" */,
E1DC9812296DC06200982F06 /* XCRemoteSwiftPackageReference "PulseLogHandler" */,
E1DC981F296DDBE600982F06 /* XCRemoteSwiftPackageReference "CollectionView" */,
E1FAD1C42A0375BA007F5521 /* XCRemoteSwiftPackageReference "UDPBroadcastConnection" */,
E14CB6842A9FF62A001586C6 /* XCRemoteSwiftPackageReference "jellyfin-sdk-swift" */,
E15D4F032B1B0C3C00442DB8 /* XCLocalSwiftPackageReference "PreferencesView" */,
Expand Down Expand Up @@ -4747,14 +4743,6 @@
minimumVersion = 4.0.0;
};
};
E1DC981F296DDBE600982F06 /* XCRemoteSwiftPackageReference "CollectionView" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/LePips/CollectionView";
requirement = {
branch = main;
kind = branch;
};
};
E1FAD1C42A0375BA007F5521 /* XCRemoteSwiftPackageReference "UDPBroadcastConnection" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/gunterhager/UDPBroadcastConnection";
Expand Down Expand Up @@ -5051,10 +5039,6 @@
package = E1DC9812296DC06200982F06 /* XCRemoteSwiftPackageReference "PulseLogHandler" */;
productName = PulseLogHandler;
};
E1DC981D296DD91900982F06 /* CollectionView */ = {
isa = XCSwiftPackageProductDependency;
productName = CollectionView;
};
E1FAD1C52A0375BA007F5521 /* UDPBroadcast */ = {
isa = XCSwiftPackageProductDependency;
package = E1FAD1C42A0375BA007F5521 /* XCRemoteSwiftPackageReference "UDPBroadcastConnection" */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "20f168223d2d1133c4837df32ef688f816b79816393b1172be8e57d39c47d619",
"originHash" : "c477e4f1cd54bd525946c46dd4d4243ceca54f879672628a772af4ecb8aa0a79",
"pins" : [
{
"identity" : "blurhashkit",
Expand Down Expand Up @@ -37,15 +37,6 @@
"revision" : "e4e0adc7722430870293e390e32d35c37a0d047b"
}
},
{
"identity" : "collectionview",
"kind" : "remoteSourceControl",
"location" : "https://github.com/LePips/CollectionView",
"state" : {
"branch" : "main",
"revision" : "70a44bd1a8864f88213be69613554a9d5a8fb779"
}
},
{
"identity" : "corestore",
"kind" : "remoteSourceControl",
Expand Down

0 comments on commit 58190d7

Please sign in to comment.