Refactor TimelineItemBubbledStylerView for polls (#1404)

* Refactor bubble bg colors and insets

* Improve MapLibreStaticMapView layout

* Add BubbleTimestampLayout

* Refactor BubbleTimestampLayoutType

* Refine .horizontal, .vertical layouts

* Rename layout type

* Add docs

* Restore LocationRoomTimelineItem body

* Refactor whitespaces

* Fix background color for LocationRoomTimelineView.

* Fix UTs

* Fix analytics ui tests

* Fix bug report tests

* Fix settings ui tests

* Rename private property

* Record room screen tests
This commit is contained in:
Alfonso Grillo
2023-07-26 17:17:41 +02:00
committed by GitHub
parent 08785683f5
commit a6708c0231
39 changed files with 209 additions and 231 deletions

View File

@@ -48,9 +48,7 @@ struct MapLibreStaticMapView<PinAnnotation: View>: View {
AsyncImage(url: url) { phase in
switch phase {
case .empty:
Image("mapBlurred")
.resizable()
.aspectRatio(contentMode: .fill)
placeholderImage
case .success(let image):
ZStack {
image
@@ -64,24 +62,31 @@ struct MapLibreStaticMapView<PinAnnotation: View>: View {
EmptyView()
}
}
.position(x: geometry.frame(in: .local).midX, y: geometry.frame(in: .local).midY)
.id(fetchAttempt)
} else {
Image("mapBlurred")
placeholderImage
}
}
}
private var placeholderImage: some View {
Image("mapBlurred")
.resizable()
.scaledToFill()
}
private var errorView: some View {
Button {
fetchAttempt += 1
} label: {
ZStack {
Image("mapBlurred")
VStack {
Image(systemName: "arrow.clockwise")
Text(L10n.actionStaticMapLoad)
placeholderImage
.overlay {
VStack {
Image(systemName: "arrow.clockwise")
Text(L10n.actionStaticMapLoad)
}
}
}
}
}
}