Skip to content

Commit 901c676

Browse files
authored
Fixes CMM-680: date pickers clipped on Touch ID devives (#24773)
1 parent 1a0f830 commit 901c676

9 files changed

Lines changed: 97 additions & 216 deletions

Modules/Sources/JetpackStats/Views/LegacyFloatingDateControl.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ struct LegacyFloatingDateControl: View {
1919
Spacer(minLength: 8)
2020
navigationControls
2121
}
22+
.modifier(MinimumBottomSafeArea(minPadding: 16))
2223
.dynamicTypeSize(...DynamicTypeSize.xLarge)
2324
.padding(.horizontal, 24)
2425
.background {
@@ -159,6 +160,24 @@ private struct StatsDateRangeTip: Tip {
159160
}
160161
}
161162

163+
private struct MinimumBottomSafeArea: ViewModifier {
164+
let minPadding: CGFloat
165+
166+
@State private var bottomInset: CGFloat = 0
167+
168+
func body(content: Content) -> some View {
169+
content
170+
.padding(.bottom, bottomInset == 0 ? minPadding : 0)
171+
.overlay(
172+
GeometryReader { geometry in
173+
Color.clear.onAppear {
174+
self.bottomInset = geometry.safeAreaInsets.bottom
175+
}
176+
}
177+
)
178+
}
179+
}
180+
162181
private extension View {
163182
func floatingStyle(cornerRadius: CGFloat = 40) -> some View {
164183
modifier(FloatingStyle(cornerRadius: cornerRadius))

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
26.2
22
-----
33
* [*] New Stats: Add support for "weeks" granularity [#24767]
4+
* [*] New Stats: Fix an issue with date controls clipped on Touch ID devices [#24773]
45
* [*] New Stats: Fix dark mode support in custom range picker [#24770]
56
* [*] New Stats: Fix edit card menu shown in the wrong places [#24774]
67
* [*] Fix Split View mode on iPad on some scenarios in portrait mode [#24705]

WordPress/Classes/ViewRelated/Stats/Insights/SiteStatsInsightsTableViewController.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import WordPressKit
44
import WordPressFlux
55
import WordPressUI
66

7-
class SiteStatsInsightsTableViewController: SiteStatsBaseTableViewController, StoryboardLoadable {
8-
static var defaultStoryboardName: String = "SiteStatsDashboard"
9-
7+
class SiteStatsInsightsTableViewController: SiteStatsBaseTableViewController {
108
weak var bannerView: JetpackBannerView?
119

1210
var isGrowAudienceShowing: Bool {
@@ -54,6 +52,17 @@ class SiteStatsInsightsTableViewController: SiteStatsBaseTableViewController, St
5452
return ImmuTableDiffableViewHandler(takeOver: self, with: analyticsTracker)
5553
}()
5654

55+
// MARK: - Initialization
56+
57+
init() {
58+
super.init(nibName: nil, bundle: nil)
59+
tableStyle = .insetGrouped
60+
}
61+
62+
required init?(coder: NSCoder) {
63+
fatalError("init(coder:) has not been implemented")
64+
}
65+
5766
// MARK: - View
5867

5968
override func viewDidLoad() {

WordPress/Classes/ViewRelated/Stats/Period Stats/SiteStatsPeriodTableViewController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ protocol SiteStatsReferrerDelegate: AnyObject {
1818
}
1919

2020
final class SiteStatsPeriodTableViewController: SiteStatsBaseTableViewController {
21-
static var defaultStoryboardName: String = "SiteStatsDashboard"
22-
2321
weak var bannerView: JetpackBannerView?
2422

2523
// MARK: - Properties

WordPress/Classes/ViewRelated/Stats/SiteStatsDashboard.storyboard

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)