Skip to content

Commit

Permalink
Merge pull request #463 from SUPLA/develop
Browse files Browse the repository at this point in the history
v25.01
  • Loading branch information
przemyslawzygmunt authored Jan 2, 2025
2 parents 2f28d9f + 482e2e8 commit 3fdf75c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
8 changes: 4 additions & 4 deletions SUPLA.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8145,7 +8145,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SUPLA/SUPLA.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 216;
CURRENT_PROJECT_VERSION = 217;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = T6ZPGSWA75;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -8164,7 +8164,7 @@
"$(inherited)",
"$(PROJECT_DIR)/SUPLA/lib",
);
MARKETING_VERSION = 24.12.01;
MARKETING_VERSION = 25.01;
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -D DEBUG";
PRODUCT_BUNDLE_IDENTIFIER = com.acsoftware.ios.supla;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -8184,7 +8184,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SUPLA/SUPLA.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 216;
CURRENT_PROJECT_VERSION = 217;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = T6ZPGSWA75;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -8203,7 +8203,7 @@
"$(inherited)",
"$(PROJECT_DIR)/SUPLA/lib",
);
MARKETING_VERSION = 24.12.01;
MARKETING_VERSION = 25.01;
PRODUCT_BUNDLE_IDENTIFIER = com.acsoftware.ios.supla;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "SUPLA/SUPLA-Bridging-Header.h";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class BaseHistoryDetailVM: BaseViewModel<BaseHistoryDetailViewState, BaseHistory
}

func changeRange(range: ChartRange) {
send(event: .clearHighlight)
if (range == .custom) {
updateView {
// For custom range no reload is needed
Expand Down Expand Up @@ -123,18 +124,21 @@ class BaseHistoryDetailVM: BaseViewModel<BaseHistoryDetailViewState, BaseHistory
}

func moveRangeLeft() {
send(event: .clearHighlight)
shiftByRange(forward: false)
if let state = currentState() { triggerMeasurementsLoad(state: state) }
updateUserState()
}

func moveRangeRight() {
send(event: .clearHighlight)
shiftByRange(forward: true)
if let state = currentState() { triggerMeasurementsLoad(state: state) }
updateUserState()
}

func moveToDataBegin() {
send(event: .clearHighlight)
updateView {
moveToDate(state: $0, date: $0.minDate)
}
Expand All @@ -143,6 +147,7 @@ class BaseHistoryDetailVM: BaseViewModel<BaseHistoryDetailViewState, BaseHistory
}

func moveToDataEnd() {
send(event: .clearHighlight)
updateView {
moveToDate(state: $0, date: $0.maxDate)
}
Expand All @@ -151,6 +156,7 @@ class BaseHistoryDetailVM: BaseViewModel<BaseHistoryDetailViewState, BaseHistory
}

func changeAggregation(aggregation: ChartDataAggregation) {
send(event: .clearHighlight)
updateView {
let aggregations = $0.aggregations?.changing(path: \.selected, to: aggregation)
return $0.changing(path: \.aggregations, to: aggregations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,26 @@ extension ElectricityMeterHistoryFeature {
var body: some SwiftUI.View {
ZStack(alignment: .topLeading) {
Color.Supla.infoScrim.ignoresSafeArea()
TabView(selection: $selectedPage) {
ForEach(viewState.pages) { page in
switch (page) {
case .firstForSinglePhase:
FirstPageSinglePhase {
withAnimation { selectedPage = 1 }
}.tag(0)
case .firstForMultiplePhases:
FirstPageMutliplePhases {
withAnimation { selectedPage = 1 }
}.tag(0)
case .second: SecondPage { onClose() }.tag(1)
if (!viewState.pages.isEmpty) {
TabView(selection: $selectedPage) {
ForEach(viewState.pages) { page in
switch (page) {
case .firstForSinglePhase:
FirstPageSinglePhase {
withAnimation { selectedPage = 1 }
}.tag(0)
case .firstForMultiplePhases:
FirstPageMutliplePhases {
withAnimation { selectedPage = 1 }
}.tag(0)
case .second: SecondPage { onClose() }.tag(1)
}
}
}
.tabViewStyle(.page)
.indexViewStyle(.page(backgroundDisplayMode: .always))
}
.tabViewStyle(.page)
.indexViewStyle(.page(backgroundDisplayMode: .always))

}
}
}
Expand Down

0 comments on commit 3fdf75c

Please sign in to comment.