From 84a817783d4c8076092426499e7a0baa42d5b874 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Thu, 24 Nov 2022 15:13:47 +0100 Subject: [PATCH] Removed IASKPSTitleValueSpecifierViewCell to align each cell of SettingView --- Classes/SettingsView.m | 3 +- .../IASKAppSettingsViewController.m | 7 ++- .../Views/IASKPSTitleValueSpecifierViewCell.h | 22 -------- .../Views/IASKPSTitleValueSpecifierViewCell.m | 53 ------------------- linphone.xcodeproj/project.pbxproj | 6 --- 5 files changed, 4 insertions(+), 87 deletions(-) delete mode 100755 Classes/Utils/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.h delete mode 100755 Classes/Utils/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m diff --git a/Classes/SettingsView.m b/Classes/SettingsView.m index 3698ea617..8c172ba81 100644 --- a/Classes/SettingsView.m +++ b/Classes/SettingsView.m @@ -27,7 +27,6 @@ #import "IASKSpecifierValuesViewController.h" #import "IASKPSTextFieldSpecifierViewCell.h" -#import "IASKPSTitleValueSpecifierViewCell.h" #import "IASKSpecifier.h" #import "IASKTextField.h" #include "linphone/lpconfig.h" @@ -247,7 +246,7 @@ [field setTextColor:LINPHONE_MAIN_COLOR]; } - if ([cell isKindOfClass:[IASKPSTitleValueSpecifierViewCell class]]) { + if ([cell isKindOfClass:[UITableViewCell class]]) { cell.detailTextLabel.textColor = [UIColor grayColor]; } else { cell.detailTextLabel.textColor = LINPHONE_MAIN_COLOR; diff --git a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m index 6818ce1b1..84c780265 100755 --- a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m +++ b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m @@ -21,7 +21,6 @@ #import "IASKSettingsStoreUserDefaults.h" #import "IASKPSSliderSpecifierViewCell.h" #import "IASKPSTextFieldSpecifierViewCell.h" -#import "IASKPSTitleValueSpecifierViewCell.h" #import "IASKSwitch.h" #import "IASKSlider.h" #import "IASKSpecifier.h" @@ -491,7 +490,7 @@ CGRect IASKCGRectSwap(CGRect rect); cell.selectionStyle = UITableViewCellSelectionStyleNone; } else if ([identifier isEqualToString:kIASKPSMultiValueSpecifier] || [identifier isEqualToString:kIASKPSTitleValueSpecifier]) { - cell = [[IASKPSTitleValueSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; cell.accessoryType = [identifier isEqualToString:kIASKPSMultiValueSpecifier] ? UITableViewCellAccessoryDisclosureIndicator : UITableViewCellAccessoryNone; } else if ([identifier isEqualToString:kIASKPSTextFieldSpecifier]) { @@ -501,10 +500,10 @@ CGRect IASKCGRectSwap(CGRect rect); else if ([identifier isEqualToString:kIASKPSSliderSpecifier]) { cell = [[IASKPSSliderSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kIASKPSSliderSpecifier]; } else if ([identifier isEqualToString:kIASKPSChildPaneSpecifier]) { - cell = [[IASKPSTitleValueSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } else if ([identifier isEqualToString:kIASKMailComposeSpecifier]) { - cell = [[IASKPSTitleValueSpecifierViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; } else { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.h b/Classes/Utils/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.h deleted file mode 100755 index b3185b410..000000000 --- a/Classes/Utils/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// IASKPSTitleValueSpecifierViewCell.h -// http://www.inappsettingskit.com -// -// Copyright (c) 2010: -// Luc Vandal, Edovia Inc., http://www.edovia.com -// Ortwin Gentz, FutureTap GmbH, http://www.futuretap.com -// All rights reserved. -// -// It is appreciated but not required that you give credit to Luc Vandal and Ortwin Gentz, -// as the original authors of this code. You can give credit in a blog post, a tweet or on -// a info page of your app. Also, the original authors appreciate letting them know if you use this code. -// -// This code is licensed under the BSD license that is available at: http://www.opensource.org/licenses/bsd-license.php -// - -#import - - -@interface IASKPSTitleValueSpecifierViewCell : UITableViewCell - -@end diff --git a/Classes/Utils/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m b/Classes/Utils/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m deleted file mode 100755 index 17950b645..000000000 --- a/Classes/Utils/InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m +++ /dev/null @@ -1,53 +0,0 @@ -// -// IASKPSTitleValueSpecifierViewCell.m -// http://www.inappsettingskit.com -// -// Copyright (c) 2010: -// Luc Vandal, Edovia Inc., http://www.edovia.com -// Ortwin Gentz, FutureTap GmbH, http://www.futuretap.com -// All rights reserved. -// -// It is appreciated but not required that you give credit to Luc Vandal and Ortwin Gentz, -// as the original authors of this code. You can give credit in a blog post, a tweet or on -// a info page of your app. Also, the original authors appreciate letting them know if you use this code. -// -// This code is licensed under the BSD license that is available at: http://www.opensource.org/licenses/bsd-license.php -// - -#import "IASKPSTitleValueSpecifierViewCell.h" -#import "IASKSettingsReader.h" - - -@implementation IASKPSTitleValueSpecifierViewCell - -- (void)layoutSubviews { - [super layoutSubviews]; - - CGSize viewSize = [self.textLabel superview].frame.size; - - // if there's an image, make room for it - CGFloat imageOffset = floor(self.imageView.image ? self.imageView.bounds.size.width + self.imageView.frame.origin.x : 0); - - // set the left title label frame - CGFloat labelWidth = [self.textLabel sizeThatFits:CGSizeZero].width; - CGFloat minValueWidth = (self.detailTextLabel.text.length) ? kIASKMinValueWidth + kIASKSpacing : 0; - labelWidth = MIN(labelWidth, viewSize.width - minValueWidth - kIASKPaddingLeft -kIASKPaddingRight - imageOffset); - CGRect labelFrame = CGRectMake(kIASKPaddingLeft + imageOffset, 0, labelWidth, viewSize.height); - if (!self.detailTextLabel.text.length) { - labelFrame = CGRectMake(kIASKPaddingLeft + imageOffset, 0, viewSize.width - kIASKPaddingLeft - kIASKPaddingRight - imageOffset, viewSize.height); - } - self.textLabel.frame = labelFrame; - - // set the right value label frame - if (!self.textLabel.text.length) { - viewSize = [self.detailTextLabel superview].frame.size; - self.detailTextLabel.frame = CGRectMake(kIASKPaddingLeft + imageOffset, 0, viewSize.width - kIASKPaddingLeft - kIASKPaddingRight - imageOffset, viewSize.height); - } else if (self.detailTextLabel.textAlignment == NSTextAlignmentLeft) { - CGRect valueFrame = self.detailTextLabel.frame; - valueFrame.origin.x = labelFrame.origin.x + MAX(kIASKMinLabelWidth - imageOffset, labelWidth) + kIASKSpacing; - valueFrame.size.width = self.detailTextLabel.superview.frame.size.width - valueFrame.origin.x - kIASKPaddingRight; - self.detailTextLabel.frame = valueFrame; - } -} - -@end diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 812fc787e..f6c8a3df9 100644 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -913,7 +913,6 @@ D3807FF615C2894A005BE9BC /* IASKSpecifier.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FDA15C2894A005BE9BC /* IASKSpecifier.m */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; D3807FF815C2894A005BE9BC /* IASKPSSliderSpecifierViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FDD15C2894A005BE9BC /* IASKPSSliderSpecifierViewCell.m */; }; D3807FFA15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FDF15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.m */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; - D3807FFC15C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FE115C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.m */; }; D3807FFE15C2894A005BE9BC /* IASKSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FE315C2894A005BE9BC /* IASKSlider.m */; }; D380800015C2894A005BE9BC /* IASKSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FE515C2894A005BE9BC /* IASKSwitch.m */; }; D380800215C2894A005BE9BC /* IASKTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FE715C2894A005BE9BC /* IASKTextField.m */; }; @@ -2131,8 +2130,6 @@ D3807FDD15C2894A005BE9BC /* IASKPSSliderSpecifierViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKPSSliderSpecifierViewCell.m; sourceTree = ""; }; D3807FDE15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKPSTextFieldSpecifierViewCell.h; sourceTree = ""; }; D3807FDF15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKPSTextFieldSpecifierViewCell.m; sourceTree = ""; }; - D3807FE015C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKPSTitleValueSpecifierViewCell.h; sourceTree = ""; }; - D3807FE115C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKPSTitleValueSpecifierViewCell.m; sourceTree = ""; }; D3807FE215C2894A005BE9BC /* IASKSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKSlider.h; sourceTree = ""; }; D3807FE315C2894A005BE9BC /* IASKSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKSlider.m; sourceTree = ""; }; D3807FE415C2894A005BE9BC /* IASKSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKSwitch.h; sourceTree = ""; }; @@ -3750,8 +3747,6 @@ D3807FDD15C2894A005BE9BC /* IASKPSSliderSpecifierViewCell.m */, D3807FDE15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.h */, D3807FDF15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.m */, - D3807FE015C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.h */, - D3807FE115C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.m */, D3807FE215C2894A005BE9BC /* IASKSlider.h */, D3807FE315C2894A005BE9BC /* IASKSlider.m */, D3807FE415C2894A005BE9BC /* IASKSwitch.h */, @@ -5092,7 +5087,6 @@ C63F726A285A24B10066163B /* StyledDatePicker.swift in Sources */, C63F7237285A24B10066163B /* CallStatisticsData.swift in Sources */, D3807FFA15C2894A005BE9BC /* IASKPSTextFieldSpecifierViewCell.m in Sources */, - D3807FFC15C2894A005BE9BC /* IASKPSTitleValueSpecifierViewCell.m in Sources */, C63F721B285A24B10066163B /* ConferenceSchedulingSummaryView.swift in Sources */, D3807FFE15C2894A005BE9BC /* IASKSlider.m in Sources */, D380800015C2894A005BE9BC /* IASKSwitch.m in Sources */,