Hide QR code button on unsupported devices
This commit is contained in:
parent
5efdc773fb
commit
0a3d7ed076
|
@ -41,6 +41,9 @@
|
|||
D936D6CB1E8B1B34003B1343 /* FileTransferTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D936D6CA1E8B1B34003B1343 /* FileTransferTests.swift */; };
|
||||
D95AD2291B684AE1007DEBC3 /* xmpp-server-list in Resources */ = {isa = PBXBuildFile; fileRef = D95AD2281B684AE1007DEBC3 /* xmpp-server-list */; };
|
||||
D985BC7A1EBD32F700993D27 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D985BC791EBD32F700993D27 /* StoreKit.framework */; };
|
||||
D986C64C244564260066CC03 /* UIViewControllerPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = D986C64B244564260066CC03 /* UIViewControllerPreview.swift */; };
|
||||
D986C653244565C30066CC03 /* OTRInviteViewController_Previews.swift in Sources */ = {isa = PBXBuildFile; fileRef = D986C652244565C30066CC03 /* OTRInviteViewController_Previews.swift */; };
|
||||
D986C656244567B90066CC03 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D986C654244567090066CC03 /* SwiftUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
D9B3EC221FA196CE00E63C7F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9B3EC211FA196CE00E63C7F /* AppDelegate.swift */; };
|
||||
D9B7EEFB235D47C400AD1EEA /* OTRKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9B7EEF6235D477200AD1EEA /* OTRKit.framework */; };
|
||||
D9B7EEFC235D47CA00AD1EEA /* CPAProxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9B7EEE9235D476700AD1EEA /* CPAProxy.framework */; };
|
||||
|
@ -689,6 +692,9 @@
|
|||
D97070911EEF382D004FEBDE /* MediaDownloadView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MediaDownloadView.xib; path = Interface/MediaDownloadView.xib; sourceTree = "<group>"; };
|
||||
D973D7051A2D4094004D353E /* Pods-ChatSecureCorePods-ChatSecure-acknowledgements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Pods-ChatSecureCorePods-ChatSecure-acknowledgements.plist"; path = "Pods/Target Support Files/Pods-ChatSecureCorePods-ChatSecure/Pods-ChatSecureCorePods-ChatSecure-acknowledgements.plist"; sourceTree = SOURCE_ROOT; };
|
||||
D985BC791EBD32F700993D27 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
|
||||
D986C64B244564260066CC03 /* UIViewControllerPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerPreview.swift; sourceTree = "<group>"; };
|
||||
D986C652244565C30066CC03 /* OTRInviteViewController_Previews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OTRInviteViewController_Previews.swift; sourceTree = "<group>"; };
|
||||
D986C654244567090066CC03 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/SwiftUI.framework; sourceTree = DEVELOPER_DIR; };
|
||||
D98BA36B1EDE47BB004475B6 /* HTMLPreviewView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = HTMLPreviewView.xib; path = Interface/HTMLPreviewView.xib; sourceTree = "<group>"; };
|
||||
D99F17891BAB946800604558 /* Branding.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Branding.plist; sourceTree = "<group>"; };
|
||||
D99F178B1BAB947E00604558 /* Secrets.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Secrets.plist; sourceTree = "<group>"; };
|
||||
|
@ -1116,6 +1122,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D986C656244567B90066CC03 /* SwiftUI.framework in Frameworks */,
|
||||
D9C52807235CB55C002B213A /* ChatSecureCore.framework in Frameworks */,
|
||||
D985BC7A1EBD32F700993D27 /* StoreKit.framework in Frameworks */,
|
||||
07BD06A9B424D601FC93AB82 /* libPods-ChatSecureCorePods-ChatSecure.a in Frameworks */,
|
||||
|
@ -1350,6 +1357,14 @@
|
|||
path = xcconfig;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D986C651244565950066CC03 /* Previews */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D986C652244565C30066CC03 /* OTRInviteViewController_Previews.swift */,
|
||||
);
|
||||
path = Previews;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D9B7EEE0235D476700AD1EEA /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -1401,6 +1416,7 @@
|
|||
D9C52811235CB57F002B213A /* View Controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D986C651244565950066CC03 /* Previews */,
|
||||
D9C52812235CB57F002B213A /* OTRDoubleSettingViewController.m */,
|
||||
D9C52813235CB57F002B213A /* OTRNewBuddyViewController.m */,
|
||||
D9C52814235CB57F002B213A /* OTRChooseAccountViewController.m */,
|
||||
|
@ -1474,6 +1490,7 @@
|
|||
D9C52846235CB580002B213A /* Utilities */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D986C64B244564260066CC03 /* UIViewControllerPreview.swift */,
|
||||
D9C52847235CB580002B213A /* OTRConstants.m */,
|
||||
D9C52848235CB580002B213A /* OTRColors.m */,
|
||||
D9C52849235CB580002B213A /* OTRUtilities.h */,
|
||||
|
@ -1944,6 +1961,7 @@
|
|||
DB9AACD6ED82090C7A6B0076 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D986C654244567090066CC03 /* SwiftUI.framework */,
|
||||
D90DA4F2236F3C6800C585B7 /* Appirater.bundle */,
|
||||
D90DA4F3236F3C6800C585B7 /* CPAProxy.bundle */,
|
||||
D90DA4F4236F3C6800C585B7 /* TUSafariActivity.bundle */,
|
||||
|
@ -2630,6 +2648,7 @@
|
|||
D9C52A5B235CB581002B213A /* OTRProtocolManager.m in Sources */,
|
||||
D9C52A10235CB580002B213A /* OTRXMPPPresenceSubscriptionRequest.m in Sources */,
|
||||
D9C52AD5235CB581002B213A /* UIApplication+ChatSecure.swift in Sources */,
|
||||
D986C64C244564260066CC03 /* UIViewControllerPreview.swift in Sources */,
|
||||
D9C52A8B235CB581002B213A /* ServerCheck.swift in Sources */,
|
||||
D9C52A55235CB581002B213A /* PushDeserializer.swift in Sources */,
|
||||
D9C52AA5235CB581002B213A /* OTRStatusMessageCell.m in Sources */,
|
||||
|
@ -2816,6 +2835,7 @@
|
|||
D9C52A92235CB581002B213A /* SingleButtonTableViewCell.swift in Sources */,
|
||||
D9C52A82235CB581002B213A /* OTRAudioPlaybackController.m in Sources */,
|
||||
D9C52A4C235CB581002B213A /* OTROpenInTwitterActivity.m in Sources */,
|
||||
D986C653244565C30066CC03 /* OTRInviteViewController_Previews.swift in Sources */,
|
||||
D9C52A2F235CB581002B213A /* BuddyActions.swift in Sources */,
|
||||
D9C52A49235CB581002B213A /* OTRActivityItemProvider.m in Sources */,
|
||||
D9C52A30235CB581002B213A /* OTRIncomingMessage.m in Sources */,
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// UIViewControllerPreview.swift
|
||||
// ChatSecureCore
|
||||
//
|
||||
// Created by Chris Ballinger on 4/13/20.
|
||||
// Copyright © 2020 Chris Ballinger. All rights reserved.
|
||||
//
|
||||
// https://gist.github.com/mattt/ff6b58af8576c798485b449269d43607
|
||||
|
||||
import UIKit
|
||||
|
||||
#if canImport(SwiftUI) && DEBUG
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 13.0, *)
|
||||
struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable {
|
||||
let viewController: ViewController
|
||||
|
||||
init(_ builder: @escaping () -> ViewController) {
|
||||
viewController = builder()
|
||||
}
|
||||
|
||||
// MARK: - UIViewControllerRepresentable
|
||||
func makeUIViewController(context: Context) -> ViewController {
|
||||
viewController
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: ViewController, context: UIViewControllerRepresentableContext<UIViewControllerPreview<ViewController>>) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -103,7 +103,9 @@ static CGFloat const kOTRButtonHeight = 40;
|
|||
NSMutableArray *shareButtons = [[NSMutableArray alloc] initWithCapacity:2];
|
||||
|
||||
[shareButtons addObject:[self buttonWithIcon:FAEnvelope title:INVITE_LINK_STRING() type:BButtonTypeDefault action:@selector(linkShareButtonPressed:)]];
|
||||
[shareButtons addObject:[self buttonWithIcon:FACamera title:SCAN_QR_STRING() type:BButtonTypeDefault action:@selector(qrButtonPressed:)]];
|
||||
if ([QRCodeReader isAvailable]) {
|
||||
[shareButtons addObject:[self buttonWithIcon:FACamera title:SCAN_QR_STRING() type:BButtonTypeDefault action:@selector(qrButtonPressed:)]];
|
||||
}
|
||||
|
||||
self.shareButtons = shareButtons;
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// OTRInviteViewController_Previews.swift
|
||||
// ChatSecureCore
|
||||
//
|
||||
// Created by Chris Ballinger on 4/13/20.
|
||||
// Copyright © 2020 Chris Ballinger. All rights reserved.
|
||||
//
|
||||
|
||||
#if DEBUG
|
||||
import SwiftUI
|
||||
|
||||
/// Unfortunately Xcode cannot seem to create Previews with our current build configuration
|
||||
@available(iOS 13.0, *)
|
||||
struct OTRInviteViewController_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
UIViewControllerPreview {
|
||||
OTRInviteViewController(account: OTRAccount(username: "user@example.com", accountType: .jabber)!)
|
||||
}
|
||||
.previewDevice("iPhone 11 Pro Max")
|
||||
.previewLayout(.sizeThatFits)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -5,17 +5,48 @@
|
|||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "chatsecure_logo_transparent@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"filename" : "chatsecure_logo_inverted@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
Loading…
Reference in New Issue