Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fluent2-tokens] Merging main -> fluent2-tokens branch #1416

Merged
merged 22 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4fad398
Drop support for iOS 14 and remove availability checks (#1357)
huwilkes Nov 12, 2022
e0b09a5
Make ShimmerLinesView inherit ShimmerView init (#1362)
jeaniehuynh Nov 15, 2022
42700d7
Bring fluent2-tokens Segmented Control to main (#1363)
huwilkes Nov 16, 2022
595c7e7
Add demo to show notification bar from top (#1364)
jeaniehuynh Nov 16, 2022
67f385a
Update PR Template to include binary change (#1368)
huwilkes Nov 16, 2022
7b969ee
Fix PersonaListViewDemoController navigation bar transparency bug (#1…
laminesm Nov 16, 2022
4d8816c
Remove retain cycles (#1374)
mischreiber Nov 17, 2022
b61434f
update xcode version to 14.1 for ci (#1371) (#1378)
harrieshin Nov 17, 2022
b72f51e
Implement the Unread Dot for TabBar and SideTabBar (#1349)
edjamesmsft Nov 17, 2022
242ba39
Add isViewLoaded check (#1379)
laminesm Nov 17, 2022
3222188
Revert "Drop support for iOS 14 and remove availability checks (#1357…
huwilkes Nov 18, 2022
c92abb7
Defensive fixes for a UIViewPropertyAnimator crash (#1385)
lcapkovic Nov 21, 2022
c710b95
Latest localized resource files from Touchdown Build (#1388)
github-actions[bot] Nov 22, 2022
e6f220c
Fix linting issue (#1393)
laminesm Nov 23, 2022
f4e3435
Latest localized resource files from Touchdown Build (#1391)
github-actions[bot] Nov 23, 2022
16d1da2
Update demo page cell style (#1389)
laminesm Nov 23, 2022
d211055
Fix bottom sheet host height change detection (#1396)
lcapkovic Nov 23, 2022
6dac60b
Latest localized resource files from Touchdown Build (#1400)
github-actions[bot] Nov 24, 2022
ae56f02
Latest localized resource files from Touchdown Build (#1401)
github-actions[bot] Nov 28, 2022
2e5cff7
Fix PopupMenuItemCell's token sink to not overwrite custom colors (#1…
huwilkes Nov 28, 2022
5c1f841
Fix Segmented Control unread dot for icons (#1408)
huwilkes Nov 30, 2022
9148797
Merging main into fluent2-tokens
sophialee0416 Nov 30, 2022
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 @@ -98,6 +98,8 @@ class DemoListViewController: DemoTableViewController {
let demo = DemoControllerSection.allCases[indexPath.section].rows[indexPath.row]
cell.setup(title: demo.title, accessoryType: .disclosureIndicator)
cell.titleNumberOfLinesForLargerDynamicType = 2
cell.backgroundStyleType = .grouped

return cell
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import UIKit
class SegmentedControlDemoController: DemoController {
let segmentItems: [SegmentItem] = [
SegmentItem(title: "First"),
SegmentItem(title: "Second", image: UIImage(named: "Placeholder_20")),
SegmentItem(title: "Second", image: UIImage(named: "Placeholder_20"), isUnread: true),
SegmentItem(title: "Third", isUnread: true),
SegmentItem(title: "Fourth"),
SegmentItem(title: "Fifth"),
Expand Down
47 changes: 27 additions & 20 deletions ios/FluentUI/Bottom Sheet/BottomSheetController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ public class BottomSheetController: UIViewController {
animator = stateChangeAnimator(to: targetState)

currentStateChangeAnimator = animator
animator?.addCompletion { [weak self] finalPosition in
self?.currentStateChangeAnimator = nil
animator?.addCompletion { finalPosition in
completion?(finalPosition)
}
}
Expand Down Expand Up @@ -470,6 +469,18 @@ public class BottomSheetController: UIViewController {
}

public override func viewDidLayoutSubviews() {
let newHeight = view.bounds.height
if currentRootViewHeight != newHeight && currentExpansionState == .transitioning {
// The view height has changed and we can't guarantee the animation target frame is valid anymore.
// Let's complete animations and cancel ongoing gestures to guarantee we end up in a good state.
completeAnimationsIfNeeded(skipToEnd: true)

if panGestureRecognizer.state != .possible {
panGestureRecognizer.state = .cancelled
}
}
currentRootViewHeight = newHeight

// In the transitioning state a pan gesture or an animator temporarily owns the sheet frame updates,
// so to avoid interfering we won't update the frame here.
if currentExpansionState != .transitioning {
Expand All @@ -480,27 +491,15 @@ public class BottomSheetController: UIViewController {
updateDimmingViewAccessibility()
}
collapsedHeightInSafeArea = view.safeAreaLayoutGuide.layoutFrame.maxY - offset(for: .collapsed)

super.viewDidLayoutSubviews()
}

public override func viewSafeAreaInsetsDidChange() {
super.viewSafeAreaInsetsDidChange()
completeAnimationsIfNeeded(skipToEnd: true)
}

public override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)

if size.height != view.frame.height && currentExpansionState == .transitioning {
// The view is resizing and we can't guarantee the animation target frame is valid anymore.
// Completing the animation ensures the sheet will be correctly positioned on the next layout pass
completeAnimationsIfNeeded(skipToEnd: true)

if panGestureRecognizer.state != .possible {
panGestureRecognizer.state = .cancelled
}
}
}

public override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
super.willTransition(to: newCollection, with: coordinator)
completeAnimationsIfNeeded(skipToEnd: true)
Expand Down Expand Up @@ -733,9 +732,6 @@ public class BottomSheetController: UIViewController {

if animated {
currentStateChangeAnimator = animator
animator.addCompletion { [weak self] _ in
self?.currentStateChangeAnimator = nil
}
animator.startAnimation()
} else {
animator.startAnimation() // moves the animator into active state so it can be stopped
Expand Down Expand Up @@ -790,6 +786,13 @@ public class BottomSheetController: UIViewController {
guard let strongSelf = self else {
return
}

// It's important we drop the reference to the animator as early as possible.
// Otherwise we could accidentally try modifying the animator while it's calling out to its completion handler, which can lead to a crash.
if let animator = strongSelf.currentStateChangeAnimator, animator == translationAnimator {
strongSelf.currentStateChangeAnimator = nil
}

strongSelf.targetExpansionState = nil
strongSelf.panGestureRecognizer.isEnabled = strongSelf.isExpandable
strongSelf.handleCompletedStateChange(to: finalPosition == .start ? originalExpansionState : targetExpansionState,
Expand Down Expand Up @@ -849,7 +852,7 @@ public class BottomSheetController: UIViewController {
}

private func completeAnimationsIfNeeded(skipToEnd: Bool = false) {
if let currentAnimator = currentStateChangeAnimator, currentAnimator.isRunning {
if let currentAnimator = currentStateChangeAnimator, currentAnimator.isRunning, currentAnimator.state == .active {
let endPosition: UIViewAnimatingPosition = currentAnimator.isReversed ? .start : .end
currentAnimator.stopAnimation(false)
currentAnimator.finishAnimation(at: skipToEnd ? endPosition : .current)
Expand Down Expand Up @@ -969,6 +972,10 @@ public class BottomSheetController: UIViewController {
bottomSheetView.frame.minY
}

// Only used for height change detection.
// For all other cases you should probably directly use self.view.bounds.height.
private var currentRootViewHeight: CGFloat = 0

private let shouldShowDimmingView: Bool

private struct Constants {
Expand Down
4 changes: 4 additions & 0 deletions ios/FluentUI/Drawer/DrawerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ open class DrawerController: UIViewController, TokenizedControlInternal {
return UIColor(dynamicColor: color)
}
set {
if isViewLoaded {
view.backgroundColor = backgroundColor
}

guard let newColor = newValue.dynamicColor else {
return
}
Expand Down
8 changes: 8 additions & 0 deletions ios/FluentUI/Popup Menu/PopupMenuItemCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ class PopupMenuItemCell: TableViewCell, PopupMenuItemTemplateCell {

// until popupmenuitemcell actually supports token system, clients will override colors via cell's backgroundColor property
backgroundStyleType = .custom

tokenSetSink = tokenSet.sinkChanges { [weak self] in
guard let strongSelf = self else {
return
}
strongSelf.updateAppearance()
strongSelf.updateSelectionColors()
}
}

func setup(item: PopupMenuTemplateItem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
"Accessibility.ActivityIndicator.Animating.label" = "قيد التقدم";
"Accessibility.ActivityIndicator.Stopped.label" = "تم إيقاف التقدم";

/* Accessibility alert for common use */
"Accessibility.Alert" = "تنبيه";
/* Accessibility dismiss label for common use */
"Accessibility.Dismiss.Label" = "تجاهل";
/* Accessibility dismiss hint for common use */
"Accessibility.Dismiss.Hint" = "اضغط ضغطاً مزدوجاً للتجاهل";
/* Accessibility done label for common use */
"Accessibility.Done.Label" = "تم";
/* Accessibility multi select hint for common use */
"Accessibility.MultiSelect.Hint" = "اضغط ضغطاً مزدوجاً برفق لتبديل التحديد";

/* Accessibility label for the upper calendar date picker view. */
Expand Down Expand Up @@ -117,6 +122,9 @@
/* Format string for tab bar item accessbility labels. Format: "<Title>, <BadgeValue> items". Example: "Home, 5 items" */
"Accessibility.TabBarItemView.LabelFormat" = "%@، %@ من العناصر";

/* Accessibility hint for TabBarItem in TabBarItemView. Indicates whether the item is unread or not. Format: "<Title>, unread". Example: "Files, unread" */
"Accessibility.TabBarItemView.UnreadFormat" = "%@, غير مقروء";

/* Format string for badge label button accessibility label. Format: "<Item Accessibility>, <Badge Label Accessibility>". Example: "Notifications, 5 new notifications" */
"Accessibility.BadgeLabelButton.LabelFormat" = "%@, %@";

Expand Down Expand Up @@ -150,7 +158,7 @@
/* Day and time format string. Example: "Fri at 11:00 AM" */
"Date.FormatDayTime" = "%@ الساعة %@";

// MSPersonaListView
/* MSPersonaListView cell title: search(action) the directory */
"MSPersonaListView.SearchDirectory" = "البحث في الدليل";

/* MSDateTimePicker label for the start time of a date range */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
"Accessibility.ActivityIndicator.Animating.label" = "En curs";
"Accessibility.ActivityIndicator.Stopped.label" = "S'ha aturat el progrés";

/* Accessibility alert for common use */
"Accessibility.Alert" = "Alerta";
/* Accessibility dismiss label for common use */
"Accessibility.Dismiss.Label" = "Descarta";
/* Accessibility dismiss hint for common use */
"Accessibility.Dismiss.Hint" = "Toqueu dues vegades per descartar-ho.";
/* Accessibility done label for common use */
"Accessibility.Done.Label" = "Fet";
/* Accessibility multi select hint for common use */
"Accessibility.MultiSelect.Hint" = "Toca dues vegades per commutar la selecció";

/* Accessibility label for the upper calendar date picker view. */
Expand Down Expand Up @@ -117,6 +122,9 @@
/* Format string for tab bar item accessbility labels. Format: "<Title>, <BadgeValue> items". Example: "Home, 5 items" */
"Accessibility.TabBarItemView.LabelFormat" = "%@, %@ elements";

/* Accessibility hint for TabBarItem in TabBarItemView. Indicates whether the item is unread or not. Format: "<Title>, unread". Example: "Files, unread" */
"Accessibility.TabBarItemView.UnreadFormat" = "%@, sense llegir";

/* Format string for badge label button accessibility label. Format: "<Item Accessibility>, <Badge Label Accessibility>". Example: "Notifications, 5 new notifications" */
"Accessibility.BadgeLabelButton.LabelFormat" = "%@, %@";

Expand Down Expand Up @@ -150,7 +158,7 @@
/* Day and time format string. Example: "Fri at 11:00 AM" */
"Date.FormatDayTime" = "El %@ a les %@";

// MSPersonaListView
/* MSPersonaListView cell title: search(action) the directory */
"MSPersonaListView.SearchDirectory" = "Cerca al directori";

/* MSDateTimePicker label for the start time of a date range */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
"Accessibility.ActivityIndicator.Animating.label" = "Probíhá";
"Accessibility.ActivityIndicator.Stopped.label" = "Průběh zastaven";

/* Accessibility alert for common use */
"Accessibility.Alert" = "Upozornění";
/* Accessibility dismiss label for common use */
"Accessibility.Dismiss.Label" = "Zavřít";
/* Accessibility dismiss hint for common use */
"Accessibility.Dismiss.Hint" = "Poklepáním zavřete.";
/* Accessibility done label for common use */
"Accessibility.Done.Label" = "Hotovo";
/* Accessibility multi select hint for common use */
"Accessibility.MultiSelect.Hint" = "Výběr přepnete dvojitým poklepáním";

/* Accessibility label for the upper calendar date picker view. */
Expand Down Expand Up @@ -117,6 +122,9 @@
/* Format string for tab bar item accessbility labels. Format: "<Title>, <BadgeValue> items". Example: "Home, 5 items" */
"Accessibility.TabBarItemView.LabelFormat" = "%@, počet položek: %@";

/* Accessibility hint for TabBarItem in TabBarItemView. Indicates whether the item is unread or not. Format: "<Title>, unread". Example: "Files, unread" */
"Accessibility.TabBarItemView.UnreadFormat" = "%@, nepřečtené";

/* Format string for badge label button accessibility label. Format: "<Item Accessibility>, <Badge Label Accessibility>". Example: "Notifications, 5 new notifications" */
"Accessibility.BadgeLabelButton.LabelFormat" = "%@, %@";

Expand Down Expand Up @@ -150,7 +158,7 @@
/* Day and time format string. Example: "Fri at 11:00 AM" */
"Date.FormatDayTime" = "%@ v %@";

// MSPersonaListView
/* MSPersonaListView cell title: search(action) the directory */
"MSPersonaListView.SearchDirectory" = "Prohledat adresář";

/* MSDateTimePicker label for the start time of a date range */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
"Accessibility.ActivityIndicator.Animating.label" = "Igangværende";
"Accessibility.ActivityIndicator.Stopped.label" = "Status er standset";

/* Accessibility alert for common use */
"Accessibility.Alert" = "Underretning";
/* Accessibility dismiss label for common use */
"Accessibility.Dismiss.Label" = "Afvis";
/* Accessibility dismiss hint for common use */
"Accessibility.Dismiss.Hint" = "Dobbelttryk for at afvise";
/* Accessibility done label for common use */
"Accessibility.Done.Label" = "Udført";
/* Accessibility multi select hint for common use */
"Accessibility.MultiSelect.Hint" = "Dobbelttryk for at skifte valg ";

/* Accessibility label for the upper calendar date picker view. */
Expand Down Expand Up @@ -117,6 +122,9 @@
/* Format string for tab bar item accessbility labels. Format: "<Title>, <BadgeValue> items". Example: "Home, 5 items" */
"Accessibility.TabBarItemView.LabelFormat" = "%@, %@ elementer";

/* Accessibility hint for TabBarItem in TabBarItemView. Indicates whether the item is unread or not. Format: "<Title>, unread". Example: "Files, unread" */
"Accessibility.TabBarItemView.UnreadFormat" = "%@, ulæst";

/* Format string for badge label button accessibility label. Format: "<Item Accessibility>, <Badge Label Accessibility>". Example: "Notifications, 5 new notifications" */
"Accessibility.BadgeLabelButton.LabelFormat" = "%@, %@";

Expand Down Expand Up @@ -150,7 +158,7 @@
/* Day and time format string. Example: "Fri at 11:00 AM" */
"Date.FormatDayTime" = "%@ kl. %@";

// MSPersonaListView
/* MSPersonaListView cell title: search(action) the directory */
"MSPersonaListView.SearchDirectory" = "Søg i mappen";

/* MSDateTimePicker label for the start time of a date range */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
"Accessibility.ActivityIndicator.Animating.label" = "In Bearbeitung";
"Accessibility.ActivityIndicator.Stopped.label" = "Bearbeitung angehalten";

/* Accessibility alert for common use */
"Accessibility.Alert" = "Warnung";
/* Accessibility dismiss label for common use */
"Accessibility.Dismiss.Label" = "Schließen";
/* Accessibility dismiss hint for common use */
"Accessibility.Dismiss.Hint" = "Zum Schließen doppeltippen.";
/* Accessibility done label for common use */
"Accessibility.Done.Label" = "Fertig";
/* Accessibility multi select hint for common use */
"Accessibility.MultiSelect.Hint" = "Zum Umschalten der Auswahl doppelt tippen";

/* Accessibility label for the upper calendar date picker view. */
Expand Down Expand Up @@ -117,6 +122,9 @@
/* Format string for tab bar item accessbility labels. Format: "<Title>, <BadgeValue> items". Example: "Home, 5 items" */
"Accessibility.TabBarItemView.LabelFormat" = "%@, %@ Elemente";

/* Accessibility hint for TabBarItem in TabBarItemView. Indicates whether the item is unread or not. Format: "<Title>, unread". Example: "Files, unread" */
"Accessibility.TabBarItemView.UnreadFormat" = "%@, ungelesen";

/* Format string for badge label button accessibility label. Format: "<Item Accessibility>, <Badge Label Accessibility>". Example: "Notifications, 5 new notifications" */
"Accessibility.BadgeLabelButton.LabelFormat" = "%@, %@";

Expand Down Expand Up @@ -150,7 +158,7 @@
/* Day and time format string. Example: "Fri at 11:00 AM" */
"Date.FormatDayTime" = "%@ um %@";

// MSPersonaListView
/* MSPersonaListView cell title: search(action) the directory */
"MSPersonaListView.SearchDirectory" = "Verzeichnis durchsuchen";

/* MSDateTimePicker label for the start time of a date range */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
"Accessibility.ActivityIndicator.Animating.label" = "Σε εξέλιξη";
"Accessibility.ActivityIndicator.Stopped.label" = "Η πρόοδος διεκόπη";

/* Accessibility alert for common use */
"Accessibility.Alert" = "Ειδοποίηση";
/* Accessibility dismiss label for common use */
"Accessibility.Dismiss.Label" = "Κλείσιμο";
/* Accessibility dismiss hint for common use */
"Accessibility.Dismiss.Hint" = "Πατήστε δύο φορές για κλείσιμο";
/* Accessibility done label for common use */
"Accessibility.Done.Label" = "Τέλος";
/* Accessibility multi select hint for common use */
"Accessibility.MultiSelect.Hint" = "Πατήστε δύο φορές για εναλλαγή της επιλογής";

/* Accessibility label for the upper calendar date picker view. */
Expand Down Expand Up @@ -117,6 +122,9 @@
/* Format string for tab bar item accessbility labels. Format: "<Title>, <BadgeValue> items". Example: "Home, 5 items" */
"Accessibility.TabBarItemView.LabelFormat" = "%@, %@ στοιχεία";

/* Accessibility hint for TabBarItem in TabBarItemView. Indicates whether the item is unread or not. Format: "<Title>, unread". Example: "Files, unread" */
"Accessibility.TabBarItemView.UnreadFormat" = "%@, μη αναγνωσμένο";

/* Format string for badge label button accessibility label. Format: "<Item Accessibility>, <Badge Label Accessibility>". Example: "Notifications, 5 new notifications" */
"Accessibility.BadgeLabelButton.LabelFormat" = "%@, %@";

Expand Down Expand Up @@ -150,7 +158,7 @@
/* Day and time format string. Example: "Fri at 11:00 AM" */
"Date.FormatDayTime" = "%@ στις %@";

// MSPersonaListView
/* MSPersonaListView cell title: search(action) the directory */
"MSPersonaListView.SearchDirectory" = "Αναζήτηση στον κατάλογο";

/* MSDateTimePicker label for the start time of a date range */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
"Accessibility.ActivityIndicator.Animating.label" = "In progress";
"Accessibility.ActivityIndicator.Stopped.label" = "Progress halted";

/* Accessibility alert for common use */
"Accessibility.Alert" = "Alert";
/* Accessibility dismiss label for common use */
"Accessibility.Dismiss.Label" = "Dismiss";
/* Accessibility dismiss hint for common use */
"Accessibility.Dismiss.Hint" = "Double tap to dismiss";
/* Accessibility done label for common use */
"Accessibility.Done.Label" = "Done";
/* Accessibility multi select hint for common use */
"Accessibility.MultiSelect.Hint" = "Double tap to toggle selection";

/* Accessibility label for the upper calendar date picker view. */
Expand Down Expand Up @@ -117,6 +122,9 @@
/* Format string for tab bar item accessbility labels. Format: "<Title>, <BadgeValue> items". Example: "Home, 5 items" */
"Accessibility.TabBarItemView.LabelFormat" = "%@, %@ items";

/* Accessibility hint for TabBarItem in TabBarItemView. Indicates whether the item is unread or not. Format: "<Title>, unread". Example: "Files, unread" */
"Accessibility.TabBarItemView.UnreadFormat" = "%@, unread";

/* Format string for badge label button accessibility label. Format: "<Item Accessibility>, <Badge Label Accessibility>". Example: "Notifications, 5 new notifications" */
"Accessibility.BadgeLabelButton.LabelFormat" = "%@, %@";

Expand Down Expand Up @@ -150,7 +158,7 @@
/* Day and time format string. Example: "Fri at 11:00 AM" */
"Date.FormatDayTime" = "%@ at %@";

// MSPersonaListView
/* MSPersonaListView cell title: search(action) the directory */
"MSPersonaListView.SearchDirectory" = "Search Directory";

/* MSDateTimePicker label for the start time of a date range */
Expand Down
Loading