Browse Source

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
893f58ab65
1 changed files with 59 additions and 0 deletions
  1. 59 0
      iOSClient/Settings/NCManageE2EE.swift

+ 59 - 0
iOSClient/Settings/NCManageE2EE.swift

@@ -312,3 +312,62 @@ struct DeleteCerificateSection: View {
     }
 }
 
+struct NCViewE2EETest: View {
+
+    var body: some View {
+
+        VStack {
+            List {
+                Section(header:SectionView(height: 50, text: "Section Header View")) {
+                    Label {
+                        Text(NSLocalizedString("_e2e_settings_activated_", comment: ""))
+                    } icon: {
+                        Image(systemName: "checkmark.circle.fill")
+                            .resizable()
+                            .scaledToFit()
+                            .frame(width: 25, height: 25)
+                            .foregroundColor(.green)
+                    }
+                }
+                Section(header:SectionView(text: "Section Header View 42")) {
+                    Label {
+                        Text(NSLocalizedString("_e2e_settings_activated_", comment: ""))
+                    } icon: {
+                        Image(systemName: "checkmark.circle.fill")
+                            .resizable()
+                            .scaledToFit()
+                            .frame(width: 25, height: 25)
+                            .foregroundColor(.red)
+                    }
+                }
+            }
+        }
+    }
+}
+struct SectionView: View {
+
+    @State var height: CGFloat = 0
+    @State var text: String = ""
+
+    var body: some View {
+        HStack {
+            Text(text)
+        }
+        .frame(maxWidth: .infinity, minHeight: height, alignment: .bottomLeading)
+    }
+}
+
+struct NCViewE2EE_Previews: PreviewProvider {
+    static var previews: some View {
+        NCViewE2EETest()
+    }
+}
+
+extension List {
+
+    func listBackground(_ color: Color) -> some View {
+        UITableView.appearance().backgroundColor = UIColor(color)
+        return self
+    }
+}
+