Skip to content

Commit

Permalink
remove all demo scrollview
Browse files Browse the repository at this point in the history
  • Loading branch information
silentcloud committed Aug 3, 2016
1 parent 636c3f4 commit d8e855c
Show file tree
Hide file tree
Showing 12 changed files with 167 additions and 138 deletions.
119 changes: 62 additions & 57 deletions components/badge/demo/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,67 +1,72 @@
/* tslint:disable:no-console */
import * as React from 'react';
import { View } from 'react-native';
import { View, ScrollView } from 'react-native';
import { Badge, WhiteSpace } from 'antd-mobile';

export default class BasicTagExample extends React.Component<any, any> {
render() {
return (
<View style={{ padding: 20}}>

<Badge text={9}>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={109} overflowCount ={100}>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={109}>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text="new">
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={109} dot>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={109} dot size="large">
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={33} corner>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text="new" corner size="large">
<View style={{ width: 72, height: 72, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

</View>
<ScrollView
style={{ flex: 1 }}
automaticallyAdjustContentInsets={false}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
>
<View style={{ padding: 20}}>
<Badge text={9}>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={109} overflowCount ={100}>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={109}>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text="new">
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={109} dot>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={109} dot size="large">
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text={33} corner>
<View style={{ width: 52, height: 52, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>

<WhiteSpace />
<WhiteSpace />

<Badge text="new" corner size="large">
<View style={{ width: 72, height: 72, backgroundColor: 'rgba(255, 140, 101, 0.15)' }} />
</Badge>
</View>
</ScrollView>
);
}
}
18 changes: 14 additions & 4 deletions components/drawer/demo/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { StyleSheet, View, Text, Dimensions } from 'react-native';
import { Drawer, List, Button } from 'antd-mobile';
import { DefaultRenderer } from 'react-native-router-flux';
import { Drawer, List, Button, WingBlank, WhiteSpace } from 'antd-mobile';
import { DefaultRenderer, Actions } from 'react-native-router-flux';

const styles = StyleSheet.create({
container: {
Expand Down Expand Up @@ -59,8 +59,18 @@ export class DrawerMain extends React.Component<any, any> {
render() {
return (
<View style={{ height: Dimensions.get('window').height }}>
<Button type="primary" inline onPress={() => this.drawer && this.drawer.openDrawer() }>打开 drawer</Button>
<Text style={{ color: 'red' }}>主内容</Text>
<View>
<WingBlank size={16}>
<Button type="primary" inline onPress={() => this.drawer && this.drawer.openDrawer() }>打开 drawer</Button>
</WingBlank>
<Text style={{ color: 'red', textAlign: 'center', marginTop: 40 }}>主内容</Text>
<WhiteSpace size={60} />
<WingBlank size={16}>
<Button ghost inline onPress={() => {
Actions.pop();
}}>返回 demo list</Button>
</WingBlank>
</View>
</View>
);
}
Expand Down
11 changes: 8 additions & 3 deletions components/flex/demo/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, Flex, WingBlank, WhiteSpace } from 'antd-mobile';
import * as React from 'react';
import { View, Text } from 'react-native';
import { View, Text, ScrollView } from 'react-native';

const Circle = React.createClass({
render() {
Expand All @@ -22,7 +22,12 @@ const Circle = React.createClass({
export default class FlexExample extends React.Component<any, any> {
render() {
return (
<View>
<ScrollView
style={{ flex: 1 }}
automaticallyAdjustContentInsets={false}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
>
<WingBlank style={{ marginTop: 20, marginBottom: 5 }}>
<Text style={{ marginBottom: 10 }}>项目的排列方向</Text>
<Text>direction="row":主轴为水平方向,起点在左端</Text>
Expand Down Expand Up @@ -176,7 +181,7 @@ export default class FlexExample extends React.Component<any, any> {
</Flex>
</WingBlank>
<WhiteSpace />
</View>
</ScrollView>
);
}
}
11 changes: 8 additions & 3 deletions components/input-item/demo/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { View } from 'react-native';
import { ScrollView } from 'react-native';
import { InputItem, List } from 'antd-mobile';

export default class BasicInputItemExample extends React.Component<any, any> {
Expand Down Expand Up @@ -27,7 +27,12 @@ export default class BasicInputItemExample extends React.Component<any, any> {

render() {
return (
<View>
<ScrollView
style={{ flex: 1 }}
automaticallyAdjustContentInsets={false}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
>
<List>
<List.Body>
<InputItem
Expand Down Expand Up @@ -218,7 +223,7 @@ export default class BasicInputItemExample extends React.Component<any, any> {
>数字</InputItem>
</List.Body>
</List>
</View>
</ScrollView>
);
}
}
11 changes: 8 additions & 3 deletions components/list/demo/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import * as React from 'react';
import { Image, View } from 'react-native';
import { Image, ScrollView } from 'react-native';
import { List, Button } from 'antd-mobile';

export default class BasicListExample extends React.Component<any, any> {
render() {
return (
<View>
<ScrollView
style={{ flex: 1 }}
automaticallyAdjustContentInsets={false}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
>
<List>
{/* 基本用法 Demo */}
<List.Header>基本用法 Demo</List.Header>
Expand Down Expand Up @@ -165,7 +170,7 @@ export default class BasicListExample extends React.Component<any, any> {
><List.Item.Content>垂直居中对齐</List.Item.Content></List.Item>
</List.Body>
</List>
</View>
</ScrollView>
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/menu/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const MenuExample = React.createClass({
Toast.info(`选中了 ${value.toString()}`);
},
render() {
return <Menu data={data} onChange={this.onChange} />
return <Menu data={data} onChange={this.onChange} />;
},
});

Expand Down
2 changes: 1 addition & 1 deletion components/menu/demo/onelevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const MenuExample = React.createClass({
Toast.info(`选中了 ${value.toString()}`);
},
render() {
return <Menu data={data} level={1} onChange={this.onChange} />
return <Menu data={data} level={1} onChange={this.onChange} />;
},
});

Expand Down
2 changes: 1 addition & 1 deletion components/swipe-action/demo/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SwipeAction, List } from 'antd-mobile';
export default class BasicSwipeActionExample extends React.Component<any, any> {
render() {
return (
<View style={{ paddingTop: 80 }}>
<View style={{ paddingTop: 20 }}>
<List>
<List.Body>
<SwipeAction
Expand Down
2 changes: 1 addition & 1 deletion components/switch/demo/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class SwitchExample extends React.Component<any, any> {
}
render() {
return (
<List style={{marginTop: 80}}>
<List style={{ marginTop: 20 }}>
<List.Body>
<List.Item extra={<Switch checked />}>默认开</List.Item>
<List.Item extra={<Switch />}>默认关</List.Item>
Expand Down
Loading

0 comments on commit d8e855c

Please sign in to comment.