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
96171eb6
Commit
96171eb6
authored
Sep 06, 2019
by
Tonk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix iOS edit timer, add search bar on smart device screen
parent
14a6e205
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
9 deletions
+33
-9
screens/Private/HistoryScreen/HistoryScreen.js
+1
-1
screens/Private/NotificationScreen/NotificationScreen.js
+1
-2
screens/Private/SettingScreen/WifiSelectScreen.js
+1
-1
screens/Private/SmartMeterScreen/SmartMeterScreen.js
+19
-0
screens/Private/TimerScreen/TimerScreen.ios.js
+11
-5
No files found.
screens/Private/HistoryScreen/HistoryScreen.js
View file @
96171eb6
...
...
@@ -160,7 +160,7 @@ export default class HistoryScreen extends React.Component {
svg
=
{{
fontSize
:
8
,
fill
:
color
.
grey
}}
/
>
<
/View
>
<
View
style
=
{{
paddingHorizontal
:
10
,
marginBottom
:
isIphoneX
()
?
120
:
5
5
}}
>
<
View
style
=
{{
paddingHorizontal
:
10
,
marginBottom
:
isIphoneX
()
?
120
:
8
5
}}
>
<
Text
style
=
{
theme
.
normalText
}
>
Info
<
/Text
>
<
View
style
=
{{
backgroundColor
:
color
.
white
,
marginTop
:
10
,
borderRadius
:
8
}}
>
<
FlatList
...
...
screens/Private/NotificationScreen/NotificationScreen.js
View file @
96171eb6
...
...
@@ -11,13 +11,12 @@ import RNPickerSelect from 'react-native-picker-select';
import
CalendarPicker
from
'react-native-calendar-picker'
;
import
{
TouchableWithoutFeedback
}
from
'react-native-gesture-handler'
;
import
{
withNavigationFocus
}
from
'react-navigation'
;
import
dt2
from
'./notification.json'
;
const
tabHeader
=
[
{
type
:
'all'
,
label
:
'All'
},
{
type
:
'notification'
,
label
:
'Notification'
},
{
type
:
'log'
,
label
:
'Logging'
},
];
const
dt2
=
require
(
'./notification.json'
);
class
NotificationScreen
extends
React
.
Component
{
static
navigationOptions
=
({
navigation
})
=>
({
title
:
'Notifications'
,
...
...
screens/Private/SettingScreen/WifiSelectScreen.js
View file @
96171eb6
...
...
@@ -31,7 +31,7 @@ export default class WifiSelectScreen extends React.Component {
ListHeaderComponent
=
{()
=>
<
Text
style
=
{
styles
.
header
}
>
Choose
a
network
<
/Text>
}
keyExtractor
=
{(
item
,
index
)
=>
index
}
ItemSeparatorComponent
=
{()
=>
<
View
style
=
{
styles
.
separator
}
/>
}
style
=
{{
marginBottom
:
isIphoneX
()
?
100
:
5
5
}}
style
=
{{
marginBottom
:
isIphoneX
()
?
100
:
6
5
}}
/
>
);
}
...
...
screens/Private/SmartMeterScreen/SmartMeterScreen.js
View file @
96171eb6
...
...
@@ -55,6 +55,25 @@ class SmartMeterScreen extends PureComponent {
return
!
error
?
(
<>
<
View
style
=
{{
padding
:
15
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
backgroundColor
:
color
.
defaultBg
,
}}
>
<
SearchBar
containerStyle
=
{
styles
.
searchBarContainer
}
inputContainerStyle
=
{
styles
.
searchBarInputContainer
}
inputStyle
=
{
styles
.
searchBarInput
}
round
lightTheme
placeholder
=
"Search..."
onChangeText
=
{
text
=>
this
.
updateSearch
(
text
)}
value
=
{
this
.
state
.
search
}
/
>
<
/View
>
<
FlatList
refreshControl
=
{
<
RefreshControl
...
...
screens/Private/TimerScreen/TimerScreen.ios.js
View file @
96171eb6
...
...
@@ -82,10 +82,12 @@ class TimerScreen extends Component {
}
setPickerSelectData
=
()
=>
{
let
pickerSelectData
=
[{
label
:
'Main Device'
,
value
:
'main'
}];
let
pickerSelectData
=
[
{
label
:
`Main Device
${
currentSelectedData
.
name
?
`[
${
currentSelectedData
.
name
}
]`
:
''
}
`
,
value
:
'main'
},
];
this
.
props
.
existedData
.
map
((
mcbLink
,
index
)
=>
{
pickerSelectData
.
push
({
label
:
`MCB Link
${
index
+
1
}
`
,
value
:
index
+
1
});
pickerSelectData
.
push
({
label
:
`MCB Link
${
index
+
1
}
${
mcbLink
.
name
?
`[
${
mcbLink
.
name
}
]`
:
''
}
`
});
});
this
.
setState
({
pickerSelectData
});
};
...
...
@@ -152,6 +154,10 @@ class TimerScreen extends Component {
saveTimer
.
setDate
(
0
);
saveTimer
.
setSeconds
(
0
);
let
binary
=
this
.
state
.
repeatOn
.
map
(
x
=>
(
x
.
isRepeat
?
1
:
0
)).
join
(
''
);
let
decimal
=
parseInt
(
binary
,
2
);
console
.
log
(
'timer'
,
Number
(
saveTimer
));
const
timerData
=
{
isActive
:
this
.
state
.
isActive
,
isPowerOn
:
this
.
state
.
isPowerOn
,
...
...
@@ -259,7 +265,7 @@ class TimerScreen extends Component {
<
Text
style
=
{[
theme
.
modalText
,
theme
.
textDark
,
theme
.
mt2
]}
>
Set
Time
<
/Text
>
<
DatePicker
date
=
{
this
.
state
.
timer
}
date
=
{
new
Date
(
this
.
state
.
timer
)
}
onDateChange
=
{
date
=>
this
.
setState
({
timer
:
date
})}
mode
=
"time"
style
=
{{
...
...
@@ -301,7 +307,7 @@ class TimerScreen extends Component {
containerStyle
=
{
styles
.
checkboxContainer
}
fontFamily
=
{
'Avenir-Roman'
}
textStyle
=
{{
fontWeight
:
'normal'
,
color
:
color
.
darkGrey
}}
title
=
{
`Sub
breaker
${
item
.
id
}
`
}
title
=
{
`Sub
Breaker
${
item
.
id
}
${
item
.
name
?
`[
${
item
.
name
}
]`
:
''
}
`
}
checked
=
{
this
.
state
.
subBreakerList
[
index
].
selected
}
checkedIcon
=
{
<
Icon
...
...
@@ -543,7 +549,7 @@ class TimerScreen extends Component {
containerStyle
=
{
styles
.
checkboxContainer
}
fontFamily
=
{
'Avenir-Roman'
}
textStyle
=
{{
fontWeight
:
'normal'
,
color
:
color
.
darkGrey
}}
title
=
{
'Sub breaker '
+
item
.
id
}
title
=
{
`Sub Breaker
${
item
.
id
}
${
item
.
name
?
`[
${
item
.
name
}
]`
:
''
}
`
}
checked
=
{
this
.
state
.
subBreakerList
[
index
].
selected
}
checkedIcon
=
{
<
Icon
name
=
"md-checkbox"
style
=
{{
color
:
color
.
primary
,
fontSize
:
26
}}
/
>
...
...
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