Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ extension WPStyleGuide {
searchBar.accessibilityIdentifier = "Search"
searchBar.autocapitalizationType = .none
searchBar.autocorrectionType = .no
searchBar.isTranslucent = true
searchBar.backgroundImage = UIImage()
searchBar.backgroundColor = backgroundColor
if #available(iOS 26, *) {
searchBar.searchBarStyle = .minimal // Removes borders
} else {
searchBar.isTranslucent = true
searchBar.backgroundImage = UIImage()
searchBar.backgroundColor = backgroundColor
}
searchBar.returnKeyType = returnKeyType
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,7 @@ final class DomainSelectionViewController: CollapsableHeaderViewController {
searchTextField.delegate = self
searchTextField.accessibilityTraits = .searchField

let placeholderText = Strings.searchPlaceholder
let attributes = WPStyleGuide.defaultSearchBarTextAttributesSwifted(.placeholderText)
let attributedPlaceholder = NSAttributedString(string: placeholderText, attributes: attributes)
searchTextField.attributedPlaceholder = attributedPlaceholder
searchBar.placeholder = Strings.searchPlaceholder
searchTextField.accessibilityHint = Strings.searchAccessibility

view.addSubview(noResultsLabel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CollapsableHeaderViewController: UIViewController, NoResultsViewHost {
let secondaryActionTitle: String?
let defaultActionTitle: String?
open var accessoryBarHeight: CGFloat {
return 44
if #available(iOS 26, *) { 64 + 16 } else { 44 }
}

open var separatorStyle: SeparatorStyle {
Expand Down Expand Up @@ -96,7 +96,11 @@ class CollapsableHeaderViewController: UIViewController, NoResultsViewHost {
@IBOutlet var visualEffects: [UIVisualEffectView]! {
didSet {
visualEffects.forEach { (visualEffect) in
visualEffect.effect = UIBlurEffect.init(style: .systemChromeMaterial)
if #available(iOS 26, *) {
visualEffect.effect = UIBlurEffect(style: .regular)
} else {
visualEffect.effect = UIBlurEffect(style: .systemChromeMaterial)
}
// Allow touches to pass through to the scroll view behind the header.
visualEffect.contentView.isUserInteractionEnabled = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,6 @@ import WordPressShared
import WordPressUI

extension WPStyleGuide {

@objc class func defaultSearchBarTextAttributes(_ color: UIColor) -> [String: Any] {
let attributes = defaultSearchBarTextAttributesSwifted(color)
return NSAttributedString.Key.convertToRaw(attributes: attributes)
}

class func defaultSearchBarTextAttributesSwifted() -> [NSAttributedString.Key: Any] {
return [
.font: WPStyleGuide.fixedFont(for: .body)
]
}

class func defaultSearchBarTextAttributesSwifted(_ color: UIColor) -> [NSAttributedString.Key: Any] {
var attributes = defaultSearchBarTextAttributesSwifted()

attributes[.foregroundColor] = color

return attributes
}

public struct ReaderCommentsNotificationSheet {
static let textColor = UIColor.label
static let descriptionLabelFont = fontForTextStyle(.subheadline)
Expand All @@ -33,17 +13,3 @@ extension WPStyleGuide {
static let switchInProgressTintColor = UIAppColor.primary
}
}

private extension NSAttributedString.Key {
/// Converts a collection of NSAttributedString Attributes, with 'NSAttributedStringKey' instances as 'Keys', into an
/// equivalent collection that uses regular 'String' instances as keys.
///
static func convertToRaw(attributes: [NSAttributedString.Key: Any]) -> [String: Any] {
var output = [String: Any]()
for (key, value) in attributes {
output[key.rawValue] = value
}

return output
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class SiteDesignContentCollectionViewController: CollapsableHeaderViewController
}

private func configureSkipButton() {
let skip = UIBarButtonItem(title: TextContent.skipButtonTitle, style: .done, target: self, action: #selector(skipButtonTapped))
let skip = UIBarButtonItem(title: TextContent.skipButtonTitle, style: .plain, target: self, action: #selector(skipButtonTapped))
navigationItem.rightBarButtonItem = skip
}

Expand All @@ -224,7 +224,7 @@ class SiteDesignContentCollectionViewController: CollapsableHeaderViewController
return
}

navigationItem.leftBarButtonItem = UIBarButtonItem(title: TextContent.cancelButtonTitle, style: .done, target: self, action: #selector(closeButtonTapped))
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(closeButtonTapped))
}

@objc
Expand Down Expand Up @@ -253,8 +253,6 @@ class SiteDesignContentCollectionViewController: CollapsableHeaderViewController
comment: "Shortened version of the main title to be used in back navigation.")
static let skipButtonTitle = NSLocalizedString("Skip",
comment: "Continue without making a selection.")
static let cancelButtonTitle = NSLocalizedString("Cancel",
comment: "Cancel site creation.")
static let errorTitle = NSLocalizedString("Unable to load this content right now.",
comment: "Informing the user that a network request failed because the device wasn't able to establish a network connection.")
static let errorSubtitle = NSLocalizedString("Check your network connection and try again.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ final class IntentCell: UITableViewCell, ModelSettableCell, NibLoadable {
}

private func commonInit() {
selectedBackgroundView?.backgroundColor = .clear
if #available(iOS 26, *) {
selectionStyle = .none
} else {
selectedBackgroundView?.backgroundColor = .clear
}

accessibilityTraits = .button
accessibilityHint = NSLocalizedString("Selects this topic as the intent for your site.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class SiteIntentViewController: CollapsableHeaderViewController {
let searchBar = UISearchBar()
searchBar.translatesAutoresizingMaskIntoConstraints = false
WPStyleGuide.configureSearchBar(searchBar, backgroundColor: .clear, returnKeyType: .search)
searchBar.setImage(UIImage(), for: .search, state: .normal)
if #unavailable(iOS 26) {
searchBar.setImage(UIImage(), for: .search, state: .normal)
}
return searchBar
}()

Expand Down Expand Up @@ -78,15 +80,9 @@ class SiteIntentViewController: CollapsableHeaderViewController {
// Title
navigationItem.backButtonTitle = Strings.backButtonTitle
// Skip button
navigationItem.rightBarButtonItem = UIBarButtonItem(title: Strings.skipButtonTitle,
style: .done,
target: self,
action: #selector(skipButtonTapped))
navigationItem.rightBarButtonItem = UIBarButtonItem(title: Strings.skipButtonTitle, style: .plain, target: self, action: #selector(skipButtonTapped))
// Cancel button
navigationItem.leftBarButtonItem = UIBarButtonItem(title: Strings.cancelButtonTitle,
style: .done,
target: self,
action: #selector(closeButtonTapped))
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(closeButtonTapped))
navigationItem.leftBarButtonItem?.accessibilityIdentifier = "site-intent-cancel-button"
}

Expand Down Expand Up @@ -132,8 +128,6 @@ extension SiteIntentViewController {
comment: "Shortened version of the main title to be used in back navigation")
static let skipButtonTitle = NSLocalizedString("Skip",
comment: "Continue without making a selection")
static let cancelButtonTitle = NSLocalizedString("Cancel",
comment: "Cancel site creation")
static let searchTextFieldPlaceholder = NSLocalizedString("E.g. Fashion, Poetry, Politics", comment: "Placeholder text for the search field int the Site Intent screen.")
static let continueButtonTitle = NSLocalizedString("Continue", comment: "Title of the continue button for the Site Intent screen.")
}
Expand Down