mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Fix some SwiftLint warnings.
This commit is contained in:
@@ -63,7 +63,7 @@ struct MapLibreStaticMapView<PinAnnotation: View>: View {
|
||||
ZStack {
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.scaledToFill()
|
||||
pinAnnotationView
|
||||
}
|
||||
case .failure(let error):
|
||||
|
||||
@@ -423,7 +423,7 @@ struct LoadableImage_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
private extension View {
|
||||
func layout(title: String, hideTimelineMedia: Bool = false) -> some View {
|
||||
aspectRatio(contentMode: .fit)
|
||||
scaledToFit()
|
||||
.clipShape(RoundedRectangle(cornerRadius: 20))
|
||||
.overlay(alignment: .bottom) {
|
||||
Text(title)
|
||||
|
||||
@@ -23,7 +23,7 @@ struct OverridableAvatarImage: View {
|
||||
AsyncImage(url: overrideURL) { image in
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.scaledToFill()
|
||||
} placeholder: {
|
||||
ProgressView()
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ struct CreateRoomScreen: View {
|
||||
if let avatarImage = context.viewState.avatarImage {
|
||||
Image(uiImage: avatarImage)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.scaledToFill()
|
||||
.scaledFrame(size: 70, relativeTo: .title)
|
||||
.avatarShape(context.viewState.isSpace ? .roundedRect : .circle, size: 70)
|
||||
.overlay(alignment: .bottomTrailing) {
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ struct TimelineMediaPreviewRedactConfirmationView: View {
|
||||
mediaProvider: context.mediaProvider) {
|
||||
Color.compound.bgSubtleSecondary
|
||||
}
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.scaledToFill()
|
||||
}
|
||||
.clipShape(RoundedRectangle(cornerRadius: 8))
|
||||
.accessibilityHidden(true)
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ struct NotificationPermissionsScreen: View {
|
||||
Asset.Images.notificationsPromptGraphic
|
||||
.swiftUIImage
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.scaledToFit()
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,6 +461,7 @@ class TimelineInteractionHandler {
|
||||
audioPlayerState(for: itemID)?.setPlaybackSpeed(nextSpeed)
|
||||
}
|
||||
|
||||
// swiftlint:disable:next cyclomatic_complexity
|
||||
func playPauseAudio(for itemID: TimelineItemIdentifier) async {
|
||||
MXLog.info("Toggle play/pause audio for itemID \(itemID)")
|
||||
guard let timelineItem = timelineController.timelineItems.firstUsingStableID(itemID) else {
|
||||
|
||||
@@ -266,11 +266,11 @@ struct TimelineReplyView: View {
|
||||
CompoundIcon(\.image)
|
||||
.padding(4.0)
|
||||
}
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.scaledToFill()
|
||||
case .iconAsset(let asset):
|
||||
Image(asset: asset)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.scaledToFit()
|
||||
.padding(8.0)
|
||||
case .icon(let keyPath):
|
||||
CompoundIcon(keyPath, size: .medium, relativeTo: .body)
|
||||
|
||||
@@ -79,7 +79,7 @@ struct GalleryItemTileView: View {
|
||||
size: item.size,
|
||||
mediaProvider: mediaProvider) { imageView in
|
||||
imageView
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.scaledToFill()
|
||||
} placeholder: {
|
||||
placeholder
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ private struct GalleryListRow: View {
|
||||
size: item.size,
|
||||
mediaProvider: mediaProvider) { imageView in
|
||||
imageView
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.scaledToFill()
|
||||
} placeholder: {
|
||||
Color.compound.bgSubtleSecondary
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user