1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Dropdown fioxes

This commit is contained in:
Laurent Cozic
2017-11-19 00:23:18 +00:00
parent 37c0b6d24a
commit ca20a2a1c2
5 changed files with 13 additions and 8 deletions

View File

@ -64,8 +64,8 @@ class Dropdown extends React.Component {
height: 35, height: 35,
// borderWidth: 1, // borderWidth: 1,
// borderColor: '#ccc', // borderColor: '#ccc',
paddingLeft: 20, //paddingLeft: 20,
paddingRight: 20, //paddingRight: 20,
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
@ -77,6 +77,7 @@ class Dropdown extends React.Component {
const headerArrowStyle = Object.assign({}, this.props.headerStyle ? this.props.headerStyle : {}, { const headerArrowStyle = Object.assign({}, this.props.headerStyle ? this.props.headerStyle : {}, {
flex: 0, flex: 0,
marginRight: 10,
}); });
const itemStyle = Object.assign({}, this.props.itemStyle ? this.props.itemStyle : {}, { const itemStyle = Object.assign({}, this.props.itemStyle ? this.props.itemStyle : {}, {
@ -104,8 +105,8 @@ class Dropdown extends React.Component {
return ( return (
<View style={{flex: 1, flexDirection: 'column' }}> <View style={{flex: 1, flexDirection: 'column' }}>
<TouchableOpacity style={headerWrapperStyle} ref={(ref) => this.headerRef_ = ref} onPress={() => { this.setState({ listVisible: true }) }}> <TouchableOpacity style={headerWrapperStyle} ref={(ref) => this.headerRef_ = ref} onPress={() => { this.setState({ listVisible: true }) }}>
<Text ellipsizeMode="tail" numberOfLines={1} style={headerStyle}>{headerLabel}</Text>
<Text style={headerArrowStyle}>{'▼'}</Text> <Text style={headerArrowStyle}>{'▼'}</Text>
<Text ellipsizeMode="tail" numberOfLines={1} style={headerStyle}>{headerLabel}</Text>
</TouchableOpacity> </TouchableOpacity>
<Modal transparent={true} visible={this.state.listVisible} onRequestClose={() => { closeList(); }} > <Modal transparent={true} visible={this.state.listVisible} onRequestClose={() => { closeList(); }} >
<TouchableWithoutFeedback onPressOut={() => { closeList() }}> <TouchableWithoutFeedback onPressOut={() => { closeList() }}>

View File

@ -1,5 +1,5 @@
const React = require('react'); const Component = React.Component; const React = require('react'); const Component = React.Component;
const { StyleSheet, TouchableHighlight } = require('react-native'); const { StyleSheet, View, TouchableHighlight } = require('react-native');
const Icon = require('react-native-vector-icons/Ionicons').default; const Icon = require('react-native-vector-icons/Ionicons').default;
const styles = { const styles = {
@ -55,7 +55,9 @@ class Checkbox extends Component {
alignItems: 'center', alignItems: 'center',
}; };
if (style.display) thStyle.display = style.display; if (style && style.display === 'none') return <View/>
//if (style.display) thStyle.display = style.display;
return ( return (
<TouchableHighlight onPress={() => this.onPress()} style={thStyle}> <TouchableHighlight onPress={() => this.onPress()} style={thStyle}>

View File

@ -91,7 +91,7 @@ class NoteItemComponent extends Component {
const theme = themeStyle(this.props.theme); const theme = themeStyle(this.props.theme);
// IOS: display: none crashes the app // IOS: display: none crashes the app
let checkboxStyle = !isTodo ? { } : { color: theme.color }; let checkboxStyle = !isTodo ? { display: 'none' } : { color: theme.color };
if (isTodo) { if (isTodo) {
checkboxStyle.paddingRight = 10; checkboxStyle.paddingRight = 10;

View File

@ -277,7 +277,7 @@ class ScreenHeaderComponent extends Component {
backgroundColor: theme.backgroundColor, backgroundColor: theme.backgroundColor,
}} }}
headerStyle={{ headerStyle={{
color: theme.raisedColor, color: theme.raisedHighlightedColor,
fontSize: theme.fontSize, fontSize: theme.fontSize,
}} }}
itemStyle={{ itemStyle={{

View File

@ -35,6 +35,7 @@ class ConfigScreenComponent extends BaseScreenComponent {
settingContainer: { settingContainer: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center',
borderBottomWidth: 1, borderBottomWidth: 1,
borderBottomColor: theme.dividerColor, borderBottomColor: theme.dividerColor,
paddingTop: theme.marginTop, paddingTop: theme.marginTop,
@ -63,7 +64,8 @@ class ConfigScreenComponent extends BaseScreenComponent {
styles.switchSettingControl = Object.assign({}, styles.settingControl); styles.switchSettingControl = Object.assign({}, styles.settingControl);
delete styles.switchSettingControl.color; delete styles.switchSettingControl.color;
styles.switchSettingControl.width = '20%'; //styles.switchSettingControl.width = '20%';
styles.switchSettingControl.flex = 0;
this.styles_[themeId] = StyleSheet.create(styles); this.styles_[themeId] = StyleSheet.create(styles);
return this.styles_[themeId]; return this.styles_[themeId];