Merge remote-tracking branch 'origin/main' into feat/ios26-glass-effects

This commit is contained in:
Nathan Walker
2025-09-14 11:35:32 -07:00
39 changed files with 2652 additions and 48 deletions

View File

@@ -17,7 +17,7 @@ function addButtonsToAlertController(alertController: UIAlertController, options
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(options.cancelButtonText, UIAlertActionStyle.Default, () => {
raiseCallback(callback, false);
})
}),
);
}
@@ -25,16 +25,16 @@ function addButtonsToAlertController(alertController: UIAlertController, options
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(options.neutralButtonText, UIAlertActionStyle.Default, () => {
raiseCallback(callback, undefined);
})
}),
);
}
if (isString(options.okButtonText)) {
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(options.okButtonText, UIAlertActionStyle.Default, () => {
raiseCallback(callback, true);
})
);
const action = UIAlertAction.actionWithTitleStyleHandler(options.okButtonText, UIAlertActionStyle.Default, () => {
raiseCallback(callback, true);
});
alertController.addAction(action);
alertController.preferredAction = action; // Allows using keyboard enter/return to confirm the dialog
}
}
@@ -91,7 +91,7 @@ export function alert(arg: any): Promise<void> {
title: DialogStrings.ALERT,
okButtonText: DialogStrings.OK,
message: arg + '',
}
}
: arg;
const alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, UIAlertControllerStyle.Alert);
@@ -115,7 +115,7 @@ export function confirm(arg: any): Promise<boolean> {
okButtonText: DialogStrings.OK,
cancelButtonText: DialogStrings.CANCEL,
message: arg + '',
}
}
: arg;
const alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, UIAlertControllerStyle.Alert);
@@ -301,7 +301,7 @@ export function action(...args): Promise<string> {
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(action, dialogType, (arg: UIAlertAction) => {
resolve(arg.title);
})
}),
);
}
}
@@ -311,7 +311,7 @@ export function action(...args): Promise<string> {
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(options.cancelButtonText, UIAlertActionStyle.Cancel, (arg: UIAlertAction) => {
resolve(arg.title);
})
}),
);
}

View File

@@ -67,7 +67,7 @@ export const placeholderColorProperty = new CssProperty<Style, Color>({
});
placeholderColorProperty.register(Style);
const keyboardTypeConverter = makeParser<CoreTypes.KeyboardInputType>(makeValidator<CoreTypes.KeyboardInputType>(CoreTypes.KeyboardType.datetime, CoreTypes.KeyboardType.phone, CoreTypes.KeyboardType.number, CoreTypes.KeyboardType.url, CoreTypes.KeyboardType.email, CoreTypes.KeyboardType.integer), true);
const keyboardTypeConverter = makeParser<CoreTypes.KeyboardInputType>(makeValidator<CoreTypes.KeyboardInputType>(CoreTypes.KeyboardType.datetime, CoreTypes.KeyboardType.phone, CoreTypes.KeyboardType.number, CoreTypes.KeyboardType.decimal, CoreTypes.KeyboardType.url, CoreTypes.KeyboardType.email, CoreTypes.KeyboardType.integer), true);
export const autofillTypeProperty = new Property<EditableTextBase, CoreTypes.AutofillType>({ name: 'autofillType' });
autofillTypeProperty.register(EditableTextBase);

View File

@@ -204,7 +204,7 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
[keyboardTypeProperty.getDefault](): number {
return this.nativeTextViewProtected.getInputType();
}
[keyboardTypeProperty.setNative](value: 'datetime' | 'phone' | 'number' | 'url' | 'email' | 'integer' | number) {
[keyboardTypeProperty.setNative](value: 'datetime' | 'phone' | 'number' | 'decimal' | 'url' | 'email' | 'integer' | number) {
let newInputType;
switch (value) {
@@ -220,6 +220,10 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
newInputType = android.text.InputType.TYPE_CLASS_NUMBER | android.text.InputType.TYPE_NUMBER_VARIATION_NORMAL | android.text.InputType.TYPE_NUMBER_FLAG_SIGNED | android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL;
break;
case 'decimal':
newInputType = android.text.InputType.TYPE_CLASS_NUMBER | android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL | android.text.InputType.TYPE_NUMBER_FLAG_SIGNED;
break;
case 'url':
newInputType = android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_URI;
break;

View File

@@ -34,7 +34,7 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
return keyboardType.toString();
}
}
[keyboardTypeProperty.setNative](value: 'datetime' | 'phone' | 'number' | 'url' | 'email' | 'integer' | string) {
[keyboardTypeProperty.setNative](value: 'datetime' | 'phone' | 'number' | 'decimal' | 'url' | 'email' | 'integer' | string) {
let newKeyboardType: UIKeyboardType;
switch (value) {
case 'datetime':
@@ -49,6 +49,10 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
newKeyboardType = UIKeyboardType.NumbersAndPunctuation;
break;
case 'decimal':
newKeyboardType = UIKeyboardType.DecimalPad;
break;
case 'url':
newKeyboardType = UIKeyboardType.URL;
break;

View File

@@ -78,6 +78,9 @@ export class TextField extends TextFieldBase {
case 'number':
inputType = android.text.InputType.TYPE_CLASS_NUMBER | android.text.InputType.TYPE_NUMBER_VARIATION_NORMAL | android.text.InputType.TYPE_NUMBER_FLAG_SIGNED | android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL;
break;
case 'decimal':
inputType = android.text.InputType.TYPE_CLASS_NUMBER | android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL | android.text.InputType.TYPE_NUMBER_FLAG_SIGNED;
break;
case 'url':
inputType = android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_URI;
break;

View File

@@ -262,9 +262,22 @@ export class PageTransition extends Transition {
newFragment.setSharedElementEnterTransition(transitionSet);
newFragment.setSharedElementReturnTransition(transitionSet);
// Guard against duplicate shared element names being added to the same transaction
const addedSharedElementNames = new Set();
presenting.forEach((v) => {
const name = v?.sharedTransitionTag;
const nativeView = v?.nativeView;
if (!name || !nativeView || addedSharedElementNames.has(name)) {
// prevent duplicates or invalid items
return;
}
setTransitionName(v);
fragmentTransaction.addSharedElement(v.nativeView, v.sharedTransitionTag);
try {
fragmentTransaction.addSharedElement(nativeView, name);
addedSharedElementNames.add(name);
} catch (err) {
// ignore duplicates or issues adding shared element to avoid crashing
}
});
if (toPage.isLoaded) {
onPageLoaded();