mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Update files following swiftformat upgrade
This commit is contained in:
committed by
Stefan Ceriu
parent
fe189fcfed
commit
23062901c0
@@ -27,9 +27,15 @@ struct AppLockScreenViewState: BindableState {
|
||||
var bindings: AppLockScreenViewStateBindings
|
||||
|
||||
/// The number of digits the user has entered so far.
|
||||
var numberOfDigitsEntered: Int { bindings.pinCode.count }
|
||||
var numberOfDigitsEntered: Int {
|
||||
bindings.pinCode.count
|
||||
}
|
||||
|
||||
/// Whether the subtitle is in a warning state or not.
|
||||
var isSubtitleWarning: Bool { numberOfPINAttempts > 0 }
|
||||
var isSubtitleWarning: Bool {
|
||||
numberOfPINAttempts > 0
|
||||
}
|
||||
|
||||
/// The string shown in the screen's subtitle.
|
||||
var subtitle: String {
|
||||
if !isSubtitleWarning {
|
||||
|
||||
@@ -78,7 +78,7 @@ struct AppLockScreen: View {
|
||||
/// The row of dots showing how many digits have been entered.
|
||||
var pinInputField: some View {
|
||||
HStack(spacing: 24) {
|
||||
/// The size of each dot within the PIN input field.
|
||||
// The size of each dot within the PIN input field.
|
||||
let pinDotSize: CGFloat = 14
|
||||
Circle()
|
||||
.fill(context.viewState.numberOfDigitsEntered > 0 ? .compound.iconPrimary : .compound.bgSubtlePrimary)
|
||||
|
||||
@@ -117,7 +117,9 @@ struct AppLockScreenPINKeypad_Previews: PreviewProvider {
|
||||
@StateObject var model = PreviewModel()
|
||||
class PreviewModel: ObservableObject {
|
||||
@Published var pinCode = ""
|
||||
var output: String { pinCode.isEmpty ? "Enter code" : pinCode }
|
||||
var output: String {
|
||||
pinCode.isEmpty ? "Enter code" : pinCode
|
||||
}
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
||||
+11
-3
@@ -17,9 +17,17 @@ struct AppLockSetupBiometricsScreenViewState: BindableState {
|
||||
/// The supported biometry type on this device.
|
||||
let biometryType: LABiometryType
|
||||
|
||||
var icon: SFSymbol { biometryType.systemSymbol }
|
||||
var title: String { L10n.screenAppLockSetupBiometricUnlockAllowTitle(biometryType.localizedString) }
|
||||
var subtitle: String { L10n.screenAppLockSetupBiometricUnlockSubtitle(biometryType.localizedString) }
|
||||
var icon: SFSymbol {
|
||||
biometryType.systemSymbol
|
||||
}
|
||||
|
||||
var title: String {
|
||||
L10n.screenAppLockSetupBiometricUnlockAllowTitle(biometryType.localizedString)
|
||||
}
|
||||
|
||||
var subtitle: String {
|
||||
L10n.screenAppLockSetupBiometricUnlockSubtitle(biometryType.localizedString)
|
||||
}
|
||||
}
|
||||
|
||||
enum AppLockSetupBiometricsScreenViewAction {
|
||||
|
||||
+4
-1
@@ -50,7 +50,10 @@ struct AppLockSetupPINScreenViewState: BindableState {
|
||||
}
|
||||
|
||||
/// Whether the subtitle is in a warning state or not.
|
||||
var isSubtitleWarning: Bool { mode == .unlock && numberOfUnlockAttempts > 0 }
|
||||
var isSubtitleWarning: Bool {
|
||||
mode == .unlock && numberOfUnlockAttempts > 0
|
||||
}
|
||||
|
||||
var subtitle: String {
|
||||
guard mode == .unlock else { return L10n.screenAppLockSetupPinContext(InfoPlistReader.main.bundleDisplayName) }
|
||||
if !isSubtitleWarning {
|
||||
|
||||
+7
-2
@@ -22,8 +22,13 @@ struct AppLockSetupSettingsScreenViewState: BindableState {
|
||||
let biometryType: LABiometryType
|
||||
var bindings: AppLockSetupSettingsScreenViewStateBindings
|
||||
|
||||
var supportsBiometrics: Bool { biometryType != .none }
|
||||
var enableBiometricsTitle: String { L10n.screenAppLockSetupBiometricUnlockAllowTitle(biometryType.localizedString) }
|
||||
var supportsBiometrics: Bool {
|
||||
biometryType != .none
|
||||
}
|
||||
|
||||
var enableBiometricsTitle: String {
|
||||
L10n.screenAppLockSetupBiometricUnlockAllowTitle(biometryType.localizedString)
|
||||
}
|
||||
}
|
||||
|
||||
struct AppLockSetupSettingsScreenViewStateBindings {
|
||||
|
||||
Reference in New Issue
Block a user