mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Refactoring
This commit is contained in:
1 parent
3551c1a006
commit
09ef75d249
7 files changed
+43
-149
No files matched your search
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// Configuration.swift
|
||||
// QuickDrop
|
||||
//
|
||||
// Created by Leon Böttger on 15.08.25.
|
||||
//
|
||||
|
||||
import LUI
|
||||
import SwiftUI
|
||||
|
||||
let configuration = LUIConfiguration(
|
||||
appName: "QuickDrop",
|
||||
|
||||
plusVersionInfo: GetPlusViewInformation(lifetimeID: "plusversion", monthlyID: "quickdrop.monthly", yearlyID: "quickdrop.yearly", plusViewHeader: isMac() ? "plusview_title" : nil, description: isMac() ? "plusview_description" : "plusview_description_phone", onBoughtPlusVersionAlertMessage: "plusview_success_description", plusVersionFeatures: [], settingsLabelColor: .orange, settingsFooter: "plusview_footer_phone"),
|
||||
|
||||
setPlusVersion: { result in
|
||||
#if !GITHUB
|
||||
DispatchQueue.main.async {
|
||||
Settings.sharedInstance.gotPlus = result
|
||||
}
|
||||
#endif
|
||||
},
|
||||
|
||||
hasRoundedFont: false,
|
||||
|
||||
switchedToIAPafterBundleVersion: AppVersionBundle(appVersion: "1.2", buildVersion: 0, legacyUserDefaultsKey: Settings.UserDefaultsKeys.plusVersionLegacy.rawValue),
|
||||
|
||||
copyrightInformation: licenseText,
|
||||
|
||||
loggingUrl: AppGroup.appGroupDirectory,
|
||||
|
||||
introductionViewInformation: "QuickDropWelcomeDescription",
|
||||
|
||||
introductionViewImage: Image(.quickDropMockup),
|
||||
|
||||
usesAutomaticReviewPromptAndShareSheet: false,
|
||||
|
||||
usesPagedIntroduction: true,
|
||||
|
||||
supportsSplitView: false,
|
||||
|
||||
supportsLiquidGlass: true,
|
||||
|
||||
supportsPortraitSplitView: false,
|
||||
|
||||
supportsDarkModeShadow: false
|
||||
)
|
||||
@@ -1,69 +0,0 @@
|
||||
//
|
||||
// PieProgressView.swift
|
||||
// QuickDrop
|
||||
//
|
||||
// Created by Leon Böttger on 16.08.25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct PieProgressView: View {
|
||||
let progress: CGFloat // value between 0.0 and 1.0
|
||||
var size: CGFloat = 25.0
|
||||
|
||||
var color: Color? = nil
|
||||
|
||||
var body: some View {
|
||||
|
||||
let color = color ?? .gray
|
||||
|
||||
ZStack {
|
||||
|
||||
Circle()
|
||||
.stroke(lineWidth: size * 0.08)
|
||||
.foregroundColor(color)
|
||||
|
||||
ZStack {
|
||||
PieSlice(progress: progress)
|
||||
.fill(color)
|
||||
.rotationEffect(.degrees(-90)) // Start from the top
|
||||
}
|
||||
.overlay (
|
||||
Image(systemName: "checkmark")
|
||||
.font(.system(size: 12, weight: .bold))
|
||||
.foregroundColor(color == .white ? .blue : .white)
|
||||
.opacity(progress >= 1.0 ? 1.0 : 0.0) // Show checkmark only when complete
|
||||
)
|
||||
}
|
||||
.frame(width: size, height: size)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct PieSlice: Shape {
|
||||
var progress: CGFloat // from 0.0 to 1.0
|
||||
|
||||
func path(in rect: CGRect) -> Path {
|
||||
var path = Path()
|
||||
|
||||
let center = CGPoint(x: rect.midX, y: rect.midY)
|
||||
let radius = rect.width / 2
|
||||
let endAngle = Angle(degrees: 360 * Double(progress))
|
||||
|
||||
path.move(to: center)
|
||||
path.addArc(center: center,
|
||||
radius: radius,
|
||||
startAngle: .degrees(0),
|
||||
endAngle: endAngle,
|
||||
clockwise: false)
|
||||
path.closeSubpath()
|
||||
|
||||
return path
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#Preview {
|
||||
PieProgressView(progress: 0.76)
|
||||
.padding()
|
||||
}
|
||||
Reference in new issue
Block a user