use `showControls` to show/hide live text icon on ios (#2982)
parent
bdb63fff6d
commit
9c5cd391dd
|
@ -37,6 +37,7 @@ type Props = {
|
|||
onTap: () => void
|
||||
onZoom: (isZoomed: boolean) => void
|
||||
isScrollViewBeingDragged: boolean
|
||||
showControls: boolean
|
||||
}
|
||||
const ImageItem = ({
|
||||
imageSrc,
|
||||
|
|
|
@ -37,11 +37,18 @@ type Props = {
|
|||
onTap: () => void
|
||||
onZoom: (scaled: boolean) => void
|
||||
isScrollViewBeingDragged: boolean
|
||||
showControls: boolean
|
||||
}
|
||||
|
||||
const AnimatedImage = Animated.createAnimatedComponent(Image)
|
||||
|
||||
const ImageItem = ({imageSrc, onTap, onZoom, onRequestClose}: Props) => {
|
||||
const ImageItem = ({
|
||||
imageSrc,
|
||||
onTap,
|
||||
onZoom,
|
||||
onRequestClose,
|
||||
showControls,
|
||||
}: Props) => {
|
||||
const scrollViewRef = useAnimatedRef<Animated.ScrollView>()
|
||||
const translationY = useSharedValue(0)
|
||||
const [loaded, setLoaded] = useState(false)
|
||||
|
@ -144,7 +151,7 @@ const ImageItem = ({imageSrc, onTap, onZoom, onRequestClose}: Props) => {
|
|||
accessibilityLabel={imageSrc.alt}
|
||||
accessibilityHint=""
|
||||
onLoad={() => setLoaded(true)}
|
||||
enableLiveTextInteraction={!scaled}
|
||||
enableLiveTextInteraction={showControls && !scaled}
|
||||
/>
|
||||
</Animated.ScrollView>
|
||||
</GestureDetector>
|
||||
|
|
|
@ -10,6 +10,7 @@ type Props = {
|
|||
onTap: () => void
|
||||
onZoom: (scaled: boolean) => void
|
||||
isScrollViewBeingDragged: boolean
|
||||
showControls: boolean
|
||||
}
|
||||
|
||||
const ImageItem = (_props: Props) => {
|
||||
|
|
|
@ -122,6 +122,7 @@ function ImageViewing({
|
|||
imageSrc={imageSrc}
|
||||
onRequestClose={onRequestClose}
|
||||
isScrollViewBeingDragged={isDragging}
|
||||
showControls={showControls}
|
||||
/>
|
||||
</View>
|
||||
))}
|
||||
|
|
Loading…
Reference in New Issue