mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
fix(ios): symbol effects wip
This commit is contained in:
@ -201,7 +201,8 @@ export class Image extends ImageBase {
|
||||
return;
|
||||
}
|
||||
const symbol = typeof value === 'string' ? ImageSymbolEffect.fromSymbol(value) : value;
|
||||
if (symbol && symbol.effect) {
|
||||
if (symbol?.effect) {
|
||||
console.log('symbol.effect:', symbol.effect);
|
||||
this.nativeViewProtected.addSymbolEffectOptionsAnimatedCompletion(symbol.effect, symbol.options || NSSymbolEffectOptions.optionsWithRepeating(), true, symbol.completion || null);
|
||||
} else {
|
||||
this.nativeViewProtected.removeAllSymbolEffects();
|
||||
|
@ -1,9 +1,8 @@
|
||||
import { ImageSymbolEffectCommon, ImageSymbolEffects } from './symbol-effects-common';
|
||||
import type { ImageSymbolEffect as ImageSymbolEffectDefinition } from './symbol-effects.d.ts';
|
||||
export { ImageSymbolEffects };
|
||||
import { ImageSymbolEffectCommon } from './symbol-effects-common';
|
||||
export { ImageSymbolEffects } from './symbol-effects-common';
|
||||
|
||||
export const ImageSymbolEffect: typeof ImageSymbolEffectDefinition = class ImageSymbolEffect extends ImageSymbolEffectCommon implements ImageSymbolEffectDefinition {
|
||||
static fromSymbol(symbol: string): ImageSymbolEffectDefinition {
|
||||
export class ImageSymbolEffect extends ImageSymbolEffectCommon {
|
||||
static fromSymbol(symbol: string) {
|
||||
return new ImageSymbolEffect();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { SDK_VERSION } from '../../utils/constants';
|
||||
import { ImageSymbolEffectCommon, ImageSymbolEffects } from './symbol-effects-common';
|
||||
import type { ImageSymbolEffect as ImageSymbolEffectDefinition } from './symbol-effects.d.ts';
|
||||
export { ImageSymbolEffects } from './symbol-effects-common';
|
||||
|
||||
export const ImageSymbolEffect: typeof ImageSymbolEffectDefinition = class ImageSymbolEffect extends ImageSymbolEffectCommon implements ImageSymbolEffectDefinition {
|
||||
export class ImageSymbolEffect extends ImageSymbolEffectCommon {
|
||||
constructor(symbol: NSSymbolEffect) {
|
||||
super();
|
||||
this.effect = symbol;
|
||||
}
|
||||
static fromSymbol(symbol: string): ImageSymbolEffectDefinition | null {
|
||||
static fromSymbol(symbol: string): ImageSymbolEffect | null {
|
||||
if (SDK_VERSION < 17) {
|
||||
return null;
|
||||
}
|
||||
@ -92,4 +92,4 @@ export const ImageSymbolEffect: typeof ImageSymbolEffectDefinition = class Image
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user