Merge branch 'dev' into group-chats
@ -1 +1 @@
|
||||
Subproject commit 0cad06149e4ce0ae92aa3e238916861b4eba894b
|
||||
Subproject commit 8a4786d9254efa9cba361afc603b60f30157d0a6
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Session.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionGreen32.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionGreen32@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionGreen32@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionGreen64.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionGreen64@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionGreen64@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 6.9 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionWhite24.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionWhite24@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionWhite24@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionWhite40.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionWhite40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "SessionWhite40@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
@ -0,0 +1,84 @@
|
||||
|
||||
@objc(LKSessionRestorationView)
|
||||
final class SessionRestorationView : UIView {
|
||||
private let thread: TSThread
|
||||
@objc public var onRestore: (() -> Void)?
|
||||
@objc public var onDismiss: (() -> Void)?
|
||||
|
||||
// MARK: Lifecycle
|
||||
@objc init(thread: TSThread) {
|
||||
self.thread = thread;
|
||||
super.init(frame: CGRect.zero)
|
||||
initialize()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) { fatalError("Using SessionRestorationView.init(coder:) isn't allowed. Use SessionRestorationView.init(thread:) instead.") }
|
||||
override init(frame: CGRect) { fatalError("Using SessionRestorationView.init(frame:) isn't allowed. Use SessionRestorationView.init(thread:) instead.") }
|
||||
|
||||
private func initialize() {
|
||||
// Set up background
|
||||
backgroundColor = Colors.modalBackground
|
||||
layer.cornerRadius = Values.modalCornerRadius
|
||||
layer.masksToBounds = false
|
||||
layer.borderColor = Colors.modalBorder.cgColor
|
||||
layer.borderWidth = Values.borderThickness
|
||||
layer.shadowColor = UIColor.black.cgColor
|
||||
layer.shadowRadius = 8
|
||||
layer.shadowOpacity = 0.64
|
||||
// Set up title label
|
||||
let titleLabel = UILabel()
|
||||
titleLabel.textColor = Colors.text
|
||||
titleLabel.font = .boldSystemFont(ofSize: Values.mediumFontSize)
|
||||
titleLabel.text = NSLocalizedString("Session Out of Sync", comment: "")
|
||||
titleLabel.numberOfLines = 0
|
||||
titleLabel.lineBreakMode = .byWordWrapping
|
||||
titleLabel.textAlignment = .center
|
||||
// Set up explanation label
|
||||
let explanationLabel = UILabel()
|
||||
explanationLabel.textColor = Colors.text
|
||||
explanationLabel.font = .systemFont(ofSize: Values.smallFontSize)
|
||||
explanationLabel.text = NSLocalizedString("Would you like to restore your session?", comment: "")
|
||||
explanationLabel.numberOfLines = 0
|
||||
explanationLabel.textAlignment = .center
|
||||
explanationLabel.lineBreakMode = .byWordWrapping
|
||||
// Set up restore button
|
||||
let restoreButton = UIButton()
|
||||
restoreButton.set(.height, to: Values.mediumButtonHeight)
|
||||
restoreButton.layer.cornerRadius = Values.modalButtonCornerRadius
|
||||
restoreButton.backgroundColor = Colors.accent
|
||||
restoreButton.titleLabel!.font = .systemFont(ofSize: Values.smallFontSize)
|
||||
restoreButton.setTitleColor(Colors.text, for: UIControl.State.normal)
|
||||
restoreButton.setTitle(NSLocalizedString("Restore", comment: ""), for: UIControl.State.normal)
|
||||
restoreButton.addTarget(self, action: #selector(restore), for: UIControl.Event.touchUpInside)
|
||||
// Set up dismiss button
|
||||
let dismissButton = UIButton()
|
||||
dismissButton.set(.height, to: Values.mediumButtonHeight)
|
||||
dismissButton.layer.cornerRadius = Values.modalButtonCornerRadius
|
||||
dismissButton.backgroundColor = Colors.buttonBackground
|
||||
dismissButton.titleLabel!.font = .systemFont(ofSize: Values.smallFontSize)
|
||||
dismissButton.setTitleColor(Colors.text, for: UIControl.State.normal)
|
||||
dismissButton.setTitle(NSLocalizedString("Dismiss", comment: ""), for: UIControl.State.normal)
|
||||
dismissButton.addTarget(self, action: #selector(dismiss), for: UIControl.Event.touchUpInside)
|
||||
// Set up button stack view
|
||||
let buttonStackView = UIStackView(arrangedSubviews: [ dismissButton, restoreButton ])
|
||||
buttonStackView.axis = .horizontal
|
||||
buttonStackView.spacing = Values.mediumSpacing
|
||||
buttonStackView.distribution = .fillEqually
|
||||
// Set up main stack view
|
||||
let mainStackView = UIStackView(arrangedSubviews: [ titleLabel, explanationLabel, buttonStackView ])
|
||||
mainStackView.axis = .vertical
|
||||
mainStackView.spacing = Values.smallSpacing
|
||||
addSubview(mainStackView)
|
||||
mainStackView.pin(to: self, withInset: Values.mediumSpacing)
|
||||
// Update explanation label if possible
|
||||
if let contactID = thread.contactIdentifier() {
|
||||
let displayName = DisplayNameUtilities.getPrivateChatDisplayName(for: contactID) ?? contactID
|
||||
explanationLabel.text = String(format: NSLocalizedString("Would you like to restore your session with %@?", comment: ""), displayName)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Interaction
|
||||
@objc private func restore() { onRestore?() }
|
||||
|
||||
@objc private func dismiss() { onDismiss?() }
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
|
||||
@objc(LKAppearanceUtilities)
|
||||
final class AppearanceUtilities : NSObject {
|
||||
|
||||
@objc static func switchToSessionAppearance() {
|
||||
if #available(iOS 13, *) {
|
||||
UINavigationBar.appearance().barTintColor = Colors.navigationBarBackground
|
||||
UINavigationBar.appearance().isTranslucent = false
|
||||
UINavigationBar.appearance().tintColor = Colors.text
|
||||
UIToolbar.appearance().barTintColor = Colors.navigationBarBackground
|
||||
UIToolbar.appearance().isTranslucent = false
|
||||
UIToolbar.appearance().tintColor = Colors.text
|
||||
UISwitch.appearance().onTintColor = Colors.accent
|
||||
UINavigationBar.appearance().titleTextAttributes = [ NSAttributedString.Key.foregroundColor : Colors.text ]
|
||||
}
|
||||
}
|
||||
|
||||
@objc static func switchToImagePickerAppearance() {
|
||||
if #available(iOS 13, *) {
|
||||
UINavigationBar.appearance().barTintColor = .white
|
||||
UINavigationBar.appearance().isTranslucent = false
|
||||
UINavigationBar.appearance().tintColor = .black
|
||||
UINavigationBar.appearance().titleTextAttributes = [ NSAttributedString.Key.foregroundColor : UIColor.black ]
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
|
||||
var isSmallScreen: Bool {
|
||||
return (UIScreen.main.bounds.height - 568) < 1
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
import UIKit
|
||||
|
||||
// Ideally this should be in SignalServiceKit, but somehow linking fails when it is.
|
||||
|
||||
@objc(LKPushNotificationManager)
|
||||
final class LokiPushNotificationManager : NSObject {
|
||||
|