Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
radegast
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jan Hrabal
radegast
Commits
4f5c54ee
Commit
4f5c54ee
authored
Jul 10, 2019
by
jhrabal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
radegast
parent
2d2df240
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
58 deletions
+78
-58
App.js
mobile/App.js
+57
-53
app.json
mobile/app.json
+1
-3
splash.png
mobile/assets/splash.png
+0
-0
package.json
mobile/package.json
+2
-2
yarn.lock
mobile/yarn.lock
+18
-0
No files found.
mobile/App.js
View file @
4f5c54ee
import
React
from
'react'
;
import
{
StyleSheet
,
Text
,
View
,
TouchableOpacity
,
AsyncStorage
,
Alert
,
StatusBar
,
ImageBackground
,
Image
}
from
'react-native'
;
import
{
Text
,
View
,
TouchableOpacity
,
AsyncStorage
,
StatusBar
,
Image
}
from
'react-native'
;
import
EStyleSheet
from
'react-native-extended-stylesheet'
;
const
SEND_DATA_TIMER
=
60000
;
...
...
@@ -14,8 +16,7 @@ class App extends React.PureComponent {
super
(
props
);
this
.
state
=
{
mode
:
'rating'
,
stats
:
{},
statsLoading
:
false
,
lastRating
:
null
,
buffer
:
[]
};
...
...
@@ -79,7 +80,7 @@ class App extends React.PureComponent {
let
rating
=
{
rating
:
r
,
key
};
try
{
this
.
setState
({
mode
:
"info"
});
this
.
setState
({
mode
:
"info"
,
lastRating
:
r
});
await
AsyncStorage
.
setItem
(
JSON
.
stringify
(
key
),
JSON
.
stringify
(
rating
));
//add to buffer
...
...
@@ -95,53 +96,29 @@ class App extends React.PureComponent {
}
renderResults
()
{
return
<
View
><
/View
>
}
renderInfo
()
{
return
<
View
style
=
{
styles
.
center
}
><
Text
>
D
ě
kujeme
za
hodnocen
í
<
/Text></
View
>
}
render
()
{
let
{
mode
,
lastRating
}
=
this
.
state
;
let
showInfo
=
mode
==
"info"
;
renderRating
()
{
const
buttons
=
[];
for
(
let
i
=
1
;
i
<=
10
;
i
++
)
{
buttons
.
push
(
<
TouchableOpacity
key
=
{
i
}
onPress
=
{
this
.
onPress
(
i
)
}
>
<
Text
style
=
{
styles
.
rating
}
>
{
i
}
<
/Text
>
<
/TouchableOpacity
>
buttons
.
push
(
<
TouchableOpacity
key
=
{
i
}
onPress
=
{
this
.
onPress
(
i
)
}
>
<
View
style
=
{
styles
.
rating
}
>
<
Text
style
=
{
styles
.
ratingNumber
}
>
{
i
}
<
/Text
>
{
showInfo
&&
lastRating
&&
i
<=
lastRating
?
<
Image
source
=
{
require
(
'./assets/siska.png'
)
}
style
=
{
styles
.
ratingImage
}
/> : null
}
<
/View
>
<
/TouchableOpacity
>
);
}
return
(
<
View
style
=
{
styles
.
ratingsContainer
}
>
{
buttons
}
<
/View
>
);
}
render
()
{
let
{
mode
}
=
this
.
state
;
let
content
=
null
;
switch
(
mode
)
{
case
'results'
:
content
=
this
.
renderResults
();
break
;
case
'info'
:
default
:
content
=
this
.
renderRating
();
}
return
(
<
View
style
=
{
styles
.
container
}
>
<
StatusBar
hidden
/>
<
Image
source
=
{
require
(
'./assets/bg.jpg'
)
}
style
=
{{
width
:
'100%'
,
height
:
'100%'
,
position
:
'absolute'
}}
imageStyle
=
{{
resizeMode
:
'stretch'
}}
/
>
{
content
}
<
Image
source
=
{
require
(
'./assets/bg.jpg'
)
}
style
=
{
styles
.
bg
}
imageStyle
=
{{
resizeMode
:
'stretch'
}}
/
>
<
View
style
=
{
styles
.
ratingsContainer
}
>
{
buttons
}
<
/View
>
<
/View
>
);
}
...
...
@@ -153,20 +130,35 @@ class App extends React.PureComponent {
export
default
App
;
const
styles
=
StyleSheet
.
create
({
EStyleSheet
.
build
({});
const
styles
=
EStyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
'#000000'
,
width
:
'100%'
,
height
:
'100%'
},
center
:
{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
bg
:
{
width
:
'100%'
,
height
:
'100%'
,
position
:
'absolute'
},
ratingsContainer
:
{
position
:
'absolute'
,
left
:
0
,
top
:
'3
5
%'
,
top
:
'3
2
%'
,
width
:
'100%'
,
flexDirection
:
'row'
,
alignItems
:
'
center
'
,
alignItems
:
'
flex-start
'
,
justifyContent
:
'space-around'
,
color
:
'#FFFFFF'
,
paddingLeft
:
'5%'
,
...
...
@@ -174,16 +166,28 @@ const styles = StyleSheet.create({
},
rating
:
{
flexDirection
:
'column'
,
justifyContent
:
'flex-start'
,
alignItems
:
'center'
,
position
:
'relative'
},
ratingNumber
:
{
backgroundColor
:
'#FFFFFF'
,
fontSize
:
20
,
borderRadius
:
14
,
width
:
28
,
height
:
28
,
fontSize
:
'1.4rem'
,
borderRadius
:
'1rem'
,
width
:
'2rem'
,
height
:
'2rem'
,
textAlign
:
'center'
},
container
:
{
flex
:
1
,
backgroundColor
:
'#000000'
},
ratingImage
:
{
resizeMode
:
'contain'
,
position
:
'absolute'
,
top
:
'3rem'
,
height
:
'4.5rem'
}
});
mobile/app.json
View file @
4f5c54ee
...
...
@@ -13,9 +13,7 @@
"orientation"
:
"landscape"
,
"icon"
:
"./assets/icon.png"
,
"splash"
:
{
"image"
:
"./assets/bg.jpg"
,
"resizeMode"
:
"contain"
,
"backgroundColor"
:
"#000000"
"backgroundColor"
:
"#BCBCBC"
},
"updates"
:
{
"fallbackToCacheTimeout"
:
0
...
...
mobile/assets/splash.png
0 → 100644
View file @
4f5c54ee
67 Bytes
mobile/package.json
View file @
4f5c54ee
...
...
@@ -12,10 +12,11 @@
"react"
:
"16.8.3"
,
"react-dom"
:
"^16.8.6"
,
"react-native"
:
"https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz"
,
"react-native-extended-stylesheet"
:
"^0.12.0"
,
"react-native-web"
:
"^0.11.4"
},
"devDependencies"
:
{
"babel-preset-expo"
:
"^5.1.1"
},
"private"
:
true
}
\ No newline at end of file
}
mobile/yarn.lock
View file @
4f5c54ee
...
...
@@ -1496,6 +1496,11 @@ css-in-js-utils@^2.0.0:
hyphenate-style-name "^1.0.2"
isobject "^3.0.1"
css-mediaquery@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/css-mediaquery/-/css-mediaquery-0.1.2.tgz#6a2c37344928618631c54bd33cedd301da18bea0"
integrity sha1-aiw3NEkoYYYxxUvTPO3TAdoYvqA=
debounce@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.0.tgz#44a540abc0ea9943018dc0eaa95cce87f65cd131"
...
...
@@ -3485,6 +3490,11 @@ object-keys@^1.0.11, object-keys@^1.0.12:
version "1.1.1"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
object-resolve-path@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/object-resolve-path/-/object-resolve-path-1.1.1.tgz#a7f8f93e8a20af80e44217ba7db54316d9d12232"
integrity sha1-p/j5Poogr4DkQhe6fbVDFtnRIjI=
object-visit@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb"
...
...
@@ -3863,6 +3873,14 @@ react-native-branch@2.2.5:
version "2.2.5"
resolved "https://registry.yarnpkg.com/react-native-branch/-/react-native-branch-2.2.5.tgz#4074dd63b4973e6397d9ce50e97b57c77a518e9d"
react-native-extended-stylesheet@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/react-native-extended-stylesheet/-/react-native-extended-stylesheet-0.12.0.tgz#ebacf22d78a8e2173bdef2a08cbf1acba4dc051f"
integrity sha512-y4MEI+a9F8qtAKEjxKbwqotJg1FqKfl6vaiF25ULZ/VGkWI4GNTnsFunU9x6B3XJ6ly1E8O9fybO63u6UazL/A==
dependencies:
css-mediaquery "^0.1.2"
object-resolve-path "^1.1.0"
react-native-gesture-handler@1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.2.1.tgz#9c48fb1ab13d29cece24bbb77b1e847eebf27a2b"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment