Skip to content

Commit

Permalink
- ios-sdk: update SDK to include the latest fixes
Browse files Browse the repository at this point in the history
- ProgressView: add minimum + touch friendly sizes to avoid display as zero-sized views (which prevented cancelling by tapping because the touch never reached the view)
  • Loading branch information
felix-schwarz committed Jul 16, 2024
1 parent fdcb70f commit 48eed6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion ownCloudAppShared/User Interface/Progress/ProgressView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public class ProgressView: UIView, Themeable, CAAnimationDelegate, ThemeCSSAutoS
var foregroundCircleLayer : CAShapeLayer = CAShapeLayer()
var stopButtonLayer : CAShapeLayer = CAShapeLayer()

private let dimensions : CGSize = CGSize(width: 30, height: 30)
private let dimensions = CGSize(width: 30, height: 30)
private let minimumViewSize = CGSize(width: 50, height: 50)
private let circleLineWidth : CGFloat = 3

private var _observerRegistered : Bool = false
Expand Down Expand Up @@ -133,6 +134,16 @@ public class ProgressView: UIView, Themeable, CAAnimationDelegate, ThemeCSSAutoS

self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.cancel)))

self.addConstraints([
// Enforce minimum size of .dimensions
widthAnchor.constraint(greaterThanOrEqualToConstant: dimensions.width),
heightAnchor.constraint(greaterThanOrEqualToConstant: dimensions.height),

// Nudge Auto Layout towards using .minimumViewSize (.dimensions + extra space to make a better touch target) while allowing individual "overrides"
widthAnchor.constraint(equalToConstant: minimumViewSize.width).with(priority: .defaultHigh),
heightAnchor.constraint(equalToConstant: minimumViewSize.height).with(priority: .defaultHigh)
])

NotificationCenter.default.addObserver(self, selector: #selector(self.appDidBecomeActive), name: UIApplication.didBecomeActiveNotification, object: nil)
}

Expand Down

0 comments on commit 48eed6d

Please sign in to comment.