Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #112 from alexandrius/master
Browse files Browse the repository at this point in the history
Add optional hardware texture rendering on Android
  • Loading branch information
ArtemKolichenkov authored May 18, 2020
2 parents b33a818 + 84c01f6 commit 4432c94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default class App extends React.Component {
| minScale | number | minimum zoom scale | 0.6 |
| maxScale | number | maximum zoom scale | 10 |
| useNativeDriver | boolean | Whether to animate using [`useNativeDriver`](https://reactnative.dev/docs/animations#using-the-native-driver) | false |
| useHardwareTextureAndroid | boolean | for disabling rendering to hardware texture on Android | true |

| Method | params | Description |
| ---------- | --------- | ---------------------------------------------------------------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion src/image-zoom/image-zoom.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ export default class ImageViewer extends React.Component<Props, State> {
}}
{...this.imagePanResponder!.panHandlers}
>
<Animated.View style={animateConf} renderToHardwareTextureAndroid>
<Animated.View style={animateConf} renderToHardwareTextureAndroid={this.props.useHardwareTextureAndroid}>
<View
onLayout={this.handleLayout.bind(this)}
style={{
Expand Down
5 changes: 5 additions & 0 deletions src/image-zoom/image-zoom.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ export class Props {
*/
public enableCenterFocus?: boolean = true;

/**
* for disabling rendering to hardware texture on Android
*/
public useHardwareTextureAndroid?: boolean = true;

/**
* minimum zoom scale
*/
Expand Down

0 comments on commit 4432c94

Please sign in to comment.