mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Remove pinned views from the home screen room list header, potential fix for various layout issues.
This commit is contained in:
committed by
Stefan Ceriu
parent
f9f163ff78
commit
9e6b6ba60a
@@ -20,7 +20,6 @@ struct HomeScreenContent: View {
|
|||||||
@Environment(\.verticalSizeClass) private var verticalSizeClass
|
@Environment(\.verticalSizeClass) private var verticalSizeClass
|
||||||
|
|
||||||
@ObservedObject var context: HomeScreenViewModel.Context
|
@ObservedObject var context: HomeScreenViewModel.Context
|
||||||
@State private var topSectionFrame: CGRect = .zero
|
|
||||||
let scrollViewAdapter: ScrollViewAdapter
|
let scrollViewAdapter: ScrollViewAdapter
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@@ -53,18 +52,16 @@ struct HomeScreenContent: View {
|
|||||||
.layoutPriority(1)
|
.layoutPriority(1)
|
||||||
}
|
}
|
||||||
case .rooms:
|
case .rooms:
|
||||||
// Showing empty views in pinned headers makes the room list spasm when reaching the top
|
LazyVStack(spacing: 0) {
|
||||||
LazyVStack(spacing: 0, pinnedViews: [.sectionHeaders]) {
|
|
||||||
Section {
|
Section {
|
||||||
if context.viewState.shouldShowEmptyFilterState {
|
if context.viewState.shouldShowEmptyFilterState {
|
||||||
RoomListFiltersEmptyStateView(state: context.filtersState)
|
RoomListFiltersEmptyStateView(state: context.filtersState)
|
||||||
.frame(height: geometry.size.height - topSectionFrame.height)
|
.frame(height: geometry.size.height)
|
||||||
} else {
|
} else {
|
||||||
HomeScreenRoomList(context: context)
|
HomeScreenRoomList(context: context)
|
||||||
}
|
}
|
||||||
} header: {
|
} header: {
|
||||||
topSection
|
topSection
|
||||||
.readFrame($topSectionFrame)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.isSearching($context.isSearchFieldFocused)
|
.isSearching($context.isSearchFieldFocused)
|
||||||
@@ -110,8 +107,7 @@ struct HomeScreenContent: View {
|
|||||||
private var topSection: some View {
|
private var topSection: some View {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
if !context.isSearchFieldFocused {
|
if !context.isSearchFieldFocused {
|
||||||
filters
|
RoomListFiltersView(state: $context.filtersState)
|
||||||
.frame(alignment: .top)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if context.viewState.securityBannerMode == .sessionVerification {
|
if context.viewState.securityBannerMode == .sessionVerification {
|
||||||
@@ -131,10 +127,6 @@ struct HomeScreenContent: View {
|
|||||||
.background(Color.compound.bgCanvasDefault)
|
.background(Color.compound.bgCanvasDefault)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var filters: some View {
|
|
||||||
RoomListFiltersView(state: $context.filtersState)
|
|
||||||
}
|
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var migrationView: some View {
|
private var migrationView: some View {
|
||||||
if UIDevice.current.isPhone {
|
if UIDevice.current.isPhone {
|
||||||
|
|||||||
Reference in New Issue
Block a user