-
Notifications
You must be signed in to change notification settings - Fork 3
/
Tweak.xm
41 lines (36 loc) · 984 Bytes
/
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
#import <objc/runtime.h>
#include <Foundation/Foundation.h>
#include <RemoteLog.h>
#include <UIKit/UIKit.h>
@interface YTMainAppVideoPlayerOverlayView : UIView
-(UIViewController *)_viewControllerForAncestor;
@end
@interface YTWatchMiniBarView : UIView
@end
%group Main
%hook YTWatchMiniBarView
-(void)setWatchMiniPlayerLayout:(int)arg1 {
%orig(1);
}
-(int)watchMiniPlayerLayout {
return 1;
}
-(void)layoutSubviews {
%orig;
self.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width - self.frame.size.width), self.frame.origin.y, self.frame.size.width, self.frame.size.height);
}
%end
%hook YTMainAppVideoPlayerOverlayView
-(BOOL)isUserInteractionEnabled {
if([[self _viewControllerForAncestor].parentViewController.parentViewController isKindOfClass:%c(YTWatchMiniBarViewController)]) {
return NO;
}
return %orig;
}
%end
%end
%ctor {
if(UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad) {
%init(Main);
}
}