Skip to content
Open
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
18 changes: 18 additions & 0 deletions Classes/Core/Controllers/FLEXNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ + (instancetype)withRootViewController:(UIViewController *)rootVC {
- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for FLEX interface
if (@available(iOS 9.0, *)) {
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.navigationBar.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}

// Set navigation bar title text color to ensure visibility
if (@available(iOS 13.0, *)) {
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
[appearance configureWithDefaultBackground];
appearance.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor labelColor]};
appearance.largeTitleTextAttributes = @{NSForegroundColorAttributeName: [UIColor labelColor]};
self.navigationBar.standardAppearance = appearance;
self.navigationBar.scrollEdgeAppearance = appearance;
} else {
self.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor blackColor]};
}

self.waitingToAddTab = YES;

// Add gesture to reveal toolbar if hidden
Expand Down
6 changes: 6 additions & 0 deletions Classes/Core/Controllers/FLEXTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ - (void)loadView {
- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for all FLEX table views
if (@available(iOS 9.0, *)) {
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.tableView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}

self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;

// Toolbar
Expand Down
6 changes: 6 additions & 0 deletions Classes/Core/Views/Cells/FLEXTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ - (void)postInit {

self.titleLabel.numberOfLines = 1;
self.subtitleLabel.numberOfLines = 1;

// Force LTR layout for all FLEX table view cells
self.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.contentView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.titleLabel.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.subtitleLabel.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}

- (UILabel *)titleLabel {
Expand Down
8 changes: 8 additions & 0 deletions Classes/ExplorerInterface/FLEXExplorerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,16 @@ - (void)dealloc {
- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for FLEX explorer interface
if (@available(iOS 9.0, *)) {
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}

// Toolbar
_explorerToolbar = [FLEXExplorerToolbar new];
if (@available(iOS 9.0, *)) {
_explorerToolbar.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}

// Start the toolbar off below any bars that may be at the top of the view.
CGFloat toolbarOriginY = NSUserDefaults.standardUserDefaults.flex_toolbarTopMargin;
Expand Down
5 changes: 5 additions & 0 deletions Classes/ExplorerInterface/FLEXWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ - (id)initWithFrame:(CGRect)frame {
// If we make the window level too high, we block out UIAlertViews.
// There's a balance between staying above the app's windows and staying below alerts.
self.windowLevel = UIWindowLevelAlert - 1;

// Force LTR layout for FLEX window
if (@available(iOS 9.0, *)) {
self.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}
}
return self;
}
Expand Down
3 changes: 2 additions & 1 deletion Classes/GlobalStateExplorers/FLEXLiveObjectsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ - (void)viewDidLoad {
self.activatesSearchBarAutomatically = YES;
self.searchBarDebounceInterval = kFLEXDebounceInstant;
self.showsCarousel = YES;
self.carousel.items = @[@"A→Z", @"Count", @"Size"];
// Use RTL-aware arrow that flips direction in Arabic/RTL layouts
self.carousel.items = @[@"A\u2192Z", @"Count", @"Size"];

self.refreshControl = [UIRefreshControl new];
[self.refreshControl addTarget:self action:@selector(refreshControlDidRefresh:) forControlEvents:UIControlEventValueChanged];
Expand Down
5 changes: 5 additions & 0 deletions Classes/GlobalStateExplorers/FLEXWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ - (id)initWithURL:(NSURL *)url {
- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for technical content
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.navigationController.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

[self.view addSubview:self.webView];
self.webView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.webView.frame = self.view.bounds;
self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

Expand Down
9 changes: 9 additions & 0 deletions Classes/GlobalStateExplorers/Globals/FLEXGlobalsSection.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ - (void)configureCell:(__kindof UITableViewCell *)cell forRow:(NSInteger)row {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.font = UIFont.flex_defaultTableCellFont;
cell.textLabel.text = self.rows[row].entryNameFuture();

// Force LTR layout for FLEX table view cells
if (@available(iOS 9.0, *)) {
cell.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
cell.contentView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
if (cell.textLabel) {
cell.textLabel.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}
}
}

@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ + (FLEXGlobalsEntry *)globalsEntryForRow:(FLEXGlobalsRow)row {

- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for FLEX globals menu
if (@available(iOS 9.0, *)) {
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.tableView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}

self.title = @"💪 FLEX";
self.showsSearchBar = YES;
Expand Down
10 changes: 10 additions & 0 deletions Classes/Network/FLEXHTTPTransactionDetailController.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ - (instancetype)initWithStyle:(UITableViewStyle)style {

- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for network transaction detail screen
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.tableView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.navigationController.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(handleTransactionUpdatedNotification:)
Expand Down Expand Up @@ -156,6 +161,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.textLabel.attributedText = [[self class] attributedTextForRow:rowModel];
cell.accessoryType = rowModel.selectionFuture ? UITableViewCellAccessoryDisclosureIndicator : UITableViewCellAccessoryNone;
cell.selectionStyle = rowModel.selectionFuture ? UITableViewCellSelectionStyleDefault : UITableViewCellSelectionStyleNone;

// Force LTR layout for network detail cells
cell.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
cell.contentView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
cell.textLabel.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

return cell;
}
Expand Down
5 changes: 5 additions & 0 deletions Classes/Network/FLEXNetworkMITMViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ - (id)init {

- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for network history screen
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.tableView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.navigationController.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

self.showsSearchBar = YES;
self.pinSearchBar = YES;
Expand Down
10 changes: 10 additions & 0 deletions Classes/Network/FLEXNetworkSettingsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ @implementation FLEXNetworkSettingsController
- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for network settings screen
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.tableView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.navigationController.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

[self disableToolbar];
self.hostDenylist = FLEXNetworkRecorder.defaultRecorder.hostDenylist.mutableCopy;

Expand Down Expand Up @@ -145,6 +150,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.accessoryView = nil;
cell.textLabel.textColor = FLEXColor.primaryTextColor;

// Force LTR layout for network settings cells
cell.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
cell.contentView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
cell.textLabel.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

switch (indexPath.section) {
// Settings
case 0: {
Expand Down
6 changes: 5 additions & 1 deletion Classes/Network/FLEXNetworkTransaction.m
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,12 @@ + (instancetype)withMessage:(NSURLSessionWebSocketMessage *)message
}

- (NSArray<NSString *> *)details API_AVAILABLE(ios(13.0)) {
// Use RTL-aware arrows that automatically flip direction based on layout
NSString *outgoingArrow = @"SENT \u2192"; // Right arrow (→) that flips in RTL
NSString *incomingArrow = @"\u2190 RECEIVED"; // Left arrow (←) that flips in RTL

return @[
self.direction == FLEXWebsocketOutgoing ? @"SENT →" : @"→ RECEIVED",
self.direction == FLEXWebsocketOutgoing ? outgoingArrow : incomingArrow,
[NSByteCountFormatter
stringFromByteCount:self.dataLength
countStyle:NSByteCountFormatterCountStyleBinary
Expand Down
21 changes: 21 additions & 0 deletions Classes/Network/FLEXNetworkTransactionCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,47 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

// Force LTR layout for FLEX network cells
if (@available(iOS 9.0, *)) {
self.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.contentView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}

self.nameLabel = [UILabel new];
self.nameLabel.font = UIFont.flex_defaultTableCellFont;
self.nameLabel.textAlignment = NSTextAlignmentLeft;
if (@available(iOS 9.0, *)) {
self.nameLabel.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}
[self.contentView addSubview:self.nameLabel];

self.pathLabel = [UILabel new];
self.pathLabel.font = UIFont.flex_defaultTableCellFont;
self.pathLabel.textColor = [UIColor colorWithWhite:0.4 alpha:1.0];
self.pathLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
self.pathLabel.textAlignment = NSTextAlignmentLeft;
if (@available(iOS 9.0, *)) {
self.pathLabel.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}
[self.contentView addSubview:self.pathLabel];

self.thumbnailImageView = [UIImageView new];
self.thumbnailImageView.layer.borderColor = UIColor.blackColor.CGColor;
self.thumbnailImageView.layer.borderWidth = 1.0;
self.thumbnailImageView.contentMode = UIViewContentModeScaleAspectFit;
if (@available(iOS 9.0, *)) {
self.thumbnailImageView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}
[self.contentView addSubview:self.thumbnailImageView];

self.transactionDetailsLabel = [UILabel new];
self.transactionDetailsLabel.font = [UIFont systemFontOfSize:10.0];
self.transactionDetailsLabel.textColor = [UIColor colorWithWhite:0.65 alpha:1.0];
self.transactionDetailsLabel.textAlignment = NSTextAlignmentLeft;
if (@available(iOS 9.0, *)) {
self.transactionDetailsLabel.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}
[self.contentView addSubview:self.transactionDetailsLabel];
}
return self;
Expand Down
5 changes: 5 additions & 0 deletions Classes/Utility/Keyboard/FLEXKeyboardHelpViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ @implementation FLEXKeyboardHelpViewController

- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for technical content
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.navigationController.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

self.textView = [[UITextView alloc] initWithFrame:self.view.bounds];
self.textView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.textView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
[self.view addSubview:self.textView];
#if TARGET_OS_SIMULATOR
Expand Down
6 changes: 6 additions & 0 deletions Classes/ViewHierarchy/FLEXImagePreviewViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,14 @@ - (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))comp
- (void)viewDidLoad {
[super viewDidLoad];

// Force LTR layout for UI consistency
self.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.navigationController.view.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

self.imageView = [[UIImageView alloc] initWithImage:self.image];
self.imageView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
self.scrollView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
self.scrollView.delegate = self;
self.scrollView.backgroundColor = self.backgroundColors.firstObject;
self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
Expand Down