Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ExTBH committed Nov 15, 2022
1 parent 6b1b456 commit 0ff8dec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
28 changes: 24 additions & 4 deletions Theos/Classes/ThemingViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
return color;
}

// https://stackoverflow.com/a/7323029/16619237
NSString *splitStringByUpperCase(NSString *str){

int index = 1;
NSMutableString* mutableInputString = [NSMutableString stringWithString:str];

while (index < mutableInputString.length) {

if ([[NSCharacterSet uppercaseLetterCharacterSet] characterIsMember:[mutableInputString characterAtIndex:index]]) {
[mutableInputString insertString:@" " atIndex:index];
index++;
}
index++;
}

return [NSString stringWithString:mutableInputString];
}


@interface ColorCell()
@end
Expand Down Expand Up @@ -69,7 +87,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSIntege

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
label.text = @"Unavailable for below iOS 13 :)";
label.text = @"Unavailable for below iOS 14 :)";
label.textColor = UIColor.secondaryLabelColor;
return label;
}
Expand Down Expand Up @@ -97,9 +115,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}

cell.selectionStyle = UITableViewCellSelectionStyleNone;
NSString *key = _ThemeOptionKeysDict()[@(indexPath.row)];
cell.textLabel.text = key;
cell.colorButton.backgroundColor = colorForKey(key);
NSString *rawKey = _ThemeOptionKeysDict()[@(indexPath.row)];
NSString *formattedKey = [rawKey stringByReplacingOccurrencesOfString:@"Color" withString:@""];
formattedKey = splitStringByUpperCase(formattedKey);
cell.textLabel.text = formattedKey;
cell.colorButton.backgroundColor = colorForKey(rawKey);
[cell.colorButton addTarget:self action:@selector(tappedColor:) forControlEvents:UIControlEventTouchUpInside];


Expand Down
4 changes: 2 additions & 2 deletions Theos/layout/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: dev.extbh.jodelemproved
Name: Jodel EMPROVED
Version: 1.1.4
Version: 1.1.4-1
Architecture: iphoneos-arm
Description: Customizing the Jodel app
Depiction: https://repo.extbh.dev/dev.extbh.jodelemproved/
Depiction: https://repo.depiction.extbh.dev/dev.extbh.jodelemproved/
Homepage: https://extbh.dev
Maintainer: ExTBH <[email protected]>
Author: ExTBH <[email protected]>
Expand Down

0 comments on commit 0ff8dec

Please sign in to comment.