Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신승민
/
pocketMovie
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
신승민
2019-12-04 21:05:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e01b535ca1791bd8bb10edb8be20436c350fdc27
e01b535c
1 parent
b8786578
Update structure
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
144 additions
and
174 deletions
App.js
Components/AppTabNavigator/AddMediaTab.js
Components/AppTabNavigator/HomeTab.js
Components/AppTabNavigator/LikesTab.js
Components/AppTabNavigator/MovieRankingTab.js
Components/AppTabNavigator/ProfileTab.js
Components/AppTabNavigator/SearchTab.js
Components/Loading.js
Components/Movie_info.js
App.js
View file @
e01b535
...
...
@@ -2,7 +2,6 @@ import React, { Component } from 'react';
import
{
StyleSheet
,
Text
,
View
}
from
'react-native'
;
import
{
createAppContainer
}
from
'react-navigation'
;
import
{
createStackNavigator
}
from
'react-navigation-stack'
;
import
MainScreen
from
'./Components/MainScreen'
;
const
AppStackNavigator
=
createStackNavigator
({
...
...
@@ -12,74 +11,3 @@ const AppStackNavigator = createStackNavigator({
});
export
default
createAppContainer
(
AppStackNavigator
);
\ No newline at end of file
const
API_KEY
=
"2bf00f660b1a6a3ffeb6e06ac270cce3"
;
const
NAVER_CLIENT_ID
=
"KqPsntd1hcPJ8FUPBGqN"
;
const
NAVER_CLIENT_SECRET
=
"0GRb3uya1U"
;
// const option = {
// query: "겨울왕국"
// };
// request.get(
// {
// uri: "https://openapi.naver.com/v1/search/movie", //xml 요청 주소는 https://openapi.naver.com/v1/search/image.xml
// qs: option,
// headers: {
// "X-Naver-Client-Id": NAVER_CLIENT_ID,
// "X-Naver-Client-Secret": NAVER_CLIENT_SECRET
// }
// },
// function(err, res, body) {
// let json = JSON.parse(body); //json으로 파싱
// console.log(json);
// }
// );
/*
export default class extends React.Component {
state = {
isLoading: true
};
getNaverApi = async () => {
fetch("https://openapi.naver.com/v1/search/movie.json?query='겨울왕국 2'", {
headers: {
"X-Naver-Client-Id": NAVER_CLIENT_ID,
"X-Naver-Client-Secret": NAVER_CLIENT_SECRET
}
})
.then(response => response.json())
.then(json => {
console.log(json.items[0].image);
});
};
getMovieList = async () => {
axios
.get(
`http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=${API_KEY}&targetDt=20191129`
)
.then(response => {
for (var i = 0; i < 10; i++) {
console.log(
response.data.boxOfficeResult.dailyBoxOfficeList[i].movieNm
);
}
})
.catch(error => {
console.log(error);
});
};
componentDidMount() {
this.getMovieList();
this.getNaverApi();
}
render() {
const { isLoading, temp, condition } = this.state;
return isLoading ? (
<Loading />
) : (
<Weather temp={Math.round(temp)} condition={condition} />
);
}
}
*/
\ No newline at end of file
...
...
Components/AppTabNavigator/AddMediaTab.js
deleted
100644 → 0
View file @
b878657
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
export
default
class
AddMediaTab
extends
Component
{
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
AddMediaTab
<
/Text
>
<
/View
>
);
}
}
const
style
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}
});
\ No newline at end of file
Components/AppTabNavigator/HomeTab.js
deleted
100644 → 0
View file @
b878657
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
export
default
class
HomeTab
extends
Component
{
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
HomeTab
<
/Text
>
<
/View
>
);
}
}
const
style
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}
});
\ No newline at end of file
Components/AppTabNavigator/LikesTab.js
deleted
100644 → 0
View file @
b878657
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
export
default
class
LikesTab
extends
Component
{
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
LikesTab
<
/Text
>
<
/View
>
);
}
}
const
style
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}
});
\ No newline at end of file
Components/AppTabNavigator/MovieRankingTab.js
View file @
e01b535
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'react-native'
;
import
{
Icon
}
from
'native-base'
;
import
{
AsyncStorage
}
from
"react-native"
;
import
axios
from
"axios"
;
const
API_KEY
=
"2bf00f660b1a6a3ffeb6e06ac270cce3"
;
const
NAVER_CLIENT_ID
=
"KqPsntd1hcPJ8FUPBGqN"
;
const
NAVER_CLIENT_SECRET
=
"0GRb3uya1U"
;
export
default
class
MovieRankingTab
extends
Component
{
static
navigationOptions
=
{
tabBarIcon
:
({
tintColor
})
=>
(
<
Icon
name
=
'ios-trophy'
style
=
{{
color
:
tintColor
}}
/
>
)
};
getNaverApi
=
async
()
=>
{
fetch
(
"https://openapi.naver.com/v1/search/movie.json?query='겨울왕국 2'"
,
{
headers
:
{
"X-Naver-Client-Id"
:
NAVER_CLIENT_ID
,
"X-Naver-Client-Secret"
:
NAVER_CLIENT_SECRET
}
})
.
then
(
response
=>
response
.
json
())
.
then
(
json
=>
{
console
.
log
(
json
.
items
[
0
].
image
);
});
};
getMovieList
=
async
()
=>
{
axios
.
get
(
`http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=
${
API_KEY
}
&targetDt=20191129`
)
.
then
(
response
=>
{
for
(
var
i
=
0
;
i
<
10
;
i
++
)
{
console
.
log
(
response
.
data
.
boxOfficeResult
.
dailyBoxOfficeList
[
i
].
movieNm
);
}
})
.
catch
(
error
=>
{
console
.
log
(
error
);
});
};
componentDidMount
()
{
this
.
getMovieList
();
this
.
getNaverApi
();
}
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
MovieRankingTab
<
/Text
>
<
Text
>
MovieRanking
<
/Text
>
<
Image
style
=
{{
height
:
'25%'
,
width
:
'25%'
}}
source
=
{{
uri
:
"https://ssl.pstatic.net/imgmovie/mdi/mit110/1368/136873_P18_100537.jpg"
}}
/
>
<
/View
>
);
}
...
...
Components/AppTabNavigator/ProfileTab.js
deleted
100644 → 0
View file @
b878657
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
export
default
class
ProfileTab
extends
Component
{
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
ProfileTab
<
/Text
>
<
/View
>
);
}
}
const
style
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}
});
\ No newline at end of file
Components/AppTabNavigator/SearchTab.js
deleted
100644 → 0
View file @
b878657
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
export
default
class
SearchTab
extends
Component
{
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
SearchTab
<
/Text
>
<
/View
>
);
}
}
const
style
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}
});
\ No newline at end of file
Components/Loading.js
0 → 100644
View file @
e01b535
import
React
from
"react"
;
import
{
StyleSheet
,
Text
,
View
,
StatusBar
}
from
"react-native"
;
export
default
function
Loading
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
StatusBar
barStyle
=
"dark-content"
/>
<
Text
style
=
{
styles
.
text
}
>
Getting
the
current
weather
<
/Text
>
<
/View
>
);
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
justifyContent
:
"flex-end"
,
paddingHorizontal
:
30
,
paddingVertical
:
100
,
backgroundColor
:
"#FDF6AA"
},
text
:
{
color
:
"#2c2c2c"
,
fontSize
:
30
}
});
Components/Movie_info.js
0 → 100644
View file @
e01b535
import
React
from
"react"
;
import
{
StyleSheet
,
Text
,
View
}
from
'react-native'
;
import
{
AsyncStorage
}
from
"react-native"
;
import
Loading
from
"./Loading"
;
import
axios
from
"axios"
;
const
API_KEY
=
"2bf00f660b1a6a3ffeb6e06ac270cce3"
;
const
NAVER_CLIENT_ID
=
"KqPsntd1hcPJ8FUPBGqN"
;
const
NAVER_CLIENT_SECRET
=
"0GRb3uya1U"
;
// const option = {
// query: "겨울왕국"
// };
// request.get(
// {
// uri: "https://openapi.naver.com/v1/search/movie", //xml 요청 주소는 https://openapi.naver.com/v1/search/image.xml
// qs: option,
// headers: {
// "X-Naver-Client-Id": NAVER_CLIENT_ID,
// "X-Naver-Client-Secret": NAVER_CLIENT_SECRET
// }
// },
// function(err, res, body) {
// let json = JSON.parse(body); //json으로 파싱
// console.log(json);
// }
// );
export
default
class
extends
React
.
Component
{
state
=
{
isLoading
:
true
};
getNaverApi
=
async
()
=>
{
fetch
(
"https://openapi.naver.com/v1/search/movie.json?query='겨울왕국 2'"
,
{
headers
:
{
"X-Naver-Client-Id"
:
NAVER_CLIENT_ID
,
"X-Naver-Client-Secret"
:
NAVER_CLIENT_SECRET
}
})
.
then
(
response
=>
response
.
json
())
.
then
(
json
=>
{
console
.
log
(
json
.
items
[
0
].
image
);
});
};
getMovieList
=
async
()
=>
{
axios
.
get
(
`http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=
${
API_KEY
}
&targetDt=20191129`
)
.
then
(
response
=>
{
for
(
var
i
=
0
;
i
<
10
;
i
++
)
{
console
.
log
(
response
.
data
.
boxOfficeResult
.
dailyBoxOfficeList
[
i
].
movieNm
);
}
})
.
catch
(
error
=>
{
console
.
log
(
error
);
});
};
componentDidMount
()
{
this
.
getMovieList
();
this
.
getNaverApi
();
}
render
()
{
return
(
<
View
>
<
Text
>
WantToWatchTab
<
/Text
>
<
/View
>
);
}
}
\ No newline at end of file
Please
register
or
login
to post a comment