From 40ee51db7cf6f4d100e83a5040a57e02bb736e73 Mon Sep 17 00:00:00 2001 From: Sergey Zolotarev Date: Mon, 4 Mar 2024 18:58:30 +0600 Subject: [PATCH] [focus-ios] Fix missing buttons in Find In Page bar (https://github.com/mozilla-mobile/focus-ios/pull/3894) * Fix invisible Find Previous & Find Next buttons Move the corresponding icon assets to the DesginSystem module so that they can be found at runtime. Fixes https://github.com/mozilla-mobile/focus-ios/issues/3699 * Make Find Previous / Find Next buttons initially disabled When the user hasn't entered any text, the previous/next buttons were not made disabled, which could be a little bit misleading and was not consistent with the case where there are no search results. --------- Co-authored-by: isabelrios --- .../Blockzilla/Utilities/FindInPageBar.swift | 6 ++++-- .../Assets.xcassets/FindInPage}/Contents.json | 0 .../FindInPage}/find_next.imageset/Contents.json | 0 .../FindInPage}/find_next.imageset/Find Next.pdf | Bin .../FindInPage}/find_next.imageset/find_next.pdf | Bin .../find_previous.imageset/Contents.json | 0 .../find_previous.imageset/Find Previous.pdf | Bin .../find_previous.imageset/find_previous.pdf | Bin .../Sources/DesignSystem/UIImage+AppImages.swift | 4 ++++ 9 files changed, 8 insertions(+), 2 deletions(-) rename focus-ios/focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/Contents.json (100%) rename focus-ios/focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_next.imageset/Contents.json (100%) rename focus-ios/focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_next.imageset/Find Next.pdf (100%) rename focus-ios/focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_next.imageset/find_next.pdf (100%) rename focus-ios/focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_previous.imageset/Contents.json (100%) rename focus-ios/focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_previous.imageset/Find Previous.pdf (100%) rename focus-ios/focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_previous.imageset/find_previous.pdf (100%) diff --git a/focus-ios/focus-ios/Blockzilla/Utilities/FindInPageBar.swift b/focus-ios/focus-ios/Blockzilla/Utilities/FindInPageBar.swift index b5f96149e727..c1987af6d26a 100644 --- a/focus-ios/focus-ios/Blockzilla/Utilities/FindInPageBar.swift +++ b/focus-ios/focus-ios/Blockzilla/Utilities/FindInPageBar.swift @@ -77,18 +77,20 @@ class FindInPageBar: UIView { matchCountView.accessibilityIdentifier = "FindInPage.matchCount" addSubview(matchCountView) - previousButton.setImage(UIImage(named: "find_previous"), for: []) + previousButton.setImage(.findPrevious, for: []) previousButton.setTitleColor(.white, for: []) previousButton.accessibilityLabel = UIConstants.strings.findInPagePreviousLabel previousButton.addTarget(self, action: #selector(didFindPrevious), for: .touchUpInside) previousButton.accessibilityIdentifier = "FindInPage.find_previous" + previousButton.isEnabled = false addSubview(previousButton) - nextButton.setImage(UIImage(named: "find_next"), for: []) + nextButton.setImage(.findNext, for: []) nextButton.setTitleColor(.white, for: []) nextButton.accessibilityLabel = UIConstants.strings.findInPageNextLabel nextButton.addTarget(self, action: #selector(didFindNext), for: .touchUpInside) nextButton.accessibilityIdentifier = "FindInPage.find_next" + nextButton.isEnabled = false addSubview(nextButton) let closeButton = UIButton() diff --git a/focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/Contents.json b/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/Contents.json similarity index 100% rename from focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/Contents.json rename to focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/Contents.json diff --git a/focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/Contents.json b/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/Contents.json similarity index 100% rename from focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/Contents.json rename to focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/Contents.json diff --git a/focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/Find Next.pdf b/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/Find Next.pdf similarity index 100% rename from focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/Find Next.pdf rename to focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/Find Next.pdf diff --git a/focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/find_next.pdf b/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/find_next.pdf similarity index 100% rename from focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/find_next.pdf rename to focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/find_next.pdf diff --git a/focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/Contents.json b/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/Contents.json similarity index 100% rename from focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/Contents.json rename to focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/Contents.json diff --git a/focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/Find Previous.pdf b/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/Find Previous.pdf similarity index 100% rename from focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/Find Previous.pdf rename to focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/Find Previous.pdf diff --git a/focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/find_previous.pdf b/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/find_previous.pdf similarity index 100% rename from focus-ios/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/find_previous.pdf rename to focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/find_previous.pdf diff --git a/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/UIImage+AppImages.swift b/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/UIImage+AppImages.swift index 15aea7c41f95..26447e93e1c6 100644 --- a/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/UIImage+AppImages.swift +++ b/focus-ios/focus-ios/BlockzillaPackage/Sources/DesignSystem/UIImage+AppImages.swift @@ -46,4 +46,8 @@ public extension UIImage { static let delete = UIImage(named: "icon_delete")! static let hamburgerMenu = UIImage(named: "icon_hamburger_menu")! static let stopMenu = UIImage(named: "icon_stop_menu")! + + // MARK: Find In Page + static let findPrevious = UIImage(named: "find_previous")! + static let findNext = UIImage(named: "find_next")! }