Skip to content

Commit 90f15fa

Browse files
committed
Merge branch 'release/0.1.3'
2 parents 5908318 + 760ceef commit 90f15fa

39 files changed

+492
-362
lines changed

Adamant.xcodeproj/project.pbxproj

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
E93EFE13200D1156000BB482 /* ChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93EFE12200D1156000BB482 /* ChatViewController.swift */; };
2828
E948E03B20235E2300975D6B /* SettingsRoutes.swift in Sources */ = {isa = PBXBuildFile; fileRef = E948E03A20235E2300975D6B /* SettingsRoutes.swift */; };
2929
E948E0482024F02700975D6B /* Footer.xib in Resources */ = {isa = PBXBuildFile; fileRef = E948E0472024F02700975D6B /* Footer.xib */; };
30+
E948E04A2027673400975D6B /* ExportTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = E948E0492027673400975D6B /* ExportTools.swift */; };
31+
E948E04C2027679300975D6B /* AdamantExportTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = E948E04B2027679300975D6B /* AdamantExportTools.swift */; };
32+
E948E04E20278D5600975D6B /* SettingsDependencies.swift in Sources */ = {isa = PBXBuildFile; fileRef = E948E04D20278D5600975D6B /* SettingsDependencies.swift */; };
3033
E95F856520067A030070534A /* GlobalConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95F856420067A030070534A /* GlobalConstants.swift */; };
3134
E95F85692006AB9D0070534A /* NormalizedTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95F85682006AB9D0070534A /* NormalizedTransaction.swift */; };
3235
E95F856B200789450070534A /* JSModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95F856A200789450070534A /* JSModels.swift */; };
@@ -165,6 +168,9 @@
165168
E93EFE12200D1156000BB482 /* ChatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatViewController.swift; sourceTree = "<group>"; };
166169
E948E03A20235E2300975D6B /* SettingsRoutes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsRoutes.swift; sourceTree = "<group>"; };
167170
E948E0472024F02700975D6B /* Footer.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Footer.xib; sourceTree = "<group>"; };
171+
E948E0492027673400975D6B /* ExportTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExportTools.swift; sourceTree = "<group>"; };
172+
E948E04B2027679300975D6B /* AdamantExportTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdamantExportTools.swift; sourceTree = "<group>"; };
173+
E948E04D20278D5600975D6B /* SettingsDependencies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsDependencies.swift; sourceTree = "<group>"; };
168174
E95F856420067A030070534A /* GlobalConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalConstants.swift; sourceTree = "<group>"; };
169175
E95F85682006AB9D0070534A /* NormalizedTransaction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NormalizedTransaction.swift; sourceTree = "<group>"; };
170176
E95F856A200789450070534A /* JSModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSModels.swift; sourceTree = "<group>"; };
@@ -334,6 +340,7 @@
334340
E95F858D20093F940070534A /* ChatDataProvider.swift */,
335341
E93580DA20160BC10057FC2E /* ContactsService.swift */,
336342
E9E7CD8C20026B6600DFC4DB /* DialogService.swift */,
343+
E948E0492027673400975D6B /* ExportTools.swift */,
337344
E9C51ECA200E2AA100385EB7 /* FeeCalculator.swift */,
338345
E9E7CDAE2002B8A100DFC4DB /* Router.swift */,
339346
);
@@ -352,6 +359,7 @@
352359
E913C9161FFFAF76001A83F7 /* JSAdamantCore.swift */,
353360
E93580DC20160BD30057FC2E /* KnownContactsService.swift */,
354361
E9E7CDB42002BA6900DFC4DB /* SwinjectedRouter.swift */,
362+
E948E04B2027679300975D6B /* AdamantExportTools.swift */,
355363
);
356364
path = Services;
357365
sourceTree = "<group>";
@@ -470,6 +478,7 @@
470478
isa = PBXGroup;
471479
children = (
472480
E982F69920235B1300566AC7 /* Settings.storyboard */,
481+
E948E04D20278D5600975D6B /* SettingsDependencies.swift */,
473482
E948E03A20235E2300975D6B /* SettingsRoutes.swift */,
474483
E982F69B20235B4D00566AC7 /* SettingsTableViewController.swift */,
475484
);
@@ -791,11 +800,13 @@
791800
E9E7CDBB2003AAA700DFC4DB /* RoundAvatarTableViewCell.swift in Sources */,
792801
E9E7CDAF2002B8A100DFC4DB /* Router.swift in Sources */,
793802
E9E7CDC72003F6D200DFC4DB /* TransactionTableViewCell.swift in Sources */,
803+
E948E04E20278D5600975D6B /* SettingsDependencies.swift in Sources */,
794804
E9C51ECD200E2BF900385EB7 /* HardFeeCalculator.swift in Sources */,
795805
E9E7CDB32002B9FB00DFC4DB /* LoginRoutes.swift in Sources */,
796806
E95F85B0200952AF0070534A /* Chatroom+CoreDataProperties.swift in Sources */,
797807
E91947B22000246A001362F8 /* AdamantError.swift in Sources */,
798808
E95F85802008C8D70070534A /* ChatsRoutes.swift in Sources */,
809+
E948E04A2027673400975D6B /* ExportTools.swift in Sources */,
799810
E95F85AF200952AF0070534A /* Chatroom+CoreDataClass.swift in Sources */,
800811
E93EFE13200D1156000BB482 /* ChatViewController.swift in Sources */,
801812
E9E7CDC02003AF6D00DFC4DB /* AdamantCellFactory.swift in Sources */,
@@ -825,6 +836,7 @@
825836
E913C9081FFFA943001A83F7 /* AdamantCore.swift in Sources */,
826837
E9EC342120052ABB00C0E546 /* TransferViewController.swift in Sources */,
827838
E9EC34142005178500C0E546 /* TransactionDetailsViewController.swift in Sources */,
839+
E948E04C2027679300975D6B /* AdamantExportTools.swift in Sources */,
828840
E93580DD20160BD30057FC2E /* KnownContactsService.swift in Sources */,
829841
E9E7CDB12002B97B00DFC4DB /* AccountRoutes.swift in Sources */,
830842
E95F856B200789450070534A /* JSModels.swift in Sources */,
@@ -993,6 +1005,7 @@
9931005
DEVELOPMENT_TEAM = J2L77FMN46;
9941006
DISPLAY_NAME = ADM.Dev;
9951007
INFOPLIST_FILE = Adamant/Info.plist;
1008+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
9961009
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
9971010
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev";
9981011
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1012,8 +1025,9 @@
10121025
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
10131026
CODE_SIGN_STYLE = Manual;
10141027
DEVELOPMENT_TEAM = J2L77FMN46;
1015-
DISPLAY_NAME = ADAMANT;
1028+
DISPLAY_NAME = Adamant;
10161029
INFOPLIST_FILE = Adamant/Info.plist;
1030+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
10171031
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
10181032
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger";
10191033
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1089,8 +1103,9 @@
10891103
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
10901104
CODE_SIGN_STYLE = Manual;
10911105
DEVELOPMENT_TEAM = J2L77FMN46;
1092-
DISPLAY_NAME = ADAMANT;
1106+
DISPLAY_NAME = Adamant;
10931107
INFOPLIST_FILE = Adamant/Info.plist;
1108+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
10941109
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
10951110
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-qa";
10961111
PRODUCT_NAME = "$(TARGET_NAME)";

Adamant/AppDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2626
container.registerAdamantAccountStory()
2727
container.registerAdamantLoginStory()
2828
container.registerAdamantChatsStory()
29+
container.registerAdamantSettingsStory()
2930

3031

3132
// MARK: 2. Prepare UI

Adamant/Assets/Assets.xcassets/Colors/Chat_recipient.colorset/Contents.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

Adamant/Assets/Assets.xcassets/Colors/Chat_sender.colorset/Contents.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

Adamant/Assets/Assets.xcassets/Colors/Contents.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

Adamant/Assets/Assets.xcassets/Colors/Gray_main.colorset/Contents.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

Adamant/Assets/Assets.xcassets/Colors/Gray_secondary.colorset/Contents.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

Adamant/Assets/Assets.xcassets/Colors/Icons.colorset/Contents.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

Adamant/Helpers/GlobalConstants.swift

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,25 @@
99
import UIKit
1010

1111
extension UIColor {
12-
static let adamantPrimary = UIColor(named: "Gray_main")!
13-
static let adamantSecondary = UIColor(named: "Gray_secondary")!
14-
static let adamantChatIcons = UIColor(named: "Icons")!
12+
// MARK: Global colors
1513

16-
static let adamantChatRecipientBackground = UIColor(named: "Chat_recipient")!
17-
static let adamantChatSenderBackground = UIColor(named: "Chat_sender")!
14+
/// UIColor(named: "Gray_main")
15+
static let adamantPrimary = UIColor(red: 0.29, green: 0.29, blue: 0.29, alpha: 1)
16+
17+
/// UIColor(named: "Gray_secondary")
18+
static let adamantSecondary = UIColor(red: 0.478, green: 0.478, blue: 0.478, alpha: 1)
19+
20+
/// UIColor(named: "Icons")
21+
static let adamantChatIcons = UIColor(red: 0.62, green: 0.62, blue: 0.62, alpha: 1)
22+
23+
24+
// MARK: Chat colors
25+
26+
/// UIColor(named: "Chat_recipient")
27+
static let adamantChatRecipientBackground = UIColor(red: 0.965, green: 0.973, blue: 0.981, alpha: 1)
28+
29+
/// UIColor(named: "Chat_sender")!
30+
static let adamantChatSenderBackground = UIColor(red: 0.925, green: 0.925, blue: 0.925, alpha: 1)
1831
}
1932

2033
extension UIFont {

Adamant/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.1.2</string>
20+
<string>0.1.3</string>
2121
<key>CFBundleVersion</key>
22-
<string>3</string>
22+
<string>4</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UIAppFonts</key>

Adamant/ServiceProtocols/DialogService.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
import UIKit
1010

11+
enum ShareType {
12+
case copyToPasteboard
13+
case share
14+
}
15+
1116
protocol DialogService {
1217
/// Present view controller modally
1318
func presentModallyViewController(_ viewController: UIViewController, animated: Bool, completion: (() -> Void)?)
@@ -19,8 +24,11 @@ protocol DialogService {
1924

2025

2126
// MARK: - Indicators
22-
func showProgress(withMessage: String, userInteractionEnable: Bool)
27+
func showProgress(withMessage: String?, userInteractionEnable: Bool)
2328
func dismissProgress()
2429
func showSuccess(withMessage: String)
2530
func showError(withMessage: String)
31+
32+
// MARK: - ActivityControllers
33+
func presentShareAlertFor(string: String, types: [ShareType], animated: Bool, completion: (() -> Void)?)
2634
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// ExportTools.swift
3+
// Adamant
4+
//
5+
// Created by Anokhov Pavel on 04.02.2018.
6+
// Copyright © 2018 Adamant. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
protocol ExportTools {
12+
func summaryFor(transaction: Transaction, url: URL) -> String
13+
}

Adamant/Services/AdamantAccountService.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,20 @@ extension AdamantAccountService {
166166
}
167167
}
168168

169+
169170
// MARK: - Update
170171
extension AdamantAccountService {
171-
func start() {
172-
if !autoupdate { autoupdate = true }
173-
174-
if status != .loggedIn {
175-
stop()
176-
return
172+
private func start() {
173+
if let timer = timer {
174+
timer.invalidate()
175+
self.timer = nil
177176
}
178177

179178
timer = Timer(timeInterval: autoupdateInterval, repeats: true, block: { _ in
179+
if self.status != .loggedIn {
180+
return
181+
}
182+
180183
if !self.updating {
181184
self.updateAccountData()
182185
}
@@ -190,9 +193,7 @@ extension AdamantAccountService {
190193
}
191194
}
192195

193-
func stop() {
194-
if autoupdate { autoupdate = false }
195-
196+
private func stop() {
196197
timer?.invalidate()
197198
timer = nil
198199
}

Adamant/Services/AdamantDialogService.swift

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extension AdamantDialogService {
5353

5454
// MARK: - Indicators
5555
extension AdamantDialogService {
56-
func showProgress(withMessage message: String, userInteractionEnable enabled: Bool) {
56+
func showProgress(withMessage message: String?, userInteractionEnable enabled: Bool) {
5757
FTIndicator.showProgress(withMessage: message, userInteractionEnable: enabled)
5858
}
5959

@@ -75,3 +75,31 @@ extension AdamantDialogService {
7575
FTIndicator.showError(withMessage: message)
7676
}
7777
}
78+
79+
80+
// MAKR: - Activity controllers
81+
extension AdamantDialogService {
82+
func presentShareAlertFor(string: String, types: [ShareType], animated: Bool, completion: (() -> Void)?) {
83+
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
84+
85+
for type in types {
86+
switch type {
87+
case .copyToPasteboard:
88+
alert.addAction(UIAlertAction(title: "Copy To Pasteboard", style: .default, handler: { _ in
89+
UIPasteboard.general.string = string
90+
self.showToastMessage("\(string)\nCopied To Pasteboard!")
91+
}))
92+
93+
case .share:
94+
alert.addAction(UIAlertAction(title: "Share", style: .default, handler: { _ in
95+
let vc = UIActivityViewController(activityItems: [string], applicationActivities: nil)
96+
self.presentModallyViewController(vc, animated: true, completion: completion)
97+
}))
98+
}
99+
}
100+
101+
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
102+
103+
presentModallyViewController(alert, animated: animated, completion: completion)
104+
}
105+
}

0 commit comments

Comments
 (0)