mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 18:12:44 +02:00
vector-im/element-ios/issues/5298 - Added build setting + ui and unit tests.
This commit is contained in:
committed by
Stefan Ceriu
parent
0a852eb371
commit
e1505d70c5
@@ -17,19 +17,28 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import Keys
|
||||
import CoreLocation
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
enum MockLocationSharingScreenState: MockScreenState, CaseIterable {
|
||||
case standard
|
||||
case shareUserLocation
|
||||
case displayExistingLocation
|
||||
|
||||
var screenType: Any.Type {
|
||||
MockLocationSharingScreenState.self
|
||||
}
|
||||
|
||||
var screenView: ([Any], AnyView) {
|
||||
|
||||
var location: CLLocationCoordinate2D?
|
||||
if self == .displayExistingLocation {
|
||||
location = CLLocationCoordinate2D(latitude: 51.4932641, longitude: -0.257096)
|
||||
}
|
||||
|
||||
let mapURL = URL(string: "https://api.maptiler.com/maps/streets/style.json?key=" + RiotKeys().mapTilerAPIKey)!
|
||||
let viewModel = LocationSharingViewModel(tileServerMapURL: mapURL,
|
||||
avatarData: AvatarInput(mxContentUri: "", matrixItemId: "", displayName: "Alice"))
|
||||
avatarData: AvatarInput(mxContentUri: "", matrixItemId: "", displayName: "Alice"),
|
||||
location: location)
|
||||
return ([viewModel],
|
||||
AnyView(LocationSharingView(context: viewModel.context)
|
||||
.addDependency(MockAvatarService.example)))
|
||||
|
||||
Reference in New Issue
Block a user