diff --git a/Linphone.xcodeproj/project.pbxproj b/Linphone.xcodeproj/project.pbxproj index dea1d116b..f334eb911 100644 --- a/Linphone.xcodeproj/project.pbxproj +++ b/Linphone.xcodeproj/project.pbxproj @@ -18,6 +18,15 @@ D719ABC92ABC6FD700B41C10 /* CoreContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = D719ABC82ABC6FD700B41C10 /* CoreContext.swift */; }; D719ABCC2ABC769C00B41C10 /* AssistantView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D719ABCB2ABC769C00B41C10 /* AssistantView.swift */; }; D719ABCF2ABC779A00B41C10 /* AccountLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D719ABCE2ABC779A00B41C10 /* AccountLoginViewModel.swift */; }; + D74C9CF82ACACECE0021626A /* WelcomePage1Fragment.swift in Sources */ = {isa = PBXBuildFile; fileRef = D74C9CF72ACACECE0021626A /* WelcomePage1Fragment.swift */; }; + D74C9CFA2ACACF2D0021626A /* WelcomePage2Fragment.swift in Sources */ = {isa = PBXBuildFile; fileRef = D74C9CF92ACACF2D0021626A /* WelcomePage2Fragment.swift */; }; + D74C9CFC2ACACF370021626A /* WelcomePage3Fragment.swift in Sources */ = {isa = PBXBuildFile; fileRef = D74C9CFB2ACACF370021626A /* WelcomePage3Fragment.swift */; }; + D74C9CFF2ACAEC5E0021626A /* PopupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D74C9CFE2ACAEC5E0021626A /* PopupView.swift */; }; + D74C9D012ACB098C0021626A /* PermissionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D74C9D002ACB098C0021626A /* PermissionManager.swift */; }; + D7702EF22AC7205000557C00 /* WelcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7702EF12AC7205000557C00 /* WelcomeView.swift */; }; + D7A03FBD2ACC2DB60081A588 /* ContactsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A03FBC2ACC2DB60081A588 /* ContactsView.swift */; }; + D7A03FC02ACC2E390081A588 /* HistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A03FBF2ACC2E390081A588 /* HistoryView.swift */; }; + D7A03FC62ACC458A0081A588 /* SplashScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A03FC52ACC458A0081A588 /* SplashScreen.swift */; }; D7A2EDD62AC18115005D90FC /* SharedMainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A2EDD52AC18115005D90FC /* SharedMainViewModel.swift */; }; D7D24D132AC1B4E800C6F35B /* NotoSans-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D7D24D0D2AC1B4E800C6F35B /* NotoSans-Medium.ttf */; }; D7D24D142AC1B4E800C6F35B /* NotoSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D7D24D0E2AC1B4E800C6F35B /* NotoSans-Regular.ttf */; }; @@ -42,6 +51,15 @@ D719ABC82ABC6FD700B41C10 /* CoreContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreContext.swift; sourceTree = ""; }; D719ABCB2ABC769C00B41C10 /* AssistantView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssistantView.swift; sourceTree = ""; }; D719ABCE2ABC779A00B41C10 /* AccountLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountLoginViewModel.swift; sourceTree = ""; }; + D74C9CF72ACACECE0021626A /* WelcomePage1Fragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomePage1Fragment.swift; sourceTree = ""; }; + D74C9CF92ACACF2D0021626A /* WelcomePage2Fragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomePage2Fragment.swift; sourceTree = ""; }; + D74C9CFB2ACACF370021626A /* WelcomePage3Fragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomePage3Fragment.swift; sourceTree = ""; }; + D74C9CFE2ACAEC5E0021626A /* PopupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupView.swift; sourceTree = ""; }; + D74C9D002ACB098C0021626A /* PermissionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionManager.swift; sourceTree = ""; }; + D7702EF12AC7205000557C00 /* WelcomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeView.swift; sourceTree = ""; }; + D7A03FBC2ACC2DB60081A588 /* ContactsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsView.swift; sourceTree = ""; }; + D7A03FBF2ACC2E390081A588 /* HistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryView.swift; sourceTree = ""; }; + D7A03FC52ACC458A0081A588 /* SplashScreen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SplashScreen.swift; sourceTree = ""; }; D7A2EDD52AC18115005D90FC /* SharedMainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedMainViewModel.swift; sourceTree = ""; }; D7A2EDDA2AC19EEC005D90FC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; D7D24D0D2AC1B4E800C6F35B /* NotoSans-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NotoSans-Medium.ttf"; sourceTree = ""; }; @@ -82,13 +100,14 @@ path = Pods; sourceTree = ""; }; - D717071C2AC591EF0037746F /* utils */ = { + D717071C2AC591EF0037746F /* Utils */ = { isa = PBXGroup; children = ( D717071D2AC5922E0037746F /* ColorExtension.swift */, D717071F2AC5989C0037746F /* TextExtension.swift */, + D74C9D002ACB098C0021626A /* PermissionManager.swift */, ); - path = utils; + path = Utils; sourceTree = ""; }; D719ABAA2ABC67BF00B41C10 = { @@ -112,10 +131,11 @@ D719ABB52ABC67BF00B41C10 /* Linphone */ = { isa = PBXGroup; children = ( - D719ABC72ABC6FB200B41C10 /* core */, - D719ABC52ABC6EE800B41C10 /* ui */, - D717071C2AC591EF0037746F /* utils */, + D7A03FC52ACC458A0081A588 /* SplashScreen.swift */, D719ABB62ABC67BF00B41C10 /* LinphoneApp.swift */, + D719ABC72ABC6FB200B41C10 /* Core */, + D719ABC52ABC6EE800B41C10 /* UI */, + D717071C2AC591EF0037746F /* Utils */, D719ABBA2ABC67BF00B41C10 /* Assets.xcassets */, D719ABBC2ABC67BF00B41C10 /* Linphone.entitlements */, D7A2EDDA2AC19EEC005D90FC /* Info.plist */, @@ -134,55 +154,102 @@ path = "Preview Content"; sourceTree = ""; }; - D719ABC52ABC6EE800B41C10 /* ui */ = { + D719ABC52ABC6EE800B41C10 /* UI */ = { isa = PBXGroup; children = ( - D719ABCA2ABC761800B41C10 /* assistant */, - D719ABC62ABC6F0200B41C10 /* main */, + D719ABCA2ABC761800B41C10 /* Assistant */, + D719ABC62ABC6F0200B41C10 /* Main */, + D7702EF02AC7200600557C00 /* Welcome */, ); - path = ui; + path = UI; sourceTree = ""; }; - D719ABC62ABC6F0200B41C10 /* main */ = { + D719ABC62ABC6F0200B41C10 /* Main */ = { isa = PBXGroup; children = ( - D7A2EDD42AC180FE005D90FC /* viewmodel */, + D7A03FBB2ACC2D850081A588 /* Contacts */, + D74C9CFD2ACAEC150021626A /* Fragments */, + D7A03FBE2ACC2E010081A588 /* History */, + D7A2EDD42AC180FE005D90FC /* Viewmodel */, D719ABB82ABC67BF00B41C10 /* ContentView.swift */, ); - path = main; + path = Main; sourceTree = ""; }; - D719ABC72ABC6FB200B41C10 /* core */ = { + D719ABC72ABC6FB200B41C10 /* Core */ = { isa = PBXGroup; children = ( D719ABC82ABC6FD700B41C10 /* CoreContext.swift */, ); - path = core; + path = Core; sourceTree = ""; }; - D719ABCA2ABC761800B41C10 /* assistant */ = { + D719ABCA2ABC761800B41C10 /* Assistant */ = { isa = PBXGroup; children = ( - D719ABCD2ABC777600B41C10 /* viewmodel */, + D719ABCD2ABC777600B41C10 /* Viewmodel */, D719ABCB2ABC769C00B41C10 /* AssistantView.swift */, ); - path = assistant; + path = Assistant; sourceTree = ""; }; - D719ABCD2ABC777600B41C10 /* viewmodel */ = { + D719ABCD2ABC777600B41C10 /* Viewmodel */ = { isa = PBXGroup; children = ( D719ABCE2ABC779A00B41C10 /* AccountLoginViewModel.swift */, ); - path = viewmodel; + path = Viewmodel; sourceTree = ""; }; - D7A2EDD42AC180FE005D90FC /* viewmodel */ = { + D74C9CF62ACACEB70021626A /* Fragments */ = { + isa = PBXGroup; + children = ( + D74C9CF72ACACECE0021626A /* WelcomePage1Fragment.swift */, + D74C9CF92ACACF2D0021626A /* WelcomePage2Fragment.swift */, + D74C9CFB2ACACF370021626A /* WelcomePage3Fragment.swift */, + ); + path = Fragments; + sourceTree = ""; + }; + D74C9CFD2ACAEC150021626A /* Fragments */ = { + isa = PBXGroup; + children = ( + D74C9CFE2ACAEC5E0021626A /* PopupView.swift */, + ); + path = Fragments; + sourceTree = ""; + }; + D7702EF02AC7200600557C00 /* Welcome */ = { + isa = PBXGroup; + children = ( + D74C9CF62ACACEB70021626A /* Fragments */, + D7702EF12AC7205000557C00 /* WelcomeView.swift */, + ); + path = Welcome; + sourceTree = ""; + }; + D7A03FBB2ACC2D850081A588 /* Contacts */ = { + isa = PBXGroup; + children = ( + D7A03FBC2ACC2DB60081A588 /* ContactsView.swift */, + ); + path = Contacts; + sourceTree = ""; + }; + D7A03FBE2ACC2E010081A588 /* History */ = { + isa = PBXGroup; + children = ( + D7A03FBF2ACC2E390081A588 /* HistoryView.swift */, + ); + path = History; + sourceTree = ""; + }; + D7A2EDD42AC180FE005D90FC /* Viewmodel */ = { isa = PBXGroup; children = ( D7A2EDD52AC18115005D90FC /* SharedMainViewModel.swift */, ); - path = viewmodel; + path = Viewmodel; sourceTree = ""; }; D7D24D0C2AC1B4C700C6F35B /* Fonts */ = { @@ -322,11 +389,20 @@ D71707202AC5989C0037746F /* TextExtension.swift in Sources */, D719ABB92ABC67BF00B41C10 /* ContentView.swift in Sources */, D719ABC92ABC6FD700B41C10 /* CoreContext.swift in Sources */, + D7A03FBD2ACC2DB60081A588 /* ContactsView.swift in Sources */, D719ABCF2ABC779A00B41C10 /* AccountLoginViewModel.swift in Sources */, + D74C9D012ACB098C0021626A /* PermissionManager.swift in Sources */, + D7702EF22AC7205000557C00 /* WelcomeView.swift in Sources */, D719ABB72ABC67BF00B41C10 /* LinphoneApp.swift in Sources */, D7A2EDD62AC18115005D90FC /* SharedMainViewModel.swift in Sources */, + D7A03FC62ACC458A0081A588 /* SplashScreen.swift in Sources */, + D7A03FC02ACC2E390081A588 /* HistoryView.swift in Sources */, + D74C9CF82ACACECE0021626A /* WelcomePage1Fragment.swift in Sources */, D717071E2AC5922E0037746F /* ColorExtension.swift in Sources */, + D74C9CFC2ACACF370021626A /* WelcomePage3Fragment.swift in Sources */, D719ABCC2ABC769C00B41C10 /* AssistantView.swift in Sources */, + D74C9CFA2ACACF2D0021626A /* WelcomePage2Fragment.swift in Sources */, + D74C9CFF2ACAEC5E0021626A /* PopupView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -452,6 +528,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CODE_SIGN_ENTITLEMENTS = Linphone/Linphone.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; @@ -462,6 +539,7 @@ ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Linphone/Info.plist; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; @@ -493,6 +571,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CODE_SIGN_ENTITLEMENTS = Linphone/Linphone.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; @@ -503,6 +582,7 @@ ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Linphone/Info.plist; + INFOPLIST_KEY_NSPhotoLibraryUsageDescription = ""; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; diff --git a/Linphone/.DS_Store b/Linphone/.DS_Store index ec9d1dc22..ee98363d4 100644 Binary files a/Linphone/.DS_Store and b/Linphone/.DS_Store differ diff --git a/Linphone/Assets.xcassets/Mountain.imageset/Contents.json b/Linphone/Assets.xcassets/Linphone.imageset/Contents.json similarity index 88% rename from Linphone/Assets.xcassets/Mountain.imageset/Contents.json rename to Linphone/Assets.xcassets/Linphone.imageset/Contents.json index 646235f4e..ff043ddb2 100644 --- a/Linphone/Assets.xcassets/Mountain.imageset/Contents.json +++ b/Linphone/Assets.xcassets/Linphone.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Mountain.svg", + "filename" : "linphone.svg", "idiom" : "universal", "scale" : "1x" }, diff --git a/Linphone/Assets.xcassets/Linphone.imageset/Linphone.svg b/Linphone/Assets.xcassets/Linphone.imageset/Linphone.svg new file mode 100644 index 000000000..44f54349b --- /dev/null +++ b/Linphone/Assets.xcassets/Linphone.imageset/Linphone.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Linphone/Assets.xcassets/Mountain.imageset/Mountain.svg b/Linphone/Assets.xcassets/Mountain.imageset/Mountain.svg deleted file mode 100644 index e67609aff..000000000 --- a/Linphone/Assets.xcassets/Mountain.imageset/Mountain.svg +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/Linphone/Assets.xcassets/address-book.imageset/Contents.json b/Linphone/Assets.xcassets/address-book.imageset/Contents.json new file mode 100644 index 000000000..7e7aa5f15 --- /dev/null +++ b/Linphone/Assets.xcassets/address-book.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "address-book.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Linphone/Assets.xcassets/address-book.imageset/address-book.svg b/Linphone/Assets.xcassets/address-book.imageset/address-book.svg new file mode 100644 index 000000000..9dc0b9ec9 --- /dev/null +++ b/Linphone/Assets.xcassets/address-book.imageset/address-book.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Linphone/Assets.xcassets/current-dot.imageset/Contents.json b/Linphone/Assets.xcassets/current-dot.imageset/Contents.json new file mode 100644 index 000000000..dafa79dae --- /dev/null +++ b/Linphone/Assets.xcassets/current-dot.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "current-dot.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Linphone/Assets.xcassets/current-dot.imageset/current-dot.svg b/Linphone/Assets.xcassets/current-dot.imageset/current-dot.svg new file mode 100644 index 000000000..e28783f66 --- /dev/null +++ b/Linphone/Assets.xcassets/current-dot.imageset/current-dot.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Linphone/Assets.xcassets/dot.imageset/Contents.json b/Linphone/Assets.xcassets/dot.imageset/Contents.json new file mode 100644 index 000000000..ad32b6795 --- /dev/null +++ b/Linphone/Assets.xcassets/dot.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "dot.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Linphone/Assets.xcassets/dot.imageset/dot.svg b/Linphone/Assets.xcassets/dot.imageset/dot.svg new file mode 100644 index 000000000..fe8bdc248 --- /dev/null +++ b/Linphone/Assets.xcassets/dot.imageset/dot.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Linphone/Assets.xcassets/mountain.imageset/Contents.json b/Linphone/Assets.xcassets/mountain.imageset/Contents.json new file mode 100644 index 000000000..101c38e7e --- /dev/null +++ b/Linphone/Assets.xcassets/mountain.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "mountain.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Linphone/Assets.xcassets/mountain.imageset/mountain.svg b/Linphone/Assets.xcassets/mountain.imageset/mountain.svg new file mode 100644 index 000000000..fdb0ecf8d --- /dev/null +++ b/Linphone/Assets.xcassets/mountain.imageset/mountain.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/Linphone/Assets.xcassets/open-source.imageset/Contents.json b/Linphone/Assets.xcassets/open-source.imageset/Contents.json new file mode 100644 index 000000000..f63666669 --- /dev/null +++ b/Linphone/Assets.xcassets/open-source.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "open-source.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Linphone/Assets.xcassets/open-source.imageset/open-source.svg b/Linphone/Assets.xcassets/open-source.imageset/open-source.svg new file mode 100644 index 000000000..9bbb7658b --- /dev/null +++ b/Linphone/Assets.xcassets/open-source.imageset/open-source.svg @@ -0,0 +1,3 @@ + + + diff --git a/Linphone/Assets.xcassets/phone.imageset/Contents.json b/Linphone/Assets.xcassets/phone.imageset/Contents.json new file mode 100644 index 000000000..1c2ef1a6a --- /dev/null +++ b/Linphone/Assets.xcassets/phone.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "phone.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Linphone/Assets.xcassets/phone.imageset/phone.svg b/Linphone/Assets.xcassets/phone.imageset/phone.svg new file mode 100644 index 000000000..6eb862926 --- /dev/null +++ b/Linphone/Assets.xcassets/phone.imageset/phone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Linphone/Assets.xcassets/secure-image.imageset/Contents.json b/Linphone/Assets.xcassets/secure-image.imageset/Contents.json new file mode 100644 index 000000000..ade67196d --- /dev/null +++ b/Linphone/Assets.xcassets/secure-image.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "secure-image.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Linphone/Assets.xcassets/secure-image.imageset/secure-image.svg b/Linphone/Assets.xcassets/secure-image.imageset/secure-image.svg new file mode 100644 index 000000000..7c8d6ee3a --- /dev/null +++ b/Linphone/Assets.xcassets/secure-image.imageset/secure-image.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Linphone/core/CoreContext.swift b/Linphone/Core/CoreContext.swift similarity index 84% rename from Linphone/core/CoreContext.swift rename to Linphone/Core/CoreContext.swift index c08a9cf93..789384f73 100644 --- a/Linphone/core/CoreContext.swift +++ b/Linphone/Core/CoreContext.swift @@ -19,7 +19,7 @@ import linphonesw -class CoreContext : ObservableObject { +final class CoreContext : ObservableObject { static let shared = CoreContext() @@ -29,11 +29,14 @@ class CoreContext : ObservableObject { var coreVersion: String = Core.getVersion @Published var loggedIn : Bool = false - private init() { - + private init() {} + + func initialiseCore() async throws { LoggingService.Instance.logLevel = LogLevel.Debug - try? mCore = Factory.Instance.createCore(configPath: "", factoryConfigPath: "", systemContext: nil) + let factory = Factory.Instance + let configDir = factory.getConfigDir(context: nil) + try? mCore = Factory.Instance.createCore(configPath: "\(configDir)/MyConfig", factoryConfigPath: "", systemContext: nil) try? mCore.start() // Create a Core listener to listen for the callback we need diff --git a/Linphone/Info.plist b/Linphone/Info.plist index 0ec3efdd4..c3b52b04f 100644 --- a/Linphone/Info.plist +++ b/Linphone/Info.plist @@ -11,5 +11,10 @@ NotoSans-Bold.ttf NotoSans-ExtraBold.ttf + UILaunchScreen + + UIImageName + linphone + diff --git a/Linphone/LinphoneApp.swift b/Linphone/LinphoneApp.swift index 3aae5e76d..2b7f833fa 100644 --- a/Linphone/LinphoneApp.swift +++ b/Linphone/LinphoneApp.swift @@ -21,9 +21,16 @@ import SwiftUI @main struct LinphoneApp: App { + + @State private var isActive = false + var body: some Scene { WindowGroup { - ContentView(sharedMainViewModel: SharedMainViewModel()) + if isActive { + ContentView(sharedMainViewModel: SharedMainViewModel()) + }else { + SplashScreen(isActive: $isActive) + } } } } diff --git a/Linphone/Localizable.xcstrings b/Linphone/Localizable.xcstrings index 4b684b10d..825ac2ca4 100644 --- a/Linphone/Localizable.xcstrings +++ b/Linphone/Localizable.xcstrings @@ -6,6 +6,12 @@ }, " or " : { + }, + "[nos conditions d’utilisation](https://linphone.org/general-terms)" : { + + }, + "[notre politique de confidentialité](https://linphone.org/privacy-policy)" : { + }, "%lld Book (Example)" : { "extractionState" : "manual", @@ -59,6 +65,9 @@ } } } + }, + "Accept all" : { + }, "assistant_account_login" : { "extractionState" : "manual", @@ -77,14 +86,51 @@ } } }, + "Calls" : { + + }, + "Conditions de service" : { + + }, + "Contacts" : { + + }, + "Contacts View" : { + + }, + "Deny all" : { + + }, + "En continuant, vous acceptez ces conditions, %@ et %@." : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "En continuant, vous acceptez ces conditions, %1$@ et %2$@." + } + } + } + }, "Forgotten password?" : { + }, + "History View" : { + + }, + "Linphone" : { + }, "Log out" : { + }, + "Next" : { + }, "Not account yet?" : { + }, + "Open source" : { + }, "password" : { "extractionState" : "manual", @@ -108,12 +154,30 @@ }, "Scan QR code" : { + }, + "Sécurisé" : { + + }, + "Skip" : { + + }, + "Start" : { + }, "TCP" : { }, "TLS" : { + }, + "to Linphone" : { + + }, + "Une application de communication **sécurisée**, **open source** et **française**." : { + + }, + "Une application open source et un **service gratuit** depuis **2001**." : { + }, "Use SIP Account" : { @@ -134,6 +198,12 @@ } } } + }, + "Vos communications sont en sécurité grâce aux **Chiffrement de bout en bout**." : { + + }, + "Welcome" : { + } }, "version" : "1.0" diff --git a/Linphone/SplashScreen.swift b/Linphone/SplashScreen.swift new file mode 100644 index 000000000..b2ee812a6 --- /dev/null +++ b/Linphone/SplashScreen.swift @@ -0,0 +1,38 @@ +// +// SplashScreen.swift +// Linphone +// +// Created by Benoît Martins on 03/10/2023. +// + +import SwiftUI + +struct SplashScreen: View { + + @ObservedObject private var coreContext = CoreContext.shared + @Binding var isActive: Bool + + var body: some View { + GeometryReader { geometry in + VStack { + Spacer() + HStack { + Spacer() + Image("linphone") + Spacer() + } + Spacer() + } + + } + .ignoresSafeArea(.all) + .onAppear { + Task { + try await coreContext.initialiseCore() + withAnimation { + self.isActive = true + } + } + } + } +} diff --git a/Linphone/ui/assistant/AssistantView.swift b/Linphone/UI/Assistant/AssistantView.swift similarity index 97% rename from Linphone/ui/assistant/AssistantView.swift rename to Linphone/UI/Assistant/AssistantView.swift index aa219ef92..16552e0d1 100644 --- a/Linphone/ui/assistant/AssistantView.swift +++ b/Linphone/UI/Assistant/AssistantView.swift @@ -34,7 +34,7 @@ struct AssistantView: View { ScrollView(.vertical) { VStack { ZStack { - Image("Mountain") + Image("mountain") .resizable() .scaledToFill() .frame(width: geometry.size.width, height: 100) @@ -203,7 +203,7 @@ struct AssistantView: View { .padding(.horizontal, 10) Button(action: { - + }) { Text("Register") .default_text_style_orange_600(styleSize: 20) @@ -230,9 +230,6 @@ struct AssistantView: View { } } -struct AssistantView_Previews: PreviewProvider { - - static var previews: some View { - AssistantView(accountLoginViewModel: AccountLoginViewModel()) - } +#Preview { + AssistantView(accountLoginViewModel: AccountLoginViewModel()) } diff --git a/Linphone/ui/assistant/viewmodel/AccountLoginViewModel.swift b/Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift similarity index 100% rename from Linphone/ui/assistant/viewmodel/AccountLoginViewModel.swift rename to Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift diff --git a/Linphone/ui/main/viewmodel/SharedMainViewModel.swift b/Linphone/UI/Main/Contacts/ContactsView.swift similarity index 73% rename from Linphone/ui/main/viewmodel/SharedMainViewModel.swift rename to Linphone/UI/Main/Contacts/ContactsView.swift index ded17529c..32124a5b3 100644 --- a/Linphone/ui/main/viewmodel/SharedMainViewModel.swift +++ b/Linphone/UI/Main/Contacts/ContactsView.swift @@ -1,7 +1,7 @@ /* * Copyright (c) 2010-2023 Belledonne Communications SARL. * -* This file is part of Linphone +* This file is part of linphone-iphone * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,9 +17,20 @@ * along with this program. If not, see . */ -import linphonesw +import SwiftUI -class SharedMainViewModel : ObservableObject { - - init() {} +struct ContactsView: View { + var body: some View { + VStack { + Spacer() + Image("linphone") + .padding(.bottom, 20) + Text("Contacts View") + Spacer() + } + } +} + +#Preview { + ContactsView() } diff --git a/Linphone/UI/Main/ContentView.swift b/Linphone/UI/Main/ContentView.swift new file mode 100644 index 000000000..ef8b2e08d --- /dev/null +++ b/Linphone/UI/Main/ContentView.swift @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of linphone-iphone + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import SwiftUI + +struct ContentView: View { + + @ObservedObject var sharedMainViewModel : SharedMainViewModel + @ObservedObject private var coreContext = CoreContext.shared + + var body: some View { + if UserDefaults.standard.bool(forKey: "general_terms") == false { + WelcomeView(sharedMainViewModel: sharedMainViewModel) + } else if coreContext.mCore.defaultAccount == nil { + AssistantView(accountLoginViewModel: AccountLoginViewModel()) + } else { + TabView { + ContactsView() + .tabItem { + Label("Contacts", image: "address-book") + } + + HistoryView() + .tabItem { + Label("Calls", image: "phone") + } + } + } + } +} + +#Preview { + ContentView(sharedMainViewModel: SharedMainViewModel()) +} diff --git a/Linphone/UI/Main/Fragments/PopupView.swift b/Linphone/UI/Main/Fragments/PopupView.swift new file mode 100644 index 000000000..531bb4146 --- /dev/null +++ b/Linphone/UI/Main/Fragments/PopupView.swift @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of Linphone + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import SwiftUI +import Photos + +struct PopupView: View { + + var permissionManager = PermissionManager.shared + + @Binding var isShowPopup: Bool + + var body: some View { + GeometryReader { geometry in + VStack (alignment: .leading) { + Text("Conditions de service") + .default_text_style_800(styleSize: 16) + .frame(alignment: .leading) + .padding(.bottom, 2) + + Text("En continuant, vous acceptez ces conditions, \(Text("[notre politique de confidentialité](https://linphone.org/privacy-policy)").underline()) et \(Text("[nos conditions d’utilisation](https://linphone.org/general-terms)").underline()).") + .tint(Color.gray_main2_600) + .default_text_style(styleSize: 15) + .padding(.bottom, 20) + + Button(action: { + self.isShowPopup.toggle() + }) { + Text("Deny all") + .default_text_style_orange_600(styleSize: 20) + .frame(height: 35) + .frame(maxWidth: .infinity) + } + .padding(.horizontal, 20) + .padding(.vertical, 10) + .cornerRadius(60) + .overlay( + RoundedRectangle(cornerRadius: 60) + .inset(by: 0.5) + .stroke(Color.orange_main_500, lineWidth: 1) + ) + .padding(.bottom, 10) + Button(action: { + permissionManager.photoLibraryRequestPermission() + }) { + Text("Accept all") + .default_text_style_white_600(styleSize: 20) + .frame(height: 35) + .frame(maxWidth: .infinity) + } + .padding(.horizontal, 20) + .padding(.vertical, 10) + .background(Color.orange_main_500) + .cornerRadius(60) + } + .padding(.horizontal, 20) + .padding(.vertical, 20) + .background(.white) + .cornerRadius(20) + .padding(.horizontal) + .frame(maxHeight: .infinity) + .shadow(color: Color.orange_main_500, radius: 0, x: 0, y: 2) + } + } +} diff --git a/Linphone/UI/Main/History/HistoryView.swift b/Linphone/UI/Main/History/HistoryView.swift new file mode 100644 index 000000000..3e9cf4ba0 --- /dev/null +++ b/Linphone/UI/Main/History/HistoryView.swift @@ -0,0 +1,27 @@ +// +// HistoryView.swift +// Linphone +// +// Created by Benoît Martins on 03/10/2023. +// + +import SwiftUI + +struct HistoryView: View { + + @ObservedObject private var coreContext = CoreContext.shared + + var body: some View { + VStack { + Spacer() + Image("linphone") + .padding(.bottom, 20) + Text("History View") + Spacer() + } + } +} + +#Preview { + HistoryView() +} diff --git a/Linphone/ui/main/ContentView.swift b/Linphone/UI/Main/Viewmodel/SharedMainViewModel.swift similarity index 52% rename from Linphone/ui/main/ContentView.swift rename to Linphone/UI/Main/Viewmodel/SharedMainViewModel.swift index dd80aa860..31a93e888 100644 --- a/Linphone/ui/main/ContentView.swift +++ b/Linphone/UI/Main/Viewmodel/SharedMainViewModel.swift @@ -1,7 +1,7 @@ /* * Copyright (c) 2010-2023 Belledonne Communications SARL. * -* This file is part of linphone-iphone +* This file is part of Linphone * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,20 +17,29 @@ * along with this program. If not, see . */ -import SwiftUI +import linphonesw -struct ContentView: View { +class SharedMainViewModel : ObservableObject { - @ObservedObject var sharedMainViewModel : SharedMainViewModel + @Published var generalTermsAccepted = false - var body: some View { - AssistantView(accountLoginViewModel: AccountLoginViewModel()) - } -} + init() { + let preferences = UserDefaults.standard -struct ContentView_Previews: PreviewProvider { + let generalTermsKey = "general_terms" + + if preferences.object(forKey: generalTermsKey) == nil { + preferences.set(generalTermsAccepted, forKey: generalTermsKey) + } else { + generalTermsAccepted = preferences.bool(forKey: generalTermsKey) + } + } - static var previews: some View { - AssistantView(accountLoginViewModel: AccountLoginViewModel()) - } + func changeGeneralTerms(){ + let preferences = UserDefaults.standard + + generalTermsAccepted = true + let generalTermsKey = "general_terms" + preferences.set(generalTermsAccepted, forKey: generalTermsKey) + } } diff --git a/Linphone/UI/Welcome/Fragments/WelcomePage1Fragment.swift b/Linphone/UI/Welcome/Fragments/WelcomePage1Fragment.swift new file mode 100644 index 000000000..69b58d13e --- /dev/null +++ b/Linphone/UI/Welcome/Fragments/WelcomePage1Fragment.swift @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of Linphone + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import Foundation +import SwiftUI + +struct WelcomePage1Fragment: View{ + + var body: some View{ + VStack { + Spacer() + VStack { + Image("linphone") + .renderingMode(.template) + .resizable() + .foregroundStyle(Color.orange_main_500) + .frame(width: 100, height: 100) + Text("Linphone") + .welcome_text_style_gray_800(styleSize: 30) + .padding(.bottom, 20) + Text("Une application de communication **sécurisée**, **open source** et **française**.") + .welcome_text_style_gray(styleSize: 15) + .multilineTextAlignment(.center) + + } + Spacer() + Spacer() + } + .frame(maxWidth: .infinity) + .padding(.horizontal, 20) + } +} + +#Preview { + WelcomePage1Fragment() +} diff --git a/Linphone/UI/Welcome/Fragments/WelcomePage2Fragment.swift b/Linphone/UI/Welcome/Fragments/WelcomePage2Fragment.swift new file mode 100644 index 000000000..fa309bcd9 --- /dev/null +++ b/Linphone/UI/Welcome/Fragments/WelcomePage2Fragment.swift @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of Linphone + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import Foundation +import SwiftUI + +struct WelcomePage2Fragment: View { + + var body: some View{ + VStack { + Spacer() + VStack { + Image("secure-image") + .renderingMode(.template) + .resizable() + .foregroundStyle(Color.orange_main_500) + .frame(width: 70, height: 100) + Text("Sécurisé") + .welcome_text_style_gray_800(styleSize: 30) + .padding(.bottom, 20) + Text("Vos communications sont en sécurité grâce aux **Chiffrement de bout en bout**.") + .welcome_text_style_gray(styleSize: 15) + .multilineTextAlignment(.center) + + } + Spacer() + Spacer() + } + .frame(maxWidth: .infinity) + } +} + +#Preview { + WelcomePage2Fragment() +} diff --git a/Linphone/UI/Welcome/Fragments/WelcomePage3Fragment.swift b/Linphone/UI/Welcome/Fragments/WelcomePage3Fragment.swift new file mode 100644 index 000000000..803af3968 --- /dev/null +++ b/Linphone/UI/Welcome/Fragments/WelcomePage3Fragment.swift @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of Linphone + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import Foundation +import SwiftUI + +struct WelcomePage3Fragment: View { + + var body: some View{ + VStack { + Spacer() + VStack { + Image("open-source") + .renderingMode(.template) + .resizable() + .foregroundStyle(Color.orange_main_500) + .frame(width: 100, height: 100) + Text("Open source") + .welcome_text_style_gray_800(styleSize: 30) + .padding(.bottom, 20) + Text("Une application open source et un **service gratuit** depuis **2001**.") + .welcome_text_style_gray(styleSize: 15) + .multilineTextAlignment(.center) + + } + Spacer() + Spacer() + } + .frame(maxWidth: .infinity) + } +} + +#Preview { + WelcomePage3Fragment() +} diff --git a/Linphone/UI/Welcome/WelcomeView.swift b/Linphone/UI/Welcome/WelcomeView.swift new file mode 100644 index 000000000..f9befaeca --- /dev/null +++ b/Linphone/UI/Welcome/WelcomeView.swift @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of Linphone + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import SwiftUI + +struct WelcomeView: View{ + + @ObservedObject var sharedMainViewModel : SharedMainViewModel + + var permissionManager = PermissionManager.shared + + @State private var index = 0 + @State private var isShowPopup = false + + var body: some View { + GeometryReader { geometry in + ZStack { + VStack { + ZStack { + Image("mountain") + .resizable() + .scaledToFill() + .frame(width: geometry.size.width, height: 100) + .clipped() + + VStack (alignment: .trailing) { + Text("Skip") + .underline() + .default_text_style_600(styleSize: 15) + .padding(.top, -35) + .padding(.trailing, 20) + .onTapGesture { + withAnimation { + self.index = 2 + self.isShowPopup.toggle() + } + } + Text("Welcome") + .welcome_text_style_white_800(styleSize: 35) + .padding(.trailing, 100) + .frame(width: geometry.size.width) + .padding(.bottom, -25) + Text("to Linphone") + .welcome_text_style_white_800(styleSize: 25) + .padding(.leading, 100) + .frame(width: geometry.size.width) + .padding(.bottom, -10) + } + .frame(width: geometry.size.width) + } + .padding(.top, 35) + .padding(.bottom, 10) + + VStack{ + TabView(selection: $index) { + ForEach((0..<3), id: \.self) { index in + if index == 0 { + WelcomePage1Fragment() + } else if index == 1 { + WelcomePage2Fragment() + } else if index == 2 { + WelcomePage3Fragment() + } else { + WelcomePage1Fragment() + } + } + } + .tabViewStyle(PageTabViewStyle(indexDisplayMode: .always)) + .onAppear { + setupAppearance() + } + } + + Button(action: { + if index < 2 { + withAnimation { + index += 1 + } + } else if index == 2 { + withAnimation{ + self.isShowPopup.toggle() + } + } + }) { + Text(index == 2 ? "Start" : "Next") + .default_text_style_white_600(styleSize: 20) + .frame(height: 35) + .frame(maxWidth: .infinity) + } + .padding(.horizontal, 20) + .padding(.vertical, 10) + .background(Color.orange_main_500) + .cornerRadius(60) + .padding(.bottom) + .padding(.horizontal) + } + + if self.isShowPopup { + PopupView(isShowPopup: $isShowPopup) + .background(.black.opacity(0.65)) + .edgesIgnoringSafeArea(.all) + .onTapGesture { + self.isShowPopup.toggle() + } + } + } + } + .onReceive(permissionManager.$photoLibraryPermissionGranted, perform: { (granted) in + if granted { + withAnimation { + sharedMainViewModel.changeGeneralTerms() + } + } + }) + } + + func setupAppearance() { + UIPageControl.appearance().currentPageIndicatorTintColor = UIColor(Color.orange_main_500) + if #available(iOS 16.0, *) { + + let dotCurrentImage = UIImage(named: "current-dot") + let dotImage = UIImage(named: "dot") + + UIPageControl.appearance().setCurrentPageIndicatorImage(dotCurrentImage, forPage: 0) + UIPageControl.appearance().setCurrentPageIndicatorImage(dotCurrentImage, forPage: 1) + UIPageControl.appearance().setCurrentPageIndicatorImage(dotCurrentImage, forPage: 2) + + UIPageControl.appearance().setIndicatorImage(dotImage, forPage: 0) + UIPageControl.appearance().setIndicatorImage(dotImage, forPage: 1) + UIPageControl.appearance().setIndicatorImage(dotImage, forPage: 2) + } + UIPageControl.appearance().pageIndicatorTintColor = UIColor(Color.gray_main2_200) + } +} + +#Preview { + WelcomeView(sharedMainViewModel: SharedMainViewModel()) +} diff --git a/Linphone/utils/ColorExtension.swift b/Linphone/Utils/ColorExtension.swift similarity index 100% rename from Linphone/utils/ColorExtension.swift rename to Linphone/Utils/ColorExtension.swift diff --git a/Linphone/Utils/PermissionManager.swift b/Linphone/Utils/PermissionManager.swift new file mode 100644 index 000000000..6a830e412 --- /dev/null +++ b/Linphone/Utils/PermissionManager.swift @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010-2023 Belledonne Communications SARL. + * + * This file is part of Linphone + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import Foundation +import Photos + +class PermissionManager : ObservableObject { + + static let shared = PermissionManager() + + @Published var photoLibraryPermissionGranted = false + @Published var cameraPermissionGranted = false + + private init() {} + + func photoLibraryRequestPermission(){ + PHPhotoLibrary.requestAuthorization(for: .readWrite, handler: {status in + DispatchQueue.main.async { + self.photoLibraryPermissionGranted = (status == .authorized || status == .limited || status == .restricted) + } + }) + } + + func cameraRequestPermission() { + AVCaptureDevice.requestAccess(for: .video, completionHandler: {accessGranted in + DispatchQueue.main.async { + self.cameraPermissionGranted = accessGranted + } + }) + } +} diff --git a/Linphone/utils/TextExtension.swift b/Linphone/Utils/TextExtension.swift similarity index 89% rename from Linphone/utils/TextExtension.swift rename to Linphone/Utils/TextExtension.swift index b48850251..74e85bb0c 100644 --- a/Linphone/utils/TextExtension.swift +++ b/Linphone/Utils/TextExtension.swift @@ -111,4 +111,19 @@ extension View { self.font(Font.custom("NotoSans-ExtraBold", size: styleSize)) .foregroundStyle(Color.orange_main_500) } + + func welcome_text_style_white_800(styleSize: CGFloat) -> some View { + self.font(Font.custom("NotoSans-ExtraBold", size: styleSize)) + .foregroundStyle(Color.white) + } + + func welcome_text_style_gray_800(styleSize: CGFloat) -> some View { + self.font(Font.custom("NotoSans-ExtraBold", size: styleSize)) + .foregroundStyle(Color.gray_main2_600) + } + + func welcome_text_style_gray(styleSize: CGFloat) -> some View { + self.font(Font.custom("NotoSans-Regular", size: styleSize)) + .foregroundStyle(Color.gray_main2_600) + } } diff --git a/Linphone/ui/.DS_Store b/Linphone/ui/.DS_Store deleted file mode 100644 index 9bbad94a3..000000000 Binary files a/Linphone/ui/.DS_Store and /dev/null differ