Skip to content

Commit

Permalink
Merge pull request #30 from AVIRO-official/feature/home
Browse files Browse the repository at this point in the history
24.02.24-29) [Feat]: Home 1.2.1 업데이트 완료
  • Loading branch information
Jeon0976 authored Feb 28, 2024
2 parents c3ae9a6 + de1f0c9 commit 5ee3e06
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 7 deletions.
4 changes: 2 additions & 2 deletions AVIRO.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,7 @@
CODE_SIGN_ENTITLEMENTS = AVIRO/AVIRO.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = C4K2HXA435;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = AVIRO/App/Info.plist;
Expand Down Expand Up @@ -2478,7 +2478,7 @@
CODE_SIGN_ENTITLEMENTS = AVIRO/AVIRO.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = C4K2HXA435;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = AVIRO/App/Info.plist;
Expand Down
1 change: 0 additions & 1 deletion AVIRO/Custom/SubClass/UIButton/FranchiseToggleButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by 전성훈 on 2024/02/23.
//


// MARK: - Toggle button Custom Refectoring 필요
// TODO: 좀 더 외부에서 프로퍼티 값을 받을 수 있도록 수정 예정
import UIKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Foundation

struct PlaceTopModel {
let placeState: VeganType
let category: CategoryType
let placeTitle: String
let placeCategory: String
let distance: String
Expand Down
26 changes: 26 additions & 0 deletions AVIRO/Scene/Base/AVIROTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,35 @@ final class AVIROTabBarController: UIViewController, TabBarDelegate {
button.heightAnchor.constraint(equalToConstant: CGFloat.tabBarHeight),
button.centerYAnchor.constraint(equalTo: tabBarView.centerYAnchor)
])

if index == 2 {
showUpdatedPoint(with: button)
}
}
}

private func showUpdatedPoint(with button: UIButton) {
let redDotView = UIView()

redDotView.backgroundColor = .red

let redDotSize: CGFloat = 9
redDotView.layer.cornerRadius = 4.5
redDotView.clipsToBounds = true

guard let imageView = button.imageView else { return }
redDotView.translatesAutoresizingMaskIntoConstraints = false

imageView.addSubview(redDotView)

NSLayoutConstraint.activate([
redDotView.heightAnchor.constraint(equalToConstant: redDotSize),
redDotView.widthAnchor.constraint(equalToConstant: redDotSize),
redDotView.trailingAnchor.constraint(equalTo: imageView.trailingAnchor, constant: 3),
redDotView.topAnchor.constraint(equalTo: imageView.topAnchor, constant: -3)
])
}

private func updateView() {
deleteView()
setupView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,23 +311,61 @@ final class PlaceSummaryView: UIView {

switch placeModel.placeState {
case .All:
placeIconImage = UIImage.allBox
switch placeModel.category {
case .Bar:
placeIconImage = UIImage.allBoxBar
placeCategory.text = placeModel.placeCategory + "" + Text.all.rawValue
case .Bread:
placeIconImage = UIImage.allBoxBread
placeCategory.text = placeModel.placeCategory + "" + Text.all.rawValue
case .Coffee:
placeIconImage = UIImage.allBoxCoffee
placeCategory.text = placeModel.placeCategory + "" + Text.all.rawValue
case .Restaurant:
placeIconImage = UIImage.allBoxRestaurant
placeCategory.text = placeModel.placeCategory + "" + Text.all.rawValue
}
whenSlideTopLabel.textColor = .all
whenSlideTopLabelString = Text.all.rawValue
case .Some:
placeIconImage = UIImage.someBox
switch placeModel.category {
case .Bar:
placeIconImage = UIImage.someBoxBar
placeCategory.text = placeModel.placeCategory + "" + Text.some.rawValue
case .Bread:
placeIconImage = UIImage.someBoxBread
placeCategory.text = placeModel.placeCategory + "" + Text.some.rawValue
case .Coffee:
placeIconImage = UIImage.someBoxCoffee
placeCategory.text = placeModel.placeCategory + "" + Text.some.rawValue
case .Restaurant:
placeIconImage = UIImage.someBoxRestaurant
placeCategory.text = placeModel.placeCategory + "" + Text.some.rawValue
}
whenSlideTopLabel.textColor = .some
whenSlideTopLabelString = Text.some.rawValue
case .Request:
placeIconImage = UIImage.requestBox
switch placeModel.category {
case .Bar:
placeIconImage = UIImage.requestBoxBar
placeCategory.text = placeModel.placeCategory + "" + Text.request.rawValue
case .Bread:
placeIconImage = UIImage.requestBoxBread
placeCategory.text = placeModel.placeCategory + "" + Text.request.rawValue
case .Coffee:
placeIconImage = UIImage.requestBoxCoffee
placeCategory.text = placeModel.placeCategory + "" + Text.request.rawValue
case .Restaurant:
placeIconImage = UIImage.requestBoxRestaurant
placeCategory.text = placeModel.placeCategory + "" + Text.request.rawValue
}
whenSlideTopLabel.textColor = .request
whenSlideTopLabelString = Text.request.rawValue
}

placeIcon.image = placeIconImage

placeTitle.text = placeModel.placeTitle
placeCategory.text = placeModel.placeCategory
distanceLabel.text = placeModel.distance
reviewsLabel.text = placeModel.reviewsCount + ""
addressLabel.text = placeModel.address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ final class HomeViewPresenter: NSObject {

markerModelManager.updateMarkerModelWhenClicked(with: selectedMarkerModel!)
viewController?.moveToCameraWhenHasAVIRO(validMarkerModel, zoomTo: nil)

print("Test")
}

// MARK: Load Place Sumamry
Expand Down Expand Up @@ -485,6 +487,7 @@ final class HomeViewPresenter: NSObject {

let placeTopModel = PlaceTopModel(
placeState: mapPlace,
category: markerModel.categoryType,
placeTitle: place.title,
placeCategory: place.category,
distance: distanceString,
Expand Down
1 change: 1 addition & 0 deletions AVIRO/Scene/Utils/Components/TabBarButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ final class TabBarButton: UIButton {
init(tabBarType: TabBarType) {
super.init(frame: .zero)
var config = defaultButtonConfig()

config.attributedTitle = AttributedString(
tabBarType.title,
attributes: AttributeContainer([
Expand Down

0 comments on commit 5ee3e06

Please sign in to comment.