Skip to content

Commit

Permalink
Cleaned up the TVOS Letter Picker to highlight when used and scroll w…
Browse files Browse the repository at this point in the history
…hen there are too many letters. Fixed both TVOS and iOS having the Letters crop into their HStacks. TODO: Cinematic Views on TVOS and apply the Letter Picker to the home screen libraries (TV Shows/Movies)
  • Loading branch information
Joe Kribs committed Feb 27, 2024
1 parent eebefc9 commit e41ae6b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 19 deletions.
12 changes: 4 additions & 8 deletions Swiftfin tvOS/Components/AlphaPicker/AlphaPickerBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ struct AlphaPickerBar: View {
}

var body: some View {
Group {
if AlphaPicker.characters.count > 27 {
ScrollView(showsIndicators: false) {
alphaPickerBody
}
} else {
alphaPickerBody
}
ScrollView(showsIndicators: false) {
alphaPickerBody
.frame(maxWidth: .infinity)
}
.frame(width: 150)
}
}

Expand Down
4 changes: 1 addition & 3 deletions Swiftfin tvOS/Components/AlphaPicker/AlphaPickerButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ extension AlphaPickerBar {
.font(.headline)
.frame(width: 35, height: 35)
.foregroundColor(activated ? Color.white : accentColor)
.padding(.vertical, 2)
.fixedSize(horizontal: true, vertical: true)
.background {
RoundedRectangle(cornerRadius: 5)
.frame(width: 40, height: 40)
.frame(width: 80, height: 40)
.foregroundColor(activated ? accentColor.opacity(0.5) : Color.clear)
}
}
Expand Down
6 changes: 2 additions & 4 deletions Swiftfin tvOS/Views/LibraryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@ struct LibraryView: View {
HStack(spacing: 0) {
libraryBody
.frame(maxWidth: .infinity)
Spacer()
AlphaPickerBar(viewModel: viewModel.filterViewModel)
.padding(.vertical, 5)
.frame(maxHeight: .infinity)
}
} else if alphaPickerOrientation == .leading {
HStack(spacing: 0) {
AlphaPickerBar(viewModel: viewModel.filterViewModel)
.padding(.vertical, 5)
Spacer()
.frame(maxHeight: .infinity)
libraryBody
.frame(maxWidth: .infinity)
}
Expand Down
2 changes: 2 additions & 0 deletions Swiftfin/Components/AlphaPicker/AlphaPickerBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ struct AlphaPickerBar: View {
if AlphaPicker.characters.count > 27 {
ScrollView(showsIndicators: false) {
alphaPickerBody
.frame(maxWidth: .infinity)
}
} else {
alphaPickerBody
}
}
.frame(width: 40)
}
}

Expand Down
6 changes: 2 additions & 4 deletions Swiftfin/Views/LibraryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ struct LibraryView: View {
libraryBody
.frame(maxWidth: .infinity)
AlphaPickerBar(viewModel: viewModel.filterViewModel)
.frame(width: 30)
.padding(.vertical, 5)
.padding(1)
}
} else if alphaPickerOrientation == .leading {
HStack(spacing: 0) {
AlphaPickerBar(viewModel: viewModel.filterViewModel)
.frame(width: 30)
.padding(.vertical, 5)
.padding(1)
libraryBody
.frame(maxWidth: .infinity)
}
Expand Down

0 comments on commit e41ae6b

Please sign in to comment.