-
Notifications
You must be signed in to change notification settings - Fork 1
/
tweak.xm
51 lines (39 loc) · 1.02 KB
/
tweak.xm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#import <Cephei/HBPreferences.h>
BOOL enabled;
BOOL positionEnabled;
%hook SBPIPContentViewLayoutSettings
+(CGSize)maximumContentViewSizeForAspectRatio:(CGSize)arg1 {
return enabled ? arg1 : %orig;
}
%end
%hook SBPIPContainerViewController
-(void)_updateContentViewLayoutConstraintsWithFrame:(CGRect)arg1 {
if (!enabled) {
%orig;
}
}
-(CGSize)_constrainContentViewSize:(CGSize)arg1 {
return enabled ? arg1 : %orig;
}
- (void)setContentViewPadding:(struct UIEdgeInsets)arg1 animationDuration:(double)arg2 animationOptions:(unsigned long long)arg3 {
if (!enabled) {
%orig;
}
}
- (void)_handlePanRotationPinchGestureEndedState {
if (!positionEnabled) {
%orig;
}
}
- (void)_actuallyHandlePanRotationPinchGestureEndedState {
if (!positionEnabled) {
%orig;
}
}
%end
%ctor {
HBPreferences *prefs = [[HBPreferences alloc] initWithIdentifier:@"com.itsjafer.bigpipenergy"];
[prefs registerBool:&enabled default:YES forKey:@"enabled"];
[prefs registerBool:&positionEnabled default:NO forKey:@"positionEnabled"];
%init;
}