mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fix some SwiftLint warnings.
This commit is contained in:
+1
-14
@@ -18,22 +18,9 @@ DerivedData/
|
||||
.swiftpm
|
||||
.netrc
|
||||
|
||||
# fastlane
|
||||
#
|
||||
# It is recommended to not store the screenshots in the git repo.
|
||||
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
|
||||
# For more information about the recommended setup visit:
|
||||
# https://docs.fastlane.tools/best-practices/source-control/#source-control
|
||||
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots/**/*.png
|
||||
fastlane/test_output
|
||||
towncrier.toml.tmp
|
||||
version_changes.md
|
||||
|
||||
build
|
||||
/vendor/
|
||||
*/xcshareddata/xcodecloud
|
||||
|
||||
## macOS Files
|
||||
.DS_Store
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public extension Image {
|
||||
func bigIcon(insets: CGFloat = 16, style: BigIcon.Style = .defaultSolid) -> some View {
|
||||
resizable()
|
||||
.renderingMode(.template)
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.scaledToFit()
|
||||
.scaledPadding(insets, relativeTo: .compound.headingLG)
|
||||
.modifier(BigIconModifier(style: style))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user