Use SwiftLint

This commit is contained in:
Benoit Martins 2023-10-10 11:58:07 +02:00
parent 3669674eae
commit adc8b00d6d
31 changed files with 984 additions and 900 deletions

32
.swiftlint.yml Normal file
View file

@ -0,0 +1,32 @@
disabled_rules:
- trailing_whitespace
opt_in_rules:
- empty_count
- empty_string
excluded:
- Carthage
- Pods
- SwiftLint/Common/3rdPartyLib
line_length:
warning: 150
error: 200
ignores_function_declarations: true
ignores_comments: true
ignores_urls: true
function_body_length:
warning: 300
error: 500
function_parameter_count:
warning: 6
error: 8
type_body_length:
warning: 300
error: 500
file_length:
warning: 1000
error: 1500
ignore_comment_only_lines: true
cyclomatic_complexity:
warning: 15
error: 25
reporter: "xcode"

View file

@ -7,7 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
2B416B2E7C90375B792A28AE /* Pods_Linphone.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C08FB4788AD667D35BAE64D /* Pods_Linphone.framework */; };
0DF2F35F000C9BBAE8FCB4A0 /* Pods_Linphone.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C92C314A5427A62F953EB70 /* Pods_Linphone.framework */; };
D70C93DE2AC2D0F60063CA3B /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = D70C93DD2AC2D0F60063CA3B /* Localizable.xcstrings */; };
D717071E2AC5922E0037746F /* ColorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D717071D2AC5922E0037746F /* ColorExtension.swift */; };
D71707202AC5989C0037746F /* TextExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D717071F2AC5989C0037746F /* TextExtension.swift */; };
@ -47,8 +47,9 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
2C08FB4788AD667D35BAE64D /* Pods_Linphone.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Linphone.framework; sourceTree = BUILT_PRODUCTS_DIR; };
BC39A28B26EDB00C91AB7756 /* Pods-Linphone.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Linphone.release.xcconfig"; path = "Target Support Files/Pods-Linphone/Pods-Linphone.release.xcconfig"; sourceTree = "<group>"; };
3A132937ACADB95696E2F906 /* Pods-Linphone.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Linphone.debug.xcconfig"; path = "Target Support Files/Pods-Linphone/Pods-Linphone.debug.xcconfig"; sourceTree = "<group>"; };
3E2758142B8F42856C3A34DF /* Pods-Linphone.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Linphone.release.xcconfig"; path = "Target Support Files/Pods-Linphone/Pods-Linphone.release.xcconfig"; sourceTree = "<group>"; };
7C92C314A5427A62F953EB70 /* Pods_Linphone.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Linphone.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D70C93DD2AC2D0F60063CA3B /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
D717071D2AC5922E0037746F /* ColorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorExtension.swift; sourceTree = "<group>"; };
D717071F2AC5989C0037746F /* TextExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextExtension.swift; sourceTree = "<group>"; };
@ -88,7 +89,6 @@
D7DA67612ACCB2FA00E95002 /* LoginFragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginFragment.swift; sourceTree = "<group>"; };
D7DA67632ACCB31700E95002 /* ProfileModeFragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileModeFragment.swift; sourceTree = "<group>"; };
D7FB55102AD447FD00A5AB15 /* RegisterFragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterFragment.swift; sourceTree = "<group>"; };
FBDE73581C1DC4F98CC3DF3A /* Pods-Linphone.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Linphone.debug.xcconfig"; path = "Target Support Files/Pods-Linphone/Pods-Linphone.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -96,17 +96,17 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2B416B2E7C90375B792A28AE /* Pods_Linphone.framework in Frameworks */,
0DF2F35F000C9BBAE8FCB4A0 /* Pods_Linphone.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9FFD5E6302DF1093E1CB7311 /* Frameworks */ = {
1110B8CBF3C1BFD76F8BBFB2 /* Frameworks */ = {
isa = PBXGroup;
children = (
2C08FB4788AD667D35BAE64D /* Pods_Linphone.framework */,
7C92C314A5427A62F953EB70 /* Pods_Linphone.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -114,8 +114,8 @@
A31AF2AB8C6A3D7B7EA3B424 /* Pods */ = {
isa = PBXGroup;
children = (
FBDE73581C1DC4F98CC3DF3A /* Pods-Linphone.debug.xcconfig */,
BC39A28B26EDB00C91AB7756 /* Pods-Linphone.release.xcconfig */,
3A132937ACADB95696E2F906 /* Pods-Linphone.debug.xcconfig */,
3E2758142B8F42856C3A34DF /* Pods-Linphone.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@ -126,7 +126,6 @@
D717071D2AC5922E0037746F /* ColorExtension.swift */,
D717071F2AC5989C0037746F /* TextExtension.swift */,
D74C9D002ACB098C0021626A /* PermissionManager.swift */,
D72343312ACEFF58009AA24E /* QRScannerController.swift */,
);
path = Utils;
sourceTree = "<group>";
@ -137,7 +136,7 @@
D719ABB52ABC67BF00B41C10 /* Linphone */,
D719ABB42ABC67BF00B41C10 /* Products */,
A31AF2AB8C6A3D7B7EA3B424 /* Pods */,
9FFD5E6302DF1093E1CB7311 /* Frameworks */,
1110B8CBF3C1BFD76F8BBFB2 /* Frameworks */,
);
sourceTree = "<group>";
};
@ -220,6 +219,7 @@
children = (
D719ABCE2ABC779A00B41C10 /* AccountLoginViewModel.swift */,
D72343332ACEFFC3009AA24E /* QRScanner.swift */,
D72343312ACEFF58009AA24E /* QRScannerController.swift */,
);
path = Viewmodel;
sourceTree = "<group>";
@ -310,11 +310,12 @@
isa = PBXNativeTarget;
buildConfigurationList = D719ABC22ABC67BF00B41C10 /* Build configuration list for PBXNativeTarget "Linphone" */;
buildPhases = (
5387C360B232ECCFFE549C7A /* [CP] Check Pods Manifest.lock */,
EAE6BD221624F991B659AC2E /* [CP] Check Pods Manifest.lock */,
D719ABAF2ABC67BF00B41C10 /* Sources */,
D719ABB02ABC67BF00B41C10 /* Frameworks */,
D719ABB12ABC67BF00B41C10 /* Resources */,
C6890D9F62DE340F66542619 /* [CP] Embed Pods Frameworks */,
D7FB55122AD53FE200A5AB15 /* Run Script */,
A35AE8ABA69001024776F16C /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -378,7 +379,43 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
5387C360B232ECCFFE549C7A /* [CP] Check Pods Manifest.lock */ = {
A35AE8ABA69001024776F16C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Linphone/Pods-Linphone-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Linphone/Pods-Linphone-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Linphone/Pods-Linphone-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
D7FB55122AD53FE200A5AB15 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 12;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Run Script";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which swiftlint > /dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
EAE6BD221624F991B659AC2E /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -400,23 +437,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C6890D9F62DE340F66542619 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Linphone/Pods-Linphone-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Linphone/Pods-Linphone-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Linphone/Pods-Linphone-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -572,7 +592,7 @@
};
D719ABC32ABC67BF00B41C10 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = FBDE73581C1DC4F98CC3DF3A /* Pods-Linphone.debug.xcconfig */;
baseConfigurationReference = 3A132937ACADB95696E2F906 /* Pods-Linphone.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
@ -616,7 +636,7 @@
};
D719ABC42ABC67BF00B41C10 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BC39A28B26EDB00C91AB7756 /* Pods-Linphone.release.xcconfig */;
baseConfigurationReference = 3E2758142B8F42856C3A34DF /* Pods-Linphone.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;

View file

@ -47,23 +47,23 @@ final class CoreContext : ObservableObject {
mRegistrationDelegate =
CoreDelegateStub(
onConfiguringStatus: { (core: Core, state: Config.ConfiguringState, message: String) in
onConfiguringStatus: {(_: Core, state: Config.ConfiguringState, message: String) in
NSLog("New configuration state is \(state) = \(message)\n")
if (state == .Successful) {
if state == .Successful {
self.toastMessage = "Successful"
} else {
self.toastMessage = "Failed"
}
},
onAccountRegistrationStateChanged: { (core: Core, account: Account, state: RegistrationState, message: String) in
onAccountRegistrationStateChanged: {(_: Core, account: Account, state: RegistrationState, message: String) in
// If account has been configured correctly, we will go through Progress and Ok states
// Otherwise, we will be Failed.
NSLog("New registration state is \(state) for user id \( String(describing: account.params?.identityAddress?.asString()))\n")
if (state == .Ok) {
NSLog("New registration state is \(state) for user id \( String(describing: account.params?.identityAddress?.asString())) = \(message)\n")
if state == .Ok {
self.loggingInProgress = false
self.loggedIn = true
} else if (state == .Progress) {
} else if state == .Progress {
self.loggingInProgress = true
} else {
self.toastMessage = "Registration failed"

View file

@ -3,9 +3,15 @@
"strings" : {
"" : {
},
" et " : {
},
" or " : {
},
"." : {
},
"[Forgotten password?](https://subscribe.linphone.org/)" : {
@ -131,15 +137,8 @@
"Domain" : {
},
"En continuant, vous acceptez ces conditions, %@ et %@." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "En continuant, vous acceptez ces conditions, %1$@ et %2$@."
}
}
}
"En continuant, vous acceptez ces conditions, " : {
},
"Error" : {
@ -220,21 +219,12 @@
},
"Skip" : {
},
"Some features require a Linphone account, such as group messaging, video conferences...\n\nThese features are hidden when you register with a third party SIP account.\n\nTo enable it in a commercial projet, please contact us. " : {
},
"Start" : {
},
"TCP" : {
},
"Texte explicatif du default mode : lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula." : {
},
"Texte explicatif du interoperable mode : lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula." : {
},
"The user name or password is incorrects" : {

View file

@ -25,7 +25,7 @@ struct SplashScreen: View {
@Binding var isActive: Bool
var body: some View {
GeometryReader { geometry in
GeometryReader { _ in
VStack {
Spacer()
HStack {

View file

@ -25,7 +25,7 @@ struct AssistantView: View {
@ObservedObject private var coreContext = CoreContext.shared
var body: some View {
if (sharedMainViewModel.displayProfileMode && coreContext.loggedIn){
if sharedMainViewModel.displayProfileMode && coreContext.loggedIn {
ProfileModeFragment(sharedMainViewModel: sharedMainViewModel)
} else {
LoginFragment(accountLoginViewModel: AccountLoginViewModel(), sharedMainViewModel: sharedMainViewModel)

View file

@ -72,7 +72,7 @@ struct LoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(isNameFocused ? Color.orange_main_500 : Color.gray_200, lineWidth: 1)
.stroke(isNameFocused ? Color.orangeMain500 : Color.gray200, lineWidth: 1)
)
.padding(.bottom)
.focused($isNameFocused)
@ -95,15 +95,16 @@ struct LoginFragment: View {
.focused($isPasswordFocused)
}
}
Button(action: {
isSecured.toggle()
}) {
}, label: {
Image(self.isSecured ? "eye-slash" : "eye")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
.frame(width: 20, height: 20)
}
})
}
.disabled(coreContext.loggedIn)
.padding(.horizontal, 20)
@ -112,26 +113,21 @@ struct LoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(isPasswordFocused ? Color.orange_main_500 : Color.gray_200, lineWidth: 1)
.stroke(isPasswordFocused ? Color.orangeMain500 : Color.gray200, lineWidth: 1)
)
.padding(.bottom)
Button(action: {
if (self.coreContext.loggedIn){
self.accountLoginViewModel.unregister()
self.accountLoginViewModel.delete()
} else {
self.accountLoginViewModel.login()
}
}) {
}, label: {
Text(coreContext.loggedIn ? "Log out" : "assistant_account_login")
.default_text_style_white_600(styleSize: 20)
.frame(height: 35)
.frame(maxWidth: .infinity)
}
})
.padding(.horizontal, 20)
.padding(.vertical, 10)
.background((accountLoginViewModel.username.isEmpty || accountLoginViewModel.passwd.isEmpty) ? Color.orange_main_100 : Color.orange_main_500)
.background((accountLoginViewModel.username.isEmpty || accountLoginViewModel.passwd.isEmpty) ? Color.orangeMain100 : Color.orangeMain500)
.cornerRadius(60)
.disabled(accountLoginViewModel.username.isEmpty || accountLoginViewModel.passwd.isEmpty)
.padding(.bottom)
@ -139,9 +135,9 @@ struct LoginFragment: View {
HStack {
Text("[Forgotten password?](https://subscribe.linphone.org/)")
.underline()
.tint(Color.gray_main2_600)
.tint(Color.grayMain2c600)
.default_text_style_600(styleSize: 15)
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
}
.frame(maxWidth: .infinity)
.padding(.bottom, 30)
@ -152,7 +148,7 @@ struct LoginFragment: View {
}
Text(" or ")
.default_text_style(styleSize: 15)
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
VStack {
Divider()
}
@ -166,7 +162,7 @@ struct LoginFragment: View {
Image("qr-code")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
.frame(width: 20, height: 20)
Text("Scan QR code")
@ -183,10 +179,11 @@ struct LoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(Color.orange_main_500, lineWidth: 1)
.stroke(Color.orangeMain500, lineWidth: 1)
)
.padding(.bottom)
.simultaneousGesture(TapGesture().onEnded{
.simultaneousGesture(
TapGesture().onEnded {
self.linkActive = "QR"
if !sharedMainViewModel.generalTermsAccepted {
withAnimation {
@ -195,7 +192,8 @@ struct LoginFragment: View {
} else {
self.isLinkQRActive = true
}
})
}
)
NavigationLink(isActive: $isLinkSIPActive, destination: {
ThirdPartySipAccountWarningFragment(sharedMainViewModel: sharedMainViewModel, accountLoginViewModel: accountLoginViewModel)
@ -213,10 +211,11 @@ struct LoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(Color.orange_main_500, lineWidth: 1)
.stroke(Color.orangeMain500, lineWidth: 1)
)
.padding(.bottom)
.simultaneousGesture(TapGesture().onEnded{
.simultaneousGesture(
TapGesture().onEnded {
self.linkActive = "SIP"
if !sharedMainViewModel.generalTermsAccepted {
withAnimation {
@ -225,7 +224,8 @@ struct LoginFragment: View {
} else {
self.isLinkSIPActive = true
}
})
}
)
Spacer()
@ -235,7 +235,7 @@ struct LoginFragment: View {
Text("Not account yet?")
.default_text_style(styleSize: 15)
.foregroundStyle(Color.gray_main2_700)
.foregroundStyle(Color.grayMain2c700)
.padding(.horizontal, 10)
NavigationLink(destination: RegisterFragment(), isActive: $isLinkREGActive, label: {Text("Register")
@ -249,10 +249,11 @@ struct LoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(Color.orange_main_500, lineWidth: 1)
.stroke(Color.orangeMain500, lineWidth: 1)
)
.padding(.horizontal, 10)
.simultaneousGesture(TapGesture().onEnded{
.simultaneousGesture(
TapGesture().onEnded {
self.linkActive = "REG"
if !sharedMainViewModel.generalTermsAccepted {
withAnimation {
@ -261,7 +262,8 @@ struct LoginFragment: View {
} else {
self.isLinkREGActive = true
}
})
}
)
Spacer()
}
@ -274,7 +276,18 @@ struct LoginFragment: View {
}
if self.isShowPopup {
PopupView(sharedMainViewModel: sharedMainViewModel, isShowPopup: $isShowPopup, title: Text("Conditions de service"), content: Text("En continuant, vous acceptez ces conditions, \(Text("[notre politique de confidentialité](https://linphone.org/privacy-policy)").underline()) et \(Text("[nos conditions dutilisation](https://linphone.org/general-terms)").underline())."), titleFirstButton: Text("Deny all"), actionFirstButton: {self.isShowPopup.toggle()}, titleSecondButton: Text("Accept all"), actionSecondButton: {acceptGeneralTerms()})
let contentPopup1 = Text("En continuant, vous acceptez ces conditions, ")
let contentPopup2 = Text("[notre politique de confidentialité](https://linphone.org/privacy-policy)").underline()
let contentPopup3 = Text(" et ")
let contentPopup4 = Text("[nos conditions dutilisation](https://linphone.org/general-terms)").underline()
let contentPopup5 = Text(".")
PopupView(sharedMainViewModel: sharedMainViewModel, isShowPopup: $isShowPopup,
title: Text("Conditions de service"),
content: contentPopup1 + contentPopup2 + contentPopup3 + contentPopup4 + contentPopup5,
titleFirstButton: Text("Deny all"),
actionFirstButton: {self.isShowPopup.toggle()},
titleSecondButton: Text("Accept all"),
actionSecondButton: {acceptGeneralTerms()})
.background(.black.opacity(0.65))
.onTapGesture {
self.isShowPopup.toggle()

View file

@ -50,7 +50,7 @@ struct ProfileModeFragment: View {
VStack(spacing: 10) {
Button(action: {
options = 1
}) {
}, label: {
HStack {
Image(options == 1 ? "radio-button-fill" : "radio-button")
Text("Default")
@ -66,7 +66,7 @@ struct ProfileModeFragment: View {
}
Spacer()
}
}
})
HStack {
Text("Chiffrement de bout en bout de tous vos échanges, grâce au mode default vos communications sont à labri des regards.")
@ -75,7 +75,7 @@ struct ProfileModeFragment: View {
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal, 16)
.padding(.vertical, 20)
.background(Color.gray_100)
.background(Color.gray100)
.cornerRadius(15)
.padding(.bottom, 5)
@ -86,7 +86,7 @@ struct ProfileModeFragment: View {
Button(action: {
options = 2
}) {
}, label: {
HStack {
Image(options == 2 ? "radio-button-fill" : "radio-button")
Text("Interoperable")
@ -102,7 +102,7 @@ struct ProfileModeFragment: View {
}
Spacer()
}
}
})
HStack {
Text("Ce mode vous permet dêtre interopérable avec dautres services SIP.\nVos communications seront chiffrées de point à point. ")
@ -111,7 +111,7 @@ struct ProfileModeFragment: View {
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal, 16)
.padding(.vertical, 20)
.background(Color.gray_100)
.background(Color.gray100)
.cornerRadius(15)
}
.frame(maxWidth: sharedMainViewModel.maxWidth)
@ -121,15 +121,15 @@ struct ProfileModeFragment: View {
Button(action: {
sharedMainViewModel.changeHideProfileMode()
}) {
}, label: {
Text("Continue")
.default_text_style_white_600(styleSize: 20)
.frame(height: 35)
.frame(maxWidth: .infinity)
}
})
.padding(.horizontal, 20)
.padding(.vertical, 10)
.background(Color.orange_main_500)
.background(Color.orangeMain500)
.cornerRadius(60)
.padding(.horizontal)
.padding(.bottom, geometry.safeAreaInsets.bottom.isEqual(to: 0.0) ? 20 : 0)
@ -142,7 +142,21 @@ struct ProfileModeFragment: View {
}
if self.isShowPopup {
PopupView(sharedMainViewModel: sharedMainViewModel, isShowPopup: $isShowPopup, title: Text(isShowPopupForDefault ? "Default mode" : "Interoperable mode"), content: Text(isShowPopupForDefault ? "Texte explicatif du default mode : lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula." : "Texte explicatif du interoperable mode : lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula."), titleFirstButton: nil, actionFirstButton: {}, titleSecondButton: Text("Close"), actionSecondButton: {self.isShowPopup.toggle()})
PopupView(sharedMainViewModel: sharedMainViewModel, isShowPopup: $isShowPopup,
title: Text(isShowPopupForDefault ? "Default mode" : "Interoperable mode"),
content: Text(
isShowPopupForDefault
? "Texte explicatif du default mode : lorem ipsum dolor sit amet, consectetur adipiscing elit."
+ "Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula."
: "Texte explicatif du interoperable mode : lorem ipsum dolor sit amet, consectetur adipiscing elit."
+ " Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula."),
titleFirstButton: nil,
actionFirstButton: {},
titleSecondButton: Text("Close"),
actionSecondButton: {
self.isShowPopup.toggle()
}
)
.background(.black.opacity(0.65))
.onTapGesture {
self.isShowPopup.toggle()

View file

@ -28,7 +28,7 @@ struct RegisterFragment: View {
Image("caret-left")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
.frame(width: 25, height: 25, alignment: .leading)
.padding(.top, -65)
.onTapGesture {

View file

@ -50,7 +50,7 @@ struct ThirdPartySipAccountLoginFragment: View {
Image("caret-left")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
.frame(width: 25, height: 25, alignment: .leading)
.padding(.top, -65)
.onTapGesture {
@ -89,7 +89,7 @@ struct ThirdPartySipAccountLoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(isNameFocused ? Color.orange_main_500 : Color.gray_200, lineWidth: 1)
.stroke(isNameFocused ? Color.orangeMain500 : Color.gray200, lineWidth: 1)
)
.padding(.bottom)
.focused($isNameFocused)
@ -114,13 +114,13 @@ struct ThirdPartySipAccountLoginFragment: View {
}
Button(action: {
isSecured.toggle()
}) {
}, label: {
Image(self.isSecured ? "eye-slash" : "eye")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
.frame(width: 20, height: 20)
}
})
}
.disabled(coreContext.loggedIn)
.padding(.horizontal, 20)
@ -129,7 +129,7 @@ struct ThirdPartySipAccountLoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(isPasswordFocused ? Color.orange_main_500 : Color.gray_200, lineWidth: 1)
.stroke(isPasswordFocused ? Color.orangeMain500 : Color.gray200, lineWidth: 1)
)
.padding(.bottom)
@ -147,7 +147,7 @@ struct ThirdPartySipAccountLoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(isDomainFocused ? Color.orange_main_500 : Color.gray_200, lineWidth: 1)
.stroke(isDomainFocused ? Color.orangeMain500 : Color.gray200, lineWidth: 1)
)
.padding(.bottom)
.focused($isDomainFocused)
@ -166,7 +166,7 @@ struct ThirdPartySipAccountLoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(isDisplayNameFocused ? Color.orange_main_500 : Color.gray_200, lineWidth: 1)
.stroke(isDisplayNameFocused ? Color.orangeMain500 : Color.gray200, lineWidth: 1)
)
.padding(.bottom)
.focused($isDisplayNameFocused)
@ -186,7 +186,7 @@ struct ThirdPartySipAccountLoginFragment: View {
Image("caret-down")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
.frame(width: 20, height: 20)
}
.frame(height: 25)
@ -196,31 +196,28 @@ struct ThirdPartySipAccountLoginFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(Color.gray_200, lineWidth: 1)
.stroke(Color.gray200, lineWidth: 1)
)
.padding(.bottom)
Spacer()
Button(action: {
if (self.coreContext.loggedIn){
self.accountLoginViewModel.unregister()
self.accountLoginViewModel.delete()
} else {
self.accountLoginViewModel.login()
}
accountLoginViewModel.domain = "sip.linphone.org"
accountLoginViewModel.transportType = "TLS"
}) {
}, label: {
Text(coreContext.loggedIn ? "Log out" : "assistant_account_login")
.default_text_style_white_600(styleSize: 20)
.frame(height: 35)
.frame(maxWidth: .infinity)
}
})
.padding(.horizontal, 20)
.padding(.vertical, 10)
.background((accountLoginViewModel.username.isEmpty || accountLoginViewModel.passwd.isEmpty || accountLoginViewModel.domain.isEmpty) ? Color.orange_main_100 : Color.orange_main_500)
.background(
(accountLoginViewModel.username.isEmpty || accountLoginViewModel.passwd.isEmpty || accountLoginViewModel.domain.isEmpty)
? Color.orangeMain100
: Color.orangeMain500)
.cornerRadius(60)
.disabled(accountLoginViewModel.username.isEmpty || accountLoginViewModel.passwd.isEmpty || accountLoginViewModel.domain.isEmpty)
.padding(.bottom, geometry.safeAreaInsets.bottom.isEqual(to: 0.0) ? 20 : 0)

View file

@ -44,7 +44,7 @@ struct ThirdPartySipAccountWarningFragment: View {
Image("caret-left")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
.frame(width: 25, height: 25, alignment: .leading)
.padding(.top, -65)
.onTapGesture {
@ -75,7 +75,7 @@ struct ThirdPartySipAccountWarningFragment: View {
Image("conversation")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
.frame(width: 20, height: 20, alignment: .leading)
.onTapGesture {
withAnimation {
@ -84,7 +84,7 @@ struct ThirdPartySipAccountWarningFragment: View {
}
}
.padding(16)
.background(Color.gray_main2_200)
.background(Color.grayMain2c200)
.cornerRadius(40)
.padding(.horizontal)
@ -92,7 +92,7 @@ struct ThirdPartySipAccountWarningFragment: View {
Image("video-call")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.gray_main2_500)
.foregroundStyle(Color.grayMain2c500)
.frame(width: 20, height: 20, alignment: .leading)
.onTapGesture {
withAnimation {
@ -101,7 +101,7 @@ struct ThirdPartySipAccountWarningFragment: View {
}
}
.padding(16)
.background(Color.gray_main2_200)
.background(Color.grayMain2c200)
.cornerRadius(40)
.padding(.horizontal)
@ -109,7 +109,9 @@ struct ThirdPartySipAccountWarningFragment: View {
}
.padding(.bottom, 40)
Text("Some features require a Linphone account, such as group messaging, video conferences...\n\nThese features are hidden when you register with a third party SIP account.\n\nTo enable it in a commercial projet, please contact us. ")
Text("Some features require a Linphone account, such as group messaging, video conferences...\n\n"
+ "These features are hidden when you register with a third party SIP account.\n\n"
+ "To enable it in a commercial projet, please contact us. ")
.default_text_style(styleSize: 15)
.multilineTextAlignment(.center)
.padding(.bottom)
@ -119,7 +121,7 @@ struct ThirdPartySipAccountWarningFragment: View {
HStack {
Text("[linphone.org/contact](https://linphone.org/contact)")
.tint(Color.orange_main_500)
.tint(Color.orangeMain500)
.default_text_style_orange_600(styleSize: 15)
.frame(height: 35)
}
@ -128,7 +130,7 @@ struct ThirdPartySipAccountWarningFragment: View {
.overlay(
RoundedRectangle(cornerRadius: 60)
.inset(by: 0.5)
.stroke(Color.orange_main_500, lineWidth: 1)
.stroke(Color.orangeMain500, lineWidth: 1)
)
Spacer()
@ -142,19 +144,19 @@ struct ThirdPartySipAccountWarningFragment: View {
Button(action: {
dismiss()
}) {
}, label: {
Text("I prefere create an account")
.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)
.stroke(Color.orangeMain500, lineWidth: 1)
)
.frame(maxWidth: sharedMainViewModel.maxWidth)
.padding(.horizontal)
@ -170,7 +172,7 @@ struct ThirdPartySipAccountWarningFragment: View {
})
.padding(.horizontal, 20)
.padding(.vertical, 10)
.background(Color.orange_main_500)
.background(Color.orangeMain500)
.cornerRadius(60)
.frame(maxWidth: sharedMainViewModel.maxWidth)
.padding(.horizontal)

View file

@ -38,9 +38,11 @@ class AccountLoginViewModel : ObservableObject {
// TLS is strongly recommended
// Only use UDP if you don't have the choice
var transport: TransportType
if (transportType == "TLS") { transport = TransportType.Tls }
else if (transportType == "TCP") { transport = TransportType.Tcp }
else { transport = TransportType.Udp }
if transportType == "TLS" {
transport = TransportType.Tls
} else if transportType == "TCP" {
transport = TransportType.Tcp
} else { transport = TransportType.Udp }
// To configure a SIP account, we need an Account object and an AuthInfo object
// The first one is how to connect to the proxy server, the second one stores the credentials
@ -58,7 +60,7 @@ class AccountLoginViewModel : ObservableObject {
// A SIP account is identified by an identity address that we can construct from the username and domain
let identity = try Factory.Instance.createAddress(addr: String("sip:" + username + "@" + domain))
try! accountParams.setIdentityaddress(newValue: identity)
try accountParams.setIdentityaddress(newValue: identity)
// We also need to configure where the proxy server is located
let address = try Factory.Instance.createAddress(addr: String("sip:" + domain))

View file

@ -54,13 +54,15 @@ class Coordinator: NSObject, AVCaptureMetadataOutputObjectsDelegate {
func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {
// Check if the metadataObjects array is not nil and it contains at least one object.
if metadataObjects.count == 0 {
if metadataObjects.isEmpty {
scanResult = "Scan a QR code"
return
}
// Get the metadata object.
let metadataObj = metadataObjects[0] as! AVMetadataMachineReadableCodeObject
guard let metadataObj = metadataObjects[0] as? AVMetadataMachineReadableCodeObject else {
return
}
if metadataObj.type == AVMetadataObject.ObjectType.qr,
let result = metadataObj.stringValue {
@ -68,7 +70,6 @@ class Coordinator: NSObject, AVCaptureMetadataOutputObjectsDelegate {
if let url = NSURL(string: result) {
if UIApplication.shared.canOpenURL(url as URL) {
lastResult = result
//scanResult = result
do {
try coreContext.mCore.setProvisioninguri(newValue: result)
coreContext.mCore.stop()

View file

@ -29,13 +29,13 @@ struct PopupLoadingView: View {
ProgressView()
.controlSize(.large)
.progressViewStyle(CircularProgressViewStyle(tint: Color.orange_main_500))
.progressViewStyle(CircularProgressViewStyle(tint: Color.orangeMain500))
.frame(maxWidth: .infinity)
.padding(.top)
.padding(.bottom)
Text("Opération en cours...")
.tint(Color.gray_main2_600)
.tint(Color.grayMain2c600)
.default_text_style(styleSize: 15)
.frame(maxWidth: .infinity)
}
@ -46,7 +46,7 @@ struct PopupLoadingView: View {
.padding(.horizontal)
.frame(maxHeight: .infinity)
.frame(maxWidth: .infinity)
.shadow(color: Color.orange_main_500, radius: 0, x: 0, y: 2)
.shadow(color: Color.orangeMain500, radius: 0, x: 0, y: 2)
.frame(maxWidth: sharedMainViewModel.maxWidth)
.position(x: geometry.size.width / 2, y: geometry.size.height / 2)
}

View file

@ -31,10 +31,10 @@ struct PopupView: View {
var content: Text?
var titleFirstButton: Text?
var actionFirstButton: () -> ()
var actionFirstButton: () -> Void
var titleSecondButton: Text?
var actionSecondButton: () -> ()
var actionSecondButton: () -> Void
var body: some View {
GeometryReader { geometry in
@ -44,10 +44,9 @@ struct PopupView: View {
.frame(alignment: .leading)
.padding(.bottom, 2)
if content != nil {
content
.tint(Color.gray_main2_600)
.tint(Color.grayMain2c600)
.default_text_style(styleSize: 15)
.padding(.bottom, 20)
}
@ -55,19 +54,19 @@ struct PopupView: View {
if titleFirstButton != nil {
Button(action: {
actionFirstButton()
}) {
}, label: {
titleFirstButton
.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)
.stroke(Color.orangeMain500, lineWidth: 1)
)
.padding(.bottom, 10)
}
@ -75,15 +74,15 @@ struct PopupView: View {
if titleSecondButton != nil {
Button(action: {
actionSecondButton()
}) {
}, label: {
titleSecondButton
.default_text_style_white_600(styleSize: 20)
.frame(height: 35)
.frame(maxWidth: .infinity)
}
})
.padding(.horizontal, 20)
.padding(.vertical, 10)
.background(Color.orange_main_500)
.background(Color.orangeMain500)
.cornerRadius(60)
}
}
@ -93,7 +92,7 @@ struct PopupView: View {
.cornerRadius(20)
.padding(.horizontal)
.frame(maxHeight: .infinity)
.shadow(color: Color.orange_main_500, radius: 0, x: 0, y: 2)
.shadow(color: Color.orangeMain500, radius: 0, x: 0, y: 2)
.frame(maxWidth: sharedMainViewModel.maxWidth)
.position(x: geometry.size.width / 2, y: geometry.size.height / 2)
}
@ -101,6 +100,12 @@ struct PopupView: View {
}
#Preview {
PopupView(sharedMainViewModel: SharedMainViewModel(), isShowPopup: .constant(true), title: Text("Title"), content: Text("Content"), titleFirstButton: Text("Deny all"), actionFirstButton: {}, titleSecondButton: Text("Accept all"), actionSecondButton: {})
PopupView(sharedMainViewModel: SharedMainViewModel(), isShowPopup: .constant(true),
title: Text("Title"),
content: Text("Content"),
titleFirstButton: Text("Deny all"),
actionFirstButton: {},
titleSecondButton: Text("Accept all"),
actionSecondButton: {})
.background(.black.opacity(0.65))
}

View file

@ -44,35 +44,35 @@ struct ToastView: ViewModifier {
case "Successful":
Text("QR code validated!")
.multilineTextAlignment(.center)
.foregroundStyle(Color.green_success_500)
.foregroundStyle(Color.greenSuccess500)
.default_text_style(styleSize: 15)
.padding(8)
case "Failed":
Text("Invalid QR code!")
.multilineTextAlignment(.center)
.foregroundStyle(Color.red_danger_500)
.foregroundStyle(Color.redDanger500)
.default_text_style(styleSize: 15)
.padding(8)
case "Invalide URI":
Text("Invalide URI")
.multilineTextAlignment(.center)
.foregroundStyle(Color.red_danger_500)
.foregroundStyle(Color.redDanger500)
.default_text_style(styleSize: 15)
.padding(8)
case "Registration failed":
Text("The user name or password is incorrects")
.multilineTextAlignment(.center)
.foregroundStyle(Color.red_danger_500)
.foregroundStyle(Color.redDanger500)
.default_text_style(styleSize: 15)
.padding(8)
default:
Text("Error")
.multilineTextAlignment(.center)
.foregroundStyle(Color.red_danger_500)
.foregroundStyle(Color.redDanger500)
.default_text_style(styleSize: 15)
.padding(8)
}
@ -83,7 +83,7 @@ struct ToastView: ViewModifier {
.overlay(
RoundedRectangle(cornerRadius: 50)
.inset(by: 0.5)
.stroke(isShowing == "Successful" ? Color.green_success_500 : Color.red_danger_500, lineWidth: 1)
.stroke(isShowing == "Successful" ? Color.greenSuccess500 : Color.redDanger500, lineWidth: 1)
)
.onTapGesture {
isShowing = ""

View file

@ -29,7 +29,7 @@ struct WelcomePage1Fragment: View{
Image("linphone")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
.frame(width: 100, height: 100)
Text("Linphone")
.welcome_text_style_gray_800(styleSize: 30)

View file

@ -29,7 +29,7 @@ struct WelcomePage2Fragment: View {
Image("secure-image")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
.frame(width: 70, height: 100)
Text("Sécurisé")
.welcome_text_style_gray_800(styleSize: 30)

View file

@ -29,7 +29,7 @@ struct WelcomePage3Fragment: View {
Image("open-source")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
.frame(width: 100, height: 100)
Text("Open source")
.welcome_text_style_gray_800(styleSize: 30)

View file

@ -99,15 +99,15 @@ struct WelcomeView: View{
} else if index == 2 {
permissionManager.cameraRequestPermission()
}
}) {
}, label: {
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)
.background(Color.orangeMain500)
.cornerRadius(60)
.padding(.horizontal)
.padding(.bottom, geometry.safeAreaInsets.bottom.isEqual(to: 0.0) ? 20 : 0)
@ -126,7 +126,7 @@ struct WelcomeView: View{
}
func setupAppearance() {
UIPageControl.appearance().currentPageIndicatorTintColor = UIColor(Color.orange_main_500)
UIPageControl.appearance().currentPageIndicatorTintColor = UIColor(Color.orangeMain500)
if #available(iOS 16.0, *) {
let dotCurrentImage = UIImage(named: "current-dot")
@ -140,7 +140,7 @@ struct WelcomeView: View{
UIPageControl.appearance().setIndicatorImage(dotImage, forPage: 1)
UIPageControl.appearance().setIndicatorImage(dotImage, forPage: 2)
}
UIPageControl.appearance().pageIndicatorTintColor = UIColor(Color.gray_main2_200)
UIPageControl.appearance().pageIndicatorTintColor = UIColor(Color.grayMain2c200)
}
}

View file

@ -22,70 +22,70 @@ import SwiftUI
extension Color {
static let transparent_color = Color(hex: "#00000000")
static let transparentColor = Color(hex: "#00000000")
static let black = Color(hex: "#000000")
static let white = Color(hex: "#FFFFFF")
static let orange_main_700 = Color(hex: "#B72D00")
static let orange_main_500 = Color(hex: "#FF5E00")
static let orange_main_300 = Color(hex: "#FFB266")
static let orange_main_100 = Color(hex: "#FFEACB")
static let orange_main_100_alpha_50 = Color(hex: "#80FFEACB")
static let orangeMain700 = Color(hex: "#B72D00")
static let orangeMain500 = Color(hex: "#FF5E00")
static let orangeMain300 = Color(hex: "#FFB266")
static let orangeMain100 = Color(hex: "#FFEACB")
static let orangeMain100Alpha50 = Color(hex: "#80FFEACB")
static let gray_main2_800 = Color(hex: "#22334D")
static let gray_main2_800_alpha_65 = Color(hex: "#A622334D")
static let gray_main2_700 = Color(hex: "#364860")
static let gray_main2_600 = Color(hex: "#4E6074")
static let gray_main2_500 = Color(hex: "#6C7A87")
static let gray_main2_400 = Color(hex: "#9AABB5")
static let gray_main2_300 = Color(hex: "#C0D1D9")
static let gray_main2_200 = Color(hex: "#DFECF2")
static let gray_main2_100 = Color(hex: "#EEF6F8")
static let grayMain2c800 = Color(hex: "#22334D")
static let grayMain2c800Alpha65 = Color(hex: "#A622334D")
static let grayMain2c700 = Color(hex: "#364860")
static let grayMain2c600 = Color(hex: "#4E6074")
static let grayMain2c500 = Color(hex: "#6C7A87")
static let grayMain2c400 = Color(hex: "#9AABB5")
static let grayMain2c300 = Color(hex: "#C0D1D9")
static let grayMain2c200 = Color(hex: "#DFECF2")
static let grayMain2c100 = Color(hex: "#EEF6F8")
static let gray_100 = Color(hex: "#F9F9F9")
static let gray_200 = Color(hex: "#EDEDED")
static let gray_300 = Color(hex: "#C9C9C9")
static let gray_400 = Color(hex: "#949494")
static let gray_500 = Color(hex: "#4E4E4E")
static let gray_600 = Color(hex: "#2E3030")
static let gray_900 = Color(hex: "#070707")
static let gray100 = Color(hex: "#F9F9F9")
static let gray200 = Color(hex: "#EDEDED")
static let gray300 = Color(hex: "#C9C9C9")
static let gray400 = Color(hex: "#949494")
static let gray500 = Color(hex: "#4E4E4E")
static let gray600 = Color(hex: "#2E3030")
static let gray900 = Color(hex: "#070707")
static let red_danger_200 = Color(hex: "#F5CCBE")
static let red_danger_500 = Color(hex: "#DD5F5F")
static let red_danger_700 = Color(hex: "#9E3548")
static let redDanger200 = Color(hex: "#F5CCBE")
static let redDanger500 = Color(hex: "#DD5F5F")
static let redDanger700 = Color(hex: "#9E3548")
static let green_success_500 = Color(hex: "#4FAE80")
static let green_success_700 = Color(hex: "#377D71")
static let green_success_200 = Color(hex: "#ACF5C1")
static let greenSuccess500 = Color(hex: "#4FAE80")
static let greenSuccess700 = Color(hex: "#377D71")
static let greenSuccess200 = Color(hex: "#ACF5C1")
static let blue_info_500 = Color(hex: "#4AA8FF")
static let blueInfo500 = Color(hex: "#4AA8FF")
static let orange_warning_600 = Color(hex: "#DBB820")
static let orangeWarning600 = Color(hex: "#DBB820")
static let orange_away = Color(hex: "#FFA645")
static let orangeAway = Color(hex: "#FFA645")
init(hex: String) {
let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int: UInt64 = 0
Scanner(string: hex).scanHexInt64(&int)
let a, r, g, b: UInt64
let alpha, red, green, blue: UInt64
switch hex.count {
case 3: // RGB (12-bit)
(a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
(alpha, red, green, blue) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
case 6: // RGB (24-bit)
(a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF)
(alpha, red, green, blue) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF)
case 8: // ARGB (32-bit)
(a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF)
(alpha, red, green, blue) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF)
default:
(a, r, g, b) = (1, 1, 1, 0)
(alpha, red, green, blue) = (1, 1, 1, 0)
}
self.init(
.sRGB,
red: Double(r) / 255,
green: Double(g) / 255,
blue: Double(b) / 255,
opacity: Double(a) / 255
red: Double(red) / 255,
green: Double(green) / 255,
blue: Double(blue) / 255,
opacity: Double(alpha) / 255
)
}
}

View file

@ -24,32 +24,32 @@ extension View {
func default_text_style_300(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Light", size: styleSize))
.foregroundStyle(Color.gray_main2_600)
.foregroundStyle(Color.grayMain2c600)
}
func default_text_style(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Regular", size: styleSize))
.foregroundStyle(Color.gray_main2_600)
.foregroundStyle(Color.grayMain2c600)
}
func default_text_style_500(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Medium", size: styleSize))
.foregroundStyle(Color.gray_main2_600)
.foregroundStyle(Color.grayMain2c600)
}
func default_text_style_600(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-SemiBold", size: styleSize))
.foregroundStyle(Color.gray_main2_600)
.foregroundStyle(Color.grayMain2c600)
}
func default_text_style_700(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Bold", size: styleSize))
.foregroundStyle(Color.gray_main2_600)
.foregroundStyle(Color.grayMain2c600)
}
func default_text_style_800(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-ExtraBold", size: styleSize))
.foregroundStyle(Color.gray_main2_600)
.foregroundStyle(Color.grayMain2c600)
}
func default_text_style_white_300(styleSize: CGFloat) -> some View {
@ -84,32 +84,32 @@ extension View {
func default_text_style_orange_300(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Light", size: styleSize))
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
}
func default_text_style_orange(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Regular", size: styleSize))
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
}
func default_text_style_orange_500(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Medium", size: styleSize))
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
}
func default_text_style_orange_600(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-SemiBold", size: styleSize))
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
}
func default_text_style_orange_700(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Bold", size: styleSize))
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
}
func default_text_style_orange_800(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-ExtraBold", size: styleSize))
.foregroundStyle(Color.orange_main_500)
.foregroundStyle(Color.orangeMain500)
}
func welcome_text_style_white_800(styleSize: CGFloat) -> some View {
@ -119,21 +119,21 @@ extension View {
func welcome_text_style_gray_800(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-ExtraBold", size: styleSize))
.foregroundStyle(Color.gray_main2_600)
.foregroundStyle(Color.grayMain2c600)
}
func welcome_text_style_gray(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Regular", size: styleSize))
.foregroundStyle(Color.gray_main2_600)
.foregroundStyle(Color.grayMain2c600)
}
func profile_mode_text_style_gray_800(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-ExtraBold", size: styleSize))
.foregroundStyle(Color.gray_900)
.foregroundStyle(Color.gray900)
}
func profile_mode_text_style_gray(styleSize: CGFloat) -> some View {
self.font(Font.custom("NotoSans-Regular", size: styleSize))
.foregroundStyle(Color.gray_main2_600)
.foregroundStyle(Color.grayMain2c600)
}
}

View file

@ -23,3 +23,11 @@ target 'Linphone' do
basic_pods
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
end
end
end