Skip to content

Commit 9a8126d

Browse files
committed
Merge branch 'develop' into steve/6021_beacon_event
2 parents 96bfdba + cc8ae93 commit 9a8126d

35 files changed

+1515
-39
lines changed

.github/workflows/triage-move-labelled.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
if: >
1212
contains(github.event.issue.labels.*.name, 'A-Maths') ||
1313
contains(github.event.issue.labels.*.name, 'A-Message-Pinning') ||
14-
contains(github.event.issue.labels.*.name, 'A-Threads') ||
1514
contains(github.event.issue.labels.*.name, 'A-Polls') ||
1615
contains(github.event.issue.labels.*.name, 'A-Location-Sharing') ||
1716
contains(github.event.issue.labels.*.name, 'A-Message-Bubbles') ||

Config/Project.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
KEYCHAIN_ACCESS_GROUP = $(AppIdentifierPrefix)$(BASE_BUNDLE_IDENTIFIER).keychain.shared
2626

2727
// Build settings
28-
IPHONEOS_DEPLOYMENT_TARGET = 12.1
28+
IPHONEOS_DEPLOYMENT_TARGET = 14.0
2929
SDKROOT = iphoneos
3030
TARGETED_DEVICE_FAMILY = 1,2
31-
SWIFT_VERSION = 5.3.1
31+
SWIFT_VERSION = 5.6
3232
ENABLE_BITCODE = NO
3333

3434
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @executable_path/../../Frameworks

Podfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'https://cdn.cocoapods.org/'
22

33
# Uncomment this line to define a global platform for your project
4-
platform :ios, '12.1'
4+
platform :ios, '14.0'
55

66
# Use frameworks to allow usage of pods written in Swift
77
use_frameworks!
@@ -57,6 +57,7 @@ end
5757

5858
def import_SwiftUI_pods
5959
pod 'Introspect', '~> 0.1'
60+
pod 'DSBottomSheet', '~> 0.3'
6061
end
6162

6263
abstract_target 'RiotPods' do
@@ -151,4 +152,4 @@ post_install do |installer|
151152
config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['$(inherited)', '-Xcc', '-Wno-nullability-completeness']
152153
end
153154
end
154-
end
155+
end

Podfile.lock

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ PODS:
2020
- BlueRSA (1.0.200)
2121
- DGCollectionViewLeftAlignFlowLayout (1.0.4)
2222
- Down (0.11.0)
23+
- DSBottomSheet (0.3.0)
2324
- DSWaveformImage (6.1.1)
2425
- DTCoreText (1.6.26):
2526
- DTCoreText/Core (= 1.6.26)
@@ -105,6 +106,7 @@ DEPENDENCIES:
105106
- AnalyticsEvents (from `https://github.com/matrix-org/matrix-analytics-events.git`, branch `release/swift`)
106107
- DGCollectionViewLeftAlignFlowLayout (~> 1.0.4)
107108
- Down (~> 0.11.0)
109+
- DSBottomSheet (~> 0.3)
108110
- DSWaveformImage (~> 6.1.1)
109111
- DTCoreText (~> 1.6.25)
110112
- ffmpeg-kit-ios-audio (= 4.5.1)
@@ -139,6 +141,7 @@ SPEC REPOS:
139141
- BlueRSA
140142
- DGCollectionViewLeftAlignFlowLayout
141143
- Down
144+
- DSBottomSheet
142145
- DSWaveformImage
143146
- DTCoreText
144147
- DTFoundation
@@ -191,6 +194,7 @@ SPEC CHECKSUMS:
191194
BlueRSA: dfeef51db96bcc4edec654956c1581adbda4e6a3
192195
DGCollectionViewLeftAlignFlowLayout: a0fa58797373ded039cafba8133e79373d048399
193196
Down: b6ba1bc985c9d2f4e15e3b293d2207766fa12612
197+
DSBottomSheet: ca0ac37eb5af2dd54663f86b84382ed90a59be2a
194198
DSWaveformImage: 3c718a0cf99291887ee70d1d0c18d80101d3d9ce
195199
DTCoreText: ec749e013f2e1f76de5e7c7634642e600a7467ce
196200
DTFoundation: a53f8cda2489208cbc71c648be177f902ee17536
@@ -225,6 +229,6 @@ SPEC CHECKSUMS:
225229
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
226230
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
227231

228-
PODFILE CHECKSUM: 8055bae15b82bd29b1d12c64ff038fe6f86a8ca0
232+
PODFILE CHECKSUM: 39feedaf75b9a9287e4fe5309200e0493a9251a3
229233

230-
COCOAPODS: 1.11.2
234+
COCOAPODS: 1.11.3

Riot/Assets/Images.xcassets/Common/share_action_button.imageset/Contents.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
"info" : {
2020
"author" : "xcode",
2121
"version" : 1
22+
},
23+
"properties" : {
24+
"template-rendering-intent" : "template"
2225
}
2326
}

Riot/Assets/en.lproj/Vector.strings

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,6 +2142,13 @@ Tap the + to start adding people.";
21422142
"location_sharing_static_share_title" = "Send my current location";
21432143
"location_sharing_pin_drop_share_title" = "Send this location";
21442144
"location_sharing_live_map_callout_title" = "Share location";
2145+
"location_sharing_live_viewer_title" = "Location";
2146+
"location_sharing_live_list_item_time_left" = "%@ left";
2147+
"location_sharing_live_list_item_sharing_expired" = "Sharing expired";
2148+
"location_sharing_live_list_item_last_update" = "Updated %@ ago";
2149+
"location_sharing_live_list_item_last_update_invalid" = "Unknown last update";
2150+
"location_sharing_live_list_item_current_user_display_name" = "You";
2151+
"location_sharing_live_list_item_stop_sharing_action" = "Stop sharing";
21452152

21462153
// MARK: - MatrixKit
21472154

Riot/Assets/third_party_licenses.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,31 @@
19501950
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19511951
<br/><br/>
19521952
</li>
1953+
<li>
1954+
<b>DSBottomSheet</b> (<a href="https://github.com/danielsaidi/BottomSheet">https://github.com/danielsaidi/BottomSheet</a>)
1955+
<br/><br/>
1956+
MIT License
1957+
<br/><br/>
1958+
Copyright (c) 2021 Daniel Saidi
1959+
<br/><br/>
1960+
Permission is hereby granted, free of charge, to any person obtaining a copy of
1961+
this software and associated documentation files (the "Software"), to deal in
1962+
the Software without restriction, including without limitation the rights to
1963+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
1964+
the Software, and to permit persons to whom the Software is furnished to do so,
1965+
subject to the following conditions:
1966+
<br/><br/>
1967+
The above copyright notice and this permission notice shall be included in all
1968+
copies or substantial portions of the Software.
1969+
<br/><br/>
1970+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1971+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
1972+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1973+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1974+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1975+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1976+
<br/><br/>
1977+
</li>
19531978
</ul>
19541979
</body>
19551980
</html>

Riot/Generated/Strings.swift

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,6 +2759,30 @@ public class VectorL10n: NSObject {
27592759
public static var locationSharingInvalidAuthorizationSettings: String {
27602760
return VectorL10n.tr("Vector", "location_sharing_invalid_authorization_settings")
27612761
}
2762+
/// You
2763+
public static var locationSharingLiveListItemCurrentUserDisplayName: String {
2764+
return VectorL10n.tr("Vector", "location_sharing_live_list_item_current_user_display_name")
2765+
}
2766+
/// Updated %@ ago
2767+
public static func locationSharingLiveListItemLastUpdate(_ p1: String) -> String {
2768+
return VectorL10n.tr("Vector", "location_sharing_live_list_item_last_update", p1)
2769+
}
2770+
/// Unknown last update
2771+
public static var locationSharingLiveListItemLastUpdateInvalid: String {
2772+
return VectorL10n.tr("Vector", "location_sharing_live_list_item_last_update_invalid")
2773+
}
2774+
/// Sharing expired
2775+
public static var locationSharingLiveListItemSharingExpired: String {
2776+
return VectorL10n.tr("Vector", "location_sharing_live_list_item_sharing_expired")
2777+
}
2778+
/// Stop sharing
2779+
public static var locationSharingLiveListItemStopSharingAction: String {
2780+
return VectorL10n.tr("Vector", "location_sharing_live_list_item_stop_sharing_action")
2781+
}
2782+
/// %@ left
2783+
public static func locationSharingLiveListItemTimeLeft(_ p1: String) -> String {
2784+
return VectorL10n.tr("Vector", "location_sharing_live_list_item_time_left", p1)
2785+
}
27622786
/// Share location
27632787
public static var locationSharingLiveMapCalloutTitle: String {
27642788
return VectorL10n.tr("Vector", "location_sharing_live_map_callout_title")
@@ -2767,6 +2791,10 @@ public class VectorL10n: NSObject {
27672791
public static var locationSharingLiveShareTitle: String {
27682792
return VectorL10n.tr("Vector", "location_sharing_live_share_title")
27692793
}
2794+
/// Location
2795+
public static var locationSharingLiveViewerTitle: String {
2796+
return VectorL10n.tr("Vector", "location_sharing_live_viewer_title")
2797+
}
27702798
/// %@ could not load the map. Please try again later.
27712799
public static func locationSharingLoadingMapErrorTitle(_ p1: String) -> String {
27722800
return VectorL10n.tr("Vector", "location_sharing_loading_map_error_title", p1)

RiotSwiftUI/Modules/Common/Mock/MockAppScreens.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import Foundation
2020
@available(iOS 14.0, *)
2121
enum MockAppScreens {
2222
static let appScreens: [MockScreenState.Type] = [
23+
MockLiveLocationSharingViewerScreenState.self,
2324
MockOnboardingCelebrationScreenState.self,
2425
MockOnboardingAvatarScreenState.self,
2526
MockOnboardingDisplayNameScreenState.self,
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
//
2+
// Copyright 2021 New Vector Ltd
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import SwiftUI
18+
19+
struct LiveLocationSharingViewerCoordinatorParameters {
20+
let session: MXSession
21+
}
22+
23+
final class LiveLocationSharingViewerCoordinator: Coordinator, Presentable {
24+
25+
// MARK: - Properties
26+
27+
// MARK: Private
28+
29+
private let parameters: LiveLocationSharingViewerCoordinatorParameters
30+
private let liveLocationSharingViewerHostingController: UIViewController
31+
private var liveLocationSharingViewerViewModel: LiveLocationSharingViewerViewModelProtocol
32+
33+
private let shareLocationActivityControllerBuilder = ShareLocationActivityControllerBuilder()
34+
35+
// MARK: Public
36+
37+
// Must be used only internally
38+
var childCoordinators: [Coordinator] = []
39+
var completion: (() -> Void)?
40+
41+
// MARK: - Setup
42+
43+
@available(iOS 14.0, *)
44+
init(parameters: LiveLocationSharingViewerCoordinatorParameters) {
45+
self.parameters = parameters
46+
47+
let service = LiveLocationSharingViewerService(session: parameters.session)
48+
49+
let viewModel = LiveLocationSharingViewerViewModel(mapStyleURL: BuildSettings.tileServerMapStyleURL, service: service)
50+
let view = LiveLocationSharingViewer(viewModel: viewModel.context)
51+
.addDependency(AvatarService.instantiate(mediaManager: parameters.session.mediaManager))
52+
liveLocationSharingViewerViewModel = viewModel
53+
liveLocationSharingViewerHostingController = VectorHostingController(rootView: view)
54+
}
55+
56+
// MARK: - Public
57+
func start() {
58+
MXLog.debug("[LiveLocationSharingViewerCoordinator] did start.")
59+
liveLocationSharingViewerViewModel.completion = { [weak self] result in
60+
guard let self = self else { return }
61+
MXLog.debug("[LiveLocationSharingViewerCoordinator] LiveLocationSharingViewerViewModel did complete with result: \(result).")
62+
switch result {
63+
case .done:
64+
self.completion?()
65+
case .share(let coordinate):
66+
self.presentLocationActivityController(with: coordinate)
67+
case .stopLocationSharing:
68+
self.stopLocationSharing()
69+
}
70+
}
71+
}
72+
73+
func toPresentable() -> UIViewController {
74+
return self.liveLocationSharingViewerHostingController
75+
}
76+
77+
func presentLocationActivityController(with coordinate: CLLocationCoordinate2D) {
78+
79+
let shareActivityController = shareLocationActivityControllerBuilder.build(with: coordinate)
80+
81+
self.liveLocationSharingViewerHostingController.present(shareActivityController, animated: true)
82+
}
83+
84+
func stopLocationSharing() {
85+
// TODO: Handle stop location sharing
86+
}
87+
}

0 commit comments

Comments
 (0)