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
korkeep
2019-12-12 20:08:00 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
89606a8e47bbb6cba48194dd58b962f777680ee5
89606a8e
1 parent
e7a8c9e4
일단은 refresh 버튼 누르면 업데이트되는 것까진 구현함
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
Components/AppTabNavigator/MovieRankingTab.js
Components/AppTabNavigator/WantToWatchTab.js
assets/refresh.png
Components/AppTabNavigator/MovieRankingTab.js
View file @
89606a8
...
...
@@ -12,12 +12,18 @@ import {
import
{
Icon
}
from
"native-base"
;
import
{
AsyncStorage
}
from
"react-native"
;
import
axios
from
"axios"
;
import
WantToWatchTab
from
'./WantToWatchTab'
;
const
API_KEY
=
"2bf00f660b1a6a3ffeb6e06ac270cce3"
;
const
NAVER_CLIENT_ID
=
"KqPsntd1hcPJ8FUPBGqN"
;
const
NAVER_CLIENT_SECRET
=
"0GRb3uya1U"
;
//List 전역변수 선언하기
//list = "";
export
default
class
MovieRankingTab
extends
Component
{
state
=
{
list
:
""
,
//Add하고 싶은 정보 list
flag
:
false
,
//WantToWatchTab을 새로고침 할지 말지 여부
isLoading
:
true
,
info
:
[],
date
:
""
,
...
...
@@ -212,9 +218,10 @@ export default class MovieRankingTab extends Component {
_onPressButton
(
temp
)
{
//this.state.list = ""; //초기화(On Off 기능으로 짜놨습니당, 누적되는거 보고싶으면 이부분 주석달면 돼여)
Alert
.
alert
(
temp
);
//메시지 띄우고
this
.
state
.
list
=
this
.
state
.
list
+
'\n'
+
temp
;
//list 누적해준다(endl으로 구분)
this
.
state
.
list
=
this
.
state
.
list
+
temp
+
'\n'
;
//list 누적해준다(endl으로 구분)
console
.
log
(
this
.
state
.
list
);
//콘솔에 log 띄운다
AsyncStorage
.
setItem
(
'MovieLists'
,
this
.
state
.
list
);
//DB에 저장한다
//WantToWatchTab.render(); //새로고침
}
render
()
{
...
...
Components/AppTabNavigator/WantToWatchTab.js
View file @
89606a8
...
...
@@ -10,6 +10,7 @@ import {
}
from
'react-native'
;
import
{
Icon
}
from
"native-base"
;
import
axios
from
"axios"
;
import
MovieRankingTab
from
'./MovieRankingTab'
;
const
API_KEY
=
"2bf00f660b1a6a3ffeb6e06ac270cce3"
;
const
NAVER_CLIENT_ID
=
"KqPsntd1hcPJ8FUPBGqN"
;
const
NAVER_CLIENT_SECRET
=
"0GRb3uya1U"
;
...
...
@@ -83,8 +84,9 @@ export default class App extends Component {
//Data 설정함수
setData
=
async
()
=>
{
try
{
this
.
state
.
list
=
await
AsyncStorage
.
getItem
(
'MovieLists'
);
//List에 받아온다
//console.log(this.state.list); //잘 뜨는데??
//요거 바꿔봤다
this
.
state
.
list
=
await
AsyncStorage
.
getItem
(
'MovieLists'
);
//List에 받아온다
console
.
log
(
this
.
state
.
list
);
//잘 뜨는데??
}
catch
(
error
)
{
alert
(
error
)
...
...
@@ -96,8 +98,9 @@ export default class App extends Component {
return
(
<
View
style
=
{
styles
.
container
}
>
<
TouchableOpacity
onPress
=
{
this
.
componentDidMount
.
bind
(
this
)}
>
{
/* 눌러용 누르면 리스트 갱신됩니다 */
}
<
Text
style
=
{
styles
.
textStyle
}
>
눌러용
<
/Text
>
{
/* 버튼 누르면 리스트 갱신됩니다 */
}
<
Image
source
=
{
require
(
'../../assets/refresh.png'
)}
/
>
{
/* <Text style={styles.textStyle}>Refresh Button</Text> */
}
<
/TouchableOpacity
>
<
Text
style
=
{
styles
.
textStyle
}
>
{
this
.
state
.
list
}
<
/Text
>
<
/View
>
...
...
assets/refresh.png
0 → 100644
View file @
89606a8
2.48 KB
Please
register
or
login
to post a comment