Procházet zdrojové kódy

watchos: display a message if the recent list is empty

master
paweldomas před 6 roky
rodič
revize
1bc28e4904

+ 2
- 0
ios/app/watchos/app/Base.lproj/Interface.storyboard Zobrazit soubor

@@ -14,6 +14,7 @@
14 14
             <objects>
15 15
                 <controller title="Meetings" id="AgC-eL-Hgc" customClass="InterfaceController" customModule="JitsiMeetCompanion" customModuleProvider="target">
16 16
                     <items>
17
+                        <label alignment="left" textAlignment="left" numberOfLines="0" id="OQN-sx-tDt"/>
17 18
                         <table alignment="left" id="gpO-ql-Xsr">
18 19
                             <items>
19 20
                                 <tableRow identifier="MeetingRowType" id="GGl-av-xeJ" customClass="MeetingRowController" customModule="JitsiMeetCompanion_Extension">
@@ -39,6 +40,7 @@
39 40
                         </table>
40 41
                     </items>
41 42
                     <connections>
43
+                        <outlet property="infoLabel" destination="OQN-sx-tDt" id="Juv-tb-SNj"/>
42 44
                         <outlet property="table" destination="gpO-ql-Xsr" id="aVV-iZ-z3l"/>
43 45
                     </connections>
44 46
                 </controller>

+ 18
- 4
ios/app/watchos/extension/InterfaceController.swift Zobrazit soubor

@@ -16,17 +16,31 @@
16 16
  */
17 17
 
18 18
 import WatchKit
19
+import WatchConnectivity
19 20
 import Foundation
20 21
 
21 22
 
22 23
 class InterfaceController: WKInterfaceController {
23 24
 
25
+    @IBOutlet var infoLabel: WKInterfaceLabel!
24 26
     @IBOutlet var table: WKInterfaceTable!
25 27
 
28
+    override func didAppear(){
29
+        self.updateUI(ExtensionDelegate.currentJitsiMeetContext)
30
+    }
31
+
26 32
     func updateUI(_ newContext:JitsiMeetContext) {
27
-        if let recentURLsArray = newContext.recentURLs {
28
-            updateRecents(withRecents:  recentURLsArray, currentContext: newContext)
29
-        }
33
+      if (newContext.recentURLs == nil || newContext.recentURLs!.count == 0) {
34
+        infoLabel.setText("There are no recent meetings. Please use the app on the phone to start a new call.")
35
+
36
+        table.setHidden(true)
37
+        infoLabel.setHidden(false)
38
+      } else {
39
+        updateRecents(withRecents: newContext.recentURLs!, currentContext: newContext)
40
+
41
+        table.setHidden(false)
42
+        infoLabel.setHidden(true)
43
+      }
30 44
     }
31 45
 
32 46
     private func updateRecents(withRecents recents: NSArray, currentContext: JitsiMeetContext) {
@@ -68,7 +82,7 @@ class InterfaceController: WKInterfaceController {
68 82
     override func contextForSegue(withIdentifier segueIdentifier: String, in table: WKInterfaceTable, rowIndex: Int) -> Any? {
69 83
         let controller = table.rowController(at: rowIndex) as! MeetingRowController
70 84
         let currentContext = ExtensionDelegate.currentJitsiMeetContext
71
-      
85
+
72 86
         // Copy the current context and add the joinConferenceURL to trigger the command when the in-call screen is displayed
73 87
         let actionContext = JitsiMeetContext(jmContext: currentContext)
74 88
         actionContext.joinConferenceURL = controller.roomUrl

Načítá se…
Zrušit
Uložit