Skip to content

Commit

Permalink
pull
Browse files Browse the repository at this point in the history
  • Loading branch information
m1rosh committed May 21, 2024
2 parents 243a213 + c16f376 commit 1867b8b
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 205 deletions.
14 changes: 7 additions & 7 deletions LiveRecipes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 5PM42AC732;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = TimerActivityWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = TimerActivityWidget;
Expand All @@ -960,7 +960,7 @@
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = ru.LiveRecipes.TimerActivityWidget;
PRODUCT_BUNDLE_IDENTIFIER = ru.LiveRecipesq.TimerActivityWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -976,7 +976,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 5PM42AC732;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = TimerActivityWidget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = TimerActivityWidget;
Expand All @@ -988,7 +988,7 @@
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = ru.LiveRecipes.TimerActivityWidget;
PRODUCT_BUNDLE_IDENTIFIER = ru.LiveRecipesq.TimerActivityWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -1127,7 +1127,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"LiveRecipes/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 5PM42AC732;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = LiveRecipes/Info.plist;
Expand All @@ -1143,7 +1143,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = ru.LiveRecipes;
PRODUCT_BUNDLE_IDENTIFIER = ru.LiveRecipesq;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "LiveRecipes/LiveRecipes-Bridging-Header.h";
Expand Down Expand Up @@ -1180,7 +1180,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = ru.LiveRecipes;
PRODUCT_BUNDLE_IDENTIFIER = ru.LiveRecipesq;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "LiveRecipes/LiveRecipes-Bridging-Header.h";
Expand Down
3 changes: 3 additions & 0 deletions LiveRecipes/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -3006,6 +3006,9 @@
}
}
}
},
"Очистить недавние?" : {

},
"Первое блюдо" : {
"extractionState" : "manual",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ struct TimerView: View {
}
else {
Text(hours == 0 ? "\(minutes)m:\(seconds)s" : "\(hours)h:\(minutes)m:\(seconds)s")
.foregroundColor(Color(uiColor: .label))
.foregroundColor(Color(uiColor: .black))
.font(.system(size: 19, weight: .semibold))
.padding(.top, 2)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct IngredientRunningTextView2: View {
.background(.white)
.clipShape(RoundedRectangle(cornerRadius: 20))
.font(.system(size: 18, weight: .regular))
.foregroundColor(Color(uiColor: .label))
.foregroundColor(Color(uiColor: .black))
.offset(x: computedFinishX, y: 0)
Spacer()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ struct OneStepView: View {
Spacer()
}
}.buttonStyle(.borderedProminent)
.tint(Color(uiColor: .label))
.tint(Color(uiColor: .black))
.padding(.bottom, 20)
.frame(width: UIScreen.main.bounds.width - 20)
.offset(y: model.isTimerOnView ? 10 : -100)
Expand Down
13 changes: 8 additions & 5 deletions LiveRecipes/Modules/Recipes/FiltersView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct FiltersView: View {
Image(systemName: "xmark")
.imageScale(.small)
.fontWeight(.semibold)
.foregroundStyle(Color(red: 0.2353, green: 0.2353, blue: 0.2627, opacity: 0.6))
.foregroundStyle(Color(red: 0.2353, green: 0.2353, blue: 0.2627, opacity: 1))
}
.frame(width: 30, height: 30)
.background(Color(UIColor.secondarySystemBackground))
Expand All @@ -35,6 +35,9 @@ struct FiltersView: View {
Button {
viewModel.duration = ""
viewModel.calories = ""
viewModel.protein = ""
viewModel.fats = ""
viewModel.carbohydrates = ""
viewModel.contains = []
viewModel.notContains = []
viewModel.findRecipesByFilter()
Expand Down Expand Up @@ -74,7 +77,7 @@ struct FiltersView: View {
TextField("num".localized, text: $viewModel.calories)
.padding(EdgeInsets(top: 4, leading: 0, bottom: 4, trailing: 0))
.keyboardType(.numberPad)
.background(RoundedRectangle(cornerRadius: 8).fill(.background))
.background(RoundedRectangle(cornerRadius: 8).fill(.windowBackground))
.multilineTextAlignment(.center)
.frame(width: 90)
}
Expand All @@ -98,7 +101,7 @@ struct FiltersView: View {
TextField("num".localized, text: $viewModel.protein)
.padding(EdgeInsets(top: 4, leading: 0, bottom: 4, trailing: 0))
.keyboardType(.numberPad)
.background(RoundedRectangle(cornerRadius: 8).fill(.background))
.background(RoundedRectangle(cornerRadius: 8).fill(.windowBackground))
.multilineTextAlignment(.center)
.frame(width: 90)
}
Expand All @@ -122,7 +125,7 @@ struct FiltersView: View {
TextField("num".localized, text: $viewModel.fats)
.padding(EdgeInsets(top: 4, leading: 0, bottom: 4, trailing: 0))
.keyboardType(.numberPad)
.background(RoundedRectangle(cornerRadius: 8).fill(.background))
.background(RoundedRectangle(cornerRadius: 8).fill(.windowBackground))
.multilineTextAlignment(.center)
.frame(width: 90)
}
Expand All @@ -146,7 +149,7 @@ struct FiltersView: View {
TextField("num".localized, text: $viewModel.carbohydrates)
.padding(EdgeInsets(top: 4, leading: 0, bottom: 4, trailing: 0))
.keyboardType(.numberPad)
.background(RoundedRectangle(cornerRadius: 8).fill(.background))
.background(RoundedRectangle(cornerRadius: 8).fill(.windowBackground))
.multilineTextAlignment(.center)
.frame(width: 90)
}
Expand Down
143 changes: 1 addition & 142 deletions LiveRecipes/Modules/Recipes/KeyWordsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,84 +7,6 @@

import SwiftUI

//struct KeyWordsView: View {
// @Environment(\.presentationMode) var presentationMode
// @StateObject var viewModel: RecipesViewModel
// @State private var searchText = ""
//
// var body: some View {
// NavigationView {
// keyWordsViewContent()
// .searchable(text: $searchText, placement: .navigationBarDrawer(displayMode: .always))
// .navigationTitle("keywords.title".localized)
// .navigationBarTitleDisplayMode(.inline)
// .toolbar {
// ToolbarItem(placement: .topBarTrailing) {
// Button {
// self.presentationMode.wrappedValue.dismiss()
// viewModel.sortKeyWordsByChoose()
// } label: {
// VStack {
// Image(systemName: "xmark")
// .imageScale(.small)
// .fontWeight(.semibold)
// .foregroundStyle(Color(red: 0.2353, green: 0.2353, blue: 0.2627, opacity: 0.6))
// }
// .frame(width: 30, height: 30)
// .background(Color(UIColor.secondarySystemBackground))
// .clipShape(.circle)
// }
// }
// }
// }
// }
//
// @ViewBuilder
// func keyWordsViewContent() -> some View {
// if (viewModel.keyWords.isEmpty) {
// Text("keywords.error.message".localized)
// } else {
// ScrollView {
// LazyVGrid(columns: [GridItem(), GridItem(), GridItem()],
// content: {
// ForEach (viewModel.keyWords.indices, id: \.self) { index in
// VStack {
// Button(action: {
// viewModel.keyWords[index].choose()
// }, label: {
// Text(viewModel.keyWords[index].keyWord)
// .tint(viewModel.keyWords[index].isChoosed ? .white : .black)
// .font(.caption)
// .padding(8)
// .background(Color(viewModel.keyWords[index].isChoosed ? UIColor.orange : UIColor.secondarySystemBackground))
// .clipShape(.capsule)
// })
// }
// }
// })
// }
// .overlay(
// Button {
// self.presentationMode.wrappedValue.dismiss()
// viewModel.sortKeyWordsByChoose()
// } label: {
// HStack {
// Image(systemName: "magnifyingglass")
// .imageScale(.medium)
// Text("keywords.search.button".localized)
// }
// .tint(.white)
// .fontWeight(.semibold)
// }
// .frame(width: 200, height: 50)
// .background(.orange, in: .rect(cornerRadius: 14)),
// alignment: .bottom
// )
// }
// }
//}



struct KeyWordsView: View {
@Environment(\.presentationMode) var presentationMode
Expand All @@ -107,7 +29,7 @@ struct KeyWordsView: View {
Image(systemName: "xmark")
.imageScale(.small)
.fontWeight(.semibold)
.foregroundStyle(Color(red: 0.2353, green: 0.2353, blue: 0.2627, opacity: 0.6))
.foregroundStyle(Color(red: 0.2353, green: 0.2353, blue: 0.2627, opacity: 1))
}
.frame(width: 30, height: 30)
.background(Color(UIColor.secondarySystemBackground))
Expand Down Expand Up @@ -165,66 +87,3 @@ struct KeyWordsView: View {
}
}
}


//пытался сделать нормально, не через LazyVGrid

// LazyVStack {
// GeometryReader { proxy in
// var width = UIScreen.main.bounds.size.width
// var height = UIScreen.main.bounds.size.height
// ZStack(alignment: .topLeading) {
// ForEach (viewModel.keyWords.indices, id: \.self) { index in
// VStack {
// Button(action: {
// viewModel.keyWords[index].choose()
// }, label: {
// Text(viewModel.keyWords[index].keyWord)
// .tint(viewModel.keyWords[index].isChoosed ? .white : .black)
// .font(.caption)
// .padding(8)
// .background(Color(viewModel.keyWords[index].isChoosed ? UIColor.orange : UIColor.secondarySystemBackground))
// .clipShape(.capsule)
// })
// .padding(4)
// }
// .alignmentGuide(.top, computeValue: {d in
// let result = height
// if index == viewModel.keyWords.endIndex {
// height = 0
// }
// return result
// })
// .alignmentGuide(.leading, computeValue: { d in
// if (abs(width - d.width) > proxy.size.width - 24)
// {
// width = 0
// height -= d.height
// }
// let result = width
// if index == viewModel.keyWords.endIndex {
// width = 0
// } else {
// width -= d.width
// }
// return result
// })
//
// .padding(.horizontal, 8)
// }
// }
// }
// }
// }
// .scrollIndicators(.hidden)
// }
// }
//
// private func viewHeightReader(_ binding: Binding<CGFloat>) -> some View {
// return GeometryReader { geometry -> Color in
// let rect = geometry.frame(in: .local)
// DispatchQueue.main.async {
// binding.wrappedValue = rect.size.height
// }
// return .clear
// }
2 changes: 1 addition & 1 deletion LiveRecipes/Modules/Recipes/RecipesModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ final class RecipesModel: ObservableObject, RecipesModelProtocol {
return [
KeyWord(keyWord: "Суп"), KeyWord(keyWord: "Завтрак"), KeyWord(keyWord: "Салат"), KeyWord(keyWord: "Вкус"), KeyWord(keyWord: "Быстрое"), KeyWord(keyWord: "Дессерт"), KeyWord(keyWord: "Секрет"), KeyWord(keyWord: "Тесто"),
KeyWord(keyWord: "Форма"), KeyWord(keyWord: "Сахар"), KeyWord(keyWord: "Сладкое"), KeyWord(keyWord: "Традиционное"), KeyWord(keyWord: "Легкий"), KeyWord(keyWord: "Диета"), KeyWord(keyWord: "Пудинг"), KeyWord(keyWord: "Сироп"),
KeyWord(keyWord: "Фрукт")
KeyWord(keyWord: "Фрукт"), KeyWord(keyWord: "Мексиканское"), KeyWord(keyWord: "Фрукты"), KeyWord(keyWord: "Нежный"), KeyWord(keyWord: "Утотченный"), KeyWord(keyWord: "Сладкая"), KeyWord(keyWord: "Карамель"), KeyWord(keyWord: "Мучное"), KeyWord(keyWord: "Английское"), KeyWord(keyWord: "Второе блюдо"), KeyWord(keyWord: "Полезное"), KeyWord(keyWord: "Легкое"), KeyWord(keyWord: "Вечер"),KeyWord(keyWord: "Ужин"), KeyWord(keyWord: "Обед"), KeyWord(keyWord: "Драники"), KeyWord(keyWord: "Сырники"), KeyWord(keyWord: "Итальянское"), KeyWord(keyWord: "Огонь"), KeyWord(keyWord: "Отдых"), KeyWord(keyWord: "Простое"), KeyWord(keyWord: "Постное"), KeyWord(keyWord: "Постный"), KeyWord(keyWord: "Лист"), KeyWord(keyWord: "Духовка"),KeyWord(keyWord: "В духовке") , KeyWord(keyWord: "Крепкое"), KeyWord(keyWord: "Крепкий"), KeyWord(keyWord: "Мука"), KeyWord(keyWord: "Сода"), KeyWord(keyWord: "Без молока"), KeyWord(keyWord: "Алкоголь")
]
}
}
Expand Down
6 changes: 5 additions & 1 deletion LiveRecipes/Modules/Recipes/RecipesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ struct RecipesView: View {
allRecipesView()
cookToTimeView()
recentRecipesView()
.onAppear {
viewModel.isLoadingRecents = true
viewModel.loadRecents()
}
myRecipesView()
}
else {
Expand Down Expand Up @@ -294,7 +298,7 @@ struct RecipesView: View {
.font(.caption2)
.multilineTextAlignment(.center)
}
.frame(width: 220, height: 100)
.frame(width: 220, height: 170)
.background(Color(UIColor.secondarySystemBackground))
.clipShape(.rect(cornerRadius: 8))
.padding(.bottom, 12)
Expand Down
Loading

0 comments on commit 1867b8b

Please sign in to comment.