Commit 0b5e2c29 by Demid Merzlyakov

Remove unused code.

parent c464fb65
......@@ -35,8 +35,6 @@
CD1B71462660F95300916E71 /* OneWeatherWidgetExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = CD1B71392660F95000916E71 /* OneWeatherWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
CD1DDD30260218AE00AC62B2 /* DaysControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD1DDD2F260218AE00AC62B2 /* DaysControlView.swift */; };
CD1DDD332602305200AC62B2 /* ForecastInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD1DDD322602305200AC62B2 /* ForecastInfoCell.swift */; };
CD251ED82603633800ED7A65 /* ForecastPrecipitationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD251ED72603633800ED7A65 /* ForecastPrecipitationCell.swift */; };
CD251EDC26036E5400ED7A65 /* DayTimePrecipitationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD251EDB26036E5400ED7A65 /* DayTimePrecipitationView.swift */; };
CD2ABF32261489F700C1A92E /* LocationCellFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD2ABF31261489F700C1A92E /* LocationCellFactory.swift */; };
CD2C22812670C36A001ADA9A /* ShortsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD2C22802670C36A001ADA9A /* ShortsView.swift */; };
CD2C22832670C579001ADA9A /* ShortsCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD2C22822670C579001ADA9A /* ShortsCollectionViewLayout.swift */; };
......@@ -411,8 +409,6 @@
CD1B71432660F95300916E71 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CD1DDD2F260218AE00AC62B2 /* DaysControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysControlView.swift; sourceTree = "<group>"; };
CD1DDD322602305200AC62B2 /* ForecastInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForecastInfoCell.swift; sourceTree = "<group>"; };
CD251ED72603633800ED7A65 /* ForecastPrecipitationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForecastPrecipitationCell.swift; sourceTree = "<group>"; };
CD251EDB26036E5400ED7A65 /* DayTimePrecipitationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DayTimePrecipitationView.swift; sourceTree = "<group>"; };
CD2ABF31261489F700C1A92E /* LocationCellFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationCellFactory.swift; sourceTree = "<group>"; };
CD2C22802670C36A001ADA9A /* ShortsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortsView.swift; sourceTree = "<group>"; };
CD2C22822670C579001ADA9A /* ShortsCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortsCollectionViewLayout.swift; sourceTree = "<group>"; };
......@@ -880,15 +876,6 @@
path = OneWeatherWidget;
sourceTree = "<group>";
};
CD251EDA26036E2F00ED7A65 /* ForecastPrecipitationCell */ = {
isa = PBXGroup;
children = (
CD251ED72603633800ED7A65 /* ForecastPrecipitationCell.swift */,
CD251EDB26036E5400ED7A65 /* DayTimePrecipitationView.swift */,
);
path = ForecastPrecipitationCell;
sourceTree = "<group>";
};
CD2C227F2670C347001ADA9A /* Shorts */ = {
isa = PBXGroup;
children = (
......@@ -1275,7 +1262,6 @@
isa = PBXGroup;
children = (
CD35DFCE2603448300F2138F /* ForecastInfoCell */,
CD251EDA26036E2F00ED7A65 /* ForecastPrecipitationCell */,
CD8E041525F8F91B001785B6 /* ForecastCellFactory.swift */,
CD593BCB2608A4F200C93428 /* ForecastDailyCell.swift */,
CD593BCE2608A50900C93428 /* ForecastHourlyCell.swift */,
......@@ -2303,7 +2289,6 @@
CDC6125325E79C8F00188DA7 /* DayTimeView.swift in Sources */,
CE13B81B262480B3007CBD4D /* AdView.swift in Sources */,
CD85797B2672216600CC4CDA /* UIView+InterfaceStyle.swift in Sources */,
CD251EDC26036E5400ED7A65 /* DayTimePrecipitationView.swift in Sources */,
CD32CE04260C742300235081 /* MenuViewController.swift in Sources */,
CE0457952632B3F900B3C19A /* NotificationsCoordinator.swift in Sources */,
CD86246925E672A20097F3FB /* PrecipButton.swift in Sources */,
......@@ -2344,7 +2329,6 @@
CD85796F26721C2900CC4CDA /* ShortsViewModel.swift in Sources */,
CDE2BF252609D9140085C930 /* ForecastWindButton.swift in Sources */,
CD32CE16260C77C600235081 /* MenuHeaderButton.swift in Sources */,
CD251ED82603633800ED7A65 /* ForecastPrecipitationCell.swift in Sources */,
CE13B816262480B3007CBD4D /* NativeAdLoader.swift in Sources */,
CDF9BF8E26133D050037847D /* LocationSearchCoordinator.swift in Sources */,
CD7EB378269C60680088999D /* PromotionLargeWidgetView.swift in Sources */,
......
//
// DayTimePrecipitationView.swift
// 1Weather
//
// Created by Dmitry Stepanets on 18.03.2021.
//
import UIKit
class DayTimePrecipitationView: UIView {
//Private
private let dayTimeLabel = UILabel()
private let precipitationView = PrecipitationView()
private let valueLabel = UILabel()
init(withSeparator:Bool = false) {
super.init(frame: .zero)
prepareView()
prepareLabels()
preparePrecipView()
if withSeparator {
prepareSeparator()
}
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
private extension DayTimePrecipitationView {
func prepareView() {
self.snp.makeConstraints { (make) in
make.width.equalTo(90)
}
}
func prepareLabels() {
dayTimeLabel.font = AppFont.SFPro.bold(size: 14)
dayTimeLabel.textColor = ThemeManager.currentTheme.secondaryTextColor
addSubview(dayTimeLabel)
valueLabel.font = AppFont.SFPro.bold(size: 12)
valueLabel.textColor = ThemeManager.currentTheme.secondaryTextColor
addSubview(valueLabel)
//Constraints
dayTimeLabel.snp.makeConstraints { (make) in
make.top.equalToSuperview().inset(24)
make.centerX.equalToSuperview()
}
valueLabel.snp.makeConstraints { (make) in
make.centerX.equalToSuperview()
make.bottom.equalToSuperview().inset(18)
}
}
func preparePrecipView() {
addSubview(precipitationView)
precipitationView.snp.makeConstraints { (make) in
make.top.equalTo(dayTimeLabel.snp.bottom).offset(24).priority(.medium)
make.bottom.equalTo(valueLabel.snp.top).offset(-20)
make.width.equalTo(24)
make.centerX.equalToSuperview()
make.height.equalTo(130)
}
}
func prepareSeparator() {
let separatorView = UIView()
separatorView.backgroundColor = UIColor(hex: 0xc2c9d6)
separatorView.alpha = 0.5
addSubview(separatorView)
separatorView.snp.makeConstraints { (make) in
make.top.equalTo(dayTimeLabel)
make.bottom.equalTo(precipitationView)
make.right.equalToSuperview()
make.width.equalTo(1)
}
}
}
//
// ForecastPrecipitationCell.swift
// 1Weather
//
// Created by Dmitry Stepanets on 18.03.2021.
//
import UIKit
class ForecastPrecipitationCell: UITableViewCell {
//Private
private let titleLabel = UILabel()
private let stackView = UIStackView()
private let infoContainer = UIView()
private let infoImageView = UIImageView()
private let infoLabel = UILabel()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
prepareCell()
prepareTitle()
prepareStackView()
prepareInfoContainer()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
//MARK:- Prepare
private extension ForecastPrecipitationCell {
func prepareCell() {
selectionStyle = .none
contentView.backgroundColor = ThemeManager.currentTheme.baseBackgroundColor
}
func prepareTitle() {
titleLabel.font = AppFont.SFPro.bold(size: 16)
titleLabel.textColor = ThemeManager.currentTheme.secondaryTextColor
titleLabel.text = "precipitation.title".localized().uppercased()
contentView.addSubview(titleLabel)
}
func prepareStackView() {
stackView.axis = .horizontal
stackView.distribution = .fillEqually
stackView.alignment = .center
stackView.spacing = 0
stackView.clipsToBounds = false
stackView.isLayoutMarginsRelativeArrangement = true
stackView.layoutMargins = .init(top: 0, left: 6, bottom: 0, right: 6)
contentView.addSubview(stackView)
stackView.snp.makeConstraints { (make) in
make.top.equalTo(titleLabel.snp.bottom).offset(18)
make.left.right.equalToSuperview().inset(18)
}
}
func prepareInfoContainer() {
infoImageView.contentMode = .scaleAspectFit
infoImageView.image = UIImage(named: "humidity")
infoContainer.addSubview(infoImageView)
infoImageView.snp.makeConstraints { (make) in
make.left.equalToSuperview().inset(20)
make.centerY.equalToSuperview()
make.width.height.equalTo(12)
}
infoLabel.font = AppFont.SFPro.regular(size: 13)
infoLabel.textColor = ThemeManager.currentTheme.secondaryTextColor
infoLabel.text = "Possible light shower between 1 PM - 2 PM"
infoContainer.addSubview(infoLabel)
infoLabel.snp.makeConstraints { (make) in
make.left.equalTo(infoImageView.snp.right).offset(8)
make.right.equalToSuperview().inset(8)
make.centerY.equalToSuperview()
}
infoContainer.backgroundColor = UIColor(hex: 0xd9ebfe)
infoContainer.layer.cornerRadius = 12
contentView.addSubview(infoContainer)
infoContainer.snp.makeConstraints { (make) in
make.left.right.equalToSuperview().inset(18)
make.height.equalTo(40)
make.top.equalTo(stackView.snp.bottom).offset(20).priority(.medium)
make.bottom.equalToSuperview().inset(15)
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment