Преглед изворни кода

improved widget

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana пре 2 година
родитељ
комит
a9fad16140

+ 3 - 2
Widget/Nextcloud/NextcloudWidgetView.swift

@@ -61,7 +61,7 @@ struct NextcloudWidgetView: View {
                                     Spacer()
                                 }
                                 .padding(.leading, 10)
-                                .frame(height: 40.0)
+                                .frame(height: (geo.size.height-110)/CGFloat(entry.recentDatas.count))
                             }
                         }
                     }
@@ -141,7 +141,8 @@ struct NextcloudWidgetView: View {
 
 struct NextcloudWidget_Previews: PreviewProvider {
     static var previews: some View {
-        let entry = NextcloudDataEntry(date: Date(), recentDatas: recentDatasTest, isPlaceholder: false, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " widget")
+        let recentDatas = Array(recentDatasTest[0...2])
+        let entry = NextcloudDataEntry(date: Date(), recentDatas: recentDatas, isPlaceholder: false, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " widget")
         NextcloudWidgetView(entry: entry).previewContext(WidgetPreviewContext(family: .systemLarge))
     }
 }

+ 1 - 0
iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift

@@ -77,6 +77,7 @@ class NCViewerMedia: UIViewController {
         print("deinit NCViewerMedia")
 
         self.tipView?.dismiss()
+        NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterPauseMedia, userInfo: nil)
         NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterOpenMediaDetail), object: nil)
     }