Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions AirCasting.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objectVersion = 70;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -1198,6 +1198,11 @@
FAFBDBE82BC494C500A9E839 /* NotificationInfoKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationInfoKeys.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
33DBE7D32E40DCFE003234F1 /* CommonUI */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = CommonUI; sourceTree = "<group>"; };
33DBE7DB2E41FC88003234F1 /* Preview */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Preview; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */

/* Begin PBXFrameworksBuildPhase section */
4FB39DF92621B53C00E5E564 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
Expand Down Expand Up @@ -1649,6 +1654,7 @@
AC32040625CC122900A68520 /* Utils */ = {
isa = PBXGroup;
children = (
33DBE7DB2E41FC88003234F1 /* Preview */,
3310E1F82E27D6FE00E0281A /* BatchError.swift */,
FAFBDBE32BC4942500A9E839 /* Notifications */,
3320F2E22922657C00EFFB2D /* Bluetooth */,
Expand Down Expand Up @@ -1801,6 +1807,7 @@
AC7EB37425A6FB3A00A7F2AF /* AirCasting */ = {
isa = PBXGroup;
children = (
33DBE7D32E40DCFE003234F1 /* CommonUI */,
DD2DDBAA27B535D900807011 /* UIState */,
B367A587274E9E05004C605B /* FeatureFlags */,
B3EFAB1326EFE2C800E88141 /* Bootstrap */,
Expand Down Expand Up @@ -3066,6 +3073,10 @@
);
dependencies = (
);
fileSystemSynchronizedGroups = (
33DBE7D32E40DCFE003234F1 /* CommonUI */,
33DBE7DB2E41FC88003234F1 /* Preview */,
);
name = AirCasting;
packageProductDependencies = (
AC787D74267B41990034B222 /* AirCastingStyling */,
Expand Down Expand Up @@ -4094,7 +4105,7 @@
CODE_SIGN_ENTITLEMENTS = AirCasting/AirCasting.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = 8;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = LXAGXH6CF6;
ENABLE_PREVIEWS = YES;
Expand All @@ -4104,7 +4115,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.24.1;
MARKETING_VERSION = 1.25.1;
PRODUCT_BUNDLE_IDENTIFIER = org.habitatmap.AirCasting;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -4122,7 +4133,7 @@
CODE_SIGN_ENTITLEMENTS = AirCasting/AirCasting.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = LXAGXH6CF6;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = AirCasting/Info.plist;
Expand All @@ -4131,7 +4142,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.24.1;
MARKETING_VERSION = 1.25.1;
PRODUCT_BUNDLE_IDENTIFIER = org.habitatmap.AirCasting;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -4210,7 +4221,7 @@
CODE_SIGN_ENTITLEMENTS = AirCasting/AirCasting.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = LXAGXH6CF6;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = AirCasting/Info.plist;
Expand All @@ -4219,7 +4230,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.24.1;
MARKETING_VERSION = 1.25.1;
PRODUCT_BUNDLE_IDENTIFIER = org.habitatmap.AirCasting;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
3 changes: 1 addition & 2 deletions AirCasting/Assets.xcassets/2-power.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "poweron@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "poweron@3x.png",
"filename" : "power_ab.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "connected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "connected@3x.png",
"filename" : "ab_connected.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions AirCasting/Assets.xcassets/Air.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "onboarding_air.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "onboarding_air@3x.png",
"filename" : "how_is_air.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "onboarding_measure&map2.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "onboarding_measure&map2@3x.png",
"filename" : "ab_onboard.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions AirCasting/Assets.xcassets/Bitmap.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "onboarding_welcome.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "onboarding_welcome@3x.png",
"filename" : "onboarding_welcome.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Binary file modified AirCasting/Assets.xcassets/Bitmap.imageset/onboarding_welcome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ab_connecting.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "airbeam_cable@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "airbeam_cable@3x.png",
"filename" : "ab_unplugged.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions AirCasting/Assets.xcassets/airbeam.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "connect@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "connect@3x.png",
"filename" : "airbeam.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "didyouknow.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "didyouknow@3x.png",
"filename" : "airbeam_mini_hand_lying.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
41 changes: 41 additions & 0 deletions AirCasting/CommonUI/ABCircleAndLoader.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Created by Lunar on 4.08.25.
//

import SwiftUI

struct ABCircleAndLoader: View {
let airbeamImage: String

init(airbeamImage: String = "airbeam") {
self.airbeamImage = airbeamImage
}

var body: some View {
syncImage
.overlay(
loader
.padding(28),
alignment: .bottomTrailing
)
}

var loader: some View {
ZStack {
Color.accentColor
.frame(width: Constants.Loader.size, height: Constants.Loader.size)
.clipShape(Circle())
ProgressView()
.progressViewStyle(CircularProgressViewStyle(tint: Color.white))
.scaleEffect(2)
}
}

var syncImage: some View {
Image(airbeamImage)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not very important but is there sth like alt text for ios? like accessibility desc or sth

.aspectRatio(contentMode: .fit)
}
}

#Preview {
ABCircleAndLoader()
}
106 changes: 106 additions & 0 deletions AirCasting/CommonUI/ProgressFlowAB.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// Created by Lunar on 4.08.25.
//

import SwiftUI
import AirCastingStyling

struct ProgressFlowAB: View {
let title: String
let message: String
let progress: Float
let abImage: any View

let continueButtonOnClickDestination: (any View)?
let continueButtonOnClick: (@MainActor () -> Void)?

init(progress: Float, abImage: any View, title: String, message: String, continueButtonOnClickDestination: (any View)? = nil) {
self.progress = progress
self.title = title
self.message = message
self.abImage = abImage
self.continueButtonOnClick = nil
self.continueButtonOnClickDestination = continueButtonOnClickDestination
}

init(progress: Float, airbeamImageAsset: String, title: String, message: String, continueButtonOnClickDestination: (any View)? = nil) {
self.progress = progress
self.title = title
self.message = message
self.abImage = image(airbeamImageAsset)
self.continueButtonOnClick = nil
self.continueButtonOnClickDestination = continueButtonOnClickDestination
}

init(progress: Float, airbeamImageAsset: String, title: String, message: String, continueButtonOnClick: @escaping @MainActor () -> Void) {
self.progress = progress
self.title = title
self.message = message
self.abImage = image(airbeamImageAsset)
self.continueButtonOnClickDestination = nil
self.continueButtonOnClick = continueButtonOnClick
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another minor remark: Is there a way to dry it out? not sure if this is the way to go in Swift (having multiple inits, even if they are v. similar). Maybe you can make structs or whatever like

enum ABImageSource {
    case view(AnyView)
    case asset(String)
}
enum ContinueAction {
    case navigation(AnyView)
    case action(@MainActor () -> Void)
    case none
}

and then have one init like

init(progress: Float, abImageSource: ABImageSource, title: String, message: String, continueAction: ContinueAction = .none
) {
    self.progress = progress
    self.abImageSource = abImageSource
    self.title = title
    self.message = message
    self.continueAction = continueAction
}

but possibly I'm thinking in over languages ;)


var body: some View {
VStack(alignment: .leading) {
ProgressView(value: progress)
.padding(.bottom, 50)
AnyView(abImage)
.frame(maxWidth: .infinity)
VStack(alignment: .leading, spacing: 15) {
titleLabel
.frame(maxWidth: .infinity, alignment: .leading)
messageLabel
.frame(maxWidth: .infinity, alignment: .leading)
}
.padding(.top)
.frame(maxWidth: .infinity)
Spacer()
if let continueButtonOnClickDestination {
NavigationLink(
destination: AnyView(continueButtonOnClickDestination),
label: {
Text(Strings.Commons.continue)
.font(Fonts.muliBoldHeading1)
.frame(maxWidth: .infinity)
})
.buttonStyle(BlueButtonStyle())

} else if let continueButtonOnClick {
Button(action: continueButtonOnClick) {
Text(Strings.Commons.continue)
.font(Fonts.muliBoldHeading1)
.frame(maxWidth: .infinity)
}
.buttonStyle(BlueButtonStyle())
}
}
.frame(maxWidth: .infinity)
.padding()
.background(Color.aircastingBackground.ignoresSafeArea())
}

var titleLabel: some View {
Text(title)
.font(Fonts.moderateBoldTitle3)
.foregroundColor(.accentColor)
}

var messageLabel: some View {
Text(message)
.font(Fonts.moderateRegularHeading1)
.foregroundColor(.aircastingGray)
}
}

private func image(_ imageAsset: String) -> any View {
Image(imageAsset)
.aspectRatio(contentMode: .fit)
}

#Preview("AB Loading") {
ProgressFlowAB(progress: 0.4, abImage: ABCircleAndLoader(), title: Strings.SDSyncRootView.title, message: Strings.SDSyncRootView.message)
}

#Preview("AB Ready") {
ProgressFlowAB(progress: 0.4, airbeamImageAsset: "4-connected", title: Strings.SDSyncRootView.title, message: Strings.SDSyncRootView.message, continueButtonOnClickDestination: Text("test"))
}
Loading
Loading