Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Commit

Permalink
fixed android layout issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dabit3 committed Sep 8, 2016
1 parent fbcba61 commit f6a2262
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 24 deletions.
10 changes: 2 additions & 8 deletions index.android.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import React from 'react'
import { AppRegistry } from 'react-native'
import { Provider } from 'react-redux'
import AppRootContainer from './src'
import configureStore from './src/store/configureStore'

const store = configureStore()
import AppRootContainer from './src/AppRootContainer'

const HackathonStarter = () => (
<Provider store={store}>
<AppRootContainer />
</Provider>
<AppRootContainer />
)

AppRegistry.registerComponent('HackathonStarter', () => HackathonStarter)
18 changes: 15 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,25 @@ class App extends Component {
<About />
</TabNavigator.Item>
<TabNavigator.Item
tabStyle={selectedTab !== 'contact' && { marginBottom: -6 }}
tabStyle={[
selectedTab !== 'contact' && { marginBottom: -6 },
selectedTab === 'contact' && Platform.OS === 'android' && {marginBottom: -3}
]}
titleStyle={[styles.titleStyle, {marginTop: -1}]}
selectedTitleStyle={[styles.titleSelected, {marginTop: -3, marginBottom: 7}]}
selectedTitleStyle={[
styles.titleSelected,
{marginBottom: 7},
Platform.OS === 'android' ? {marginTop: 1 } : {marginTop: -3}
]}
selected={selectedTab === 'contact'}
title={selectedTab === 'contact' ? 'CONTACT' : null}
renderIcon={() => <Icon style={{paddingBottom: 4}} color={colors.grey2} name='contacts' size={26} />}
renderSelectedIcon={() => <Icon color={colors.primary} name='contacts' size={26} />}
renderSelectedIcon={() => (
<Icon
color={colors.primary}
name='contacts'
size={Platform.OS === 'ios' ? 26 : 22 } />
)}
onPress={() => this.changeTab('contact')}>
<Contact />
</TabNavigator.Item>
Expand Down
4 changes: 0 additions & 4 deletions src/about/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class About extends Component {
<View key={i} style={styles.user}>
<Image
style={styles.image}
resizeMode='center'
source={{uri: u.avatar}} />
<RNEText style={styles.name}>{u.name}</RNEText>
</View>
Expand Down Expand Up @@ -86,9 +85,6 @@ class About extends Component {
<RNESocialIcon
type='tumblr'
/>
<RNESocialIcon
type='youtube'
/>
</View>
</RNECard>
<RNECard
Expand Down
5 changes: 2 additions & 3 deletions src/components/nav/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import Icon from 'react-native-vector-icons/MaterialIcons'

let styles = {}

const NavigationBar = () => {
const src = require('image!logo')
const NavigationBar = () => {
const LeftButton = (route, navigator, index, navState) => {
if (index > 0) {
const leftAction = navigator.pop
Expand All @@ -37,7 +36,7 @@ const NavigationBar = () => {
)
}
return (
<NavTitleIcon src={src} />
<NavTitleIcon />
)
}

Expand Down
33 changes: 33 additions & 0 deletions src/components/nav/NavTitleIcon.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* @providesModule HSNavTitleIcon
*/

import React from 'react'
import { View, Image, StyleSheet, Dimensions } from 'react-native'
const { width } = Dimensions.get('window')

let styles = {}

const NavTitleIcon = () => (
<View style={styles.iconContainer}>
<Image
source={require('../../images/logo.png')}
style={styles.logo} />
</View>
)

styles = StyleSheet.create({
iconContainer: {
flex: 1,
width: width - 140,
justifyContent: 'center',
alignItems: 'center'
},
logo: {
width: 136,
height: 28,
resizeMode: 'contain'
}
})

export default NavTitleIcon
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ import { View, Image, StyleSheet } from 'react-native'

let styles = {}

const NavTitleIcon = ({src}) => (
<View>
const NavTitleIcon = () => (
<View style={styles.iconContainer}>
<Image
source={src}
source={require('image!logo')}
style={styles.logo} />
</View>
)

styles = StyleSheet.create({
container: {
iconContainer: {
},
logo: {
resizeMode: 'center',
marginTop: -15
marginTop: -15,
resizeMode: 'center'
}
})

Expand Down
1 change: 1 addition & 0 deletions src/contact/Contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Contact extends Component {
<RNEFormLabel containerStyle={styles.labelContainerStyle}>Phone</RNEFormLabel>
<RNEFormInput placeholder='Please enter your phone number...' />
<RNEButton
raised
onPress={() => console.log('yo')}
icon={{name: 'done'}}
buttonStyle={{marginTop: 15}}
Expand Down

0 comments on commit f6a2262

Please sign in to comment.