/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* @flow
* @providesModule ViewExample
*/
'use strict';
var React = require('react');
var ReactNative = require('react-native');
var {
StyleSheet,
Text,
View,
} = ReactNative;
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var styles = StyleSheet.create({
box: {
backgroundColor: '#527FE4',
borderColor: '#000033',
borderWidth: 1,
},
zIndex: {
justifyContent: 'space-around',
width: 100,
height: 50,
marginTop: -10,
},
});
class ViewBorderStyleExample extends React.Component {
state = {
showBorder: true
};
render() {
return (
Dashed border style
Dotted border style
);
}
_handlePress = () => {
this.setState({showBorder: !this.state.showBorder});
};
}
class ZIndexExample extends React.Component {
state = {
flipped: false
};
render() {
const indices = this.state.flipped ? [-1, 0, 1, 2] : [2, 1, 0, -1];
return (
Tap to flip sorting order
ZIndex {indices[0]}
ZIndex {indices[1]}
ZIndex {indices[2]}
ZIndex {indices[3]}
);
}
_handlePress = () => {
this.setState({flipped: !this.state.flipped});
};
}
exports.title = '';
exports.description = 'Basic building block of all UI, examples that ' +
'demonstrate some of the many styles available.';
exports.displayName = 'ViewExample';
exports.examples = [
{
title: 'Background Color',
render: function() {
return (
Blue background
);
},
}, {
title: 'Border',
render: function() {
return (
5px blue border
);
},
}, {
title: 'Padding/Margin',
render: function() {
return (
5px padding
5px margin
5px margin and padding,
widthAutonomous=true
);
},
}, {
title: 'Border Radius',
render: function() {
return (
Too much use of `borderRadius` (especially large radii) on
anything which is scrolling may result in dropped frames.
Use sparingly.
);
},
}, {
title: 'Border Style',
render: function() {
return ;
},
}, {
title: 'Circle with Border Radius',
render: function() {
return (
);
},
}, {
title: 'Overflow',
render: function() {
return (
Overflow hidden
Overflow visible
);
},
}, {
title: 'Opacity',
render: function() {
return (
Opacity 0
Opacity 0.1
Opacity 0.3
Opacity 0.5
Opacity 0.7
Opacity 0.9
Opacity 1
);
},
}, {
title: 'ZIndex',
render: function() {
return ;
},
},
];