Skip to content

Commit 68370d4

Browse files
committed
chore: refactoring
1 parent a60f2a1 commit 68370d4

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/dialogs/dialogs.ios.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,8 @@ function addButtonsToAlertController(alertController: MDCAlertController, option
167167

168168
function createAlertController(options: DialogOptions & MDCAlertControlerOptions, resolve?: Function) {
169169
const alertController = MDCAlertControllerImpl.alloc().init() as IMDCAlertControllerImpl;
170-
const colorScheme = themer.getAppColorScheme() as MDCSemanticColorScheme;
171-
const scheme = MDCContainerScheme.alloc().init();
172-
if (colorScheme) {
173-
scheme.colorScheme = colorScheme;
174-
}
175-
// Step 3: Apply the container scheme to your component using the desired alert style
176-
alertController.applyThemeWithScheme(scheme);
170+
alertController.mdc_adjustsFontForContentSizeCategory = true;
171+
177172
if (options.title) {
178173
alertController.title = options.title;
179174
}
@@ -266,7 +261,6 @@ function createAlertController(options: DialogOptions & MDCAlertControlerOptions
266261
(alertController.view as MDCAlertControllerView).contentInsets = UIEdgeInsetsZero;
267262
} else {
268263
alertController._disableContentInsets = true;
269-
270264
}
271265
}
272266
view.viewController = alertController; // needed to prevent a crash in layoutChild
@@ -528,13 +522,12 @@ export function login(arg: any): Promise<LoginResult> {
528522

529523
function showUIAlertController(alertController: MDCAlertController) {
530524
// themer needs to be applied after actions creation
531-
532-
const colorScheme: MDCSemanticColorScheme = themer.getAppColorScheme();
525+
const colorScheme = themer.getAppColorScheme() as MDCSemanticColorScheme;
526+
const scheme = MDCContainerScheme.alloc().init();
533527
if (colorScheme) {
534-
MDCAlertColorThemer.applySemanticColorSchemeToAlertController(colorScheme, alertController);
535-
// } else {
536-
// MDCAlertControllerThemer.applySchemeToAlertController(MDCAlertScheme.alloc().init(), alertController);
528+
scheme.colorScheme = colorScheme;
537529
}
530+
alertController.applyThemeWithScheme(scheme);
538531

539532
let currentView = getCurrentPage() || Application.getRootView();
540533

@@ -553,7 +546,6 @@ function showUIAlertController(alertController: MDCAlertController) {
553546
alertController.popoverPresentationController.sourceRect = CGRectMake(viewController.view.bounds.size.width / 2.0, viewController.view.bounds.size.height / 2.0, 1.0, 1.0);
554547
alertController.popoverPresentationController.permittedArrowDirections = 0;
555548
}
556-
557549
viewController.presentViewControllerAnimatedCompletion(alertController, true, null);
558550
}
559551
return viewController;

0 commit comments

Comments
 (0)