瀏覽代碼

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 年之前
父節點
當前提交
7feeeac27c

+ 1 - 1
Widget/Dashboard/DashboardData.swift

@@ -163,7 +163,7 @@ func getDashboardDataEntry(isPreview: Bool, displaySize: CGSize, completion: @es
         if error != .success {
             completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, titleImage: titleImage, title: title, footerImage: "xmark.icloud", footerText: error.errorDescription))
         } else if datas.isEmpty {
-            completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, titleImage: titleImage, title: title, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " dashboard"))
+            completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, titleImage: titleImage, title: title, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " dashboard, " + NSLocalizedString("_no_data_available_", comment: "")))
         } else {
             completion(DashboardDataEntry(date: Date(), datas: datas, isPlaceholder: false, titleImage: titleImage, title: title, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " dashboard"))
         }

+ 1 - 25
Widget/Dashboard/DashboardWidgetView.swift

@@ -101,35 +101,11 @@ struct DashboardWidgetView: View {
                 .padding(.top, 40)
                 .redacted(reason: entry.isPlaceholder ? .placeholder : [])
 
-                /*
-                HStack(spacing: 0) {
-
-                    let sizeButton: CGFloat = 40
-                    let placeholderColor = Color(white: 0.8)
-                    let brandColor = Color(NCBrandColor.shared.brand)
-                    let brandTextColor = Color(NCBrandColor.shared.brandText)
-                    
-                    Link(destination: entry.isPlaceholder ? NCGlobal.shared.widgetActionNoAction : NCGlobal.shared.widgetActionVoiceMemo, label: {
-                        Image("microphone")
-                            .resizable()
-                            .renderingMode(.template)
-                            .foregroundColor(entry.isPlaceholder ? placeholderColor : brandTextColor)
-                            .padding(10)
-                            .background(entry.isPlaceholder ? placeholderColor : brandColor)
-                            .clipShape(Circle())
-                            .scaledToFit()
-                            .frame(width: geo.size.width, height: sizeButton)
-                    })
-                }
-                .frame(width: geo.size.width, height: geo.size.height - 25, alignment: .bottomTrailing)
-                .redacted(reason: entry.isPlaceholder ? .placeholder : [])
-                */
-                
                 HStack {
 
                     let placeholderColor = Color(white: 0.2)
                     let brandColor = Color(NCBrandColor.shared.brand)
-
+                    
                     Image(systemName: entry.footerImage)
                         .resizable()
                         .scaledToFit()

+ 1 - 1
Widget/Nextcloud/NextcloudData.swift

@@ -221,7 +221,7 @@ func getNextcloudDataEntry(isPreview: Bool, displaySize: CGSize, completion: @es
         if error != .success {
             completion(NextcloudDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, tile: title, footerImage: "xmark.icloud", footerText: error.errorDescription))
         } else if datas.isEmpty {
-            completion(NextcloudDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, tile: title, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " widget"))
+            completion(NextcloudDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, tile: title, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " widget, " + NSLocalizedString("_no_data_available_", comment: "")))
         } else {
             completion(NextcloudDataEntry(date: Date(), datas: datas, isPlaceholder: false, tile: title, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " widget"))
         }

+ 5 - 2
Widget/Toolbar/ToolbarWidgetView.swift

@@ -94,16 +94,19 @@ struct ToolbarWidgetView: View {
 
                 HStack {
 
+                    let placeholderColor = Color(white: 0.2)
+                    let brandColor = Color(NCBrandColor.shared.brand)
+
                     Image(systemName: entry.footerImage)
                         .resizable()
                         .scaledToFit()
                         .frame(width: 15, height: 15)
-                        .foregroundColor(entry.isPlaceholder ? Color(white: 0.2) : Color(NCBrandColor.shared.brand))
+                        .foregroundColor(entry.isPlaceholder ? placeholderColor : brandColor)
 
                     Text(entry.footerText)
                         .font(.caption2)
                         .padding(.trailing, 13.0)
-                        .foregroundColor(entry.isPlaceholder ? Color(white: 0.2) : Color(NCBrandColor.shared.brand))
+                        .foregroundColor(entry.isPlaceholder ? placeholderColor : brandColor)
                 }
                 .frame(maxWidth: geo.size.width - 5, maxHeight: geo.size.height - 2, alignment: .bottomTrailing)
             }.background(ContainerRelativeShape().fill(Color(.black)))

+ 2 - 0
iOSClient/AppDelegate.swift

@@ -276,6 +276,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         // Reload Widget
         if #available(iOS 14.0, *) {
             WidgetCenter.shared.reloadAllTimelines()
+            //WidgetCenter.shared.reloadTimelines(ofKind: "DashboardWidget")
+            //WidgetCenter.shared.reloadTimelines(ofKind: "NextcloudWidget")
         }
 
         // Clear operation queue

+ 1 - 1
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -884,10 +884,10 @@
 "_copy_passphrase_"         = "Copy passphrase";
 "_select_color_"            = "Select the color";
 "_change_color_"            = "Change color";
-
 "_description_dashboardwidget_" = "Having the Dashboard always at your fingertips has never been easier.";
 "_description_nextcloudwidget_" = "View your recent files and use the toolbar to speed up your operations.";
 "_description_toolbarwidget_"   = "A the toolbar to speed up your operations.";
+"_no_data_available_"       = "no data available";
 
 // Video
 "_select_trace_"            = "Select the trace";