|
@@ -63,6 +63,8 @@ public class ProfileViewController: UITableViewController {
|
|
|
|
|
|
var isLoadingAddFriend = false
|
|
|
|
|
|
+ var publicBanner = FloatingNotificationBanner()
|
|
|
+
|
|
|
private func reload() {
|
|
|
if let user = self.user {
|
|
|
self.navigationController?.navigationBar.topItem?.title = "\(user.firstName) \(user.lastName)"
|
|
@@ -248,8 +250,9 @@ public class ProfileViewController: UITableViewController {
|
|
|
if !CheckConnection.isConnectedToNetwork() || API.nGetCLXConnState() == 0 {
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
self.switchPrivateAccount.setOn(!value, animated: true)
|
|
|
return
|
|
|
}
|
|
@@ -263,18 +266,20 @@ public class ProfileViewController: UITableViewController {
|
|
|
"offline_mode" : value ? "0" : "1"
|
|
|
], _where: "f_pin = '\(self.data)'")
|
|
|
})
|
|
|
- DispatchQueue.main.async {
|
|
|
+ DispatchQueue.main.async { [self] in
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Successfully changed".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Successfully changed".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
}
|
|
|
} else {
|
|
|
- DispatchQueue.main.async {
|
|
|
+ DispatchQueue.main.async { [self] in
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Unable to access servers".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Unable to access servers".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
self.switchPrivateAccount.setOn(!value, animated: true)
|
|
|
}
|
|
|
}
|
|
@@ -287,8 +292,9 @@ public class ProfileViewController: UITableViewController {
|
|
|
if !CheckConnection.isConnectedToNetwork() || API.nGetCLXConnState() == 0 {
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
self.switchPrivateAccount.setOn(!value, animated: true)
|
|
|
return
|
|
|
}
|
|
@@ -302,18 +308,20 @@ public class ProfileViewController: UITableViewController {
|
|
|
"privacy_flag" : value ? "1" : "0"
|
|
|
], _where: "f_pin = '\(self.data)'")
|
|
|
})
|
|
|
- DispatchQueue.main.async {
|
|
|
+ DispatchQueue.main.async { [self] in
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Successfully changed".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Successfully changed".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
}
|
|
|
} else {
|
|
|
- DispatchQueue.main.async {
|
|
|
+ DispatchQueue.main.async { [self] in
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Unable to access servers".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Unable to access servers".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
self.switchPrivateAccount.setOn(!value, animated: true)
|
|
|
}
|
|
|
}
|
|
@@ -345,15 +353,17 @@ public class ProfileViewController: UITableViewController {
|
|
|
}
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: title, subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: title, subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
return
|
|
|
}
|
|
|
if !CheckConnection.isConnectedToNetwork() {
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
return
|
|
|
}
|
|
|
let controller = QmeraAudioViewController()
|
|
@@ -372,15 +382,17 @@ public class ProfileViewController: UITableViewController {
|
|
|
}
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: title, subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: title, subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
return
|
|
|
}
|
|
|
if !CheckConnection.isConnectedToNetwork() {
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
return
|
|
|
}
|
|
|
if let user = user {
|
|
@@ -458,14 +470,15 @@ public class ProfileViewController: UITableViewController {
|
|
|
})
|
|
|
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "updateFifthTab"), object: nil, userInfo: nil)
|
|
|
|
|
|
- DispatchQueue.main.async {
|
|
|
+ DispatchQueue.main.async { [self] in
|
|
|
self.profile.image = UIImage(systemName: "person.circle.fill")!
|
|
|
self.profile.backgroundColor = .white
|
|
|
self.user?.thumb = ""
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Successfully removed profile picture".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Successfully removed profile picture".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
self.dismissImage?(UIImage(systemName: "person.circle.fill")!, "")
|
|
|
}
|
|
|
}
|
|
@@ -494,19 +507,21 @@ public class ProfileViewController: UITableViewController {
|
|
|
}
|
|
|
isLoadingAddFriend = true
|
|
|
addFriend { result in
|
|
|
- DispatchQueue.main.async {
|
|
|
+ DispatchQueue.main.async { [self] in
|
|
|
if result {
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Successfully add friend".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Successfully add friend".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
self.isDismiss?()
|
|
|
self.navigationController?.popViewController(animated: true)
|
|
|
} else {
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Server busy, please try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Server busy, please try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
self.isLoadingAddFriend = false
|
|
|
}
|
|
|
}
|
|
@@ -532,7 +547,7 @@ public class ProfileViewController: UITableViewController {
|
|
|
alert.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: {(_) in
|
|
|
Nexilis.showLoader()
|
|
|
self.unFriend { result in
|
|
|
- DispatchQueue.main.async {
|
|
|
+ DispatchQueue.main.async { [self] in
|
|
|
if result {
|
|
|
Database.shared.database?.inTransaction({ (fmdb, rollback) in
|
|
|
if let cursor = Database.shared.getRecords(fmdb: fmdb, query: "select * from BUDDY where f_pin = '\(self.data)'"), cursor.next() {
|
|
@@ -566,8 +581,9 @@ public class ProfileViewController: UITableViewController {
|
|
|
Nexilis.hideLoader(completion: {})
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Server busy, please try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Server busy, please try again later".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -597,8 +613,9 @@ public class ProfileViewController: UITableViewController {
|
|
|
}
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Successfully changed name".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ self.publicBanner.dismiss()
|
|
|
+ self.publicBanner = FloatingNotificationBanner(title: "Successfully changed name".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
+ self.publicBanner.show()
|
|
|
}
|
|
|
navigationItem.backButtonTitle = ""
|
|
|
navigationController?.show(controller, sender: nil)
|
|
@@ -667,13 +684,14 @@ extension ProfileViewController: ImageVideoPickerDelegate {
|
|
|
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "updateFifthTab"), object: nil, userInfo: nil)
|
|
|
|
|
|
DispatchQueue.main.async {
|
|
|
- Nexilis.hideLoader(completion: {
|
|
|
+ Nexilis.hideLoader(completion: { [self] in
|
|
|
self.profile.image = image
|
|
|
let imageView = UIImageView(image: UIImage(systemName: "checkmark.circle.fill"))
|
|
|
self.user?.thumb = fileDir.lastPathComponent
|
|
|
imageView.tintColor = .white
|
|
|
- let banner = FloatingNotificationBanner(title: "Successfully changed profile picture".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
- banner.show()
|
|
|
+ publicBanner.dismiss()
|
|
|
+ publicBanner = FloatingNotificationBanner(title: "Successfully changed profile picture".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .success, colors: nil, iconPosition: .center)
|
|
|
+ publicBanner.show()
|
|
|
self.dismissImage?(image, fileDir.lastPathComponent)
|
|
|
})
|
|
|
}
|