Эх сурвалжийг харах

coding

Signed-off-by: marinofaggiana <marino.faggiana@nextcloud.com>
marinofaggiana 2 жил өмнө
parent
commit
a7c6d80249

+ 0 - 1
Widget/Nextcloud/NextcloudData.swift

@@ -27,7 +27,6 @@ import NCCommunication
 let imageSize:CGFloat = 30
 let spacingImageUpload:CGFloat = 10
 
-
 struct NextcloudDataEntry: TimelineEntry {
     let date: Date
     let recentDatas: [RecentData]

+ 46 - 38
Widget/Nextcloud/NextcloudWidgetView.swift

@@ -71,42 +71,50 @@ struct NextcloudWidgetView: View {
                         .frame(width: geo.size.width, height: 30.0)
 
                     HStack(spacing: 0) {
-                        Button(action: {
-                            Link(destination: URL(string: "nextcloud://open-action?action=upload-asset")!) { }
-                        }) {
-                            Image("buttonAddImage")
-                                .resizable()
-                                .renderingMode(.template)
-                                .foregroundColor(Color(NCBrandColor.shared.brandText))
-                                .padding(10)
-                                .background(Color(NCBrandColor.shared.brand))
-                                .clipShape(Circle())
-                                .scaledToFit()
-                        }.frame(width: geo.size.width/3, height: 50)
-                        Button(action: {
-                            Link(destination: URL(string: "nextcloud://open-action?action=add-scan-document")!) { }
-                        }) {
-                            Image("buttonAddScan")
-                                .resizable()
-                                .renderingMode(.template)
-                                .foregroundColor(Color(NCBrandColor.shared.brandText))
-                                .padding(10)
-                                .background(Color(NCBrandColor.shared.brand))
-                                .clipShape(Circle())
-                                .scaledToFit()
-                        }.frame(width: geo.size.width/3, height: 50)
-                        Button(action: {
-                            Link(destination: URL(string: "nextcloud://open-action?action=create-voice-memo")!) { }
-                        }) {
-                            Image("microphone")
-                                .resizable()
-                                .renderingMode(.template)
-                                .foregroundColor(Color(NCBrandColor.shared.brandText))
-                                .padding(10)
-                                .background(Color(NCBrandColor.shared.brand))
-                                .clipShape(Circle())
-                                .scaledToFit()
-                        }.frame(width: geo.size.width/3, height: 50)
+
+                        Image("buttonAddImage")
+                            .resizable()
+                            .renderingMode(.template)
+                            .foregroundColor(Color(NCBrandColor.shared.brandText))
+                            .padding(10)
+                            .background(Color(NCBrandColor.shared.brand))
+                            .clipShape(Circle())
+                            .scaledToFit()
+                            .frame(width: geo.size.width/4, height: 50)
+                            .widgetURL(URL(string: "nextcloud://open-action?action=upload-asset")!)
+
+                        Image("buttonAddScan")
+                            .resizable()
+                            .renderingMode(.template)
+                            .foregroundColor(Color(NCBrandColor.shared.brandText))
+                            .padding(10)
+                            .background(Color(NCBrandColor.shared.brand))
+                            .clipShape(Circle())
+                            .scaledToFit()
+                            .frame(width: geo.size.width/4, height: 50)
+                            .widgetURL(URL(string: "nextcloud://open-action?action=add-scan-document")!)
+
+                        Image("note.text")
+                            .resizable()
+                            .renderingMode(.template)
+                            .foregroundColor(Color(NCBrandColor.shared.brandText))
+                            .padding(10)
+                            .background(Color(NCBrandColor.shared.brand))
+                            .clipShape(Circle())
+                            .scaledToFit()
+                            .frame(width: geo.size.width/4, height: 50)
+                            .widgetURL(URL(string: "nextcloud://open-action?action=create-text-document")!)
+
+                        Image("microphone")
+                            .resizable()
+                            .renderingMode(.template)
+                            .foregroundColor(Color(NCBrandColor.shared.brandText))
+                            .padding(10)
+                            .background(Color(NCBrandColor.shared.brand))
+                            .clipShape(Circle())
+                            .scaledToFit()
+                            .frame(width: geo.size.width/4, height: 50)
+                            .widgetURL(URL(string: "nextcloud://open-action?action=create-voice-memo")!)
                     }
                     .frame(width: geo.size.width, height: 40)
                 }
@@ -120,9 +128,9 @@ struct NextcloudWidgetView: View {
                         .foregroundColor(Color(NCBrandColor.shared.brand))
                     Text(entry.footerText)
                         .font(.caption2)
-                        .padding(.trailing, 10.0)
+                        .padding(.trailing, 13.0)
                 }
-                .frame(maxWidth: geo.size.width, maxHeight: geo.size.height-3, alignment: .bottomTrailing)
+                .frame(maxWidth: geo.size.width, maxHeight: geo.size.height-4, alignment: .bottomTrailing)
             }
         }
     }

+ 11 - 1
iOSClient/AppDelegate.swift

@@ -834,12 +834,22 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         var serverUrl: String = ""
         var matchedAccount: tableAccount?
 
+
+        /*
+         Example:
+         nextcloud://open-action?action=create-voice-memo
+         */
+
+        if scheme == "nextcloud" && action == "open-action" {
+
+        }
+
         /*
          Example:
          nextcloud://open-file?path=Talk/IMG_0000123.jpg&user=marinofaggiana&link=https://cloud.nextcloud.com/f/123
          */
 
-        if scheme == "nextcloud" && action == "open-file" {
+        else if scheme == "nextcloud" && action == "open-file" {
 
             if !isSearchingMode, let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) {