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