mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-19 12:56:06 +00:00
Add QR code view to fix file sending for Samsung devices
This commit is contained in:
1 parent
a39b6f0682
commit
b4604a5a51
19 files changed
+315
-38
No files matched your search
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// QrCodeView.swift
|
||||
// NearDrop
|
||||
//
|
||||
// Created by Leon Böttger on 10.03.25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
let qrCodeViewSize = CGSize(width: 530.0, height: 270.0)
|
||||
|
||||
struct QrCodeView: View {
|
||||
@State private var qrCode: String = ""
|
||||
let closeView: () -> Void
|
||||
|
||||
var body: some View {
|
||||
|
||||
VStack {
|
||||
|
||||
Button(action: {
|
||||
closeView()
|
||||
}, label: {
|
||||
Image("xmark")
|
||||
.resizable()
|
||||
.frame(width: 14, height: 14)
|
||||
.opacity(0.5)
|
||||
})
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||
.padding(.trailing, 15)
|
||||
.padding(.top, 15)
|
||||
|
||||
HStack {
|
||||
Spacer()
|
||||
|
||||
Image("QR")
|
||||
.resizable()
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.frame(height: 190)
|
||||
|
||||
Spacer()
|
||||
|
||||
|
||||
Text("QrCodeInstructions".localized())
|
||||
.padding(.top, 5)
|
||||
.padding(.horizontal)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.padding(.bottom)
|
||||
|
||||
Spacer()
|
||||
|
||||
}
|
||||
.frame(width: qrCodeViewSize.width, height: qrCodeViewSize.height)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public extension String {
|
||||
func localized() -> String {
|
||||
let localizedString = NSLocalizedString(self, comment: "")
|
||||
return localizedString
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#Preview {
|
||||
QrCodeView(closeView: {})
|
||||
}
|
||||
Reference in new issue
Block a user