Skip to content

Commit ddd5887

Browse files
committed
chore(android): zoom image needs a hierarchy
1 parent e6a7408 commit ddd5887

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/zoomimage/index.android.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export * from './index-common';
22
import { ZoomImageBase, maxZoomScaleProperty, minZoomScaleProperty, zoomScaleProperty } from './index-common';
33

44
export class ZoomImg extends ZoomImageBase {
5+
_needUpdateHierarchy = true;
56
//@ts-ignore
67
nativeViewProtected: com.facebook.samples.zoomable.ZoomableDraweeView;
78
//@ts-ignore
@@ -24,14 +25,10 @@ export class ZoomImg extends ZoomImageBase {
2425
}
2526

2627
[minZoomScaleProperty.setNative](scale: number) {
27-
if (this.nativeViewProtected) {
28-
this.nativeViewProtected.getZoomableController().setMinScaleFactor(scale);
29-
}
28+
this.nativeViewProtected.getZoomableController().setMinScaleFactor(scale);
3029
}
3130

3231
[maxZoomScaleProperty.setNative](scale: number) {
33-
if (this.nativeViewProtected) {
34-
this.nativeViewProtected.getZoomableController().setMaxScaleFactor(scale);
35-
}
32+
this.nativeViewProtected.getZoomableController().setMaxScaleFactor(scale);
3633
}
3734
}

0 commit comments

Comments
 (0)