-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scroll-to-top button to Reader streams (#23957)
- Loading branch information
Showing
9 changed files
with
53 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
WordPress/Classes/ViewRelated/Reader/Cards/ReaderStreamBaseCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
WordPress/Classes/ViewRelated/Reader/ReaderButtonScrollToTop.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import UIKit | ||
|
||
final class ReaderButtonScrollToTop: UIButton { | ||
private var isButtonHidden = false | ||
|
||
static func make(closure: @escaping () -> Void) -> ReaderButtonScrollToTop { | ||
var configuration = UIButton.Configuration.bordered() | ||
configuration.image = UIImage(systemName: "arrow.up")? | ||
.withConfiguration(UIImage.SymbolConfiguration(pointSize: 12, weight: .regular)) | ||
configuration.cornerStyle = .capsule | ||
configuration.baseBackgroundColor = .secondarySystemBackground | ||
configuration.baseForegroundColor = .label | ||
configuration.contentInsets = .init(top: 10, leading: 10, bottom: 10, trailing: 10) | ||
|
||
return ReaderButtonScrollToTop(configuration: configuration, primaryAction: .init { _ in | ||
closure() | ||
WPAnalytics.track(.readerButtonScrollToTopTapped) | ||
}) | ||
} | ||
|
||
func setButtonHidden(_ isHidden: Bool, animated: Bool) { | ||
guard isButtonHidden != isHidden else { return } | ||
isButtonHidden = isHidden | ||
|
||
UIView.animate(withDuration: animated ? 0.33 : 0.0) { | ||
self.alpha = isHidden ? 0 : 1 | ||
self.isUserInteractionEnabled = !isHidden | ||
} | ||
} | ||
|
||
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool { | ||
bounds.insetBy(dx: -8, dy: -10).contains(point) | ||
} | ||
} |
62 changes: 0 additions & 62 deletions
62
...ted/System/Floating Create Button/FancyAlertViewController+CreateButtonAnnouncement.swift
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
...s/AppImages.xcassets/Illustrations/wp-illustration-ia-announcement.imageset/Contents.json
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-13.4 KB
...llustrations/wp-illustration-ia-announcement.imageset/wp-illustration-ia-announcement.pdf
Binary file not shown.