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

Unify cells // dynamic font support #1579

Merged
merged 11 commits into from
Mar 21, 2024
Merged
2 changes: 1 addition & 1 deletion .github/workflows/uitests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
-test-iterations 3 \
-retry-tests-on-failure \
-resultBundlePath "testResult.xcresult" \
| xcpretty
| xcbeautify --quieter

- name: Upload test results
uses: actions/upload-artifact@v4
Expand Down
52 changes: 34 additions & 18 deletions NextcloudTalk.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "NO">
<CommandLineArguments>
<CommandLineArgument
argument = "-UIPreferredContentSizeCategoryName"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "UICTContentSizeCategoryS"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<Testables>
<TestableReference
skipped = "NO">
Expand Down
5 changes: 1 addition & 4 deletions NextcloudTalk/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

[NCUserInterfaceController sharedInstance].mainViewController = (NCSplitViewController *) self.window.rootViewController;
[NCUserInterfaceController sharedInstance].roomsTableViewController = [NCUserInterfaceController sharedInstance].mainViewController.viewControllers.firstObject.childViewControllers.firstObject;

if (@available(iOS 14.5, *)) {
[NCUserInterfaceController sharedInstance].mainViewController.displayModeButtonVisibility = UISplitViewControllerDisplayModeButtonVisibilityNever;
}
[NCUserInterfaceController sharedInstance].mainViewController.displayModeButtonVisibility = UISplitViewControllerDisplayModeButtonVisibilityNever;

NSArray *arguments = [[NSProcessInfo processInfo] arguments];

Expand Down
1 change: 0 additions & 1 deletion NextcloudTalk/AutoCompletionTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ static NSString *AutoCompletionCellIdentifier = @"AutoCompletionCellIdentifier
@property (nonatomic, strong) AvatarButton *avatarButton;
@property (nonatomic, strong) UIImageView *userStatusImageView;

+ (CGFloat)defaultFontSize;
- (void)setUserStatus:(NSString *)userStatus;

@end
18 changes: 3 additions & 15 deletions NextcloudTalk/AutoCompletionTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

#import "AutoCompletionTableViewCell.h"
#import "ChatTableViewCell.h"

#import "SLKUIConstants.h"

Expand Down Expand Up @@ -85,10 +86,8 @@ - (void)configureSubviews
- (void)prepareForReuse
{
[super prepareForReuse];

CGFloat pointSize = [AutoCompletionTableViewCell defaultFontSize];

self.titleLabel.font = [UIFont systemFontOfSize:pointSize];
self.titleLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
self.titleLabel.text = @"";

[self.avatarButton cancelCurrentRequest];
Expand All @@ -108,7 +107,7 @@ - (UILabel *)titleLabel
_titleLabel.backgroundColor = [UIColor clearColor];
_titleLabel.userInteractionEnabled = NO;
_titleLabel.numberOfLines = 1;
_titleLabel.font = [UIFont systemFontOfSize:[AutoCompletionTableViewCell defaultFontSize]];
_titleLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
_titleLabel.textColor = [UIColor secondaryLabelColor];
}
return _titleLabel;
Expand Down Expand Up @@ -137,15 +136,4 @@ - (void)setUserStatus:(NSString *)userStatus
}
}

+ (CGFloat)defaultFontSize
{
CGFloat pointSize = 16.0;

// NSString *contentSizeCategory = [[UIApplication sharedApplication] preferredContentSizeCategory];
// pointSize += SLKPointSizeDifferenceForCategory(contentSizeCategory);

return pointSize;
}


@end
7 changes: 7 additions & 0 deletions NextcloudTalk/AvatarButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,17 @@ import SDWebImage
}

private func commonInit() {
self.layer.masksToBounds = true
self.imageView?.contentMode = .scaleToFill
self.imageView?.frame = self.frame
self.contentVerticalAlignment = .fill
self.contentHorizontalAlignment = .fill
self.backgroundColor = .systemGray3
}

override func layoutSubviews() {
super.layoutSubviews()
self.layer.cornerRadius = self.frame.width / 2.0
}

// MARK: - Conversation avatars
Expand Down
Loading
Loading