Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
safetcut-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
atichat
safetcut-app
Commits
e987c33c
Commit
e987c33c
authored
Jul 17, 2019
by
OuiAtichat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add safescrollview to bottomtabs
parent
92b026dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
74 deletions
+100
-74
AppNavigation.js
+62
-44
screens/Private/PageFour.js
+1
-1
screens/Private/SmartMeterScreen/SmartMeterScreen.js
+36
-28
screens/Public/AuthLoadingScreen.js
+1
-1
No files found.
AppNavigation.js
View file @
e987c33c
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Icon
,
View
}
from
'native-base'
;
import
{
Icon
,
View
}
from
'native-base'
;
// import { } from 'react-native';
import
{
import
{
createStackNavigator
,
createStackNavigator
,
createAppContainer
,
createAppContainer
,
createBottomTabNavigator
,
createBottomTabNavigator
,
createSwitchNavigator
,
createSwitchNavigator
,
SafeAreaView
,
}
from
'react-navigation'
;
}
from
'react-navigation'
;
import
{
BottomNavigation
,
BottomNavigationTab
}
from
'react-native-ui-kitten'
;
import
{
BottomNavigation
,
BottomNavigationTab
}
from
'react-native-ui-kitten'
;
...
@@ -109,49 +111,65 @@ const BottomNavigationTabs = props => {
...
@@ -109,49 +111,65 @@ const BottomNavigationTabs = props => {
];
];
return
(
return
(
<
View
style
=
{{
backgroundColor
:
'#f3f3f3'
}}
>
<
SafeAreaView
<
View
style
=
{{
style
=
{{
position
:
'absolute'
,
backgroundColor
:
'white'
,
bottom
:
0
,
borderTopLeftRadius
:
15
,
left
:
0
,
borderTopRightRadius
:
15
,
right
:
0
,
}}
borderTopLeftRadius
:
15
,
>
borderTopRightRadius
:
15
,
<
View
style
=
{{
paddingHorizontal
:
25
}}
>
backgroundColor
:
'white'
,
<
BottomNavigation
shadowColor
:
'#000'
,
{...
props
}
shadowOffset
:
{
// style={{ marginTop: 5 }}
width
:
0
,
selectedIndex
=
{
props
.
navigation
.
state
.
index
}
height
:
6
,
onSelect
=
{
onTabSelect
}
},
indicatorStyle
=
{{
borderRadius
:
5
}}
shadowOpacity
:
0.39
,
>
shadowRadius
:
8.3
,
{
BottomTabs
.
map
((
tab
,
index
)
=>
(
elevation
:
13
,
<
BottomNavigationTab
}}
key
=
{
index
+
tab
.
label
}
>
title
=
{
tab
.
label
}
<
View
style
=
{{
paddingHorizontal
:
25
}}
>
titleStyle
=
{{
fontFamily
:
'Avenir_Roman'
}}
<
BottomNavigation
icon
=
{
props
=>
{
// {...props}
const
color
=
props
.
tintColor
;
style
=
{{
marginTop
:
1
}}
delete
props
.
tintColor
;
// To remove warning
selectedIndex
=
{
props
.
navigation
.
state
.
index
}
return
(
onSelect
=
{
onTabSelect
}
<
Icon
indicatorStyle
=
{{
borderRadius
:
5
}}
style
=
{{
>
marginTop
:
5
,
{
BottomTabs
.
map
((
tab
,
index
)
=>
(
textAlign
:
'center'
,
<
BottomNavigationTab
fontSize
:
20
,
key
=
{
index
+
tab
.
label
}
color
,
title
=
{
tab
.
label
}
}}
titleStyle
=
{{
type
=
{
tab
.
icon
.
type
||
'Ionicons'
}
fontFamily
:
'Avenir_Roman'
,
name
=
{
tab
.
icon
.
name
}
fontSize
:
11
,
/
>
fontWeight
:
'500'
,
);
marginVertical
:
0
,
}}
marginBottom
:
2
,
/
>
}}
))}
icon
=
{
props
=>
{
<
/BottomNavigation
>
let
color
=
props
.
tintColor
;
<
/View
>
delete
props
.
tintColor
;
// To remove warning
return
(
<
Icon
style
=
{{
marginTop
:
5
,
textAlign
:
'center'
,
fontSize
:
20
,
color
,
}}
type
=
{
tab
.
icon
.
type
||
'Ionicons'
}
name
=
{
tab
.
icon
.
name
}
/
>
);
}}
/
>
))}
<
/BottomNavigation
>
<
/View
>
<
/View
>
<
/View
>
<
/
SafeArea
View
>
);
);
};
};
const
MainApp
=
createBottomTabNavigator
(
const
MainApp
=
createBottomTabNavigator
(
...
@@ -160,7 +178,7 @@ const MainApp = createBottomTabNavigator(
...
@@ -160,7 +178,7 @@ const MainApp = createBottomTabNavigator(
One
:
FirstStack
,
One
:
FirstStack
,
Two
:
SecondStack
,
Two
:
SecondStack
,
Tree
:
ThirdStack
,
Tree
:
ThirdStack
,
Four
:
FourthStack
,
Four
:
{
screen
:
FourthStack
,
navigationOptions
:
{
tabBarVisible
:
false
}
}
,
},
},
{
{
initialRouteName
:
'SmartMeter'
,
initialRouteName
:
'SmartMeter'
,
...
@@ -193,7 +211,7 @@ const AppStack = createSwitchNavigator(
...
@@ -193,7 +211,7 @@ const AppStack = createSwitchNavigator(
Main
:
MainApp
,
Main
:
MainApp
,
},
},
{
{
initialRouteName
:
'
AuthLoading
'
,
initialRouteName
:
'
Main
'
,
}
}
);
);
...
...
screens/Private/PageFour.js
View file @
e987c33c
...
@@ -27,7 +27,7 @@ export default class PageFour extends Component {
...
@@ -27,7 +27,7 @@ export default class PageFour extends Component {
render
()
{
render
()
{
return
(
return
(
<
View
>
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'#000'
}}
>
<
Text
>
Logout
demo
<
/Text
>
<
Text
>
Logout
demo
<
/Text
>
<
Button
<
Button
onPress
=
{()
=>
{
onPress
=
{()
=>
{
...
...
screens/Private/SmartMeterScreen/SmartMeterScreen.js
View file @
e987c33c
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Text
}
from
'native-base'
;
import
{
Text
,
Footer
}
from
'native-base'
;
import
{
Image
,
FlatList
,
View
}
from
'react-native'
;
import
{
Image
,
FlatList
,
View
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
increment
,
decrement
}
from
'../../../reduxStore/actions'
;
import
{
increment
,
decrement
}
from
'../../../reduxStore/actions'
;
...
@@ -64,33 +64,41 @@ class SmartMeterScreen extends Component {
...
@@ -64,33 +64,41 @@ class SmartMeterScreen extends Component {
render
()
{
render
()
{
return
(
return
(
<
FlatList
<>
contentContainerStyle
=
{{
backgroundColor
:
'#f3f3f3'
,
paddingHorizontal
:
15
}}
<
FlatList
data
=
{
Meter
}
style
=
{{
keyExtractor
=
{
item
=>
item
.
deviceName
}
flex
:
1
,
ListEmptyComponent
=
{()
=>
(
backgroundColor
:
'#f3f3f3'
,
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
paddingHorizontal
:
15
,
<
Text
>
No
Device
Connected
<
/Text
>
}}
<
/View
>
// contentContainerStyle={{}}
)}
data
=
{
Meter
}
ListHeaderComponent
=
{()
=>
(
keyExtractor
=
{
item
=>
item
.
deviceName
}
<
Text
style
=
{{
fontSize
:
16
,
color
:
color
.
grey3
,
marginVertical
:
20
}}
>
Smart
meter
<
/Text
>
ListEmptyComponent
=
{()
=>
(
)}
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
renderItem
=
{({
item
,
index
})
=>
(
<
Text
>
No
Device
Connected
<
/Text
>
<
MeterCard
<
/View
>
key
=
{
index
+
item
.
deviceName
}
)}
deviceName
=
{
item
.
deviceName
}
ListHeaderComponent
=
{()
=>
(
description
=
{
item
.
description
}
<
Text
style
=
{{
fontSize
:
16
,
color
:
color
.
grey3
,
marginVertical
:
20
}}
>
Smart
meter
<
/Text
>
img
=
{
item
.
img
}
)}
isOnline
=
{
item
.
isOnline
}
renderItem
=
{({
item
,
index
})
=>
(
isOn
=
{
item
.
isOn
}
<
MeterCard
index
=
{
index
+
1
}
key
=
{
index
+
item
.
deviceName
}
onPressEachCard
=
{()
=>
{
deviceName
=
{
item
.
deviceName
}
this
.
props
.
navigation
.
navigate
(
'SmartMeterDetail'
,
{
deviceName
:
item
.
deviceName
});
description
=
{
item
.
description
}
}}
img
=
{
item
.
img
}
/
>
isOnline
=
{
item
.
isOnline
}
)}
isOn
=
{
item
.
isOn
}
/
>
index
=
{
index
+
1
}
onPressEachCard
=
{()
=>
{
this
.
props
.
navigation
.
navigate
(
'SmartMeterDetail'
,
{
deviceName
:
item
.
deviceName
});
}}
/
>
)}
/
>
<
View
style
=
{{
backgroundColor
:
'#f3f3f3'
}}
/
>
<
/
>
);
);
}
}
}
}
...
...
screens/Public/AuthLoadingScreen.js
View file @
e987c33c
...
@@ -23,7 +23,7 @@ export default class AuthLoadingScreen extends Component {
...
@@ -23,7 +23,7 @@ export default class AuthLoadingScreen extends Component {
return
(
return
(
<
View
style
=
{{
flex
:
1
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
View
style
=
{{
flex
:
1
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
ActivityIndicator
size
=
"large"
color
=
"#f44c4c"
/>
<
ActivityIndicator
size
=
"large"
color
=
"#f44c4c"
/>
<
StatusBar
barStyle
=
"default"
/>
<
StatusBar
hidden
/>
<
/View
>
<
/View
>
);
);
}
}
...
...
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