diff --git a/apps/ios/Shared/Views/ChatList/ChatListView.swift b/apps/ios/Shared/Views/ChatList/ChatListView.swift index b9817ed4b6..7d628bfa56 100644 --- a/apps/ios/Shared/Views/ChatList/ChatListView.swift +++ b/apps/ios/Shared/Views/ChatList/ChatListView.swift @@ -88,13 +88,25 @@ struct ChatListView: View { .safeAreaInset(edge: .top) { if oneHandUI { Divider().background(Material.ultraThin) } } + .safeAreaInset(edge: .bottom) { + if oneHandUI { + Divider().padding(.bottom, Self.hasHomeIndicator ? 0 : 8).background(Material.ultraThin) + } + } } + static var hasHomeIndicator: Bool = { + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let window = windowScene.windows.first { + window.safeAreaInsets.bottom > 0 + } else { false } + }() + @ViewBuilder func withToolbar(content: () -> some View) -> some View { if #available(iOS 16.0, *) { if oneHandUI { content() - .toolbarBackground(.visible, for: .bottomBar) + .toolbarBackground(.hidden, for: .bottomBar) .toolbar { bottomToolbar } } else { content() @@ -112,28 +124,18 @@ struct ChatListView: View { @ToolbarContentBuilder var topToolbar: some ToolbarContent { ToolbarItem(placement: .topBarLeading) { leadingToolbarItem } - ToolbarItem(placement: .principal) { principalToolbarItem } + ToolbarItem(placement: .principal) { SubsStatusIndicator() } ToolbarItem(placement: .topBarTrailing) { trailingToolbarItem } } @ToolbarContentBuilder var bottomToolbar: some ToolbarContent { - ToolbarItem(placement: .bottomBar) { - let v = HStack { - leadingToolbarItem - principalToolbarItem - trailingToolbarItem - } - if #available(iOS 16.0, *) { - v - } else { - VStack(spacing: 0) { - Divider() - v - .padding(.vertical) - .frame(maxWidth: .infinity) - .background(Material.ultraThin) - } - } + let padding: Double = Self.hasHomeIndicator ? 0 : 14 + ToolbarItemGroup(placement: .bottomBar) { + leadingToolbarItem.padding(.bottom, padding) + Spacer() + SubsStatusIndicator().padding(.bottom, padding) + Spacer() + trailingToolbarItem.padding(.bottom, padding) } } @@ -160,14 +162,6 @@ struct ChatListView: View { } } - @ViewBuilder var principalToolbarItem: some View { - HStack(spacing: 4) { - Text("Chats").font(.headline) - SubsStatusIndicator() - } - .frame(maxWidth: .infinity, alignment: .center) - } - @ViewBuilder var trailingToolbarItem: some View { switch chatModel.chatRunning { case .some(true): NewChatMenuButton() @@ -313,6 +307,7 @@ struct SubsStatusIndicator: View { showServersSummary = true } label: { HStack(spacing: 4) { + Text("Chats").foregroundStyle(Color.primary).fixedSize().font(.headline) SubscriptionStatusIndicatorView(subs: subs, hasSess: hasSess) if showSubscriptionPercentage { SubscriptionStatusPercentageView(subs: subs, hasSess: hasSess)