diff options
| author | Mojgan <Mojgan.jelodar@codic.se> | 2023-05-22 14:40:34 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2023-05-23 10:59:00 +0200 |
| commit | 42b5c775aa094b1a6d681fe7179c8f7fa1dfff7e (patch) | |
| tree | 44a8ff0827fc64a69ef1d8c2f9a9e7f25f3f738f | |
| parent | 124ebaae1447da30aab1f5385f200f2de535de1b (diff) | |
| download | mullvadvpn-42b5c775aa094b1a6d681fe7179c8f7fa1dfff7e.tar.xz mullvadvpn-42b5c775aa094b1a6d681fe7179c8f7fa1dfff7e.zip | |
Make the tappable area bigger for small buttons
| -rw-r--r-- | ios/MullvadVPN.xcodeproj/project.pbxproj | 17 | ||||
| -rw-r--r-- | ios/MullvadVPN/Containers/Root/HeaderBarButton.swift | 15 | ||||
| -rw-r--r-- | ios/MullvadVPN/Containers/Root/HeaderBarView.swift | 8 | ||||
| -rw-r--r-- | ios/MullvadVPN/Notifications/UI/NotificationBannerView.swift | 4 | ||||
| -rw-r--r-- | ios/MullvadVPN/Views/IncreasedHitButton.swift | 21 |
5 files changed, 35 insertions, 30 deletions
diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj index ae304ecf80..57a6c6f324 100644 --- a/ios/MullvadVPN.xcodeproj/project.pbxproj +++ b/ios/MullvadVPN.xcodeproj/project.pbxproj @@ -233,7 +233,6 @@ 58B26E262943522400D5980C /* NotificationProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B26E252943522400D5980C /* NotificationProvider.swift */; }; 58B26E282943527300D5980C /* SystemNotificationProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B26E272943527300D5980C /* SystemNotificationProvider.swift */; }; 58B26E2A2943545A00D5980C /* NotificationManagerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B26E292943545A00D5980C /* NotificationManagerDelegate.swift */; }; - 58B3F30F2742708B00A2DD38 /* HeaderBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B3F30E2742708B00A2DD38 /* HeaderBarButton.swift */; }; 58B43C1925F77DB60002C8C3 /* TunnelControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B43C1825F77DB60002C8C3 /* TunnelControlView.swift */; }; 58B8644529C7971B005E107C /* AccountTokenInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 582AE30F2440A6CA00E6733A /* AccountTokenInput.swift */; }; 58B8644629C7972F005E107C /* CustomDateComponentsFormatting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5896AE83246D5889005B36CB /* CustomDateComponentsFormatting.swift */; }; @@ -370,16 +369,17 @@ 7A818F1F29F0305800C7F0F4 /* RootConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A818F1E29F0305800C7F0F4 /* RootConfiguration.swift */; }; 7AD2DA1529DC4EB900250737 /* UISearchBar+Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AD2DA1429DC4EB900250737 /* UISearchBar+Appearance.swift */; }; 7AF0419E29E957EB00D492DD /* AccountCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AF0419D29E957EB00D492DD /* AccountCoordinator.swift */; }; - A97FF5502A0D2FFC00900996 /* NSFileCoordinator+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97FF54F2A0D2FFC00900996 /* NSFileCoordinator+Extensions.swift */; }; - A9CF11FD2A0518E7001D9565 /* AddressCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CF11FC2A0518E7001D9565 /* AddressCacheTests.swift */; }; A917351F29FAA9C400D5DCFD /* RESTTransportStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = A917351E29FAA9C400D5DCFD /* RESTTransportStrategy.swift */; }; A917352129FAAA5200D5DCFD /* TransportStrategyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A917352029FAAA5200D5DCFD /* TransportStrategyTests.swift */; }; A92CAAC629F7D33C008ED922 /* TunnelTransportProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92CAAC529F7D33C008ED922 /* TunnelTransportProvider.swift */; }; A97FF54B2A0B7AD000900996 /* SimulatorTunnelTransportProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97FF54A2A0B7AD000900996 /* SimulatorTunnelTransportProvider.swift */; }; + A97FF5502A0D2FFC00900996 /* NSFileCoordinator+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97FF54F2A0D2FFC00900996 /* NSFileCoordinator+Extensions.swift */; }; + A9CF11FD2A0518E7001D9565 /* AddressCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CF11FC2A0518E7001D9565 /* AddressCacheTests.swift */; }; E1187ABC289BBB850024E748 /* OutOfTimeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1187ABA289BBB850024E748 /* OutOfTimeViewController.swift */; }; E1187ABD289BBB850024E748 /* OutOfTimeContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1187ABB289BBB850024E748 /* OutOfTimeContentView.swift */; }; E158B360285381C60002F069 /* String+AccountFormatting.swift in Sources */ = {isa = PBXBuildFile; fileRef = E158B35F285381C60002F069 /* String+AccountFormatting.swift */; }; E1FD0DF528AA7CE400299DB4 /* StatusActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1FD0DF428AA7CE400299DB4 /* StatusActivityView.swift */; }; + F03580252A13842C00E5DAFD /* IncreasedHitButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = F03580242A13842C00E5DAFD /* IncreasedHitButton.swift */; }; F07CFF2029F2720E008C0343 /* RegisteredDeviceInAppNotificationProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F07CFF1F29F2720E008C0343 /* RegisteredDeviceInAppNotificationProvider.swift */; }; F0C2AEFD2A0BB5CC00986207 /* NotificationProviderIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C2AEFC2A0BB5CC00986207 /* NotificationProviderIdentifier.swift */; }; /* End PBXBuildFile section */ @@ -883,7 +883,6 @@ 58B26E252943522400D5980C /* NotificationProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationProvider.swift; sourceTree = "<group>"; }; 58B26E272943527300D5980C /* SystemNotificationProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemNotificationProvider.swift; sourceTree = "<group>"; }; 58B26E292943545A00D5980C /* NotificationManagerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManagerDelegate.swift; sourceTree = "<group>"; }; - 58B3F30E2742708B00A2DD38 /* HeaderBarButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderBarButton.swift; sourceTree = "<group>"; }; 58B43C1825F77DB60002C8C3 /* TunnelControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelControlView.swift; sourceTree = "<group>"; }; 58B93A1226C3F13600A55733 /* TunnelState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelState.swift; sourceTree = "<group>"; }; 58B993B02608A34500BA7811 /* LoginContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginContentView.swift; sourceTree = "<group>"; }; @@ -979,16 +978,17 @@ 7A818F1E29F0305800C7F0F4 /* RootConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootConfiguration.swift; sourceTree = "<group>"; }; 7AD2DA1429DC4EB900250737 /* UISearchBar+Appearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UISearchBar+Appearance.swift"; sourceTree = "<group>"; }; 7AF0419D29E957EB00D492DD /* AccountCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountCoordinator.swift; sourceTree = "<group>"; }; - A97FF54F2A0D2FFC00900996 /* NSFileCoordinator+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSFileCoordinator+Extensions.swift"; sourceTree = "<group>"; }; - A9CF11FC2A0518E7001D9565 /* AddressCacheTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressCacheTests.swift; sourceTree = "<group>"; }; A917351E29FAA9C400D5DCFD /* RESTTransportStrategy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RESTTransportStrategy.swift; sourceTree = "<group>"; }; A917352029FAAA5200D5DCFD /* TransportStrategyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransportStrategyTests.swift; sourceTree = "<group>"; }; A92CAAC529F7D33C008ED922 /* TunnelTransportProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelTransportProvider.swift; sourceTree = "<group>"; }; A97FF54A2A0B7AD000900996 /* SimulatorTunnelTransportProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimulatorTunnelTransportProvider.swift; sourceTree = "<group>"; }; + A97FF54F2A0D2FFC00900996 /* NSFileCoordinator+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSFileCoordinator+Extensions.swift"; sourceTree = "<group>"; }; + A9CF11FC2A0518E7001D9565 /* AddressCacheTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressCacheTests.swift; sourceTree = "<group>"; }; E1187ABA289BBB850024E748 /* OutOfTimeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutOfTimeViewController.swift; sourceTree = "<group>"; }; E1187ABB289BBB850024E748 /* OutOfTimeContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutOfTimeContentView.swift; sourceTree = "<group>"; }; E158B35F285381C60002F069 /* String+AccountFormatting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+AccountFormatting.swift"; sourceTree = "<group>"; }; E1FD0DF428AA7CE400299DB4 /* StatusActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusActivityView.swift; sourceTree = "<group>"; }; + F03580242A13842C00E5DAFD /* IncreasedHitButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IncreasedHitButton.swift; sourceTree = "<group>"; }; F07CFF1F29F2720E008C0343 /* RegisteredDeviceInAppNotificationProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisteredDeviceInAppNotificationProvider.swift; sourceTree = "<group>"; }; F0C2AEFC2A0BB5CC00986207 /* NotificationProviderIdentifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationProviderIdentifier.swift; sourceTree = "<group>"; }; /* End PBXFileReference section */ @@ -1414,6 +1414,7 @@ 58293FB2251241B3005D0BB5 /* CustomTextView.swift */, 5892A45D265FABFF00890742 /* EmptyTableViewHeaderFooterView.swift */, 58FD5BF32428C67600112C88 /* InAppPurchaseButton.swift */, + F03580242A13842C00E5DAFD /* IncreasedHitButton.swift */, 58F19E34228C15BA00C7710B /* SpinnerActivityIndicatorView.swift */, E1FD0DF428AA7CE400299DB4 /* StatusActivityView.swift */, 58EF581025D69DB400AEBA94 /* StatusImageView.swift */, @@ -1864,7 +1865,6 @@ isa = PBXGroup; children = ( 587425C02299833500CA2045 /* RootContainerViewController.swift */, - 58B3F30E2742708B00A2DD38 /* HeaderBarButton.swift */, 58F3C0A3249CB069003E76BE /* HeaderBarView.swift */, 7A818F1E29F0305800C7F0F4 /* RootConfiguration.swift */, ); @@ -2057,7 +2057,6 @@ isa = PBXNativeTarget; buildConfigurationList = 06799AD328F98E1D00ACD94E /* Build configuration list for PBXNativeTarget "MullvadREST" */; buildPhases = ( - 588E4EB028FEF1CA008046E3 /* Run prebuild script */, 01F1FF1F29F07D63007083C3 /* ShellScript */, 06799AB728F98E1D00ACD94E /* Headers */, 06799AB828F98E1D00ACD94E /* Sources */, @@ -2678,6 +2677,7 @@ 588527B2276B3F0700BAA373 /* LoadTunnelConfigurationOperation.swift in Sources */, 5867770E29096984006F721F /* OutOfTimeInteractor.swift in Sources */, 58F185AA298A3E3E00075977 /* TunnelCoordinator.swift in Sources */, + F03580252A13842C00E5DAFD /* IncreasedHitButton.swift in Sources */, 58F8AC0E25D3F8CE002BE0ED /* ProblemReportReviewViewController.swift in Sources */, 5878A27129091CF20096FC88 /* AccountInteractor.swift in Sources */, 5878F4FC29CDA2E4003D4BE2 /* ChangeLogViewController.swift in Sources */, @@ -2689,7 +2689,6 @@ 58BFA5C622A7C97F00A6173D /* RelayCacheTracker.swift in Sources */, E158B360285381C60002F069 /* String+AccountFormatting.swift in Sources */, 582BB1B1229569620055B6EF /* UINavigationBar+Appearance.swift in Sources */, - 58B3F30F2742708B00A2DD38 /* HeaderBarButton.swift in Sources */, 58ACF6492655365700ACE4B7 /* PreferencesViewController.swift in Sources */, 58C774BE29A7A249003A1A56 /* CustomNavigationController.swift in Sources */, E1FD0DF528AA7CE400299DB4 /* StatusActivityView.swift in Sources */, diff --git a/ios/MullvadVPN/Containers/Root/HeaderBarButton.swift b/ios/MullvadVPN/Containers/Root/HeaderBarButton.swift deleted file mode 100644 index df3858d42c..0000000000 --- a/ios/MullvadVPN/Containers/Root/HeaderBarButton.swift +++ /dev/null @@ -1,15 +0,0 @@ -// -// HeaderBarButton.swift -// MullvadVPN -// -// Created by pronebird on 15/11/2021. -// Copyright © 2021 Mullvad VPN AB. All rights reserved. -// - -import UIKit - -class HeaderBarButton: UIButton { - override func point(inside point: CGPoint, with event: UIEvent?) -> Bool { - return bounds.insetBy(dx: -10, dy: -10).contains(point) - } -} diff --git a/ios/MullvadVPN/Containers/Root/HeaderBarView.swift b/ios/MullvadVPN/Containers/Root/HeaderBarView.swift index d7cf062673..21a9e1ff93 100644 --- a/ios/MullvadVPN/Containers/Root/HeaderBarView.swift +++ b/ios/MullvadVPN/Containers/Root/HeaderBarView.swift @@ -51,7 +51,7 @@ class HeaderBarView: UIView { return label }() - let accountButton: HeaderBarButton = { + let accountButton: IncreasedHitButton = { let button = makeHeaderBarButton(with: UIImage(named: "IconAccount")) button.accessibilityIdentifier = "AccountButton" button.accessibilityLabel = NSLocalizedString( @@ -63,7 +63,7 @@ class HeaderBarView: UIView { return button }() - let settingsButton: HeaderBarButton = { + let settingsButton: IncreasedHitButton = { let button = makeHeaderBarButton(with: UIImage(named: "IconSettings")) button.accessibilityIdentifier = "SettingsButton" button.accessibilityLabel = NSLocalizedString( @@ -75,14 +75,14 @@ class HeaderBarView: UIView { return button }() - class func makeHeaderBarButton(with image: UIImage?) -> HeaderBarButton { + class func makeHeaderBarButton(with image: UIImage?) -> IncreasedHitButton { let buttonImage = image?.withTintColor(UIColor.HeaderBar.buttonColor, renderingMode: .alwaysOriginal) let disabledButtonImage = image?.withTintColor( UIColor.HeaderBar.disabledButtonColor, renderingMode: .alwaysOriginal ) - let barButton = HeaderBarButton(type: .system) + let barButton = IncreasedHitButton(type: .system) barButton.setImage(buttonImage, for: .normal) barButton.setImage(disabledButtonImage, for: .disabled) barButton.translatesAutoresizingMaskIntoConstraints = false diff --git a/ios/MullvadVPN/Notifications/UI/NotificationBannerView.swift b/ios/MullvadVPN/Notifications/UI/NotificationBannerView.swift index 8cb974b244..5562db43fd 100644 --- a/ios/MullvadVPN/Notifications/UI/NotificationBannerView.swift +++ b/ios/MullvadVPN/Notifications/UI/NotificationBannerView.swift @@ -63,8 +63,8 @@ final class NotificationBannerView: UIView { return view }() - private let actionButton: UIButton = { - let button = UIButton(type: .system) + private let actionButton: IncreasedHitButton = { + let button = IncreasedHitButton() button.tintColor = UIColor.InAppNotificationBanner.actionButtonColor button.translatesAutoresizingMaskIntoConstraints = false return button diff --git a/ios/MullvadVPN/Views/IncreasedHitButton.swift b/ios/MullvadVPN/Views/IncreasedHitButton.swift new file mode 100644 index 0000000000..14037887b2 --- /dev/null +++ b/ios/MullvadVPN/Views/IncreasedHitButton.swift @@ -0,0 +1,21 @@ +// +// IncreasedHitButton.swift +// MullvadVPN +// +// Created by Mojgan on 2023-05-16. +// Copyright © 2023 Mullvad VPN AB. All rights reserved. +// + +import UIKit + +final class IncreasedHitButton: UIButton { + private let defaultSize = 44.0 + + override func point(inside point: CGPoint, with event: UIEvent?) -> Bool { + let width = bounds.width + let height = bounds.height + let dx = (max(defaultSize, width) - width) * 0.5 + let dy = (max(defaultSize, height) - height) * 0.5 + return bounds.insetBy(dx: -dx, dy: -dy).contains(point) + } +} |
