Skip to content

Commit

Permalink
feat: hide shimmer preloader for explore grid
Browse files Browse the repository at this point in the history
  • Loading branch information
SoCuul committed Apr 4, 2024
1 parent 50c9846 commit 99c1c5b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include $(THEOS)/makefiles/common.mk

TWEAK_NAME = BHInsta

BHInsta_FILES = $(shell find src -type f \( -iname \*.x -o -iname \*.m \)) $(wildcard modules/JGProgressHUD/*.m)
BHInsta_FILES = $(shell find src -type f \( -iname \*.x -o -iname \*.xm -o -iname \*.m \)) $(wildcard modules/JGProgressHUD/*.m)
BHInsta_FRAMEWORKS = UIKit Foundation CoreGraphics Photos CoreServices SystemConfiguration SafariServices Security QuartzCore
BHInsta_PRIVATE_FRAMEWORKS = Preferences
BHInsta_EXTRA_FRAMEWORKS = Cephei CepheiPrefs CepheiUI
Expand Down
14 changes: 0 additions & 14 deletions src/Features/General/HideExploreGrid.x

This file was deleted.

28 changes: 28 additions & 0 deletions src/Features/General/HideExploreGrid.xm
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#import "../../InstagramHeaders.h"
#import "../../Manager.h"

%hook IGExploreGridViewController
- (void)viewDidLoad {
if ([BHIManager hideExploreGrid]) {
NSLog(@"[BHInsta] Hiding explore grid");

[[self view] removeFromSuperview];

return;
}
return %orig;
}
%end

%hook IGExploreViewController
- (void)viewDidLoad {
%orig;

if ([BHIManager hideExploreGrid]) {
NSLog(@"[BHInsta] Hiding explore grid");

IGShimmeringGridView *shimmeringGridView = MSHookIvar<IGShimmeringGridView *>(self, "_shimmeringGridView");
[shimmeringGridView removeFromSuperview];
}
}
%end
5 changes: 5 additions & 0 deletions src/InstagramHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@

@interface IGBadgedNavigationButton : UIView
- (void)handleLongPress; // new

@interface IGShimmeringGridView : UIView
@end

@interface IGExploreGridViewController : IGViewController
@end

@interface IGFeedGroupHeaderCell : UICollectionViewCell
Expand Down

0 comments on commit 99c1c5b

Please sign in to comment.