Merge pull request #83 from stephenb10/iosUiChanges

UI Changes
This commit is contained in:
aiden vigue 2021-06-21 22:36:40 -04:00 committed by GitHub
commit f28e043078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 16 deletions

View File

@ -52,6 +52,7 @@ struct EpisodeItemView: View {
.stroke(Color.secondary, lineWidth: 1))
}
}
.padding(.top, 1)
}
.padding(.bottom, UIDevice.current.userInterfaceIdiom == .pad ? 98 : 30)
}
@ -89,10 +90,10 @@ struct EpisodeItemView: View {
viewModel.updateWatchState()
} label: {
if viewModel.isWatched {
Image(systemName: "checkmark.rectangle.fill").foregroundColor(Color.primary)
Image(systemName: "checkmark.circle.fill").foregroundColor(Color.primary)
.font(.system(size: 20))
} else {
Image(systemName: "xmark.rectangle").foregroundColor(Color.primary)
Image(systemName: "checkmark.circle").foregroundColor(Color.primary)
.font(.system(size: 20))
}
}
@ -254,6 +255,8 @@ struct EpisodeItemView: View {
Spacer()
}.frame(maxWidth: .infinity, alignment: .leading)
.offset(x: 14)
.padding(.top, 1)
}.frame(maxWidth: .infinity, alignment: .leading)
Spacer()
HStack {
@ -273,10 +276,10 @@ struct EpisodeItemView: View {
viewModel.updateWatchState()
} label: {
if viewModel.isWatched {
Image(systemName: "checkmark.rectangle.fill").foregroundColor(Color.primary)
Image(systemName: "checkmark.circle.fill").foregroundColor(Color.primary)
.font(.system(size: 20))
} else {
Image(systemName: "xmark.rectangle").foregroundColor(Color.primary)
Image(systemName: "checkmark.circle").foregroundColor(Color.primary)
.font(.system(size: 20))
}
}

View File

@ -58,6 +58,7 @@ struct MovieItemView: View {
.stroke(Color.secondary, lineWidth: 1))
}
}
.padding(.top, 1)
}
.padding(.bottom, UIDevice.current.userInterfaceIdiom == .pad ? 98 : 30)
}
@ -95,10 +96,10 @@ struct MovieItemView: View {
viewModel.updateWatchState()
} label: {
if viewModel.isWatched {
Image(systemName: "checkmark.rectangle.fill").foregroundColor(Color.primary)
Image(systemName: "checkmark.circle.fill").foregroundColor(Color.primary)
.font(.system(size: 20))
} else {
Image(systemName: "xmark.rectangle").foregroundColor(Color.primary)
Image(systemName: "checkmark.circle").foregroundColor(Color.primary)
.font(.system(size: 20))
}
}
@ -270,6 +271,7 @@ struct MovieItemView: View {
Spacer()
}.frame(maxWidth: .infinity, alignment: .leading)
.offset(x: 14)
.padding(.top, 1)
}.frame(maxWidth: .infinity, alignment: .leading)
Spacer()
HStack {
@ -289,10 +291,10 @@ struct MovieItemView: View {
viewModel.updateWatchState()
} label: {
if viewModel.isWatched {
Image(systemName: "checkmark.rectangle.fill").foregroundColor(Color.primary)
Image(systemName: "checkmark.circle.fill").foregroundColor(Color.primary)
.font(.system(size: 20))
} else {
Image(systemName: "xmark.rectangle").foregroundColor(Color.primary)
Image(systemName: "checkmark.circle").foregroundColor(Color.primary)
.font(.system(size: 20))
}
}

View File

@ -104,14 +104,16 @@ extension BaseItemDto {
// MARK: Calculations
func getItemRuntime() -> String {
let seconds = (self.runTimeTicks ?? 0) / 10_000_000
let hours = (seconds / 3600)
let minutes = ((seconds - (hours * 3600)) / 60)
if hours != 0 {
return "\(hours):\(String(minutes).leftPad(toWidth: 2, withString: "0"))"
} else {
return "\(String(minutes))m"
}
let timeHMSFormatter: DateComponentsFormatter = {
let formatter = DateComponentsFormatter()
formatter.unitsStyle = .brief
formatter.allowedUnits = [.hour, .minute]
return formatter
}()
let text = timeHMSFormatter.string(from: Double(self.runTimeTicks! / 10_000_000)) ?? ""
return text
}
func getItemProgressString() -> String {