...
 
Commits (2)
...@@ -2327,7 +2327,7 @@ ...@@ -2327,7 +2327,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = MSHYCBXK85; DEVELOPMENT_TEAM = MSHYCBXK85;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
...@@ -2367,7 +2367,7 @@ ...@@ -2367,7 +2367,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
...@@ -2532,7 +2532,7 @@ ...@@ -2532,7 +2532,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
......
...@@ -451,7 +451,7 @@ class MessageCell: UITableViewCell, NibReusable { ...@@ -451,7 +451,7 @@ class MessageCell: UITableViewCell, NibReusable {
self.transferImageView.bottomAnchor.constraint(equalTo: self.bubble.bottomAnchor, constant: 0).isActive = true self.transferImageView.bottomAnchor.constraint(equalTo: self.bubble.bottomAnchor, constant: 0).isActive = true
if !message.message.incoming && message.initialTransferStatus != .success { if !message.message.incoming && message.initialTransferStatus != .success {
self.transferProgressView.frame = self.transferImageView.frame self.transferProgressView.frame = self.transferImageView.frame
self.transferProgressView.image = image self.transferProgressView.configureViews()
self.transferProgressView.progress = 0 self.transferProgressView.progress = 0
self.transferProgressView.target = 100 self.transferProgressView.target = 100
self.transferProgressView.currentProgress = 0 self.transferProgressView.currentProgress = 0
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>2</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string></string> <string></string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
......
...@@ -24,7 +24,7 @@ import RxSwift ...@@ -24,7 +24,7 @@ import RxSwift
class ProgressView: UIView { class ProgressView: UIView {
var maximumValue: CGFloat = 100 var maximumValue: CGFloat = 100
var imageView: UIImageView = UIImageView() var imageView: UIVisualEffectView = UIVisualEffectView()
var statusLabel = UILabel() var statusLabel = UILabel()
var disposeBug = DisposeBag() var disposeBug = DisposeBag()
...@@ -43,7 +43,7 @@ class ProgressView: UIView { ...@@ -43,7 +43,7 @@ class ProgressView: UIView {
default: default:
return "" return ""
} }
}),progressVariable }), progressVariable
.asObservable() .asObservable()
.map({ progressValue in .map({ progressValue in
return floor(progressValue) return floor(progressValue)
...@@ -62,7 +62,6 @@ class ProgressView: UIView { ...@@ -62,7 +62,6 @@ class ProgressView: UIView {
currentProgress += (target - currentProgress) * 0.1 currentProgress += (target - currentProgress) * 0.1
innerProgress = currentProgress * toAngleScaler innerProgress = currentProgress * toAngleScaler
self.progressVariable.value = newProgress self.progressVariable.value = newProgress
if self.bluredImage == nil {return}
setImage() setImage()
} }
get { get {
...@@ -70,21 +69,6 @@ class ProgressView: UIView { ...@@ -70,21 +69,6 @@ class ProgressView: UIView {
} }
} }
var image: UIImage? {
didSet {
guard let image = image else {return}
if bluredImage != nil {return}
guard let blureImage = self.blureImage(image: image) else {
return
}
self.bluredImage = blureImage
self.configureViews()
}
}
var bluredImage: UIImage?
// MARK: configure path // MARK: configure path
private var startPoint: CGPoint { private var startPoint: CGPoint {
...@@ -156,7 +140,6 @@ class ProgressView: UIView { ...@@ -156,7 +140,6 @@ class ProgressView: UIView {
let maskLayer = CAShapeLayer.init() let maskLayer = CAShapeLayer.init()
override func removeFromSuperview() { override func removeFromSuperview() {
self.bluredImage = nil
self.disposeBug = DisposeBag() self.disposeBug = DisposeBag()
self.progress = 0.00 self.progress = 0.00
self.target = 100 self.target = 100
...@@ -166,34 +149,14 @@ class ProgressView: UIView { ...@@ -166,34 +149,14 @@ class ProgressView: UIView {
super.removeFromSuperview() super.removeFromSuperview()
} }
func blureImage(image: UIImage) -> UIImage? {
let context = CIContext(options: nil)
let inputImage = CIImage(image: image)
let originalOrientation = image.imageOrientation
let originalScale = image.scale
let filterColor = CIFilter(name: "CIExposureAdjust")
filterColor?.setValue(-2, forKey: "inputEV")
filterColor?.setValue(inputImage, forKey: kCIInputImageKey)
let filterClamp = CIFilter(name: "CIAffineClamp")
let transform = CGAffineTransform.identity
filterClamp?.setValue(transform, forKey: "inputTransform")
filterClamp?.setValue(filterColor?.outputImage, forKey: kCIInputImageKey)
let filterGausse = CIFilter(name: "CIGaussianBlur")
filterGausse?.setValue(4.0, forKey: kCIInputRadiusKey)
filterGausse?.setValue(filterClamp?.outputImage, forKey: kCIInputImageKey)
let outputImage = filterGausse?.outputImage
var cgImage: CGImage?
guard let blurImage = outputImage else { return nil}
cgImage = context.createCGImage(blurImage, from: (inputImage?.extent)!)
guard let finaleImage = cgImage else { return nil }
return UIImage(cgImage: finaleImage, scale: originalScale, orientation: originalOrientation)
}
func configureViews() { func configureViews() {
self.backgroundColor = UIColor.clear
self.layer.cornerRadius = 20 self.layer.cornerRadius = 20
self.layer.masksToBounds = true self.layer.masksToBounds = true
let darkBlur = UIBlurEffect(style: UIBlurEffect.Style.dark)
self.imageView = UIVisualEffectView(effect: darkBlur)
self.imageView.alpha = 0.9
self.imageView.frame = self.bounds self.imageView.frame = self.bounds
self.imageView.image = bluredImage
maskLayer.frame = self.bounds maskLayer.frame = self.bounds
self.imageView.layer.mask = maskLayer self.imageView.layer.mask = maskLayer
self.addSubview(self.imageView) self.addSubview(self.imageView)
......