Browse Source

Fix multiple Apollo text color bugs

master
lint 3 years ago
parent
commit
1f20bdf0e5
1 changed files with 24 additions and 5 deletions
  1. +24
    -5
      tweak/Apollo.xm

+ 24
- 5
tweak/Apollo.xm View File

return %orig; return %orig;
} }
// fix for v1.10.6 no longer getting text attributes, meaning text color was not showing properly
+ (id)attributedStringFromHTML:(id)arg1 attributes:(id)arg2 compact:(BOOL)arg3 snoomojiMapping:(id)arg4 {
apolloBodyAttributes = [arg2 copy];
return %orig;
}
%end %end
%hook ActionController %hook ActionController
- (id) tableView:(id)arg1 cellForRowAtIndexPath:(NSIndexPath *)arg2 {
- (id)tableView:(id)arg1 cellForRowAtIndexPath:(NSIndexPath *)arg2 {
if (shouldAddUndeleteCell) { if (shouldAddUndeleteCell) {
if ([arg2 row] == [self tableView:arg1 numberOfRowsInSection:0] - 1){
if ([arg2 row] == [self tableView:arg1 numberOfRowsInSection:0] - 1) {
id undeleteCell = [arg1 dequeueReusableCellWithIdentifier:@"IconActionCell" forIndexPath:arg2]; id undeleteCell = [arg1 dequeueReusableCellWithIdentifier:@"IconActionCell" forIndexPath:arg2];
id prevCell = [arg1 dequeueReusableCellWithIdentifier:@"IconActionCell"];
id prevCell = [arg1 dequeueReusableCellWithIdentifier:@"IconActionCell"]; // is this necessary?
UIImageView *prevCellImageView = MSHookIvar<UIImageView *>(prevCell, "iconImageView"); UIImageView *prevCellImageView = MSHookIvar<UIImageView *>(prevCell, "iconImageView");
CGSize prevImageSize = [[prevCellImageView image] size]; CGSize prevImageSize = [[prevCellImageView image] size];
undeleteLabel.text = @"TF Did That Say?"; undeleteLabel.text = @"TF Did That Say?";
undeleteImageView.image = undeleteImage; undeleteImageView.image = undeleteImage;
// fix undelete cell being green when moderator cell is present
UIColor *contentColor = [UIColor colorWithRed:0.137 green:0.6 blue:1 alpha:1];
[undeleteImageView setTintColor:contentColor];
NSMutableAttributedString *newAttribuedText = [[NSMutableAttributedString alloc] initWithAttributedString:undeleteLabel.attributedText];
[newAttribuedText addAttribute:NSForegroundColorAttributeName value:contentColor range:NSMakeRange(0, [newAttribuedText length])];
undeleteLabel.attributedText = newAttribuedText;
MSHookIvar<UIImageView *>(undeleteCell, "disclosureIndicator").image = nil;
return undeleteCell; return undeleteCell;
} }
} }
%orig; %orig;
} }
- (NSInteger) tableView:(id)arg1 numberOfRowsInSection:(NSInteger)arg2 {
- (NSInteger)tableView:(id)arg1 numberOfRowsInSection:(NSInteger)arg2 {
if (shouldAddUndeleteCell){ if (shouldAddUndeleteCell){
return %orig + 1; return %orig + 1;
} }
} }
- (id) animationControllerForDismissedController:(id)arg1 {
- (id)animationControllerForDismissedController:(id)arg1 {
shouldAddUndeleteCell = NO; shouldAddUndeleteCell = NO;

Loading…
Cancel
Save