mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Use more Liquid Glass in the room/space screen toolbars (#4965)
* Add a glass style to the Room/Space header view on iOS 26. * Update snapshots and fix the join call button.
This commit is contained in:
@@ -320,7 +320,9 @@ struct JoinRoomScreen: View {
|
||||
if let avatar = context.viewState.avatar {
|
||||
RoomHeaderView(roomName: context.viewState.title,
|
||||
roomAvatar: avatar,
|
||||
mediaProvider: context.mediaProvider)
|
||||
mediaProvider: context.mediaProvider) {
|
||||
// There is no action but the iOS 26 designs have it looking like a button.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,12 +159,9 @@ struct RoomScreen: View {
|
||||
RoomHeaderView(roomName: context.viewState.roomTitle,
|
||||
roomAvatar: context.viewState.roomAvatar,
|
||||
dmRecipientVerificationState: context.viewState.dmRecipientVerificationState,
|
||||
mediaProvider: context.mediaProvider)
|
||||
// Using a button stops it from getting truncated in the navigation bar
|
||||
.contentShape(.rect)
|
||||
.onTapGesture {
|
||||
context.send(viewAction: .displayRoomDetails)
|
||||
}
|
||||
mediaProvider: context.mediaProvider) {
|
||||
context.send(viewAction: .displayRoomDetails)
|
||||
}
|
||||
}
|
||||
|
||||
if !ProcessInfo.processInfo.isiOSAppOnMac {
|
||||
@@ -180,14 +177,9 @@ struct RoomScreen: View {
|
||||
@ViewBuilder
|
||||
private var callButton: some View {
|
||||
if context.viewState.hasOngoingCall {
|
||||
Button {
|
||||
JoinCallButton {
|
||||
context.send(viewAction: .displayCall)
|
||||
} label: {
|
||||
Label(L10n.actionJoin, icon: \.videoCallSolid)
|
||||
.labelStyle(.titleAndIcon)
|
||||
}
|
||||
.buttonStyle(ElementCallButtonStyle())
|
||||
.accessibilityLabel(L10n.a11yJoinCall)
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.joinCall)
|
||||
} else {
|
||||
Button {
|
||||
|
||||
@@ -72,14 +72,12 @@ struct SpaceScreen: View {
|
||||
ToolbarItem(placement: .principal) {
|
||||
RoomHeaderView(roomName: context.viewState.space.name,
|
||||
roomAvatar: context.viewState.space.avatar,
|
||||
mediaProvider: context.mediaProvider)
|
||||
.contentShape(.rect)
|
||||
.onTapGesture {
|
||||
if context.viewState.isSpaceManagementEnabled,
|
||||
let roomProxy = context.viewState.roomProxy {
|
||||
context.send(viewAction: .spaceSettings(roomProxy: roomProxy))
|
||||
}
|
||||
mediaProvider: context.mediaProvider) {
|
||||
if context.viewState.isSpaceManagementEnabled,
|
||||
let roomProxy = context.viewState.roomProxy {
|
||||
context.send(viewAction: .spaceSettings(roomProxy: roomProxy))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This should really use a ToolbarItemGroup(placement: .secondaryAction), however it
|
||||
|
||||
@@ -65,9 +65,9 @@ struct ThreadTimelineScreen: View {
|
||||
roomSubtitle: context.viewState.roomTitle,
|
||||
roomAvatar: context.viewState.roomAvatar,
|
||||
dmRecipientVerificationState: context.viewState.dmRecipientVerificationState,
|
||||
mediaProvider: context.mediaProvider)
|
||||
// Using a button stops it from getting truncated in the navigation bar
|
||||
.contentShape(.rect)
|
||||
mediaProvider: context.mediaProvider) {
|
||||
// There is no action but the iOS 26 designs have it looking like a button.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ struct TimelineViewRepresentable: UIViewControllerRepresentable {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
struct TimelineView_Previews: PreviewProvider, TestablePreview {
|
||||
struct TimelineView_Previews: PreviewProvider { // Not testable as this preview is built the same way as RoomScreen.
|
||||
static let roomProxyMock = JoinedRoomProxyMock(.init(id: "stable_id",
|
||||
name: "Preview room"))
|
||||
static let roomViewModel = RoomScreenViewModel.mock(roomProxyMock: roomProxyMock)
|
||||
|
||||
Reference in New Issue
Block a user