Skip to content

Commit dc57b61

Browse files
committed
🎨 [Example] Add slight spacers after buttons
Default RN button looks awful on Android
1 parent e6b7835 commit dc57b61

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

example/src/GenericListExample.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,23 +160,26 @@ class GenericListExample extends Component {
160160
</Text>
161161
<Button
162162
onPress={() => this.toggleDefaultState()}
163-
title="'Default'"
163+
title="Default"
164164
/>
165+
<View style={style.controlPanelSpacer} />
165166
<Button
166167
onPress={() => this.toggleLoadingState()}
167-
title="'Loading'"
168+
title="Loading"
168169
/>
170+
<View style={style.controlPanelSpacer} />
169171
<Button
170172
onPress={() => this.toggleErrorState()}
171-
title="'Error'"
173+
title="Error"
172174
/>
175+
<View style={style.controlPanelSpacer} />
173176
</View>
174177
<View style={style.listContainer}>
175178
<View style={style.list}>
176179
<View style={style.listButton}>
177180
<Button
178181
onPress={() => this.changeDataA()}
179-
title="Update Data (or pull-refresh)"
182+
title="Update data (or pull-refresh)"
180183
/>
181184
</View>
182185
<ListComponent
@@ -196,7 +199,7 @@ class GenericListExample extends Component {
196199
<View style={style.listButton}>
197200
<Button
198201
onPress={() => this.changeDataB()}
199-
title="Update Data (or pull-refresh)"
202+
title="Update data (or pull-refresh)"
200203
/>
201204
</View>
202205
<ListComponent

example/src/styles.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { StyleSheet } from 'react-native';
1+
import { StyleSheet, Platform } from 'react-native';
22

33
const style = StyleSheet.create({
44
container: {
@@ -26,6 +26,9 @@ const style = StyleSheet.create({
2626
fontSize: 18,
2727
padding: 8,
2828
},
29+
controlPanelSpacer: {
30+
width: Platform.OS === 'android' ? 4 : 0,
31+
},
2932
listContainer: {
3033
flex: 1,
3134
flexDirection: 'row',

0 commit comments

Comments
 (0)