mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 23:18:27 +02:00
244 lines
8.1 KiB
Swift
244 lines
8.1 KiB
Swift
//
|
|
/*
|
|
* Copyright (c) 2025 BWI GmbH
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
import SwiftUI
|
|
|
|
// MARK: Migraion Info View
|
|
struct MigrationInfoView: View {
|
|
@Environment(\.dismiss) var dismissView
|
|
@State private var selectedTab = 1
|
|
|
|
var body: some View {
|
|
TabView(selection: $selectedTab) {
|
|
MigrationInfoViewOne()
|
|
.tag(1)
|
|
MigrationInfoViewTwo()
|
|
.tag(2)
|
|
}
|
|
.tabViewStyle(.page)
|
|
.indexViewStyle(.page(backgroundDisplayMode: .always))
|
|
//.background(Color.white.ignoresSafeArea())
|
|
.onAppear() {
|
|
FeatureBannerVisibilityService().markAsRead()
|
|
NotificationCenter.default.post(name: .bwiMarkTopBannerAsRead, object: self, userInfo: ["type" : "feature_banner"])
|
|
}
|
|
.overlay {
|
|
VStack() {
|
|
HStack() {
|
|
Spacer()
|
|
Button {
|
|
dismissView()
|
|
} label: {
|
|
Image(Asset.Images.closeButton.name)
|
|
.renderingMode(.template)
|
|
.resizable()
|
|
.frame(width: 36, height: 36)
|
|
.foregroundColor(Color(ThemeService.shared().theme.tintColor))
|
|
.padding(20)
|
|
}
|
|
}
|
|
Spacer()
|
|
HStack() {
|
|
Button {
|
|
withAnimation {
|
|
selectedTab = 1
|
|
}
|
|
} label: {
|
|
Image(systemName: "arrow.left")
|
|
.resizable()
|
|
.frame(width: 24, height: 24)
|
|
.foregroundStyle(Color(ThemeService.shared().theme.tintColor))
|
|
}
|
|
.padding(EdgeInsets(top: 20, leading: 30, bottom: 10, trailing: 30))
|
|
.opacity(selectedTab == 1 ? 0 : 1)
|
|
|
|
Spacer()
|
|
|
|
Button {
|
|
withAnimation {
|
|
selectedTab = 2
|
|
}
|
|
} label: {
|
|
Image(systemName: "arrow.right")
|
|
.resizable()
|
|
.frame(width: 24, height: 24)
|
|
.foregroundStyle(Color(ThemeService.shared().theme.tintColor))
|
|
}
|
|
.padding(EdgeInsets(top: 20, leading: 30, bottom: 10, trailing: 30))
|
|
.opacity(selectedTab == 2 ? 0 : 1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// MARK: Migraion Info View one
|
|
struct MigrationInfoViewOne: View {
|
|
var body: some View {
|
|
GeometryReader { geo in
|
|
ScrollView(.vertical) {
|
|
VStack(alignment: .center, spacing: 30) {
|
|
|
|
Spacer()
|
|
|
|
header
|
|
|
|
infoText
|
|
|
|
Spacer()
|
|
|
|
}
|
|
.frame(width: geo.size.width, height: geo.size.height)
|
|
}
|
|
}
|
|
}
|
|
|
|
var header: some View {
|
|
VStack(spacing: 50) {
|
|
Image("bumx_logo")
|
|
.resizable()
|
|
.frame(width: 150, height: 150)
|
|
.clipShape(.rect(cornerRadius: 26))
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: 26)
|
|
.stroke(.gray, lineWidth: 0.4)
|
|
)
|
|
Text(BWIL10n.bwiMobileDialogMMoreTitle)
|
|
.font(.title)
|
|
.bold()
|
|
}
|
|
}
|
|
|
|
var infoText: some View {
|
|
VStack(alignment: .leading) {
|
|
Text(BWIL10n.bwiMobileDialogM1MoreText1) +
|
|
Text(BWIL10n.bwiMobileDialogM1MoreText2).bold() +
|
|
Text(BWIL10n.bwiMobileDialogM1MoreText3)
|
|
VStack(alignment: .leading) {
|
|
HStack(alignment: .top) {
|
|
Text("•")
|
|
Text(BWIL10n.bwiMobileDialogM1MoreTextBullet1)
|
|
}
|
|
HStack(alignment: .top) {
|
|
Text("•")
|
|
Text(BWIL10n.bwiMobileDialogM1MoreTextBullet2)
|
|
}
|
|
HStack(alignment: .top) {
|
|
Text("•")
|
|
Text(BWIL10n.bwiMobileDialogM1MoreTextBullet3)
|
|
}
|
|
HStack(alignment: .top) {
|
|
Text("•")
|
|
Text(BWIL10n.bwiMobileDialogM1MoreTextBullet4)
|
|
}
|
|
}
|
|
.multilineTextAlignment(.leading)
|
|
.padding(.leading, 16)
|
|
}
|
|
.lineLimit(nil)
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
.padding(EdgeInsets(top: 0, leading: 30, bottom: 0, trailing: 30))
|
|
}
|
|
}
|
|
|
|
|
|
// MARK: Migraion Info View two
|
|
struct MigrationInfoViewTwo: View {
|
|
|
|
var body: some View {
|
|
GeometryReader { geo in
|
|
ScrollView(.vertical) {
|
|
VStack(alignment: .center, spacing: 30) {
|
|
|
|
Spacer()
|
|
|
|
header
|
|
|
|
instructionsList
|
|
|
|
Spacer()
|
|
|
|
downloadNewAppButton
|
|
}
|
|
.frame(width: geo.size.width, height: geo.size.height)
|
|
}
|
|
}
|
|
}
|
|
|
|
var header: some View {
|
|
VStack(spacing: 50) {
|
|
Image("bumx_logo")
|
|
.resizable()
|
|
.frame(width: 150, height: 150)
|
|
.clipShape(.rect(cornerRadius: 26))
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: 26)
|
|
.stroke(.gray, lineWidth: 0.4)
|
|
)
|
|
Text(BWIL10n.bwiMobileDialogMMore2Title)
|
|
.font(.title)
|
|
.bold()
|
|
}
|
|
}
|
|
|
|
var instructionsList: some View {
|
|
VStack(alignment: .leading, spacing: 10) {
|
|
HStack() {
|
|
Text("1.")
|
|
Button(action: {
|
|
|
|
}, label: {
|
|
Text(BWIL10n.bwiMobileDialogMMore2Text1)
|
|
.underline()
|
|
Image(systemName: "square.on.square")
|
|
.resizable()
|
|
.frame(width: 15, height: 15)
|
|
})
|
|
}
|
|
HStack() {
|
|
Text("2.")
|
|
Text(BWIL10n.bwiMobileDialogMMore2Text2)
|
|
}
|
|
HStack() {
|
|
Text("3.")
|
|
Text(BWIL10n.bwiMobileDialogMMore2Text3)
|
|
}
|
|
}
|
|
.lineLimit(nil)
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
}
|
|
|
|
var downloadNewAppButton: some View {
|
|
Button(action: {
|
|
guard let bumxAppStoreURL = URL(string: "itms-apps://itunes.apple.com/app/id6738500048") else { return }
|
|
guard UIApplication.shared.canOpenURL(bumxAppStoreURL) else { return }
|
|
UIApplication.shared.open(bumxAppStoreURL, options: [:], completionHandler: nil)
|
|
}, label: {
|
|
Text(BWIL10n.bwiMobileDialogMMoreButton)
|
|
.foregroundColor(.white)
|
|
.padding(.vertical, 10)
|
|
.padding(.horizontal, 50)
|
|
.background(Color(ThemeService.shared().theme.tintColor))
|
|
.clipShape(RoundedRectangle(cornerRadius: 10))
|
|
.lineLimit(nil)
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
})
|
|
.padding(.bottom, 100)
|
|
}
|
|
}
|