Skip to content

Commit

Permalink
make sure close button always remains tappable on confirmation screen…
Browse files Browse the repository at this point in the history
…s, to avoid issues with ledger disconnecting
  • Loading branch information
simonmcl committed Oct 23, 2024
1 parent 19ec442 commit 4b7a4df
Show file tree
Hide file tree
Showing 10 changed files with 317 additions and 411 deletions.
31 changes: 3 additions & 28 deletions Kukai Mobile/Modules/ConnectedApps/ConnectedApps.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="dark"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -675,6 +675,7 @@
</constraints>
</view>
<connections>
<outlet property="closeButton" destination="Koa-2H-bS5" id="BND-YT-RmL"/>
<outlet property="iconView" destination="28W-zX-9qj" id="wRX-8Y-dR4"/>
<outlet property="nameLabel" destination="dPh-Ya-Gr8" id="deI-F8-aLT"/>
<outlet property="payloadTextView" destination="2gX-6m-LOp" id="ZLx-BT-vfx"/>
Expand Down Expand Up @@ -852,32 +853,6 @@
<point key="canvasLocation" x="355" y="955"/>
</scene>
</scenes>
<designables>
<designable name="4df-5Y-kbw">
<size key="intrinsicContentSize" width="42" height="29"/>
</designable>
<designable name="7KU-xB-1SM">
<size key="intrinsicContentSize" width="24" height="14"/>
</designable>
<designable name="8Xe-wK-lVw">
<size key="intrinsicContentSize" width="60" height="36"/>
</designable>
<designable name="ACg-Aj-YI0">
<size key="intrinsicContentSize" width="24" height="14"/>
</designable>
<designable name="Koa-2H-bS5">
<size key="intrinsicContentSize" width="24" height="14"/>
</designable>
<designable name="LJ6-SS-Z5V">
<size key="intrinsicContentSize" width="79" height="36"/>
</designable>
<designable name="qx3-gA-ECC">
<size key="intrinsicContentSize" width="41" height="36"/>
</designable>
<designable name="zx7-BE-w3P">
<size key="intrinsicContentSize" width="60" height="36"/>
</designable>
</designables>
<resources>
<image name="ChevronRight" width="10" height="18"/>
<image name="Close" width="24" height="24"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import OSLog

class WalletConnectSignViewController: UIViewController, BottomSheetCustomFixedProtocol, SlideButtonDelegate {

@IBOutlet weak var closeButton: CustomisableButton!
@IBOutlet weak var iconView: UIImageView!
@IBOutlet weak var payloadTextView: UITextView!
@IBOutlet weak var nameLabel: UILabel!
Expand Down Expand Up @@ -118,13 +119,21 @@ class WalletConnectSignViewController: UIViewController, BottomSheetCustomFixedP
}

public func blockInteraction() {
self.view.isUserInteractionEnabled = false
self.swipeDownEnabled = false

for view in self.view.subviews {
if view != closeButton {
view.isUserInteractionEnabled = false
}
}
}

public func unblockInteraction() {
self.view.isUserInteractionEnabled = true
self.swipeDownEnabled = true

for view in self.view.subviews {
view.isUserInteractionEnabled = true
}
}

@IBAction func copyButtonTapped(_ sender: UIButton) {
Expand Down
529 changes: 228 additions & 301 deletions Kukai Mobile/Modules/Send/Base.lproj/Send.storyboard

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions Kukai Mobile/Modules/Send/SendAbstractConfirmViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,22 @@ class SendAbstractConfirmViewController: UIViewController {
})
}

public func blockInteraction() {
self.view.isUserInteractionEnabled = false
public func blockInteraction(exceptFor: [UIView]) {
self.swipeDownEnabled = false

for view in self.view.subviews {
if !exceptFor.contains([view]) {
view.isUserInteractionEnabled = false
}
}
}

public func unblockInteraction() {
self.view.isUserInteractionEnabled = true
self.swipeDownEnabled = true

for view in self.view.subviews {
view.isUserInteractionEnabled = true
}
}

public func performAuth() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import OSLog
class SendBatchConfirmViewController: SendAbstractConfirmViewController, SlideButtonDelegate, EditFeesViewControllerDelegate {

@IBOutlet var scrollView: UIScrollView!
@IBOutlet weak var closeButton: CustomisableButton!

// Connected app
@IBOutlet weak var connectedAppLabel: UILabel!
Expand Down Expand Up @@ -168,7 +169,7 @@ class SendBatchConfirmViewController: SendAbstractConfirmViewController, SlideBu
}

func didCompleteSlide() {
self.blockInteraction()
self.blockInteraction(exceptFor: [closeButton])
self.performAuth()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import OSLog
class SendCollectibleConfirmViewController: SendAbstractConfirmViewController, SlideButtonDelegate, EditFeesViewControllerDelegate {

@IBOutlet var scrollView: UIScrollView!
@IBOutlet weak var closeButton: CustomisableButton!

// Connected app
@IBOutlet weak var connectedAppLabel: UILabel!
Expand Down Expand Up @@ -190,7 +191,7 @@ class SendCollectibleConfirmViewController: SendAbstractConfirmViewController, S
}

func didCompleteSlide() {
self.blockInteraction()
self.blockInteraction(exceptFor: [closeButton])
self.performAuth()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import OSLog
class SendGenericConfirmViewController: SendAbstractConfirmViewController, SlideButtonDelegate, EditFeesViewControllerDelegate {

@IBOutlet var scrollView: UIScrollView!
@IBOutlet weak var closeButton: CustomisableButton!

// Connected app
@IBOutlet weak var connectedAppLabel: UILabel!
Expand Down Expand Up @@ -152,7 +153,7 @@ class SendGenericConfirmViewController: SendAbstractConfirmViewController, Slide
}

func didCompleteSlide() {
self.blockInteraction()
self.blockInteraction(exceptFor: [closeButton])
self.performAuth()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import OSLog
class SendTokenConfirmViewController: SendAbstractConfirmViewController, SlideButtonDelegate, EditFeesViewControllerDelegate {

@IBOutlet var scrollView: UIScrollView!
@IBOutlet weak var closeButton: CustomisableButton!

// Connected app
@IBOutlet weak var connectedAppLabel: UILabel!
Expand Down Expand Up @@ -170,7 +171,7 @@ class SendTokenConfirmViewController: SendAbstractConfirmViewController, SlideBu
}

func didCompleteSlide() {
self.blockInteraction()
self.blockInteraction(exceptFor: [closeButton])
self.performAuth()
}

Expand Down
4 changes: 3 additions & 1 deletion Kukai Mobile/Modules/Stake/ConfirmStakeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import os.log

class ConfirmStakeViewController: SendAbstractConfirmViewController, SlideButtonDelegate, EditFeesViewControllerDelegate {

@IBOutlet weak var closeButton: CustomisableButton!

// Connected app
@IBOutlet weak var connectedAppLabel: UILabel!
@IBOutlet weak var connectedAppIcon: UIImageView!
Expand Down Expand Up @@ -152,7 +154,7 @@ class ConfirmStakeViewController: SendAbstractConfirmViewController, SlideButton
}

func didCompleteSlide() {
self.blockInteraction()
self.blockInteraction(exceptFor: [closeButton])
self.performAuth()
}

Expand Down
Loading

0 comments on commit 4b7a4df

Please sign in to comment.