Skip to content

Commit

Permalink
Merge pull request #175 from dolbyio-samples/bugfix/scrollbar-insets
Browse files Browse the repository at this point in the history
Fix scrollbar insets for Saved and Recent streams screen
  • Loading branch information
aravind-raveendran authored Oct 20, 2023
2 parents 44f2102 + b167519 commit bf25100
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ struct RecentStreamsScreen: View {
)
.frame(maxWidth: 400)
}
.padding([.leading, .trailing], horizontalSizeClass == .regular ? Layout.spacing5x : Layout.spacing3x)
}
.layoutPriority(1)
.padding([.leading, .trailing], horizontalSizeClass == .regular ? Layout.spacing5x : Layout.spacing3x)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color(uiColor: themeManager.theme.neutral900))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct SavedStreamsScreen: View {
font: .custom("AvenirNext-Medium", size: FontSize.footnote, relativeTo: .footnote)
)
.listRowBackground(Color.clear)
.listRowInsets(EdgeInsets())
.listRowInsets(listRowEdgeInsets)
.listRowSeparator(.hidden)
.frame(height: Layout.spacing4x)

Expand All @@ -76,7 +76,7 @@ struct SavedStreamsScreen: View {
}
.onDelete(perform: viewModel.delete)
.listRowBackground(Color.clear)
.listRowInsets(EdgeInsets())
.listRowInsets(listRowEdgeInsets)
.listRowSeparator(.hidden)

}
Expand All @@ -90,7 +90,7 @@ struct SavedStreamsScreen: View {
font: .custom("AvenirNext-Medium", size: FontSize.footnote, relativeTo: .footnote)
)
.listRowBackground(Color.clear)
.listRowInsets(EdgeInsets())
.listRowInsets(listRowEdgeInsets)
.listRowSeparator(.hidden)
.frame(height: Layout.spacing4x)

Expand All @@ -104,7 +104,7 @@ struct SavedStreamsScreen: View {
}
.onDelete(perform: viewModel.delete(at:))
.listRowBackground(Color.clear)
.listRowInsets(EdgeInsets())
.listRowInsets(listRowEdgeInsets)
.listRowSeparator(.hidden)
}
.environment(\.defaultMinListRowHeight, 0)
Expand All @@ -129,7 +129,6 @@ struct SavedStreamsScreen: View {
.navigationBarBackButtonHidden()
.navigationBarTitleDisplayMode(.inline)
.navigationTitle("saved-streams.title.label")
.padding([.leading, .trailing], horizontalSizeClass == .regular ? Layout.spacing5x : Layout.spacing3x)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color(uiColor: themeManager.theme.neutral900))
.alert("saved-streams.clear-streams.label", isPresented: $isShowingClearStreamsAlert, actions: {
Expand Down Expand Up @@ -170,6 +169,11 @@ struct SavedStreamsScreen: View {
}
}
}

private var listRowEdgeInsets: EdgeInsets {
let horizontalInset = horizontalSizeClass == .regular ? Layout.spacing5x : Layout.spacing3x
return EdgeInsets(top: 0, leading: horizontalInset, bottom: 0, trailing: horizontalInset)
}
}

struct SavedStreamsScreen_Previews: PreviewProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"location" : "https://github.com/DolbyIO/rts-uikit-ios.git",
"state" : {
"branch" : "main",
"revision" : "9b90433fd0c3d1c85f4bfca2c373a80b606e7d00"
"revision" : "14ba05039ec31eb8bbe133731e1d5c0756f16df8"
}
}
],
Expand Down

0 comments on commit bf25100

Please sign in to comment.