Skip to content

Commit

Permalink
docs: update README, refactor: optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
codeestX committed Jun 28, 2017
1 parent 56cf1d5 commit 4f98ec5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Music resource API: [moe.fm](http://moe.fm/)
![](https://github.com/codeestX/MoeFM/raw/master/preview/1.jpg)
![](https://github.com/codeestX/MoeFM/raw/master/preview/2.jpg)
![](https://github.com/codeestX/MoeFM/raw/master/preview/3.jpg)
![](https://github.com/codeestX/MoeFM/raw/master/preview/4.jpg)
![](https://github.com/codeestX/MoeFM/raw/master/preview/5.jpg)
![](https://github.com/codeestX/MoeFM/raw/master/preview/4.png)
![](https://github.com/codeestX/MoeFM/raw/master/preview/5.png)

# Usage

Expand Down
21 changes: 13 additions & 8 deletions js/component/MainScreenNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React from 'react'
import { Text } from 'react-native'
import { Text, StyleSheet } from 'react-native'
import Icon from 'react-native-vector-icons/Ionicons';
import { TabNavigator } from 'react-navigation';

Expand All @@ -25,8 +25,7 @@ export default MainScreenNavigator = TabNavigator({
/>
),
tabBarLabel: ({ focused, tintColor }) => (
<Text style={{fontSize: 12, textAlign: 'center', marginBottom: 2,
color: focused? screenProps.themeColor: tintColor}}>Music</Text>
<Text style={[styles.label, {color: focused? screenProps.themeColor: tintColor}]}>Music</Text>
)
}),},
Radio: {
Expand All @@ -40,8 +39,7 @@ export default MainScreenNavigator = TabNavigator({
/>
),
tabBarLabel: ({ focused, tintColor }) => (
<Text style={{fontSize: 12, textAlign: 'center', marginBottom: 2,
color: focused? screenProps.themeColor: tintColor}}>Radio</Text>
<Text style={[styles.label, {color: focused? screenProps.themeColor: tintColor}]}>Radio</Text>
)
}),},
Me: { screen: TabMePage,
Expand All @@ -54,8 +52,7 @@ export default MainScreenNavigator = TabNavigator({
/>
),
tabBarLabel: ({ focused, tintColor }) => (
<Text style={{fontSize: 12, textAlign: 'center', marginBottom: 2,
color: focused? screenProps.themeColor: tintColor}}>Me</Text>
<Text style={[styles.label, {color: focused? screenProps.themeColor: tintColor}]}>Me</Text>
)
}),},
}, {
Expand All @@ -77,4 +74,12 @@ export default MainScreenNavigator = TabNavigator({
labelStyle: {fontSize: 9, marginVertical: -1},
},
}
);
);

const styles = StyleSheet.create({
label : {
fontSize: 12,
textAlign: 'center',
marginBottom: 2
},
});
5 changes: 3 additions & 2 deletions js/container/PlayList.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
FlatList,
Text,
View,
StyleSheet
StyleSheet,
Platform
} from 'react-native'
import Item from '../component/PlayItem'
import GlobalStyle from '../style/global'
Expand Down Expand Up @@ -39,7 +40,7 @@ class PlayList extends Component {

render() {
return (
<View style={{backgroundColor: 'white', height: 265}}>
<View style={{backgroundColor: 'white', height: Platform.OS === 'android'? 265: 280}}>
<FlatList
data={this.props.playList}
renderItem={({item, index}) => <Item song={item} index={index} isSelected={this.getCurrentIndex() === index}
Expand Down
4 changes: 2 additions & 2 deletions js/container/PlayerUIBottom.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class PlayerUIBottom extends Component {
<Interactable.View
ref='headInstance'
verticalOnly={true}
snapPoints={[{y: GlobalStyle.window_height-400}, {y: Platform.OS === 'android'? GlobalStyle.window_height-135: GlobalStyle.window_height-120}]}
snapPoints={[{y: GlobalStyle.window_height-400}, {y: Platform.OS === 'android'? GlobalStyle.window_height-135: GlobalStyle.window_height-118}]}
boundaries={{top: GlobalStyle.window_height-400}}
initialPosition={{y: Platform.OS === 'android'? GlobalStyle.window_height-135: GlobalStyle.window_height-120}}
initialPosition={{y: Platform.OS === 'android'? GlobalStyle.window_height-135: GlobalStyle.window_height-118}}
animatedValueY={this._deltaY}>
<View>
<CustomButton onPress={() => this.props.onPress()}>
Expand Down
Binary file removed preview/4.jpg
Binary file not shown.
Binary file added preview/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed preview/5.jpg
Binary file not shown.
Binary file added preview/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4f98ec5

Please sign in to comment.