Commit 510dcf16 authored by Bruno Muniz's avatar Bruno Muniz 🍎
Browse files

Merge branch 'development' into 'master'

Development 2.1 version release

See merge request !29
parents fca1754c 7276c312
......@@ -448,7 +448,7 @@
CODE_SIGN_ENTITLEMENTS = "client-ios/Resources/client-ios.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 67;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = S6JDM2WW29;
ENABLE_BITCODE = NO;
......@@ -463,7 +463,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.0.9;
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = xx.messenger.mock;
PRODUCT_NAME = "$(TARGET_NAME)";
......@@ -487,7 +487,7 @@
CODE_SIGN_ENTITLEMENTS = "client-ios/Resources/client-ios.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 67;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = S6JDM2WW29;
ENABLE_BITCODE = NO;
......@@ -503,7 +503,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.0.9;
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = xx.messenger;
PRODUCT_NAME = "$(TARGET_NAME)";
......@@ -522,7 +522,7 @@
CODE_SIGN_ENTITLEMENTS = NotificationExtension/NotificationExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 67;
DEVELOPMENT_TEAM = S6JDM2WW29;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -536,7 +536,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.0.9;
PRODUCT_BUNDLE_IDENTIFIER = xx.messenger.mock.notifications;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -553,7 +553,7 @@
CODE_SIGN_ENTITLEMENTS = NotificationExtension/NotificationExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 67;
DEVELOPMENT_TEAM = S6JDM2WW29;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -567,7 +567,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.0.9;
PRODUCT_BUNDLE_IDENTIFIER = xx.messenger.notifications;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......
......@@ -11,7 +11,6 @@ let package = Package(
.library(name: "App", targets: ["App"]),
.library(name: "HUD", targets: ["HUD"]),
.library(name: "Theme", targets: ["Theme"]),
.library(name: "Popup", targets: ["Popup"]),
.library(name: "Shared", targets: ["Shared"]),
.library(name: "Models", targets: ["Models"]),
.library(name: "XXLogger", targets: ["XXLogger"]),
......@@ -33,6 +32,7 @@ let package = Package(
.library(name: "BackupFeature", targets: ["BackupFeature"]),
.library(name: "iCloudFeature", targets: ["iCloudFeature"]),
.library(name: "SearchFeature", targets: ["SearchFeature"]),
.library(name: "DrawerFeature", targets: ["DrawerFeature"]),
.library(name: "RestoreFeature", targets: ["RestoreFeature"]),
.library(name: "CrashReporting", targets: ["CrashReporting"]),
.library(name: "ProfileFeature", targets: ["ProfileFeature"]),
......@@ -152,6 +152,7 @@ let package = Package(
"ScanFeature",
"ChatFeature",
"MenuFeature",
"ToastFeature",
"CrashService",
"BackupFeature",
"SearchFeature",
......@@ -163,6 +164,7 @@ let package = Package(
"CrashReporting",
"ChatListFeature",
"SettingsFeature",
"RequestsFeature",
"PushNotifications",
"OnboardingFeature",
"GoogleDriveFeature",
......@@ -253,6 +255,15 @@ let package = Package(
]
),
// MARK: - ToastFeature
.target(
name: "ToastFeature",
dependencies: [
"Shared"
]
),
// MARK: - CrashService
.target(
......@@ -330,12 +341,13 @@ let package = Package(
]
),
// MARK: - Popup
// MARK: - DrawerFeature
.target(
name: "Popup",
name: "DrawerFeature",
dependencies: [
"Shared",
"InputField",
.product(
name: "ScrollViewController",
package: "ScrollViewController"
......@@ -500,15 +512,15 @@ let package = Package(
dependencies: [
"HUD",
"Theme",
"Popup",
"Shared",
"Defaults",
"Keychain",
"Voxophone",
"Integration",
"ChatInputFeature",
"Permissions",
"Voxophone",
"Presentation",
"DrawerFeature",
"ChatInputFeature",
"DependencyInjection",
.product(
name: "DifferenceKit",
......@@ -548,6 +560,7 @@ let package = Package(
"Theme",
"Shared",
"Integration",
"ToastFeature",
"ContactFeature",
"DependencyInjection",
.product(
......@@ -564,15 +577,16 @@ let package = Package(
dependencies: [
"HUD",
"Theme",
"Popup",
"Shared",
"Keychain",
"Defaults",
"Countries",
"InputField",
"MenuFeature",
"Permissions",
"Integration",
"Presentation",
"DrawerFeature",
"DependencyInjection",
.product(
name: "ScrollViewController",
......@@ -612,7 +626,6 @@ let package = Package(
name: "OnboardingFeature",
dependencies: [
"HUD",
"Popup",
"Shared",
"Defaults",
"Keychain",
......@@ -621,6 +634,7 @@ let package = Package(
"Permissions",
"Integration",
"Presentation",
"DrawerFeature",
"VersionChecking",
"PushNotifications",
"DependencyInjection",
......@@ -640,12 +654,12 @@ let package = Package(
.target(
name: "MenuFeature",
dependencies: [
"Theme",
"Shared",
"Defaults",
"Integration",
"Presentation",
"ProfileFeature",
"RequestsFeature",
"SettingsFeature",
"ContactListFeature"
"DependencyInjection"
]
),
......@@ -711,14 +725,15 @@ let package = Package(
dependencies: [
"HUD",
"Theme",
"Popup",
"Shared",
"Defaults",
"Keychain",
"InputField",
"Permissions",
"MenuFeature",
"Integration",
"Presentation",
"DrawerFeature",
"PushNotifications",
"DependencyInjection",
.product(
......
......@@ -6,6 +6,7 @@ import Theme
import XXLogger
import Defaults
import Integration
import ToastFeature
import SwiftyDropbox
import CrashReporting
import PushNotifications
......@@ -51,8 +52,13 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
UNUserNotificationCenter.current().delegate = self
let rootScreen = StatusBarViewController(
UINavigationController(rootViewController: OnboardingLaunchController())
let rootScreen =
StatusBarViewController(
ToastViewController(
UINavigationController(
rootViewController: OnboardingLaunchController()
)
)
)
window = Window()
......
......@@ -18,6 +18,7 @@ import Voxophone
import Integration
import Permissions
import CrashService
import ToastFeature
import iCloudFeature
import CrashReporting
import NetworkMonitor
......@@ -101,13 +102,25 @@ struct DependencyRegistrator {
container.register(HUD() as HUDType)
container.register(ThemeController() as ThemeControlling)
container.register(ToastController())
container.register(StatusBarController() as StatusBarStyleControlling)
// MARK: Coordinators
container.register(BackupCoordinator(
passphraseFactory: BackupPassphraseController.init(_:_:)
) as BackupCoordinating)
container.register(
BackupCoordinator(
passphraseFactory: BackupPassphraseController.init(_:_:)
) as BackupCoordinating)
container.register(
MenuCoordinator(
scanFactory: ScanContainerController.init,
chatsFactory: ChatListController.init,
profileFactory: ProfileController.init,
settingsFactory: SettingsController.init,
contactsFactory: ContactListController.init,
requestsFactory: RequestsContainerController.init
) as MenuCoordinating)
container.register(
SearchCoordinator(
......@@ -121,6 +134,7 @@ struct DependencyRegistrator {
phoneFactory: ProfilePhoneController.init,
imagePickerFactory: UIImagePickerController.init,
permissionFactory: RequestPermissionController.init,
sideMenuFactory: MenuController.init(_:_:),
countriesFactory: CountryListController.init(_:),
codeFactory: ProfileCodeController.init(_:_:)
) as ProfileCoordinating)
......@@ -129,7 +143,8 @@ struct DependencyRegistrator {
SettingsCoordinator(
backupFactory: BackupController.init,
advancedFactory: SettingsAdvancedController.init,
accountDeleteFactory: AccountDeleteController.init
accountDeleteFactory: AccountDeleteController.init,
sideMenuFactory: MenuController.init(_:_:)
) as SettingsCoordinating)
container.register(
......@@ -155,21 +170,24 @@ struct DependencyRegistrator {
requestsFactory: RequestsContainerController.init,
singleChatFactory: SingleChatController.init(_:),
imagePickerFactory: UIImagePickerController.init,
nicknameFactory: NickameController.init(_:_:)
nicknameFactory: NicknameController.init(_:_:)
) as ContactCoordinating)
container.register(
RequestsCoordinator(
searchFactory: SearchController.init,
verifyingFactory: VerifyingController.init,
contactFactory: ContactController.init(_:),
nicknameFactory: NickameController.init(_:_:)
singleChatFactory: SingleChatController.init(_:),
groupChatFactory: GroupChatController.init(_:),
sideMenuFactory: MenuController.init(_:_:),
nicknameFactory: NicknameController.init(_:_:)
) as RequestsCoordinating)
container.register(
OnboardingCoordinator(
emailFactory: OnboardingEmailController.init,
phoneFactory: OnboardingPhoneController.init,
searchFactory: SearchController.init,
welcomeFactory: OnboardingWelcomeController.init,
chatListFactory: ChatListController.init,
startFactory: OnboardingStartController.init(_:),
......@@ -188,28 +206,28 @@ struct DependencyRegistrator {
newGroupFactory: CreateGroupController.init,
requestsFactory: RequestsContainerController.init,
contactFactory: ContactController.init(_:),
singleChatFactory: SingleChatController.init(_:),
groupChatFactory: GroupChatController.init(_:),
groupPopupFactory: CreatePopupController.init(_:_:)
sideMenuFactory: MenuController.init(_:_:),
groupDrawerFactory: CreateDrawerController.init(_:_:)
) as ContactListCoordinating)
container.register(
ScanCoordinator(
contactsFactory: ContactListController.init,
requestsFactory: RequestsContainerController.init,
contactFactory: ContactController.init(_:)
contactFactory: ContactController.init(_:),
sideMenuFactory: MenuController.init(_:_:)
) as ScanCoordinating)
container.register(
ChatListCoordinator(
scanFactory: ScanContainerController.init,
searchFactory: SearchController.init,
profileFactory: ProfileController.init,
settingsFactory: SettingsController.init,
contactsFactory: ContactListController.init,
requestsFactory: RequestsContainerController.init,
singleChatFactory: SingleChatController.init(_:),
sideMenuFactory: MenuController.init(_:),
groupChatFactory: GroupChatController.init(_:)
groupChatFactory: GroupChatController.init(_:),
sideMenuFactory: MenuController.init(_:_:)
) as ChatListCoordinating)
}
}
import UIKit
import Popup
import Models
import Shared
import Combine
import DrawerFeature
import DependencyInjection
final class BackupConfigController: UIViewController {
......@@ -12,7 +12,7 @@ final class BackupConfigController: UIViewController {
private let viewModel: BackupConfigViewModel
private var cancellables = Set<AnyCancellable>()
private var popupCancellables = Set<AnyCancellable>()
private var drawerCancellables = Set<AnyCancellable>()
private var wifiOnly = false
private var manualBackups = false
......@@ -82,12 +82,12 @@ final class BackupConfigController: UIViewController {
screenView.frequencyDetailView
.publisher(for: .touchUpInside)
.sink { [unowned self] in presentFrequencyPopup(manual: manualBackups) }
.sink { [unowned self] in presentFrequencyDrawer(manual: manualBackups) }
.store(in: &cancellables)
screenView.infrastructureDetailView
.publisher(for: .touchUpInside)
.sink { [unowned self] in presentInfrastructurePopup(wifiOnly: wifiOnly) }
.sink { [unowned self] in presentInfrastructureDrawer(wifiOnly: wifiOnly) }
.store(in: &cancellables)
screenView.googleDriveButton
......@@ -193,16 +193,25 @@ final class BackupConfigController: UIViewController {
}
}
private func presentInfrastructurePopup(wifiOnly: Bool) {
let cancelButton = CapsuleButton()
cancelButton.setStyle(.seeThrough)
cancelButton.setTitle(Localized.ChatList.Dashboard.cancel, for: .normal)
let wifiOnlyButton = PopupRadioButton(title: "Wi-Fi Only", isSelected: wifiOnly)
let wifiAndCellularButton = PopupRadioButton(title: "Wi-Fi and Cellular", isSelected: !wifiOnly)
let popup = BottomPopup(with: [
PopupLabel(
private func presentInfrastructureDrawer(wifiOnly: Bool) {
let cancelButton = DrawerCapsuleButton(model: .init(
title: Localized.ChatList.Dashboard.cancel,
style: .seeThrough
))
let wifiOnlyButton = DrawerRadio(
title: "Wi-Fi Only",
isSelected: wifiOnly
)
let wifiAndCellularButton = DrawerRadio(
title: "Wi-Fi and Cellular",
isSelected: !wifiOnly,
spacingAfter: 40
)
let drawer = DrawerController(with: [
DrawerText(
font: Fonts.Mulish.extraBold.font(size: 28.0),
text: Localized.Backup.Config.infrastructure,
color: Asset.neutralActive.color,
......@@ -211,49 +220,57 @@ final class BackupConfigController: UIViewController {
),
wifiOnlyButton,
wifiAndCellularButton,
PopupEmptyView(height: 20.0),
PopupStackView(spacing: 20.0, views: [cancelButton])
cancelButton
])
wifiOnlyButton.action
.sink { [unowned self] in
viewModel.didChooseWifiOnly(true)
popup.dismiss(animated: true) { [weak self] in
self?.popupCancellables.removeAll()
drawer.dismiss(animated: true) { [weak self] in
self?.drawerCancellables.removeAll()
}
}.store(in: &popupCancellables)
}.store(in: &drawerCancellables)
wifiAndCellularButton.action
.sink { [unowned self] in
viewModel.didChooseWifiOnly(false)
popup.dismiss(animated: true) { [weak self] in
self?.popupCancellables.removeAll()
drawer.dismiss(animated: true) { [weak self] in
self?.drawerCancellables.removeAll()
}
}.store(in: &popupCancellables)
}.store(in: &drawerCancellables)
cancelButton.publisher(for: .touchUpInside)
cancelButton.action
.receive(on: DispatchQueue.main)
.sink {
popup.dismiss(animated: true) { [weak self] in
self?.popupCancellables.removeAll()
drawer.dismiss(animated: true) { [weak self] in
self?.drawerCancellables.removeAll()
}
}.store(in: &popupCancellables)
}.store(in: &drawerCancellables)
coordinator.toPopup(popup, from: self)
coordinator.toDrawer(drawer, from: self)
}
private func presentFrequencyPopup(manual: Bool) {
let cancelButton = CapsuleButton()
cancelButton.setStyle(.seeThrough)
cancelButton.setTitle(Localized.ChatList.Dashboard.cancel, for: .normal)
let manualButton = PopupRadioButton(title: "Manual", isSelected: manual)
let automaticButton = PopupRadioButton(title: "Automatic", isSelected: !manual)
let popup = BottomPopup(with: [
PopupLabel(
private func presentFrequencyDrawer(manual: Bool) {
let cancelButton = DrawerCapsuleButton(model: .init(
title: Localized.ChatList.Dashboard.cancel,
style: .seeThrough
))
let manualButton = DrawerRadio(
title: "Manual",
isSelected: manual
)
let automaticButton = DrawerRadio(
title: "Automatic",
isSelected: !manual,
spacingAfter: 40
)
let drawer = DrawerController(with: [
DrawerText(
font: Fonts.Mulish.extraBold.font(size: 28.0),
text: Localized.Backup.Config.frequency(serviceName),
color: Asset.neutralActive.color,
......@@ -262,36 +279,35 @@ final class BackupConfigController: UIViewController {
),
manualButton,
automaticButton,
PopupEmptyView(height: 20.0),
PopupStackView(spacing: 20.0, views: [cancelButton])
cancelButton
])
manualButton.action
.sink { [unowned self] in
viewModel.didChooseAutomatic(false)
popup.dismiss(animated: true) { [weak self] in
self?.popupCancellables.removeAll()
drawer.dismiss(animated: true) { [weak self] in
self?.drawerCancellables.removeAll()
}
}.store(in: &popupCancellables)
}.store(in: &drawerCancellables)
automaticButton.action
.sink { [unowned self] in
viewModel.didChooseAutomatic(true)
popup.dismiss(animated: true) { [weak self] in
self?.popupCancellables.removeAll()
drawer.dismiss(animated: true) { [weak self] in
self?.drawerCancellables.removeAll()
}
}.store(in: &popupCancellables)
}.store(in: &drawerCancellables)
cancelButton.publisher(for: .touchUpInside)
cancelButton.action
.receive(on: DispatchQueue.main)
.sink {
popup.dismiss(animated: true) { [weak self] in
self?.popupCancellables.removeAll()
drawer.dismiss(animated: true) { [weak self] in
self?.drawerCancellables.removeAll()
}
}.store(in: &popupCancellables)
}.store(in: &drawerCancellables)
coordinator.toPopup(popup, from: self)
coordinator.toDrawer(drawer, from: self)
}
}
......@@ -3,7 +3,7 @@ import Shared
import Presentation
public protocol BackupCoordinating {
func toPopup(
func toDrawer(
_: UIViewController,
from: UIViewController
)
......@@ -34,7 +34,7 @@ public struct BackupCoordinator: BackupCoordinating {
}
public extension BackupCoordinator {
func toPopup(
func toDrawer(
_ screen: UIViewController,
from parent: UIViewController
) {
......
......@@ -57,7 +57,7 @@ public final class GroupChatController: UIViewController {
super.init(nibName: nil, bundle: nil)
header.setup(title: info.group.name, members: info.members)
header.setup(title: info.group.name, memberList: info.members.map { ($0.username, $0.photo) })
}
public required init?(coder: NSCoder) { nil }
......@@ -490,19 +490,19 @@ extension GroupChatController: UICollectionViewDelegate {
let item = self.sections[indexPath.section].elements[indexPath.item]
let copy = UIAction(title: Localized.Chat.BubbleMenu.copy, state: .on) { _ in
let copy = UIAction(title: Localized.Chat.BubbleMenu.copy, state: .off) { _ in
UIPasteboard.general.string = item.payload.text
}
let reply = UIAction(title: Localized.Chat.BubbleMenu.reply, state: .on) { [weak self] _ in
let reply = UIAction(title: Localized.Chat.BubbleMenu.reply, state: .off) { [weak self] _ in
self?.viewModel.didRequestReply(item)
}
let delete = UIAction(title: Localized.Chat.BubbleMenu.delete, state: .on) { [weak self] _ in