bug fix :

-display/hide call stats when clicking on the network quality icon in the status bar of the Active Call View
This commit is contained in:
Quentin Monnier 2022-07-25 13:56:01 +02:00 committed by QuentinArguillere
parent be1e726a0c
commit 7cdcdd4a4d
6 changed files with 30 additions and 9 deletions

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -57,7 +57,7 @@
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="onSideMenuClick:" destination="-1" eventType="touchUpInside" id="iOC-wy-MPP"/>
<action selector="onQualityClick:" destination="-1" eventType="touchUpInside" id="Pir-Ib-ywJ"/>
</connections>
</button>
</subviews>

View file

@ -35,6 +35,7 @@
@property(weak, nonatomic) IBOutlet UIView *outcallView;
- (IBAction)onSecurityClick:(id)sender;
- (IBAction)onQualityClick:(id)sender;
- (IBAction)onSideMenuClick:(id)sender;
- (IBAction)onRegistrationStateClick:(id)sender;
+ (UIImage *)imageForState:(LinphoneRegistrationState)state;

View file

@ -21,6 +21,7 @@
#import "LinphoneManager.h"
#import "PhoneMainView.h"
#import <UserNotifications/UserNotifications.h>
#import "linphoneapp-Swift.h"
@implementation StatusBarView {
@ -402,6 +403,11 @@
}
}
- (IBAction)onQualityClick:(id)sender {
CallStatsViewModel* stats = [[CallStatsViewModel alloc]init];
[stats toggleVisibility];
}
- (IBAction)onSideMenuClick:(id)sender {
UICompositeView *cvc = PhoneMainView.instance.mainViewController;
[cvc hideSideMenu:(cvc.sideMenuView.frame.origin.x == 0)];

View file

@ -271,3 +271,19 @@ class ControlsViewModel {
}
}
@objc class CallStatsViewModel: NSObject {
override init() {
super.init()
}
@objc
func toggleVisibility() -> Void {
if (ControlsViewModel.shared.callStatsVisible.value == true) {
ControlsViewModel.shared.callStatsVisible.value = false
} else {
ControlsViewModel.shared.callStatsVisible.value = true
}
}
}

View file

@ -256,8 +256,7 @@ import linphonesw
self.numpadView?.removeFromSuperview()
self.shadingMask.isHidden = false
self.numpadView = NumpadView(superView: self.view,callData: CallsViewModel.shared.currentCallData.value!!,marginTop:self.currentCallView?.centerSection.frame.origin.y ?? 0.0, onDismissAction: {
self.numpadView?.removeFromSuperview()
self.shadingMask.isHidden = true
ControlsViewModel.shared.numpadVisible.value = false
})
} else {
self.numpadView?.removeFromSuperview()
@ -272,8 +271,7 @@ import linphonesw
self.currentCallStatsVew?.removeFromSuperview()
self.shadingMask.isHidden = false
self.currentCallStatsVew = CallStatsView(superView: self.view,callData: CallsViewModel.shared.currentCallData.value!!,marginTop:self.currentCallView?.centerSection.frame.origin.y ?? 0.0, onDismissAction: {
self.currentCallStatsVew?.removeFromSuperview()
self.shadingMask.isHidden = true
ControlsViewModel.shared.callStatsVisible.value = false
})
} else {
self.currentCallStatsVew?.removeFromSuperview()

View file

@ -60,12 +60,12 @@ class VoipExtraButtonsView: UIStackView {
// First row
let numpad = VoipExtraButton(text: VoipTexts.call_action_numpad, buttonTheme: VoipTheme.call_action("voip_call_numpad"),onClickAction: {
ControlsViewModel.shared.numpadVisible.notifyAllObservers(with: true)
ControlsViewModel.shared.numpadVisible.value = true
})
row1.addArrangedSubview(numpad)
let stats = VoipExtraButton(text: VoipTexts.call_action_statistics, buttonTheme: VoipTheme.call_action("voip_call_stats"),onClickAction: {
ControlsViewModel.shared.callStatsVisible.notifyAllObservers(with: true)
ControlsViewModel.shared.callStatsVisible.value = true
})
row1.addArrangedSubview(stats)