浏览代码

improvements

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 1 年之前
父节点
当前提交
f85c57e987
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift

+ 6 - 4
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift

@@ -68,8 +68,6 @@ class NCPlayerToolBar: UIView {
     override func awakeFromNib() {
         super.awakeFromNib()
 
-        backgroundColor = UIColor.black.withAlphaComponent(0.1)
-
         fullscreenButton.setImage(NCUtility.shared.loadImage(named: "arrow.up.left.and.arrow.down.right", color: .white), for: .normal)
 
         subtitleButton.setImage(NCUtility.shared.loadImage(named: "captions.bubble", color: .white), for: .normal)
@@ -177,19 +175,23 @@ class NCPlayerToolBar: UIView {
 
     public func show() {
 
-        UIView.animate(withDuration: 0.3, animations: {
+        UIView.animate(withDuration: 0.6, animations: {
+            self.backgroundColor = UIColor.black
             self.alpha = 1
         }, completion: { (_: Bool) in
             self.isHidden = false
+            self.backgroundColor = UIColor.black.withAlphaComponent(0.1)
         })
     }
 
     func hide() {
 
-        UIView.animate(withDuration: 0.3, animations: {
+        UIView.animate(withDuration: 0.6, animations: {
             self.alpha = 0
+            self.backgroundColor = UIColor.black.withAlphaComponent(0.1)
         }, completion: { (_: Bool) in
             self.isHidden = true
+            self.backgroundColor = UIColor.black
         })
     }