Showing
9 changed files
with
144 additions
and
174 deletions
... | @@ -2,7 +2,6 @@ import React, { Component } from 'react'; | ... | @@ -2,7 +2,6 @@ import React, { Component } from 'react'; |
2 | import { StyleSheet, Text, View } from 'react-native'; | 2 | import { StyleSheet, Text, View } from 'react-native'; |
3 | import { createAppContainer } from 'react-navigation'; | 3 | import { createAppContainer } from 'react-navigation'; |
4 | import { createStackNavigator } from 'react-navigation-stack'; | 4 | import { createStackNavigator } from 'react-navigation-stack'; |
5 | - | ||
6 | import MainScreen from './Components/MainScreen'; | 5 | import MainScreen from './Components/MainScreen'; |
7 | 6 | ||
8 | const AppStackNavigator = createStackNavigator({ | 7 | const AppStackNavigator = createStackNavigator({ |
... | @@ -12,74 +11,3 @@ const AppStackNavigator = createStackNavigator({ | ... | @@ -12,74 +11,3 @@ const AppStackNavigator = createStackNavigator({ |
12 | }); | 11 | }); |
13 | 12 | ||
14 | export default createAppContainer(AppStackNavigator); | 13 | export default createAppContainer(AppStackNavigator); |
... | \ No newline at end of file | ... | \ No newline at end of file |
15 | - | ||
16 | -const API_KEY = "2bf00f660b1a6a3ffeb6e06ac270cce3"; | ||
17 | -const NAVER_CLIENT_ID = "KqPsntd1hcPJ8FUPBGqN"; | ||
18 | -const NAVER_CLIENT_SECRET = "0GRb3uya1U"; | ||
19 | - | ||
20 | -// const option = { | ||
21 | -// query: "겨울왕국" | ||
22 | -// }; | ||
23 | - | ||
24 | -// request.get( | ||
25 | -// { | ||
26 | -// uri: "https://openapi.naver.com/v1/search/movie", //xml 요청 주소는 https://openapi.naver.com/v1/search/image.xml | ||
27 | -// qs: option, | ||
28 | -// headers: { | ||
29 | -// "X-Naver-Client-Id": NAVER_CLIENT_ID, | ||
30 | -// "X-Naver-Client-Secret": NAVER_CLIENT_SECRET | ||
31 | -// } | ||
32 | -// }, | ||
33 | -// function(err, res, body) { | ||
34 | -// let json = JSON.parse(body); //json으로 파싱 | ||
35 | -// console.log(json); | ||
36 | -// } | ||
37 | -// ); | ||
38 | - | ||
39 | -/* | ||
40 | -export default class extends React.Component { | ||
41 | - state = { | ||
42 | - isLoading: true | ||
43 | - }; | ||
44 | - getNaverApi = async () => { | ||
45 | - fetch("https://openapi.naver.com/v1/search/movie.json?query='겨울왕국 2'", { | ||
46 | - headers: { | ||
47 | - "X-Naver-Client-Id": NAVER_CLIENT_ID, | ||
48 | - "X-Naver-Client-Secret": NAVER_CLIENT_SECRET | ||
49 | - } | ||
50 | - }) | ||
51 | - .then(response => response.json()) | ||
52 | - .then(json => { | ||
53 | - console.log(json.items[0].image); | ||
54 | - }); | ||
55 | - }; | ||
56 | - getMovieList = async () => { | ||
57 | - axios | ||
58 | - .get( | ||
59 | - `http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=${API_KEY}&targetDt=20191129` | ||
60 | - ) | ||
61 | - .then(response => { | ||
62 | - for (var i = 0; i < 10; i++) { | ||
63 | - console.log( | ||
64 | - response.data.boxOfficeResult.dailyBoxOfficeList[i].movieNm | ||
65 | - ); | ||
66 | - } | ||
67 | - }) | ||
68 | - .catch(error => { | ||
69 | - console.log(error); | ||
70 | - }); | ||
71 | - }; | ||
72 | - componentDidMount() { | ||
73 | - this.getMovieList(); | ||
74 | - this.getNaverApi(); | ||
75 | - } | ||
76 | - render() { | ||
77 | - const { isLoading, temp, condition } = this.state; | ||
78 | - return isLoading ? ( | ||
79 | - <Loading /> | ||
80 | - ) : ( | ||
81 | - <Weather temp={Math.round(temp)} condition={condition} /> | ||
82 | - ); | ||
83 | - } | ||
84 | -} | ||
85 | -*/ | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | -import React, { Component } from 'react'; | ||
2 | -import { View, Text, StyleSheet } from 'react-native'; | ||
3 | - | ||
4 | -export default class AddMediaTab extends Component { | ||
5 | - render() { | ||
6 | - return ( | ||
7 | - <View style={style.container}> | ||
8 | - <Text>AddMediaTab</Text> | ||
9 | - </View> | ||
10 | - ); | ||
11 | - } | ||
12 | -} | ||
13 | - | ||
14 | -const style = StyleSheet.create({ | ||
15 | - container: { | ||
16 | - flex: 1, | ||
17 | - alignItems: 'center', | ||
18 | - justifyContent: 'center', | ||
19 | - } | ||
20 | -}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | -import React, { Component } from 'react'; | ||
2 | -import { View, Text, StyleSheet } from 'react-native'; | ||
3 | - | ||
4 | -export default class HomeTab extends Component { | ||
5 | - render() { | ||
6 | - return ( | ||
7 | - <View style={style.container}> | ||
8 | - <Text>HomeTab</Text> | ||
9 | - </View> | ||
10 | - ); | ||
11 | - } | ||
12 | -} | ||
13 | - | ||
14 | -const style = StyleSheet.create({ | ||
15 | - container: { | ||
16 | - flex: 1, | ||
17 | - alignItems: 'center', | ||
18 | - justifyContent: 'center', | ||
19 | - } | ||
20 | -}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | -import React, { Component } from 'react'; | ||
2 | -import { View, Text, StyleSheet } from 'react-native'; | ||
3 | - | ||
4 | -export default class LikesTab extends Component { | ||
5 | - render() { | ||
6 | - return ( | ||
7 | - <View style={style.container}> | ||
8 | - <Text>LikesTab</Text> | ||
9 | - </View> | ||
10 | - ); | ||
11 | - } | ||
12 | -} | ||
13 | - | ||
14 | -const style = StyleSheet.create({ | ||
15 | - container: { | ||
16 | - flex: 1, | ||
17 | - alignItems: 'center', | ||
18 | - justifyContent: 'center', | ||
19 | - } | ||
20 | -}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | -import { View, Text, StyleSheet } from 'react-native'; | 2 | +import { View, Text, StyleSheet, Image} from 'react-native'; |
3 | import { Icon } from 'native-base'; | 3 | import { Icon } from 'native-base'; |
4 | +import { AsyncStorage } from "react-native"; | ||
5 | +import axios from "axios"; | ||
6 | + | ||
7 | +const API_KEY = "2bf00f660b1a6a3ffeb6e06ac270cce3"; | ||
8 | +const NAVER_CLIENT_ID = "KqPsntd1hcPJ8FUPBGqN"; | ||
9 | +const NAVER_CLIENT_SECRET = "0GRb3uya1U"; | ||
10 | + | ||
4 | 11 | ||
5 | export default class MovieRankingTab extends Component { | 12 | export default class MovieRankingTab extends Component { |
6 | static navigationOptions = { | 13 | static navigationOptions = { |
7 | tabBarIcon: ({ tintColor }) => ( | 14 | tabBarIcon: ({ tintColor }) => ( |
8 | <Icon name='ios-trophy' style={{ color: tintColor }} /> | 15 | <Icon name='ios-trophy' style={{ color: tintColor }} /> |
9 | ) | 16 | ) |
17 | + }; | ||
18 | + | ||
19 | + getNaverApi = async () => { | ||
20 | + fetch("https://openapi.naver.com/v1/search/movie.json?query='겨울왕국 2'", { | ||
21 | + headers: { | ||
22 | + "X-Naver-Client-Id": NAVER_CLIENT_ID, | ||
23 | + "X-Naver-Client-Secret": NAVER_CLIENT_SECRET | ||
24 | + } | ||
25 | + }) | ||
26 | + .then(response => response.json()) | ||
27 | + .then(json => { | ||
28 | + console.log(json.items[0].image); | ||
29 | + }); | ||
30 | + }; | ||
31 | + getMovieList = async () => { | ||
32 | + axios | ||
33 | + .get( | ||
34 | + `http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=${API_KEY}&targetDt=20191129` | ||
35 | + ) | ||
36 | + .then(response => { | ||
37 | + for (var i = 0; i < 10; i++) { | ||
38 | + console.log( | ||
39 | + response.data.boxOfficeResult.dailyBoxOfficeList[i].movieNm | ||
40 | + ); | ||
10 | } | 41 | } |
42 | + }) | ||
43 | + .catch(error => { | ||
44 | + console.log(error); | ||
45 | + }); | ||
46 | + }; | ||
47 | + componentDidMount() { | ||
48 | + this.getMovieList(); | ||
49 | + this.getNaverApi(); | ||
50 | + } | ||
51 | + | ||
11 | render() { | 52 | render() { |
12 | return ( | 53 | return ( |
13 | <View style={style.container}> | 54 | <View style={style.container}> |
14 | - <Text>MovieRankingTab</Text> | 55 | + <Text>MovieRanking</Text> |
56 | + <Image | ||
57 | + style = {{height:'25%',width: '25%'}} | ||
58 | + source={{uri : "https://ssl.pstatic.net/imgmovie/mdi/mit110/1368/136873_P18_100537.jpg" }}/> | ||
15 | </View> | 59 | </View> |
16 | ); | 60 | ); |
17 | } | 61 | } | ... | ... |
1 | -import React, { Component } from 'react'; | ||
2 | -import { View, Text, StyleSheet } from 'react-native'; | ||
3 | - | ||
4 | -export default class ProfileTab extends Component { | ||
5 | - render() { | ||
6 | - return ( | ||
7 | - <View style={style.container}> | ||
8 | - <Text>ProfileTab</Text> | ||
9 | - </View> | ||
10 | - ); | ||
11 | - } | ||
12 | -} | ||
13 | - | ||
14 | -const style = StyleSheet.create({ | ||
15 | - container: { | ||
16 | - flex: 1, | ||
17 | - alignItems: 'center', | ||
18 | - justifyContent: 'center', | ||
19 | - } | ||
20 | -}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | -import React, { Component } from 'react'; | ||
2 | -import { View, Text, StyleSheet } from 'react-native'; | ||
3 | - | ||
4 | -export default class SearchTab extends Component { | ||
5 | - render() { | ||
6 | - return ( | ||
7 | - <View style={style.container}> | ||
8 | - <Text>SearchTab</Text> | ||
9 | - </View> | ||
10 | - ); | ||
11 | - } | ||
12 | -} | ||
13 | - | ||
14 | -const style = StyleSheet.create({ | ||
15 | - container: { | ||
16 | - flex: 1, | ||
17 | - alignItems: 'center', | ||
18 | - justifyContent: 'center', | ||
19 | - } | ||
20 | -}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
Components/Loading.js
0 → 100644
1 | +import React from "react"; | ||
2 | +import { StyleSheet, Text, View, StatusBar } from "react-native"; | ||
3 | + | ||
4 | +export default function Loading() { | ||
5 | + return ( | ||
6 | + <View style={styles.container}> | ||
7 | + <StatusBar barStyle="dark-content" /> | ||
8 | + <Text style={styles.text}>Getting the current weather</Text> | ||
9 | + </View> | ||
10 | + ); | ||
11 | +} | ||
12 | + | ||
13 | +const styles = StyleSheet.create({ | ||
14 | + container: { | ||
15 | + flex: 1, | ||
16 | + justifyContent: "flex-end", | ||
17 | + paddingHorizontal: 30, | ||
18 | + paddingVertical: 100, | ||
19 | + backgroundColor: "#FDF6AA" | ||
20 | + }, | ||
21 | + text: { | ||
22 | + color: "#2c2c2c", | ||
23 | + fontSize: 30 | ||
24 | + } | ||
25 | +}); |
Components/Movie_info.js
0 → 100644
1 | +import React from "react"; | ||
2 | +import { StyleSheet, Text, View } from 'react-native'; | ||
3 | +import { AsyncStorage } from "react-native"; | ||
4 | +import Loading from "./Loading"; | ||
5 | +import axios from "axios"; | ||
6 | + | ||
7 | +const API_KEY = "2bf00f660b1a6a3ffeb6e06ac270cce3"; | ||
8 | +const NAVER_CLIENT_ID = "KqPsntd1hcPJ8FUPBGqN"; | ||
9 | +const NAVER_CLIENT_SECRET = "0GRb3uya1U"; | ||
10 | + | ||
11 | +// const option = { | ||
12 | +// query: "겨울왕국" | ||
13 | +// }; | ||
14 | + | ||
15 | +// request.get( | ||
16 | +// { | ||
17 | +// uri: "https://openapi.naver.com/v1/search/movie", //xml 요청 주소는 https://openapi.naver.com/v1/search/image.xml | ||
18 | +// qs: option, | ||
19 | +// headers: { | ||
20 | +// "X-Naver-Client-Id": NAVER_CLIENT_ID, | ||
21 | +// "X-Naver-Client-Secret": NAVER_CLIENT_SECRET | ||
22 | +// } | ||
23 | +// }, | ||
24 | +// function(err, res, body) { | ||
25 | +// let json = JSON.parse(body); //json으로 파싱 | ||
26 | +// console.log(json); | ||
27 | +// } | ||
28 | +// ); | ||
29 | + | ||
30 | +export default class extends React.Component { | ||
31 | + state = { | ||
32 | + isLoading: true | ||
33 | + }; | ||
34 | + getNaverApi = async () => { | ||
35 | + fetch("https://openapi.naver.com/v1/search/movie.json?query='겨울왕국 2'", { | ||
36 | + headers: { | ||
37 | + "X-Naver-Client-Id": NAVER_CLIENT_ID, | ||
38 | + "X-Naver-Client-Secret": NAVER_CLIENT_SECRET | ||
39 | + } | ||
40 | + }) | ||
41 | + .then(response => response.json()) | ||
42 | + .then(json => { | ||
43 | + console.log(json.items[0].image); | ||
44 | + }); | ||
45 | + }; | ||
46 | + getMovieList = async () => { | ||
47 | + axios | ||
48 | + .get( | ||
49 | + `http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=${API_KEY}&targetDt=20191129` | ||
50 | + ) | ||
51 | + .then(response => { | ||
52 | + for (var i = 0; i < 10; i++) { | ||
53 | + console.log( | ||
54 | + response.data.boxOfficeResult.dailyBoxOfficeList[i].movieNm | ||
55 | + ); | ||
56 | + } | ||
57 | + }) | ||
58 | + .catch(error => { | ||
59 | + console.log(error); | ||
60 | + }); | ||
61 | + }; | ||
62 | + componentDidMount() { | ||
63 | + this.getMovieList(); | ||
64 | + this.getNaverApi(); | ||
65 | + } | ||
66 | + render() { | ||
67 | + return ( | ||
68 | + <View> | ||
69 | + <Text>WantToWatchTab</Text> | ||
70 | + </View> | ||
71 | + ); | ||
72 | +} | ||
73 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment