Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.6.0 RC2 #1855

Merged
merged 8 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .swiftgen.assets.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
strings:
- inputs: ./Common/RuuviLocalization/Sources/Resources/en.lproj/Localizable.strings
outputs:
- templatePath: ./Common/RuuviLocalization/Templates/strings-swift5.stencil
output: ./Common/RuuviLocalization/Sources/RuuviLocalization.swift
params:
forceProvidesNamespaces: true
publicAccess: true
enumName: RuuviLocalization

xcassets:
- inputs: ./Common/RuuviLocalization/Sources/Resources/RuuviColors.xcassets
- inputs: ./Common/RuuviLocalization/Sources/Resources/RuuviAssets.xcassets
outputs:
- templatePath: ./Common/RuuviLocalization/Templates/xcassets-swift5.stencil
output: ./Common/RuuviLocalization/Sources/RuuviColor.swift
output: ./Common/RuuviLocalization/Sources/RuuviAsset.swift
params:
forceProvidesNamespaces: true
publicAccess: true
enumName: RuuviColor

strings:
- inputs: ./Common/RuuviLocalization/Sources/Resources/en.lproj/Localizable.strings
enumName: RuuviAsset
- inputs: ./Common/RuuviLocalization/Sources/Resources/RuuviColors.xcassets
outputs:
- templatePath: ./Common/RuuviLocalization/Templates/strings-swift5.stencil
output: ./Common/RuuviLocalization/Sources/RuuviLocalization.swift
- templatePath: ./Common/RuuviLocalization/Templates/xcassets-swift5.stencil
output: ./Common/RuuviLocalization/Sources/RuuviColor.swift
params:
forceProvidesNamespaces: true
publicAccess: true
enumName: RuuviLocalization
enumName: RuuviColor
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ private final class MigrationAssembly: Assembly {
let settings = r.resolve(RuuviLocalSettings.self)!
let idPersistence = r.resolve(RuuviLocalIDs.self)!
let ruuviPool = r.resolve(RuuviPool.self)!
let sqliteContext = r.resolve(SQLiteContext.self)!
let ruuviStorage = r.resolve(RuuviStorage.self)!
let ruuviAlertService = r.resolve(RuuviServiceAlert.self)!
let ruuviOffsetCalibrationService = r.resolve(RuuviServiceOffsetCalibration.self)!
return RuuviMigrationFactoryImpl(
settings: settings,
idPersistence: idPersistence,
ruuviPool: ruuviPool,
sqliteContext: sqliteContext,
ruuviStorage: ruuviStorage,
ruuviAlertService: ruuviAlertService,
ruuviOffsetCalibrationService: ruuviOffsetCalibrationService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ extension BackgroundSelectionPresenter {
let model = DefaultBackgroundModel(
id: i,
image: image,
thumbnail: image.resize()
thumbnail: image?.resize()
)
defaultImages.append(model)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BackgroundSelectionViewController: UIViewController {
private lazy var backButton: UIButton = {
let button = UIButton()
button.tintColor = .label
let buttonImage = RuuviAssets.backButtonImage
let buttonImage = RuuviAsset.chevronBack.image
button.setImage(buttonImage, for: .normal)
button.setImage(buttonImage, for: .highlighted)
button.imageView?.tintColor = .label
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import RuuviLocalization
import UIKit

class CardsBackgroundView: UIView {
Expand All @@ -12,7 +13,7 @@ class CardsBackgroundView: UIView {
let iv = UIImageView()
iv.contentMode = .scaleAspectFill
iv.backgroundColor = .clear
iv.image = UIImage(named: "tag_bg_layer")
iv.image = RuuviAsset.tagBgLayer.image
return iv
}()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class CardsLargeImageCell: UICollectionViewCell {
return label
}()

private lazy var humidityView = CardsIndicatorView(icon: RuuviAssets.humidityImage)
private lazy var pressureView = CardsIndicatorView(icon: RuuviAssets.pressureImage)
private lazy var movementView = CardsIndicatorView(icon: RuuviAssets.movementCounterImage)
private lazy var humidityView = CardsIndicatorView(icon: RuuviAsset.iconMeasureHumidity.image)
private lazy var pressureView = CardsIndicatorView(icon: RuuviAsset.iconMeasurePressure.image)
private lazy var movementView = CardsIndicatorView(icon: RuuviAsset.iconMeasureMovement.image)

private lazy var batteryLevelView = BatteryLevelView(fontSize: 12)

Expand Down Expand Up @@ -335,15 +335,11 @@ extension CardsLargeImageCell {
case .unknown:
dataSourceIconView.image = nil
case .advertisement:
dataSourceIconView.image = RuuviAssets.advertisementImage
case .heartbeat:
dataSourceIconView.image = RuuviAssets.heartbeatImage
case .log:
dataSourceIconView.image = RuuviAssets.heartbeatImage
dataSourceIconView.image = RuuviAsset.iconBluetooth.image
case .heartbeat, .log:
dataSourceIconView.image = RuuviAsset.iconBluetoothConnected.image
case .ruuviNetwork:
dataSourceIconView.image = RuuviAssets.ruuviNetworkImage
case .weatherProvider:
dataSourceIconView.image = RuuviAssets.weatherProviderImage
dataSourceIconView.image = RuuviAsset.iconGateway.image
}
} else {
dataSourceIconView.image = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CardsViewController: UIViewController {
// Ruuvi Logo
private lazy var ruuviLogoView: UIImageView = {
let iv = UIImageView(
image: UIImage(named: "ruuvi_logo_"),
image: RuuviAsset.ruuviLogo.image.withRenderingMode(.alwaysTemplate),
contentMode: .scaleAspectFit
)
iv.tintColor = .white
Expand All @@ -73,7 +73,7 @@ class CardsViewController: UIViewController {
private lazy var backButton: UIButton = {
let button = UIButton()
button.tintColor = .white
let buttonImage = RuuviAssets.backButtonImage
let buttonImage = RuuviAsset.chevronBack.image
button.setImage(buttonImage, for: .normal)
button.setImage(buttonImage, for: .highlighted)
button.imageView?.tintColor = .white
Expand All @@ -98,7 +98,7 @@ class CardsViewController: UIViewController {
}()

private lazy var chartButton: RuuviCustomButton = {
let button = RuuviCustomButton(icon: RuuviAssets.chartsIcon)
let button = RuuviCustomButton(icon: RuuviAsset.iconChartsButton.image)
button.backgroundColor = .clear
button.addGestureRecognizer(
UITapGestureRecognizer(
Expand All @@ -111,7 +111,7 @@ class CardsViewController: UIViewController {

private lazy var settingsButton: RuuviCustomButton = {
let button = RuuviCustomButton(
icon: RuuviAssets.settingsIcon,
icon: RuuviAsset.baselineSettingsWhite48pt.image,
iconSize: .init(width: 26, height: 25)
)
button.backgroundColor = .clear
Expand Down Expand Up @@ -505,7 +505,7 @@ extension CardsViewController {
}

func showChart(module: UIViewController) {
chartButton.image = RuuviAssets.cardsIcon
chartButton.image = RuuviAsset.iconCardsButton.image
chartViewBackground.alpha = 1
collectionView.isHidden = true
module.willMove(toParent: self)
Expand All @@ -517,7 +517,7 @@ extension CardsViewController {
}

func dismissChart() {
chartButton.image = RuuviAssets.chartsIcon
chartButton.image = RuuviAsset.iconChartsButton.image
chartViewBackground.alpha = 0
children.forEach {
$0.willMove(toParent: nil)
Expand Down Expand Up @@ -791,22 +791,22 @@ extension CardsViewController {
]

if mutedTills.first(where: { $0 != nil }) != nil {
alertButton.image = RuuviAssets.alertOffImage
alertButton.image = RuuviAsset.iconAlertOff.image
removeAlertAnimations(alpha: 0.5)
return
}

if let state = currentVisibleItem?.alertState.value {
switch state {
case .empty:
alertButton.image = RuuviAssets.alertOffImage
alertButton.image = RuuviAsset.iconAlertOff.image
removeAlertAnimations(alpha: 0.5)
case .registered:
alertButton.image = RuuviAssets.alertOnImage
alertButton.image = RuuviAsset.iconAlertOn.image
removeAlertAnimations()
case .firing:
alertButton.alpha = 1.0
alertButton.image = RuuviAssets.alertActiveImage
alertButton.image = RuuviAsset.iconAlertActive.image
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
UIView.animate(
withDuration: 0.5,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Charts
import DGCharts
import Foundation
import RuuviOntology

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Charts
import DGCharts
import UIKit

class CustomYAxisRenderer: YAxisRenderer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Charts
import DGCharts
import Foundation
import RuuviLocalization

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Charts
import DGCharts
import Foundation
import RuuviOntology

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Charts
import DGCharts
import Foundation

public class YAxisValueFormatter: NSObject, AxisValueFormatter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BTKit
import Charts
import DGCharts
import CoreBluetooth
import Foundation
import Future
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BTKit
import Charts
import DGCharts
import Foundation
import RuuviLocal
import RuuviOntology
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Charts
import DGCharts
import Humidity
import RuuviOntology
import UIKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Charts
import DGCharts
import RuuviLocalization
import RuuviService
import UIKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Charts
import DGCharts
import RuuviLocal
import RuuviLocalization
import RuuviOntology
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BTKit
import Charts
import DGCharts
// swiftlint:disable file_length
import Foundation
import GestureInstructions
Expand Down Expand Up @@ -83,7 +83,7 @@ class TagChartsViewController: UIViewController {
menu: historyLengthOptions(),
titleColor: .white,
title: RuuviLocalization.day1,
icon: RuuviAssets.dropDownArrowImage,
icon: RuuviAsset.arrowDropDown.image,
iconTintColor: RuuviColor.logoTintColor.color,
iconSize: .init(width: 14, height: 14),
preccedingIcon: false
Expand All @@ -93,7 +93,7 @@ class TagChartsViewController: UIViewController {
private lazy var moreButton: UIButton = {
let button = UIButton()
button.tintColor = .white
button.setImage(RuuviAssets.threeDotMoreImage, for: .normal)
button.setImage(RuuviAsset.more3dot.image, for: .normal)
button.imageView?.contentMode = .scaleAspectFit
button.showsMenuAsPrimaryAction = true
button.menu = moreButtonOptions()
Expand Down Expand Up @@ -137,7 +137,7 @@ class TagChartsViewController: UIViewController {
menu: nil,
titleColor: .white,
title: RuuviLocalization.TagCharts.Sync.title,
icon: UIImage(named: "icon_sync_bt"),
icon: RuuviAsset.iconSyncBt.image,
iconTintColor: .white,
iconSize: .init(width: 22, height: 22),
preccedingIcon: true
Expand Down Expand Up @@ -738,15 +738,11 @@ extension TagChartsViewController: TagChartsViewInput {
case .unknown:
dataSourceIconView.image = nil
case .advertisement:
dataSourceIconView.image = RuuviAssets.advertisementImage
case .heartbeat:
dataSourceIconView.image = RuuviAssets.heartbeatImage
case .log:
dataSourceIconView.image = RuuviAssets.heartbeatImage
dataSourceIconView.image = RuuviAsset.iconBluetooth.image
case .heartbeat, .log:
dataSourceIconView.image = RuuviAsset.iconBluetoothConnected.image
case .ruuviNetwork:
dataSourceIconView.image = RuuviAssets.ruuviNetworkImage
case .weatherProvider:
dataSourceIconView.image = RuuviAssets.weatherProviderImage
dataSourceIconView.image = RuuviAsset.iconGateway.image
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DashboardImageCell: UICollectionViewCell {
let iv = UIImageView()
iv.contentMode = .scaleAspectFit
iv.backgroundColor = .clear
iv.image = RuuviAssets.threeDotMoreImage
iv.image = RuuviAsset.more3dot.image
iv.tintColor = RuuviColor.dashboardIndicatorBig.color
return iv
}()
Expand Down Expand Up @@ -431,22 +431,18 @@ extension DashboardImageCell {
case .unknown:
dataSourceIconView.image = nil
case .advertisement:
dataSourceIconView.image = RuuviAssets.advertisementImage
case .heartbeat:
dataSourceIconView.image = RuuviAssets.heartbeatImage
case .log:
dataSourceIconView.image = RuuviAssets.heartbeatImage
dataSourceIconView.image = RuuviAsset.iconBluetooth.image
case .heartbeat, .log:
dataSourceIconView.image = RuuviAsset.iconBluetoothConnected.image
case .ruuviNetwork:
dataSourceIconView.image = RuuviAssets.ruuviNetworkImage
case .weatherProvider:
dataSourceIconView.image = RuuviAssets.weatherProviderImage
dataSourceIconView.image = RuuviAsset.iconGateway.image
}
} else {
dataSourceIconView.image = nil
}

switch viewModel.source.value {
case .ruuviNetwork, .weatherProvider:
case .ruuviNetwork:
dataSourceIconViewWidthConstraint.constant = dataSourceIconViewRegularWidth
default:
dataSourceIconViewWidthConstraint.constant = dataSourceIconViewCompactWidth
Expand Down Expand Up @@ -525,18 +521,18 @@ extension DashboardImageCell {
alertButton.isUserInteractionEnabled = false
case .registered:
alertButton.isUserInteractionEnabled = true
if alertIcon.image != RuuviAssets.alertOnImage {
if alertIcon.image != RuuviAsset.iconAlertOn.image {
alertIcon.alpha = 1
alertIcon.image = RuuviAssets.alertOnImage
alertIcon.image = RuuviAsset.iconAlertOn.image
removeAlertAnimations()
}
alertIcon.tintColor = RuuviColor.logoTintColor.color
case .firing:
alertButton.isUserInteractionEnabled = true
alertIcon.alpha = 1.0
alertIcon.tintColor = RuuviColor.orangeColor.color
if alertIcon.image != RuuviAssets.alertActiveImage {
alertIcon.image = RuuviAssets.alertActiveImage
if alertIcon.image != RuuviAsset.iconAlertActive.image {
alertIcon.image = RuuviAsset.iconAlertActive.image
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
UIView.animate(
Expand Down
Loading
Loading