Skip to content

Commit 0720709

Browse files
committed
fix(ios): symbol effects wip
1 parent 71dfa15 commit 0720709

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

apps/toolbox/src/pages/image-handling.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ export function navigatingTo(args: EventData) {
1010

1111
export class DemoModel extends Observable {
1212
addingPhoto = false;
13-
symbolWiggleEffect: ImageSymbolEffects.Wiggle;
14-
symbolBounceEffect: ImageSymbolEffects.Bounce;
15-
symbolBreathEffect: ImageSymbolEffects.Breathe;
16-
symbolRotateEffect: ImageSymbolEffects.Rotate;
13+
symbolWiggleEffect = ImageSymbolEffects.Scale;
14+
symbolBounceEffect = ImageSymbolEffects.Bounce;
15+
symbolBreathEffect = ImageSymbolEffects.Breathe;
16+
symbolRotateEffect = ImageSymbolEffects.Rotate;
1717

1818
pickImage() {
1919
const context = create({

apps/toolbox/src/pages/image-handling.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
<!-- SF Symbols with Effects -->
1515
<ContentView height="1" width="100%" backgroundColor="#efefef" margin="10"></ContentView>
1616
<GridLayout rows="auto,auto,auto" columns="*,*">
17-
<Image src="sys://photo.on.rectangle.angled" width="100" tintColor="green" symbolEffect="{{symbolWiggleEffect}}" padding="8"/>
18-
<Image col="1" src="sys://steeringwheel.and.hands" width="100" tintColor="black" symbolEffect="{{symbolWiggleEffect}}" padding="8" />
17+
<Image src="sys://photo.on.rectangle.angled" width="100" tintColor="green" iosSymbolEffect="{{symbolWiggleEffect}}" padding="8"/>
18+
<Image col="1" src="sys://steeringwheel.and.hands" width="100" tintColor="black" iosSymbolEffect="{{symbolWiggleEffect}}" padding="8" />
1919

20-
<Image row="1" src="sys://airpods.pro.chargingcase.wireless.radiowaves.left.and.right.fill" width="100" symbolEffect="{{symbolBounceEffect}}" padding="8" />
21-
<Image row="1" col="1" src="sys://lungs.fill" width="100" symbolEffect="{{symbolBreathEffect}}" padding="8" />
20+
<Image row="1" src="sys://airpods.pro.chargingcase.wireless.radiowaves.left.and.right.fill" width="100" iosSymbolEffect="{{symbolBounceEffect}}" padding="8" />
21+
<Image row="1" col="1" src="sys://lungs.fill" width="100" iosSymbolEffect="{{symbolBreathEffect}}" padding="8" />
2222

2323

24-
<Image row="2" src="sys://clock.arrow.trianglehead.2.counterclockwise.rotate.90" width="100" symbolEffect="{{symbolRotateEffect}}" padding="8" />
25-
<Image row="2" col="1" src="sys://square.and.arrow.up" width="100" symbolEffect="{{symbolWiggleEffect}}" padding="8" />
24+
<Image row="2" src="sys://clock.arrow.trianglehead.2.counterclockwise.rotate.90" width="100" iosSymbolEffect="{{symbolRotateEffect}}" padding="8" />
25+
<Image row="2" col="1" src="sys://square.and.arrow.up" width="100" iosSymbolEffect="{{symbolWiggleEffect}}" padding="8" />
2626
</GridLayout>
2727
</ios>
2828

packages/core/ui/image/index.ios.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ export class Image extends ImageBase {
201201
return;
202202
}
203203
const symbol = typeof value === 'string' ? ImageSymbolEffect.fromSymbol(value) : value;
204-
if (symbol && symbol.effect) {
204+
if (symbol?.effect) {
205+
console.log('symbol.effect:', symbol.effect);
205206
this.nativeViewProtected.addSymbolEffectOptionsAnimatedCompletion(symbol.effect, symbol.options || NSSymbolEffectOptions.optionsWithRepeating(), true, symbol.completion || null);
206207
} else {
207208
this.nativeViewProtected.removeAllSymbolEffects();
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { ImageSymbolEffectCommon, ImageSymbolEffects } from './symbol-effects-common';
2-
import type { ImageSymbolEffect as ImageSymbolEffectDefinition } from './symbol-effects.d.ts';
3-
export { ImageSymbolEffects };
1+
import { ImageSymbolEffectCommon } from './symbol-effects-common';
2+
export { ImageSymbolEffects } from './symbol-effects-common';
43

5-
export const ImageSymbolEffect: typeof ImageSymbolEffectDefinition = class ImageSymbolEffect extends ImageSymbolEffectCommon implements ImageSymbolEffectDefinition {
6-
static fromSymbol(symbol: string): ImageSymbolEffectDefinition {
4+
export class ImageSymbolEffect extends ImageSymbolEffectCommon {
5+
static fromSymbol(symbol: string) {
76
return new ImageSymbolEffect();
87
}
9-
};
8+
}

packages/core/ui/image/symbol-effects.ios.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { SDK_VERSION } from '../../utils/constants';
22
import { ImageSymbolEffectCommon, ImageSymbolEffects } from './symbol-effects-common';
3-
import type { ImageSymbolEffect as ImageSymbolEffectDefinition } from './symbol-effects.d.ts';
3+
export { ImageSymbolEffects } from './symbol-effects-common';
44

5-
export const ImageSymbolEffect: typeof ImageSymbolEffectDefinition = class ImageSymbolEffect extends ImageSymbolEffectCommon implements ImageSymbolEffectDefinition {
5+
export class ImageSymbolEffect extends ImageSymbolEffectCommon {
66
constructor(symbol: NSSymbolEffect) {
77
super();
88
this.effect = symbol;
99
}
10-
static fromSymbol(symbol: string): ImageSymbolEffectDefinition | null {
10+
static fromSymbol(symbol: string): ImageSymbolEffect | null {
1111
if (SDK_VERSION < 17) {
1212
return null;
1313
}
@@ -92,4 +92,4 @@ export const ImageSymbolEffect: typeof ImageSymbolEffectDefinition = class Image
9292

9393
return null;
9494
}
95-
};
95+
}

0 commit comments

Comments
 (0)