mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat: add traitCollectionDidChange to controllers
This commit is contained in:
@@ -393,10 +393,6 @@ class UINavigationControllerImpl extends UINavigationController {
|
||||
return controller;
|
||||
}
|
||||
|
||||
get owner(): Frame {
|
||||
return this._owner.get();
|
||||
}
|
||||
|
||||
@profile
|
||||
public viewWillAppear(animated: boolean): void {
|
||||
super.viewWillAppear(animated);
|
||||
@@ -532,6 +528,18 @@ class UINavigationControllerImpl extends UINavigationController {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public traitCollectionDidChange(previousTraitCollection: UITraitCollection): void {
|
||||
super.traitCollectionDidChange(previousTraitCollection);
|
||||
|
||||
const owner = this._owner.get();
|
||||
owner.notify({ eventName: "traitCollectionChanged", object: owner });
|
||||
console.log("---> UINavigationControllerImpl.traitCollectionDidChange()");
|
||||
|
||||
if (this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) {
|
||||
owner.notify({ eventName: "traitCollectionColorAppearanceChanged", object: owner });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _getTransitionId(nativeTransition: UIViewAnimationTransition, transitionType: string): string {
|
||||
|
||||
Reference in New Issue
Block a user