From 4b97137eee9a46ebcd0fe4d2c5a473febb4377bb Mon Sep 17 00:00:00 2001 From: AbilashK Date: Fri, 19 Feb 2016 06:27:31 -0800 Subject: [PATCH] Enable scalesPageToFit on Android Summary:PR for https://github.com/facebook/react-native/issues/5958. The viewport meta tags if present, are overridden from the page and it is rendered according to the screen size. An example has been added in the Web View section of UIExplorer demo app. Closes https://github.com/facebook/react-native/pull/6013 Differential Revision: D2953940 Pulled By: nicklockwood fb-gh-sync-id: 012769f3a2a3f7dc942b60de02a9d1b80a27236e shipit-source-id: 012769f3a2a3f7dc942b60de02a9d1b80a27236e --- Examples/UIExplorer/WebViewExample.js | 76 ++++++++++++++++++- .../Components/WebView/WebView.android.js | 7 ++ Libraries/Components/WebView/WebView.ios.js | 1 - .../views/webview/ReactWebViewManager.java | 5 ++ 4 files changed, 87 insertions(+), 2 deletions(-) diff --git a/Examples/UIExplorer/WebViewExample.js b/Examples/UIExplorer/WebViewExample.js index f734614939..6654551ad4 100644 --- a/Examples/UIExplorer/WebViewExample.js +++ b/Examples/UIExplorer/WebViewExample.js @@ -20,6 +20,7 @@ var { StyleSheet, Text, TextInput, + TouchableWithoutFeedback, TouchableOpacity, View, WebView @@ -160,6 +161,60 @@ var WebViewExample = React.createClass({ }); +var Button = React.createClass({ + _handlePress: function() { + if (this.props.enabled && this.props.onPress) { + this.props.onPress(); + } + }, + render: function() { + return ( + + + {this.props.text} + + + ); + } +}); + +var ScaledWebView = React.createClass({ + + getInitialState: function() { + return { + scalingEnabled: true + } + }, + + render: function() { + return ( + + + + { this.state.scalingEnabled ? +