|
@@ -61,9 +61,24 @@ public class FloatingButton: UIView {
|
|
|
nexilis_button.translatesAutoresizingMaskIntoConstraints = false
|
|
|
nexilis_button.isUserInteractionEnabled = true
|
|
|
if Utils.getIconDock() != nil {
|
|
|
- let dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
- if dataImage != nil {
|
|
|
- nexilis_button.image = UIImage(data: dataImage!)
|
|
|
+ var dataImage: Data?
|
|
|
+ if Utils.getIconDock()!.contains(".gif"){
|
|
|
+ nexilis_button.sd_setImage(with: URL(string: Utils.getIconCenterAnim()!)) { [self] (image, error, cacheType, imageURL) in
|
|
|
+ if let error = error {
|
|
|
+ //print("Error loading GIF: \(error.localizedDescription)")
|
|
|
+ } else {
|
|
|
+ // Configure the animation
|
|
|
+ nexilis_button.animationImages = image?.images
|
|
|
+ nexilis_button.animationDuration = image?.duration ?? 0.0
|
|
|
+ nexilis_button.animationRepeatCount = 0
|
|
|
+ nexilis_button.startAnimating()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!)
|
|
|
+ if dataImage != nil {
|
|
|
+ nexilis_button.image = UIImage(data: dataImage!)
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
nexilis_button.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
|
|
@@ -85,11 +100,11 @@ public class FloatingButton: UIView {
|
|
|
|
|
|
scrollView = UIScrollView()
|
|
|
scrollView.translatesAutoresizingMaskIntoConstraints = false
|
|
|
- scrollView.layer.borderWidth = 1.0
|
|
|
- scrollView.layer.borderColor = UIColor.white.cgColor
|
|
|
- scrollView.layer.cornerRadius = 8.0
|
|
|
- scrollView.layer.masksToBounds = true
|
|
|
- scrollView.backgroundColor = .black.withAlphaComponent(0.25)
|
|
|
+// scrollView.layer.borderWidth = 1.0
|
|
|
+// scrollView.layer.borderColor = UIColor.white.cgColor
|
|
|
+// scrollView.layer.cornerRadius = 8.0
|
|
|
+// scrollView.layer.masksToBounds = true
|
|
|
+// scrollView.backgroundColor = .black.withAlphaComponent(0.25)
|
|
|
addSubview(scrollView)
|
|
|
|
|
|
scrollView.widthAnchor.constraint(equalTo: widthAnchor).isActive = true
|