Commit
This commit is contained in:
parent
def9175c20
commit
3fad13097a
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Bucket
|
||||||
|
uuid = "38CE0E1B-29C0-4785-BF18-FE1BA38F677F"
|
||||||
|
type = "1"
|
||||||
|
version = "2.0">
|
||||||
|
</Bucket>
|
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"colors" : [
|
||||||
|
{
|
||||||
|
"color" : {
|
||||||
|
"color-space" : "srgb",
|
||||||
|
"components" : {
|
||||||
|
"alpha" : "1.000",
|
||||||
|
"blue" : "0x84",
|
||||||
|
"green" : "0x80",
|
||||||
|
"red" : "0x80"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"idiom" : "universal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"appearances" : [
|
||||||
|
{
|
||||||
|
"appearance" : "luminosity",
|
||||||
|
"value" : "dark"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"color" : {
|
||||||
|
"color-space" : "srgb",
|
||||||
|
"components" : {
|
||||||
|
"alpha" : "1.000",
|
||||||
|
"blue" : "0x84",
|
||||||
|
"green" : "0x80",
|
||||||
|
"red" : "0x80"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
46
Schedule ICTIS/Main/Views/CommentView.swift
Normal file
46
Schedule ICTIS/Main/Views/CommentView.swift
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
//
|
||||||
|
// CommentView.swift
|
||||||
|
// Schedule ICTIS
|
||||||
|
//
|
||||||
|
// Created by G412 on 17.12.2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct CommentView: View {
|
||||||
|
@Binding var textForComment: String
|
||||||
|
@FocusState private var isFocused: Bool
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
HStack {
|
||||||
|
TextField("Комментарий", text: $textForComment)
|
||||||
|
.submitLabel(.done)
|
||||||
|
.multilineTextAlignment(.leading)
|
||||||
|
.focused($isFocused)
|
||||||
|
.padding(.top, 6)
|
||||||
|
.padding(.bottom, 6)
|
||||||
|
|
||||||
|
if isFocused {
|
||||||
|
Button {
|
||||||
|
textForComment = ""
|
||||||
|
self.isFocused = false
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "xmark.circle.fill")
|
||||||
|
.padding(.trailing, 20)
|
||||||
|
.offset(x: 10)
|
||||||
|
.foregroundColor(.gray)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.frame(minHeight: 40)
|
||||||
|
.padding(.horizontal)
|
||||||
|
.background(
|
||||||
|
RoundedRectangle(cornerRadius: 10)
|
||||||
|
.fill(.white)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
SheetCreateClassView(isShowingSheet: .constant(true))
|
||||||
|
}
|
48
Schedule ICTIS/Main/Views/FieldView.swift
Normal file
48
Schedule ICTIS/Main/Views/FieldView.swift
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
//
|
||||||
|
// Field.swift
|
||||||
|
// Schedule ICTIS
|
||||||
|
//
|
||||||
|
// Created by G412 on 16.12.2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct FieldView: View {
|
||||||
|
@Binding var text: String
|
||||||
|
var nameOfImage: String
|
||||||
|
var labelForField: String
|
||||||
|
@FocusState private var isFocused: Bool
|
||||||
|
var body: some View {
|
||||||
|
HStack(spacing: 0) {
|
||||||
|
Image(systemName: nameOfImage)
|
||||||
|
.foregroundColor(Color.gray)
|
||||||
|
.padding(.leading, 12)
|
||||||
|
.padding(.trailing, 7)
|
||||||
|
TextField(labelForField, text: $text)
|
||||||
|
.font(.system(size: 18, weight: .regular))
|
||||||
|
.disableAutocorrection(true)
|
||||||
|
.submitLabel(.done)
|
||||||
|
.focused($isFocused)
|
||||||
|
if isFocused {
|
||||||
|
Button {
|
||||||
|
self.text = ""
|
||||||
|
self.isFocused = false
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "xmark.circle.fill")
|
||||||
|
.padding(.trailing, 20)
|
||||||
|
.offset(x: 10)
|
||||||
|
.foregroundColor(.gray)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.frame(height: 40)
|
||||||
|
.background(
|
||||||
|
RoundedRectangle(cornerRadius: 10)
|
||||||
|
.fill(.white)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
ContentView()
|
||||||
|
}
|
@ -47,7 +47,7 @@ struct SearchBarView: View {
|
|||||||
.background(
|
.background(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.background(Color.white)
|
.background(Color.red)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(height: 40)
|
.frame(height: 40)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// SheetView.swift
|
// SheetView.swift
|
||||||
// Schedule ICTIS
|
// Schedule ICTIS
|
||||||
//
|
//
|
||||||
// Created by G412 on 12.12.2024.
|
// Created by Mironov Egor on 12.12.2024.
|
||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
@ -2,33 +2,98 @@
|
|||||||
// SheetCreateClassView.swift
|
// SheetCreateClassView.swift
|
||||||
// Schedule ICTIS
|
// Schedule ICTIS
|
||||||
//
|
//
|
||||||
// Created by G412 on 12.12.2024.
|
// Created by Mironov Egor on 12.12.2024.
|
||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct SheetCreateClassView: View {
|
struct SheetCreateClassView: View {
|
||||||
@Binding var isShowingSheet: Bool
|
@Binding var isShowingSheet: Bool
|
||||||
@State private var isEditingClass: Bool = false
|
|
||||||
@State private var isEditingAuditory: Bool = false
|
|
||||||
@State private var isEditingProfessor: Bool = false
|
|
||||||
@State private var textForNameOfClass = ""
|
@State private var textForNameOfClass = ""
|
||||||
@State private var textForNameOfAuditory = ""
|
@State private var textForNameOfAuditory = ""
|
||||||
@State private var textForNameOfProfessor = ""
|
@State private var textForNameOfProfessor = ""
|
||||||
|
@State private var isShowingDatePickerForDate: Bool = false
|
||||||
|
@State private var selectedDay: Date = Date()
|
||||||
|
@State private var selectedStartTime: Date = Date()
|
||||||
|
@State private var selectedEndTime: Date = Date()
|
||||||
|
@State private var isImportant: Bool = false
|
||||||
|
@State private var selectedOption: String = "Нет"
|
||||||
|
@State private var textForComment: String = ""
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
VStack {
|
VStack {
|
||||||
FieldView(isEditing: $isEditingClass, text: $textForNameOfClass, nameOfImage: "book", labelForField: "Предмет")
|
FieldView(text: $textForNameOfClass, nameOfImage: "book", labelForField: "Предмет")
|
||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
FieldView(isEditing: $isEditingAuditory, text: $textForNameOfAuditory, nameOfImage: "mappin.and.ellipse", labelForField: "Корпус-аудитория")
|
FieldView(text: $textForNameOfAuditory, nameOfImage: "mappin.and.ellipse", labelForField: "Корпус-аудитория")
|
||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
FieldView(isEditing: $isEditingProfessor, text: $textForNameOfProfessor, nameOfImage: "book", labelForField: "Преподаватель")
|
FieldView(text: $textForNameOfProfessor, nameOfImage: "book", labelForField: "Преподаватель")
|
||||||
|
.padding(.bottom, 10)
|
||||||
|
HStack {
|
||||||
|
Image(systemName: "calendar")
|
||||||
|
.foregroundColor(Color.gray)
|
||||||
|
.padding(.leading, 12)
|
||||||
|
.padding(.trailing, 7)
|
||||||
|
Text("Дата")
|
||||||
|
.foregroundColor(Color("grayForFields").opacity(0.5))
|
||||||
|
.font(.system(size: 18, weight: .regular))
|
||||||
|
Spacer()
|
||||||
|
Text("\(selectedDay, formatter: dateFormatter)")
|
||||||
|
.foregroundColor(.black)
|
||||||
|
.font(.system(size: 18, weight: .medium))
|
||||||
|
.padding(.trailing, 20)
|
||||||
|
}
|
||||||
|
.frame(height: 40)
|
||||||
|
.background(
|
||||||
|
RoundedRectangle(cornerRadius: 10)
|
||||||
|
.fill(.white)
|
||||||
|
)
|
||||||
|
.overlay {
|
||||||
|
DatePicker("", selection: $selectedDay, in: Date()..., displayedComponents: .date)
|
||||||
|
.blendMode(.destinationOver)
|
||||||
|
}
|
||||||
|
.padding(.bottom, 10)
|
||||||
|
HStack {
|
||||||
|
StartEndTimeView(selectedTime: $selectedStartTime, imageName: "clock", text: "Начало")
|
||||||
|
Spacer()
|
||||||
|
StartEndTimeView(selectedTime: $selectedEndTime, imageName: "clock.badge.xmark", text: "Конец")
|
||||||
|
}
|
||||||
|
.frame(height: 40)
|
||||||
|
.padding(.bottom, 10)
|
||||||
|
Toggle("Пометить как важную", isOn: $isImportant)
|
||||||
|
.frame(height: 40)
|
||||||
|
.padding(.horizontal)
|
||||||
|
.background(
|
||||||
|
RoundedRectangle(cornerRadius: 10)
|
||||||
|
.fill(.white)
|
||||||
|
)
|
||||||
|
.padding(.bottom, 10)
|
||||||
|
|
||||||
|
HStack {
|
||||||
|
Text("Напоминанние")
|
||||||
|
Spacer()
|
||||||
|
Picker("Напоминание", selection: $selectedOption, content: {
|
||||||
|
ForEach(MockData.notifications, id: \.self) {
|
||||||
|
Text($0)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.accentColor(Color("grayForFields"))
|
||||||
|
}
|
||||||
|
.frame(height: 40)
|
||||||
|
.padding(.horizontal)
|
||||||
|
.background(
|
||||||
|
RoundedRectangle(cornerRadius: 10)
|
||||||
|
.fill(.white)
|
||||||
|
)
|
||||||
|
.padding(.bottom, 10)
|
||||||
|
|
||||||
|
CommentView(textForComment: $textForComment)
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding()
|
.padding(.horizontal)
|
||||||
.background(Color("background"))
|
.padding(.bottom, 60)
|
||||||
|
}
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .navigationBarLeading) {
|
ToolbarItem(placement: .navigationBarLeading) {
|
||||||
Button("Отменить") {
|
Button("Отменить") {
|
||||||
@ -41,49 +106,18 @@ struct SheetCreateClassView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.navigationTitle("Новая пара")
|
||||||
|
.background(Color("background"))
|
||||||
}
|
}
|
||||||
.background(Color("background")) // Фон для всего sheet
|
}
|
||||||
|
private var dateFormatter: DateFormatter {
|
||||||
|
let formatter = DateFormatter()
|
||||||
|
formatter.dateStyle = .medium
|
||||||
|
formatter.timeStyle = .none
|
||||||
|
return formatter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
SheetCreateClassView(isShowingSheet: .constant(true))
|
SheetCreateClassView(isShowingSheet: .constant(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FieldView: View {
|
|
||||||
@Binding var isEditing: Bool
|
|
||||||
@Binding var text: String
|
|
||||||
var nameOfImage: String
|
|
||||||
var labelForField: String
|
|
||||||
var body: some View {
|
|
||||||
HStack(spacing: 0) {
|
|
||||||
Image(systemName: nameOfImage)
|
|
||||||
.foregroundColor(Color.gray)
|
|
||||||
.padding(.leading, 12)
|
|
||||||
.padding(.trailing, 7)
|
|
||||||
TextField(labelForField, text: $text)
|
|
||||||
.disableAutocorrection(true)
|
|
||||||
.onTapGesture {
|
|
||||||
self.isEditing = true
|
|
||||||
}
|
|
||||||
.submitLabel(.search)
|
|
||||||
if isEditing {
|
|
||||||
Button {
|
|
||||||
self.text = ""
|
|
||||||
self.isEditing = false
|
|
||||||
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
|
|
||||||
} label: {
|
|
||||||
Image(systemName: "xmark.circle.fill")
|
|
||||||
.padding(.trailing, 20)
|
|
||||||
.offset(x: 10)
|
|
||||||
.foregroundColor(.gray)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.frame(height: 40)
|
|
||||||
.background(
|
|
||||||
RoundedRectangle(cornerRadius: 10)
|
|
||||||
.fill(.white)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
59
Schedule ICTIS/Main/Views/StartEndTimeView.swift
Normal file
59
Schedule ICTIS/Main/Views/StartEndTimeView.swift
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
//
|
||||||
|
// StartEndTimeView.swift
|
||||||
|
// Schedule ICTIS
|
||||||
|
//
|
||||||
|
// Created by Mironov Egor on 17.12.2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct StartEndTimeView: View {
|
||||||
|
@Binding var selectedTime: Date
|
||||||
|
var imageName: String
|
||||||
|
var text: String
|
||||||
|
@State private var isTimeSelected: Bool = false
|
||||||
|
var body: some View {
|
||||||
|
HStack {
|
||||||
|
Image(systemName: imageName)
|
||||||
|
.foregroundColor(Color("grayForFields"))
|
||||||
|
.padding(.leading, 12)
|
||||||
|
|
||||||
|
if !isTimeSelected {
|
||||||
|
Text(text)
|
||||||
|
.font(.system(size: 17, weight: .regular))
|
||||||
|
.foregroundColor(.gray.opacity(0.5))
|
||||||
|
}
|
||||||
|
|
||||||
|
if isTimeSelected {
|
||||||
|
Text("\(selectedTime, formatter: timeFormatter)")
|
||||||
|
.foregroundColor(.black)
|
||||||
|
.font(.system(size: 17, weight: .medium))
|
||||||
|
.padding(.trailing, 10)
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.frame(width: (UIScreen.main.bounds.width / 2) - 22, height: 40)
|
||||||
|
.background(
|
||||||
|
RoundedRectangle(cornerRadius: 10)
|
||||||
|
.fill(.white)
|
||||||
|
)
|
||||||
|
.overlay {
|
||||||
|
DatePicker("", selection: $selectedTime, in: Date()..., displayedComponents: .hourAndMinute)
|
||||||
|
.padding(.trailing, 35)
|
||||||
|
.blendMode(.destinationOver)
|
||||||
|
.onChange(of: selectedTime) { newValue, oldValue in
|
||||||
|
isTimeSelected = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var timeFormatter: DateFormatter {
|
||||||
|
let formatter = DateFormatter()
|
||||||
|
formatter.dateFormat = "HH:mm"
|
||||||
|
return formatter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
StartEndTimeView(selectedTime: .constant(Date()), imageName: "clock", text: "Начало")
|
||||||
|
}
|
58
Schedule ICTIS/Main/Views/TextFiledView.swift
Normal file
58
Schedule ICTIS/Main/Views/TextFiledView.swift
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
//
|
||||||
|
// TextFiledView.swift
|
||||||
|
// Schedule ICTIS
|
||||||
|
//
|
||||||
|
// Created by G412 on 17.12.2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct TextFiledView: View {
|
||||||
|
@State private var isEditing: Bool = false
|
||||||
|
@State private var text: String = ""
|
||||||
|
@State private var nameOfImage: String = "calendar"
|
||||||
|
@State private var labelForField: String = "Преподаватель"
|
||||||
|
|
||||||
|
@FocusState private var isTextFieldFocused: Bool
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
HStack(spacing: 0) {
|
||||||
|
Image(systemName: nameOfImage)
|
||||||
|
.foregroundColor(Color.gray)
|
||||||
|
.padding(.leading, 12)
|
||||||
|
.padding(.trailing, 7)
|
||||||
|
|
||||||
|
TextField(labelForField, text: $text)
|
||||||
|
.font(.system(size: 18, weight: .regular))
|
||||||
|
.disableAutocorrection(true)
|
||||||
|
.focused($isTextFieldFocused)
|
||||||
|
.onChange(of: isTextFieldFocused) { newValue, oldValue in
|
||||||
|
isEditing = newValue
|
||||||
|
}
|
||||||
|
.submitLabel(.done)
|
||||||
|
|
||||||
|
if isTextFieldFocused {
|
||||||
|
Button {
|
||||||
|
self.text = ""
|
||||||
|
self.isEditing = false
|
||||||
|
isTextFieldFocused = false
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "xmark.circle.fill")
|
||||||
|
.padding()
|
||||||
|
.padding(.trailing, 20)
|
||||||
|
.offset(x: 10)
|
||||||
|
.foregroundColor(.red)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.frame(height: 40)
|
||||||
|
.background(
|
||||||
|
RoundedRectangle(cornerRadius: 10)
|
||||||
|
.fill(.white)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
TextFiledView()
|
||||||
|
}
|
@ -10,13 +10,5 @@ import Foundation
|
|||||||
|
|
||||||
struct MockData {
|
struct MockData {
|
||||||
static let daysOfWeek = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"]
|
static let daysOfWeek = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"]
|
||||||
static let onlineClasses: [String] = [
|
static let notifications = ["Нет", "За 10 минут", "За 30 миннут", "За 1 час"]
|
||||||
"пр.Академический курс иностранного языка Янкаускас Е. С. LMS",
|
|
||||||
"пр.Академический курс иностранного языка Янкаускас Е. С. LMS-3",
|
|
||||||
"пр.Введение в инженерную деятельность 1 п/г Михайлова В. Д. LMS 2 п/г Романенко К. С. 3 п/г Козловский А. В. 4 п/г Компаниец В. С. 5 п/г Олейников К. А. 6 п/г Прудников В. А. 7 п/г Петров Д. А. 8 п/г Григорян К. С.",
|
|
||||||
"пр.Иностранный язык Иностранный язык LMS",
|
|
||||||
"лек.Операционные системы 1 п/г Шкурко А. Н. Г-309 АКТРУ 2 п/г Дроздов С. Н. Г-333 3 п/г Нужнов Е. В. Г-301 Operating systems(Операционные системы) 4 п/г Самойлов А. Н. LMS",
|
|
||||||
"пр.Введение в инженерную деятельность 1 п/г Плёнкин А. П. LMS-1 2 п/г Кучеров С. А. 3 п/г Шкурко А. Н. 4 п/г Механцев Б. Е.",
|
|
||||||
"лек.Операционные системы 1 п/г Шкурко А. Н. Г-309 АКТРУ 2 п/г Дроздов С. Н. Г-333 3 п/г Нужнов Е. В. Г-301 Operating systems(Операционные системы) 4 п/г Самойлов А. Н. LMS"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
@ -70,4 +70,8 @@ extension View {
|
|||||||
return Color("greenForOffline")
|
return Color("greenForOffline")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func hideKeyboard() {
|
||||||
|
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user