Resolve some todos (#1295)
* Partially resolve color todo * Update localizations for quick connect steps. use bulleted list * Same change for tvos * Remove padding2 modifier * Localisation
This commit is contained in:
parent
56fa03257e
commit
fed9c654ef
|
@ -8,19 +8,16 @@
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
// TODO: add all other missing colors from UIColor and fix usages
|
|
||||||
// - move row dividers to divider color
|
|
||||||
|
|
||||||
extension Color {
|
extension Color {
|
||||||
|
|
||||||
static let jellyfinPurple = Color(uiColor: .jellyfinPurple)
|
static let jellyfinPurple = Color(red: 172 / 255, green: 92 / 255, blue: 195 / 255, opacity: 1)
|
||||||
|
|
||||||
var uiColor: UIColor {
|
var uiColor: UIColor {
|
||||||
UIColor(self)
|
UIColor(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
var overlayColor: Color {
|
var overlayColor: Color {
|
||||||
Color(uiColor: uiColor.overlayColor)
|
Color(uiColor: uiColor.overlayColor) // TODO: move from UIColor
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Correct and add colors
|
// TODO: Correct and add colors
|
||||||
|
|
|
@ -26,17 +26,16 @@ extension ItemTrait: ItemFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ItemTrait: Displayable {
|
extension ItemTrait: Displayable {
|
||||||
// TODO: Localize
|
|
||||||
var displayTitle: String {
|
var displayTitle: String {
|
||||||
switch self {
|
switch self {
|
||||||
case .isUnplayed:
|
case .isUnplayed:
|
||||||
return "Unplayed"
|
return L10n.unplayed
|
||||||
case .isPlayed:
|
case .isPlayed:
|
||||||
return "Played"
|
return L10n.played
|
||||||
case .isFavorite:
|
case .isFavorite:
|
||||||
return "Favorites"
|
return L10n.favorites
|
||||||
case .likes:
|
case .likes:
|
||||||
return "Liked Items"
|
return L10n.likedItems
|
||||||
default:
|
default:
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,6 @@
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
extension UIColor {
|
extension UIColor {
|
||||||
|
|
||||||
static let jellyfinPurple = UIColor(red: 172 / 255, green: 92 / 255, blue: 195 / 255, alpha: 1)
|
|
||||||
|
|
||||||
var overlayColor: UIColor {
|
var overlayColor: UIColor {
|
||||||
var red: CGFloat = 0
|
var red: CGFloat = 0
|
||||||
var green: CGFloat = 0
|
var green: CGFloat = 0
|
||||||
|
|
|
@ -131,12 +131,6 @@ extension View {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove
|
|
||||||
@inlinable
|
|
||||||
func padding2(_ edges: Edge.Set = .all) -> some View {
|
|
||||||
padding(edges).padding(edges)
|
|
||||||
}
|
|
||||||
|
|
||||||
func scrollViewOffset(_ scrollViewOffset: Binding<CGFloat>) -> some View {
|
func scrollViewOffset(_ scrollViewOffset: Binding<CGFloat>) -> some View {
|
||||||
modifier(ScrollViewOffsetModifier(scrollViewOffset: scrollViewOffset))
|
modifier(ScrollViewOffsetModifier(scrollViewOffset: scrollViewOffset))
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,6 +464,8 @@ internal enum L10n {
|
||||||
internal static let library = L10n.tr("Localizable", "library", fallback: "Library")
|
internal static let library = L10n.tr("Localizable", "library", fallback: "Library")
|
||||||
/// Represents the light theme setting
|
/// Represents the light theme setting
|
||||||
internal static let light = L10n.tr("Localizable", "light", fallback: "Light")
|
internal static let light = L10n.tr("Localizable", "light", fallback: "Light")
|
||||||
|
/// Liked Items
|
||||||
|
internal static let likedItems = L10n.tr("Localizable", "likedItems", fallback: "Liked Items")
|
||||||
/// List
|
/// List
|
||||||
internal static let list = L10n.tr("Localizable", "list", fallback: "List")
|
internal static let list = L10n.tr("Localizable", "list", fallback: "List")
|
||||||
/// Live TV
|
/// Live TV
|
||||||
|
@ -658,12 +660,12 @@ internal enum L10n {
|
||||||
internal static let quickConnectInvalidError = L10n.tr("Localizable", "quickConnectInvalidError", fallback: "Invalid Quick Connect code")
|
internal static let quickConnectInvalidError = L10n.tr("Localizable", "quickConnectInvalidError", fallback: "Invalid Quick Connect code")
|
||||||
/// Note: Quick Connect not enabled
|
/// Note: Quick Connect not enabled
|
||||||
internal static let quickConnectNotEnabled = L10n.tr("Localizable", "quickConnectNotEnabled", fallback: "Note: Quick Connect not enabled")
|
internal static let quickConnectNotEnabled = L10n.tr("Localizable", "quickConnectNotEnabled", fallback: "Note: Quick Connect not enabled")
|
||||||
/// 1. Open the Jellyfin app on your phone or web browser and sign in with your account
|
/// Open the Jellyfin app on your phone or web browser and sign in with your account
|
||||||
internal static let quickConnectStep1 = L10n.tr("Localizable", "quickConnectStep1", fallback: "1. Open the Jellyfin app on your phone or web browser and sign in with your account")
|
internal static let quickConnectStep1 = L10n.tr("Localizable", "quickConnectStep1", fallback: "Open the Jellyfin app on your phone or web browser and sign in with your account")
|
||||||
/// 2. Open the user menu and go to the Quick Connect page
|
/// Open the user menu and go to the Quick Connect page
|
||||||
internal static let quickConnectStep2 = L10n.tr("Localizable", "quickConnectStep2", fallback: "2. Open the user menu and go to the Quick Connect page")
|
internal static let quickConnectStep2 = L10n.tr("Localizable", "quickConnectStep2", fallback: "Open the user menu and go to the Quick Connect page")
|
||||||
/// 3. Enter the following code:
|
/// Enter the following code:
|
||||||
internal static let quickConnectStep3 = L10n.tr("Localizable", "quickConnectStep3", fallback: "3. Enter the following code:")
|
internal static let quickConnectStep3 = L10n.tr("Localizable", "quickConnectStep3", fallback: "Enter the following code:")
|
||||||
/// Authorizing Quick Connect successful. Please continue on your other device.
|
/// Authorizing Quick Connect successful. Please continue on your other device.
|
||||||
internal static let quickConnectSuccessMessage = L10n.tr("Localizable", "quickConnectSuccessMessage", fallback: "Authorizing Quick Connect successful. Please continue on your other device.")
|
internal static let quickConnectSuccessMessage = L10n.tr("Localizable", "quickConnectSuccessMessage", fallback: "Authorizing Quick Connect successful. Please continue on your other device.")
|
||||||
/// Random
|
/// Random
|
||||||
|
|
|
@ -38,7 +38,7 @@ extension ItemView.AboutView {
|
||||||
content()
|
content()
|
||||||
.eraseToAnyView()
|
.eraseToAnyView()
|
||||||
}
|
}
|
||||||
.padding2()
|
.padding()
|
||||||
.frame(width: 700, height: 405)
|
.frame(width: 700, height: 405)
|
||||||
}
|
}
|
||||||
.buttonStyle(.card)
|
.buttonStyle(.card)
|
||||||
|
|
|
@ -106,7 +106,7 @@ struct MediaSourceInfoView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding2(.horizontal)
|
.padding(.horizontal)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,17 +25,14 @@ struct QuickConnectView: View {
|
||||||
|
|
||||||
private func pollingView(code: String) -> some View {
|
private func pollingView(code: String) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 20) {
|
VStack(alignment: .leading, spacing: 20) {
|
||||||
|
BulletedList {
|
||||||
// TODO: change strings so that numbers are removed
|
L10n.quickConnectStep1.text
|
||||||
// and use `BulletedList`
|
.padding(.bottom)
|
||||||
// - also probably rephrase/change steps
|
L10n.quickConnectStep2.text
|
||||||
|
.padding(.bottom)
|
||||||
L10n.quickConnectStep1.text
|
L10n.quickConnectStep3.text
|
||||||
|
.padding(.bottom)
|
||||||
L10n.quickConnectStep2.text
|
}
|
||||||
|
|
||||||
L10n.quickConnectStep3.text
|
|
||||||
.padding(.bottom)
|
|
||||||
|
|
||||||
Text(code)
|
Text(code)
|
||||||
.tracking(10)
|
.tracking(10)
|
||||||
|
|
|
@ -34,8 +34,8 @@ extension LiveVideoPlayer {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Overlay.LiveBottomBarView()
|
Overlay.LiveBottomBarView()
|
||||||
.padding2()
|
.padding()
|
||||||
.padding2()
|
.padding()
|
||||||
.background {
|
.background {
|
||||||
LinearGradient(
|
LinearGradient(
|
||||||
stops: [
|
stops: [
|
||||||
|
|
|
@ -44,8 +44,8 @@ extension VideoPlayer {
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding2()
|
.padding()
|
||||||
.padding2()
|
.padding()
|
||||||
|
|
||||||
ScrollViewReader { proxy in
|
ScrollViewReader { proxy in
|
||||||
ScrollView(.horizontal) {
|
ScrollView(.horizontal) {
|
||||||
|
@ -90,8 +90,8 @@ extension VideoPlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding2()
|
.padding()
|
||||||
.padding2(.horizontal)
|
.padding(.horizontal)
|
||||||
}
|
}
|
||||||
.onChange(of: currentOverlayType) { _, newValue in
|
.onChange(of: currentOverlayType) { _, newValue in
|
||||||
guard newValue == .chapters else { return }
|
guard newValue == .chapters else { return }
|
||||||
|
|
|
@ -34,8 +34,8 @@ extension VideoPlayer {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
VideoPlayer.Overlay.BottomBarView()
|
VideoPlayer.Overlay.BottomBarView()
|
||||||
.padding2()
|
.padding()
|
||||||
.padding2()
|
.padding()
|
||||||
.background {
|
.background {
|
||||||
LinearGradient(
|
LinearGradient(
|
||||||
stops: [
|
stops: [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"originHash" : "323b2ad9aaa9c000faf264d68272f0e9fab1349d9f910a0b95ee6aea10460f31",
|
"originHash" : "651194fc1966b57201a0de2cba27dc40798bbdf515febdc83f00d634d916fea4",
|
||||||
"pins" : [
|
"pins" : [
|
||||||
{
|
{
|
||||||
"identity" : "blurhashkit",
|
"identity" : "blurhashkit",
|
||||||
|
@ -132,8 +132,8 @@
|
||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/kean/Pulse",
|
"location" : "https://github.com/kean/Pulse",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "d1e39ffaaa8b8becff80cb193c93a78e32077af8",
|
"revision" : "3ac5ee35ab233e900aa484919803d51791d1e351",
|
||||||
"version" : "4.2.0"
|
"version" : "4.2.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,17 +23,14 @@ struct QuickConnectView: View {
|
||||||
|
|
||||||
private func pollingView(code: String) -> some View {
|
private func pollingView(code: String) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 20) {
|
VStack(alignment: .leading, spacing: 20) {
|
||||||
|
BulletedList {
|
||||||
// TODO: change strings so that numbers are removed
|
L10n.quickConnectStep1.text
|
||||||
// and use `BulletedList`
|
.padding(.bottom)
|
||||||
// - also probably rephrase/change steps
|
L10n.quickConnectStep2.text
|
||||||
|
.padding(.bottom)
|
||||||
L10n.quickConnectStep1.text
|
L10n.quickConnectStep3.text
|
||||||
|
.padding(.bottom)
|
||||||
L10n.quickConnectStep2.text
|
}
|
||||||
|
|
||||||
L10n.quickConnectStep3.text
|
|
||||||
.padding(.bottom)
|
|
||||||
|
|
||||||
Text(code)
|
Text(code)
|
||||||
.tracking(10)
|
.tracking(10)
|
||||||
|
|
|
@ -43,8 +43,7 @@ extension LiveVideoPlayer {
|
||||||
.padding(.trailing, splitContentViewProxy.isPresentingSplitView ? 0 : safeAreaInsets.trailing)
|
.padding(.trailing, splitContentViewProxy.isPresentingSplitView ? 0 : safeAreaInsets.trailing)
|
||||||
}
|
}
|
||||||
.if(UIDevice.isPad) { view in
|
.if(UIDevice.isPad) { view in
|
||||||
view.padding(.top)
|
view.padding()
|
||||||
.padding2(.horizontal)
|
|
||||||
}
|
}
|
||||||
.background {
|
.background {
|
||||||
LinearGradient(
|
LinearGradient(
|
||||||
|
@ -68,8 +67,7 @@ extension LiveVideoPlayer {
|
||||||
.padding(.trailing, splitContentViewProxy.isPresentingSplitView ? 0 : safeAreaInsets.trailing)
|
.padding(.trailing, splitContentViewProxy.isPresentingSplitView ? 0 : safeAreaInsets.trailing)
|
||||||
}
|
}
|
||||||
.if(UIDevice.isPad) { view in
|
.if(UIDevice.isPad) { view in
|
||||||
view.padding2(.bottom)
|
view.padding()
|
||||||
.padding2(.horizontal)
|
|
||||||
}
|
}
|
||||||
.background {
|
.background {
|
||||||
LinearGradient(
|
LinearGradient(
|
||||||
|
|
|
@ -44,7 +44,7 @@ extension VideoPlayer {
|
||||||
}
|
}
|
||||||
.if(UIDevice.isPad) { view in
|
.if(UIDevice.isPad) { view in
|
||||||
view.padding(.top)
|
view.padding(.top)
|
||||||
.padding2(.horizontal)
|
.padding(.horizontal)
|
||||||
}
|
}
|
||||||
.background {
|
.background {
|
||||||
LinearGradient(
|
LinearGradient(
|
||||||
|
@ -68,8 +68,8 @@ extension VideoPlayer {
|
||||||
.padding(.trailing, splitContentViewProxy.isPresentingSplitView ? 0 : safeAreaInsets.trailing)
|
.padding(.trailing, splitContentViewProxy.isPresentingSplitView ? 0 : safeAreaInsets.trailing)
|
||||||
}
|
}
|
||||||
.if(UIDevice.isPad) { view in
|
.if(UIDevice.isPad) { view in
|
||||||
view.padding2(.bottom)
|
view.padding(.bottom)
|
||||||
.padding2(.horizontal)
|
.padding(.horizontal)
|
||||||
}
|
}
|
||||||
.background {
|
.background {
|
||||||
LinearGradient(
|
LinearGradient(
|
||||||
|
|
|
@ -231,9 +231,9 @@
|
||||||
"quickConnectInvalidError" = "Invalid Quick Connect code";
|
"quickConnectInvalidError" = "Invalid Quick Connect code";
|
||||||
"quickConnectSuccessMessage" = "Authorizing Quick Connect successful. Please continue on your other device.";
|
"quickConnectSuccessMessage" = "Authorizing Quick Connect successful. Please continue on your other device.";
|
||||||
"showChaptersInfoInBottomOverlay" = "Show Chapters Info In Bottom Overlay";
|
"showChaptersInfoInBottomOverlay" = "Show Chapters Info In Bottom Overlay";
|
||||||
"quickConnectStep1" = "1. Open the Jellyfin app on your phone or web browser and sign in with your account";
|
"quickConnectStep1" = "Open the Jellyfin app on your phone or web browser and sign in with your account";
|
||||||
"quickConnectStep2" = "2. Open the user menu and go to the Quick Connect page";
|
"quickConnectStep2" = "Open the user menu and go to the Quick Connect page";
|
||||||
"quickConnectStep3" = "3. Enter the following code:";
|
"quickConnectStep3" = "Enter the following code:";
|
||||||
"quickConnectNotEnabled" = "Note: Quick Connect not enabled";
|
"quickConnectNotEnabled" = "Note: Quick Connect not enabled";
|
||||||
"episodeNumber" = "Episode %1$@";
|
"episodeNumber" = "Episode %1$@";
|
||||||
"compactPoster" = "Compact Poster";
|
"compactPoster" = "Compact Poster";
|
||||||
|
@ -278,6 +278,7 @@
|
||||||
"grid" = "Grid";
|
"grid" = "Grid";
|
||||||
"list" = "List";
|
"list" = "List";
|
||||||
"logs" = "Logs";
|
"logs" = "Logs";
|
||||||
|
"likedItems" = "Liked Items";
|
||||||
|
|
||||||
"onNow" = "On Now";
|
"onNow" = "On Now";
|
||||||
"sports" = "Sports";
|
"sports" = "Sports";
|
||||||
|
|
Loading…
Reference in New Issue