Commit e67ee647 authored by Oliver Wiese's avatar Oliver Wiese

clean code

parent f92d39fe
......@@ -161,7 +161,6 @@
47C822682438A85C005BCE73 /* SenderDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47C822662438A85C005BCE73 /* SenderDetails.swift */; };
47C822692438A85C005BCE73 /* PhishingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47C822672438A85C005BCE73 /* PhishingView.swift */; };
47C8226B2438A86B005BCE73 /* SenderViewMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47C8226A2438A86A005BCE73 /* SenderViewMain.swift */; };
47C8226D2438C2CF005BCE73 /* ReadViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47C8226C2438C2CF005BCE73 /* ReadViewModel.swift */; };
47CD5AAA2012368D00E771A1 /* logging_pk.asc in Resources */ = {isa = PBXBuildFile; fileRef = 47CD5AA82012368D00E771A1 /* logging_pk.asc */; };
47CD5AAD2012369400E771A1 /* support_pk2.asc in Resources */ = {isa = PBXBuildFile; fileRef = 47CD5AAC2012369300E771A1 /* support_pk2.asc */; };
47CEAC98222541B40075B7DC /* MailSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47CEAC97222541B40075B7DC /* MailSession.swift */; };
......@@ -613,7 +612,6 @@
47C822662438A85C005BCE73 /* SenderDetails.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SenderDetails.swift; sourceTree = "<group>"; };
47C822672438A85C005BCE73 /* PhishingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhishingView.swift; sourceTree = "<group>"; };
47C8226A2438A86A005BCE73 /* SenderViewMain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SenderViewMain.swift; sourceTree = "<group>"; };
47C8226C2438C2CF005BCE73 /* ReadViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadViewModel.swift; sourceTree = "<group>"; };
47CD5AA82012368D00E771A1 /* logging_pk.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = logging_pk.asc; path = keys/logging_pk.asc; sourceTree = "<group>"; };
47CD5AAC2012369300E771A1 /* support_pk2.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = support_pk2.asc; path = keys/support_pk2.asc; sourceTree = "<group>"; };
47CEAC97222541B40075B7DC /* MailSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailSession.swift; sourceTree = "<group>"; };
......@@ -1281,7 +1279,6 @@
47C8224224379EAE005BCE73 /* Tabbed Views */,
47C8225124379EAE005BCE73 /* ReadViewCoordinator.swift */,
47C8225224379EAE005BCE73 /* ReadMainView.swift */,
47C8226C2438C2CF005BCE73 /* ReadViewModel.swift */,
);
path = Read;
sourceTree = "<group>";
......@@ -2259,7 +2256,6 @@
4751C7002344D37C006B2A4D /* SecretKey+CoreDataClass.swift in Sources */,
A1AEBA5921E808CB00C84E59 /* IntroYesNoViewController.swift in Sources */,
A1EB05941D956931008659C1 /* InboxCellDelegator.swift in Sources */,
47C8226D2438C2CF005BCE73 /* ReadViewModel.swift in Sources */,
47C822602437A143005BCE73 /* CornerRounder.swift in Sources */,
8428A85D1F436A05007649A5 /* Badges.swift in Sources */,
4775D7AC243F18BC0052F2CC /* SecurityBriefingView.swift in Sources */,
......
......@@ -73,14 +73,12 @@ class ReadViewCoordinator {
}
func delete(mail: PersistentMail){
//TODO: make this work
Logger.log(delete: mail, toTrash: true)
AppDelegate.getAppDelegate().mailHandler.move(mails: [mail], from: mail.folder.path, to: UserManager.backendTrashFolderPath)
AppDelegate.getAppDelegate().presentInboxViewController()
}
func archive(mail: PersistentMail){
//TODO: make this work
Logger.log(archive: mail)
AppDelegate.getAppDelegate().mailHandler.move(mails: [mail], from: mail.folder.path, to: UserManager.backendArchiveFolderPath)
}
......
//
// ReadViewModel.swift
// enzevalos_iphone
//
// Created by Oliver Wiese on 04.04.20.
// Copyright © 2020 fu-berlin. All rights reserved.
//
import Foundation
import SwiftUI
class ReadViewModel: ObservableObject {
// Meta data
let senderName: String
let senderImg: Image
let landmarks: [Landmark]
let ccsNames: [String]
let bccsNames: [String]
init(senderName: String, senderImg: Image, landmarks: [Landmark], ccs: [String], bccs: [String]) {
self.senderName = senderName
self.senderImg = senderImg
self.landmarks = landmarks
self.ccsNames = ccs
self.bccsNames = bccs
}
}
......@@ -28,7 +28,7 @@ struct CardV<Content:View>: View{
var content: () -> Content
@State private var isAdvancedVisable:Bool = false
@/*Gesture*/State private var isTapDownB:Bool = false
@State private var isTapDownB:Bool = false
private let colo=Color(red:0.85,green:0.85,blue:0.88)
......
......@@ -14,15 +14,11 @@ struct MessageViewMain <M: DisplayMail>: View {
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
let innerPadding:CGFloat = 20 // button radius
let outerPadding:CGFloat = 5
let innerPadding: CGFloat = 20 // button radius
let outerPadding: CGFloat = 5
let extraButtonFactor: CGFloat = 0.8
@State var showExtraButtons:Bool = false
func action() {
print("Click!")
}
@State var showExtraButtons: Bool = false
var body: some View {
ZStack{
......@@ -66,7 +62,6 @@ struct MessageViewMain <M: DisplayMail>: View {
HStack{
Spacer()
ZStack{
if mail.folderType == FolderType.Archive {
forwardButton.offset(y: showExtraButtons ? -innerPadding*9 : 0)
replyAllButton.offset(y: showExtraButtons ? -innerPadding*4.5 : 0)
......@@ -160,7 +155,7 @@ struct MessageViewMain <M: DisplayMail>: View {
radius: innerPadding*extraButtonFactor,
onShortPress: {
self.moveMail(target: .Trash)
self.presentationMode.wrappedValue.dismiss()}/*TODO: fill in stuff*/
self.presentationMode.wrappedValue.dismiss()}
){
VStack{
Image(systemName: "trash")
......
......@@ -123,7 +123,7 @@ struct WarningView: View {
init(warning: Dialog) {
title = warning.title
description = warning.body
icon = Image(systemName: "xmark.octagon.fill") //warning.img
icon = Image(systemName: "xmark.octagon.fill")
color = warning.dialogColor
if let ctaTitle = warning.ctaButtonTitle, let ctaAction = warning.ctaButtonAction {
ctaButton = ButtonStruct(titleKey: ctaTitle, action: ctaAction, type: .CTA)
......@@ -189,9 +189,6 @@ struct InfoView: View {
Text(titleString)
.font(.headline)
.padding(padding)
// Text(descriptionString)
// .fontWeight(.light)
// .padding(padding)
HStack {
icon
Text(stateString)
......@@ -205,13 +202,13 @@ struct InfoView: View {
var color: Color
switch rating {
case .Positiv:
image = Image(systemName: "hand.thumbsup")//"checkmark")
image = Image(systemName: "hand.thumbsup")
color = Color(ThemeManager.encryptedMessageColor())
case .Neutral:
image = Image(systemName: "hand.thumbsdown")
color = Color(ThemeManager.unencryptedMessageColor())
case .Negativ:
image = Image(systemName: "xmark.ocatgon.fill")//"hand.raised")
image = Image(systemName: "xmark.ocatgon.fill")
color = Color(ThemeManager.troubleMessageColor())
}
image = image.resizable()
......
......@@ -34,7 +34,6 @@ struct AllPhishingContent: Identifiable {
let message: String
}
//not
struct PhishingView : View {
/// This content stores the phishing information in a list
var PhishingList = [
......@@ -45,21 +44,14 @@ struct PhishingView : View {
]
var body: some View {
List(PhishingList) { AllPhishingContent in
List(PhishingList) { AllPhishingContent in
VStack {
Text("Identification").bold()
Text(AllPhishingContent.name)
Text(AllPhishingContent.message).italic()
}
}
}
}
}
......
......@@ -36,20 +36,16 @@ struct SenderDetails: View {
@State private var moreDetails = false
var body: some View {
VStack (alignment: .leading, spacing: 20) {
Text("Sender:")
.font(.subheadline)
.padding(.bottom, 5)
HStack(alignment: .top) {
Text("More Details")
.foregroundColor(.blue)
.font(.system(size: 10))
Button (action: {
self.moreDetails.toggle()
}) {
Image(systemName: moreDetails ? "chevron.up" : "chevron.down")
.resizable()
.frame(width: 12.0, height: 7.0)
......
......@@ -101,6 +101,7 @@
"Next" = "Next";
"Button.Next" = "Next";
"next" = "next";
"Button.Prev" = "Prev";
"None" = "None";
"NormalPassword" = "Normal, password";
"Now" = "just now";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment