Toggle navigation
Toggle navigation
This project
Loading...
Sign in
윤창신
/
searchGuide
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
bluejoyq
2019-11-19 10:46:40 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b2ed7fa054216a281cf21040a633fb962d9bbcce
b2ed7fa0
1 parent
2bc40f56
add toggle loading and edit alert message
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
11 deletions
searchGuide/.expo/packager-info.json
searchGuide/App.js
searchGuide/components/AppContainer/AppContainer.js
searchGuide/components/Loading/Loading.js
searchGuide/components/SearchBar/SearchBar.js
searchGuide/.expo/packager-info.json
View file @
b2ed7fa
...
...
@@ -2,8 +2,8 @@
"devToolsPort"
:
19002
,
"expoServerPort"
:
19000
,
"packagerPort"
:
19001
,
"packagerPid"
:
1
9948
,
"packagerPid"
:
1
8100
,
"expoServerNgrokUrl"
:
"https://ep-ukj.anonymous.searchguide.exp.direct"
,
"packagerNgrokUrl"
:
"https://packager.ep-ukj.anonymous.searchguide.exp.direct"
,
"ngrokPid"
:
12884
"ngrokPid"
:
20760
}
...
...
searchGuide/App.js
View file @
b2ed7fa
import
React
from
'react'
;
import
{
View
,
ActivityIndicator
,
StyleSheet
}
from
'react-native'
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
import
AppContainer
from
'./components/AppContainer/AppContainer'
;
import
Loading
from
'./components/Loading/Loading'
;
export
default
class
App
extends
React
.
Component
{
constructor
(
props
){
super
(
props
);
this
.
state
=
{
loading
:
tru
e
loading
:
fals
e
};
}
toggleLoading
=
()
=>
{
this
.
setState
({
loading
:
true
});
}
render
(){
return
(
<>
{
this
.
state
.
loading
?
<
View
><
ActivityIndicator
size
=
"large"
color
=
"#0000ff"
/><
/View> :
null
}
<
AppContainer
/>
{
this
.
state
.
loading
?
<
Loading
/>
:
null
}
<
AppContainer
toggleLoading
=
{
this
.
toggleLoading
}
/
>
<
/
>
)
}
...
...
searchGuide/components/AppContainer/AppContainer.js
View file @
b2ed7fa
...
...
@@ -6,10 +6,13 @@ import Home from '../Home/Home';
import
Rate
from
'../Rate/Rate'
;
const
HomeScreen
=
(
props
)
=>
(
<
Home
toggleLoading
=
{
props
.
toggleLoading
}
/>
)
;
const
RateScreen
=
(
props
)
=>
(
<
Rate
toggleLoading
=
{
props
.
toggleLoading
}
/>
)
;
const
AppTabNavigator
=
createMaterialTopTabNavigator
(
{
Home
:
Home
,
Rate
:
Rate
Home
:
Home
Screen
,
Rate
:
Rate
Screen
},
{
initialRouteName
:
'Home'
,
...
...
searchGuide/components/Loading/Loading.js
0 → 100644
View file @
b2ed7fa
import
React
from
'react'
;
import
{
View
,
ActivityIndicator
,
StyleSheet
,
Dimensions
,
Modal
}
from
'react-native'
const
Loading
=
()
=>
{
return
(
<
Modal
transparent
=
{
true
}
animationType
=
{
'none'
}
>
<
View
style
=
{
styles
.
container
}
><
ActivityIndicator
size
=
{
80
}
color
=
"#ffffff"
/><
/View
>
<
/Modal
>
)
}
const
styles
=
StyleSheet
.
create
({
container
:
{
zIndex
:
2
,
height
:
Dimensions
.
get
(
'window'
).
height
,
width
:
'100%'
,
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
backgroundColor
:
'rgba(15,15,15,0.7)'
,
paddingBottom
:
50
,
},
});
export
default
Loading
;
\ No newline at end of file
searchGuide/components/SearchBar/SearchBar.js
View file @
b2ed7fa
import
React
from
'react'
;
import
{
View
,
ScrollView
}
from
'react-native'
;
import
{
View
,
ScrollView
,
Alert
}
from
'react-native'
;
import
{
Searchbar
,
Divider
,
Text
}
from
'react-native-paper'
;
import
Icon
from
'react-native-vector-icons/FontAwesome'
;
...
...
@@ -21,6 +21,16 @@ export default class SearchBar extends React.Component {
this
.
setState
({
query
:
''
});
}
voiceRecognition
=
()
=>
{
Alert
.
alert
(
'음성 인식'
,
'아직 구현 못함'
,
[
{
text
:
'확인'
,
onPress
:
()
=>
{}},
],
)
}
render
(){
return
(
<>
...
...
@@ -30,7 +40,7 @@ export default class SearchBar extends React.Component {
onChangeText
=
{
this
.
queryChange
}
value
=
{
this
.
state
.
query
}
icon
=
'microphone'
onIconPress
=
{
()
=>
{
alert
(
"원래는 음성 인식 창!"
)}
}
onIconPress
=
{
this
.
voiceRecognition
}
onSubmitEditing
=
{
this
.
submit
}
/
>
<
/View
>
...
...
Please
register
or
login
to post a comment