Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sailassist
Project
Project
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
CpjJwWHV
Sailassist
Commits
73b67541
Commit
73b67541
authored
Dec 04, 2023
by
sugita mamoru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通知画面実装
parent
9c00f333
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
23 deletions
+50
-23
NotificationView.swift
Seilassist/Sailassist/Alert/NotificationView.swift
+10
-5
NotificationContentView.swift
...ssist/Sailassist/Alert/View/NotificationContentView.swift
+6
-5
EcaCoordinatesTable.swift
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
+2
-2
ResPushHistory.swift
Seilassist/Sailassist/Json/ResPushHistory.swift
+32
-11
No files found.
Seilassist/Sailassist/Alert/NotificationView.swift
View file @
73b67541
...
@@ -8,15 +8,20 @@
...
@@ -8,15 +8,20 @@
import
SwiftUI
import
SwiftUI
struct
NotificationView
:
View
{
struct
NotificationView
:
View
{
@ObservedObject
var
pushHist
=
SharingData
.
pushHistory
var
body
:
some
View
{
var
body
:
some
View
{
VStack
(
spacing
:
0
){
VStack
(
spacing
:
0
){
TitleView
()
TitleView
()
NotificationContentView
()
ScrollView
{
ForEach
(
pushHist
.
pushHistoryData
.
map
{
$1
}
.
sorted
{
DateTextLib
.
ISO8601Text2UnixTime
(
$0
.
time
)
>
DateTextLib
.
ISO8601Text2UnixTime
(
$1
.
time
)},
id
:
\
.
id
){
data
in
Divider
()
NotificationContentView
(
pushData
:
data
)
.
frame
(
height
:
1
)
.
background
(
ColorSet
.
LineColor04
.
color
)
Divider
()
.
frame
(
height
:
1
)
.
background
(
ColorSet
.
LineColor04
.
color
)
}
}
Spacer
()
Spacer
()
}
}
...
...
Seilassist/Sailassist/Alert/View/NotificationContentView.swift
View file @
73b67541
...
@@ -8,14 +8,15 @@
...
@@ -8,14 +8,15 @@
import
SwiftUI
import
SwiftUI
struct
NotificationContentView
:
View
{
struct
NotificationContentView
:
View
{
var
pushData
:
ResPushHistory
var
body
:
some
View
{
var
body
:
some
View
{
VStack
(
alignment
:
.
leading
,
spacing
:
4
){
VStack
(
alignment
:
.
leading
,
spacing
:
4
){
HStack
(
spacing
:
10
)
{
HStack
(
spacing
:
10
)
{
Text
(
"2023-07-13T08::17:40Z"
)
Text
(
pushData
.
time
??
"2023-07-13T08::17:40Z"
)
.
foregroundColor
(
ColorSet
.
BodyDescriptiion
.
color
)
.
foregroundColor
(
ColorSet
.
BodyDescriptiion
.
color
)
.
font
(
FontStyle
.
SupplementText2
.
font
)
.
font
(
FontStyle
.
SupplementText2
.
font
)
Text
(
"Emergency"
)
Text
(
PushStatus
(
rawValue
:
pushData
.
status
??
0
)?
.
title
??
PushStatus
.
Unknown
.
title
)
.
padding
(
EdgeInsets
(
top
:
4
,
leading
:
8
,
bottom
:
4
,
trailing
:
8
))
.
padding
(
EdgeInsets
(
top
:
4
,
leading
:
8
,
bottom
:
4
,
trailing
:
8
))
.
border
(
ColorSet
.
Body
.
color
,
width
:
1
,
cornerRadius
:
4
)
.
border
(
ColorSet
.
Body
.
color
,
width
:
1
,
cornerRadius
:
4
)
.
foregroundColor
(
ColorSet
.
Body
.
color
)
.
foregroundColor
(
ColorSet
.
Body
.
color
)
...
@@ -24,11 +25,11 @@ struct NotificationContentView: View {
...
@@ -24,11 +25,11 @@ struct NotificationContentView: View {
Spacer
()
Spacer
()
}
}
Text
(
"JTest-Ship"
)
Text
(
pushData
.
title
??
"JTest-Ship"
)
.
foregroundColor
(
ColorSet
.
Body
.
color
)
.
foregroundColor
(
ColorSet
.
Body
.
color
)
.
font
(
FontStyle
.
EmphasisText
.
font
)
.
font
(
FontStyle
.
EmphasisText
.
font
)
Text
(
"Fire emergency notice from ship"
)
Text
(
pushData
.
message
??
"Fire emergency notice from ship"
)
.
foregroundColor
(
ColorSet
.
BodyDescriptiion
.
color
)
.
foregroundColor
(
ColorSet
.
BodyDescriptiion
.
color
)
.
font
(
FontStyle
.
SupplementText2
.
font
)
.
font
(
FontStyle
.
SupplementText2
.
font
)
}
}
...
@@ -38,5 +39,5 @@ struct NotificationContentView: View {
...
@@ -38,5 +39,5 @@ struct NotificationContentView: View {
}
}
#Preview {
#Preview {
NotificationContentView
()
NotificationContentView
(
pushData
:
ResPushHistory
()
)
}
}
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
View file @
73b67541
...
@@ -4313,7 +4313,7 @@ class EcaCoordinatesTable : NSObject {
...
@@ -4313,7 +4313,7 @@ class EcaCoordinatesTable : NSObject {
}
}
var
ecaDataTable
:[
ecaData
]
=
[
var
ecaDataTable
:[
ecaData
]
=
[
ecaData
(
id
:
11
,
name
:
"North American Atlantic Coasts"
,
table
:
northAmericanAtlanticCoasts
)
//
ecaData(id: 11, name: "North American Atlantic Coasts", table: northAmericanAtlanticCoasts)
// ecaData(id: 12, name: "North American Hawai", table: northAmericanHawai),
// ecaData(id: 12, name: "North American Hawai", table: northAmericanHawai),
// ecaData(id: 31, name: "Unites States Caribbean", table: unitesStatesCaribbean),
// ecaData(id: 31, name: "Unites States Caribbean", table: unitesStatesCaribbean),
// ecaData(id: 21, name: "North Sea 1", table: northSea1), //err
// ecaData(id: 21, name: "North Sea 1", table: northSea1), //err
...
@@ -4332,7 +4332,7 @@ class EcaCoordinatesTable : NSObject {
...
@@ -4332,7 +4332,7 @@ class EcaCoordinatesTable : NSObject {
// ecaData(id: 17, name: "Korea Busan Port West", table: koreaBusanPortWest),
// ecaData(id: 17, name: "Korea Busan Port West", table: koreaBusanPortWest),
// ecaData(id: 18, name: "Korea Ulsan Port", table: koreaUlsanPort),
// ecaData(id: 18, name: "Korea Ulsan Port", table: koreaUlsanPort),
// ecaData(id: 19, name: "Panama Canal Atlantic Entrance", table: panamaCanalAtlanticEntrance),
// ecaData(id: 19, name: "Panama Canal Atlantic Entrance", table: panamaCanalAtlanticEntrance),
//
ecaData(id: 20, name: "Panama Canal Pacific Entrance", table: panamaCanalPacificEntrance)
ecaData
(
id
:
20
,
name
:
"Panama Canal Pacific Entrance"
,
table
:
panamaCanalPacificEntrance
)
]
]
func
setEcaData
()
{
func
setEcaData
()
{
...
...
Seilassist/Sailassist/Json/ResPushHistory.swift
View file @
73b67541
...
@@ -8,19 +8,40 @@
...
@@ -8,19 +8,40 @@
import
Foundation
import
Foundation
//status
//status
let
statusUnknown
=
0
enum
PushStatus
:
Int
{
let
statusNormal
=
1
case
Unknown
=
0
let
statusCaution
=
2
case
Normal
=
1
let
statusWarning
=
3
case
Caution
=
2
let
statusAlarm
=
4
case
Warning
=
3
let
statusEmergency
=
5
case
Alarm
=
4
case
Emergency
=
5
var
title
:
String
{
switch
self
{
case
.
Unknown
:
"Unknown"
case
.
Normal
:
"Normal"
case
.
Caution
:
"Caution"
case
.
Warning
:
"Warning"
case
.
Alarm
:
"Alerm"
case
.
Emergency
:
"Emergency"
}
}
}
//type
//type
let
typeRouteAlert
=
0
enum
PushType
:
Int
{
let
typeBamAlert
=
1
case
RouteAlert
=
0
let
typeEmergency
=
2
case
BamAlert
=
1
let
typeChat
=
3
case
Emergency
=
2
let
typeSailassistTask
=
4
case
Chat
=
3
case
SailassistTask
=
4
}
struct
ResPushHistory
:
Codable
{
struct
ResPushHistory
:
Codable
{
var
id
:
Int
?
var
id
:
Int
?
...
...
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