mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Update files following swiftformat upgrade
This commit is contained in:
committed by
Stefan Ceriu
parent
fe189fcfed
commit
23062901c0
@@ -19,7 +19,7 @@ public extension Animation {
|
||||
return animation.disabledIfReduceMotionEnabled()
|
||||
}
|
||||
|
||||
// `noAnimation` if running tests, otherwise `self` if `UIAccessibility.isReduceMotionEnabled` is false
|
||||
/// `noAnimation` if running tests, otherwise `self` if `UIAccessibility.isReduceMotionEnabled` is false
|
||||
func disabledDuringTests() -> Self {
|
||||
let animation: Animation = ProcessInfo.isRunningTests ? .noAnimation : self
|
||||
return animation.disabledIfReduceMotionEnabled()
|
||||
|
||||
@@ -10,7 +10,9 @@ import SwiftUI
|
||||
|
||||
extension ButtonStyle where Self == MenuSheetButtonStyle {
|
||||
/// A button style for buttons that are within a menu that is being presented as a sheet.
|
||||
static var menuSheet: Self { MenuSheetButtonStyle() }
|
||||
static var menuSheet: Self {
|
||||
MenuSheetButtonStyle()
|
||||
}
|
||||
}
|
||||
|
||||
/// The style used for buttons that are part of a menu that's presented as
|
||||
|
||||
@@ -31,7 +31,6 @@ extension View {
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
func mediaGalleryTimelineAspectRatio(imageInfo: ImageInfoProxy?) -> some View {
|
||||
aspectRatio(imageInfo?.aspectRatio, contentMode: .fill)
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ private struct SearchControllerModifier: ViewModifier {
|
||||
/// is `false`, checking if this value is `false` is pretty much meaningless.
|
||||
@State private var isSearching = false
|
||||
|
||||
@ViewBuilder
|
||||
func body(content: Content) -> some View {
|
||||
let text: Text? = if let placeholder {
|
||||
Text(placeholder)
|
||||
@@ -191,7 +190,9 @@ private struct SearchController: UIViewControllerRepresentable {
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
required init?(coder: NSCoder) { fatalError() }
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
override func willMove(toParent parent: UIViewController?) {
|
||||
parent?.navigationItem.searchController = searchController
|
||||
|
||||
@@ -135,9 +135,7 @@ private struct LoadableImageContent<TransformerView: View, PlaceholderView: View
|
||||
ZStack {
|
||||
switch (contentLoader.content, shouldRender) {
|
||||
case (.image(let image), true):
|
||||
transformer(
|
||||
AnyView(Image(uiImage: image).resizable())
|
||||
)
|
||||
transformer(AnyView(Image(uiImage: image).resizable()))
|
||||
case (.gifData, true):
|
||||
transformer(AnyView(KFAnimatedImage(source: .provider(self))))
|
||||
case (.none, _), (_, false):
|
||||
@@ -170,7 +168,7 @@ private struct LoadableImageContent<TransformerView: View, PlaceholderView: View
|
||||
}
|
||||
}
|
||||
|
||||
// Note: Returns `AnyView` as this is what `transformer` expects.
|
||||
/// Note: Returns `AnyView` as this is what `transformer` expects.
|
||||
var blurHashView: AnyView? {
|
||||
if let blurhash,
|
||||
// Build a small blurhash image so that it's fast
|
||||
@@ -387,7 +385,10 @@ struct LoadableImage_Previews: PreviewProvider, TestablePreview {
|
||||
}
|
||||
}
|
||||
|
||||
static func placeholder() -> some View { Color.compound._bgBubbleIncoming }
|
||||
static func placeholder() -> some View {
|
||||
Color.compound._bgBubbleIncoming
|
||||
}
|
||||
|
||||
static func transformer(_ view: AnyView) -> some View {
|
||||
view.overlay {
|
||||
Image(systemSymbol: .playCircleFill)
|
||||
|
||||
@@ -17,7 +17,9 @@ struct UserProfileListRow: View {
|
||||
|
||||
let kind: ListRow<LoadableAvatarImage, EmptyView, EmptyView, Bool>.Kind<EmptyView, Bool>
|
||||
|
||||
var isUnknownProfile: Bool { !user.isVerified && membership == nil }
|
||||
var isUnknownProfile: Bool {
|
||||
!user.isVerified && membership == nil
|
||||
}
|
||||
|
||||
private var subtitle: String? {
|
||||
guard !isUnknownProfile else { return L10n.commonInviteUnknownProfile }
|
||||
|
||||
@@ -58,12 +58,10 @@ private struct VisualListItemLabelStyle: LabelStyle {
|
||||
struct VisualListItem_Previews: PreviewProvider, TestablePreview {
|
||||
static let strings = AnalyticsPromptScreenStrings(termsURL: ServiceLocator.shared.settings.analyticsTermsURL)
|
||||
|
||||
@ViewBuilder
|
||||
static var testImage1: some View {
|
||||
Image(systemName: "circle")
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
static var testImage2: some View {
|
||||
Image(systemName: "square")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user