Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
enzevalos
enzevalos_iphone
Commits
73aa3b02
Commit
73aa3b02
authored
Apr 10, 2021
by
Oliver Wiese
Browse files
new mailrowView
parent
68b51280
Changes
2
Hide whitespace changes
Inline
Side-by-side
enzevalos_iphone/ContactHandler.swift
View file @
73aa3b02
...
...
@@ -24,7 +24,7 @@ import SwiftUI
// TODO: Mark displayname as from CNContact
class
ContactHandler
{
static
var
cartoons
=
tru
e
static
var
cartoons
=
fals
e
private
let
store
=
CNContactStore
()
static
let
handler
=
ContactHandler
()
...
...
enzevalos_iphone/SwiftUI/Inbox/MailRowView.swift
View file @
73aa3b02
...
...
@@ -28,6 +28,55 @@ struct MailRowView <M: DisplayMail>: View {
var
activateOnTap
:
Bool
=
true
var
body
:
some
View
{
body_v2
}
private
var
content
:
String
{
get
{
let
max
=
500
if
mail
.
subject
.
count
<
max
{
return
mail
.
subject
+
"
\n
"
+
mail
.
body
.
prefix
(
max
-
mail
.
subject
.
count
)
}
return
mail
.
subject
}
}
private
var
body_v2
:
some
View
{
VStack
(
alignment
:
.
leading
)
{
HStack
{
// Sender name
Text
(
mail
.
sender
.
name
)
.
fontWeight
(
mail
.
isRead
?
.
regular
:
.
medium
)
.
lineLimit
(
2
)
Spacer
()
if
!
mail
.
displayAttachments
.
isEmpty
{
Image
(
systemName
:
"paperclip"
)
.
font
(
.
caption
)
.
foregroundColor
(
.
secondary
)
}
// Arrival time
Text
(
mail
.
date
.
timeAgoText
())
.
font
(
.
caption
)
.
padding
(
.
trailing
,
-
20
)
}
HStack
{
avatar
// Subject
Text
(
content
)
.
font
(
.
caption
)
.
lineLimit
(
6
)
}
.
padding
(
.
top
,
-
7
)
.
frame
(
height
:
65
)
}
.
foregroundColor
(
mail
.
isRead
?
.
secondary
:
.
primary
)
}
private
var
body_v1
:
some
View
{
HStack
{
avatar
...
...
Write
Preview
Supports
Markdown
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