Quellcode durchsuchen

Add files via upload

master
Gil Shahar vor 6 Jahren
Ursprung
Commit
b20bcebdf2
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
2 geänderte Dateien mit 28 neuen und 10 gelöschten Zeilen
  1. +28
    -10
      Tweak.xm
  2. BIN
      com.gilshahar7.avlock_0.0.1-68+debug_iphoneos-arm.deb

+ 28
- 10
Tweak.xm Datei anzeigen

@@ -10,12 +10,29 @@
@end


@interface AVButton : UIView
@end

@interface AVTransportControlsView : UIView
-(void)deviceOrientationDidChange;
//@property (assign, nonatomic) AVButton *skipBackButton;
@property (assign, nonatomic) AVButton *skipBackButton;
@end

@interface AVPlaybackControlsView
@property (assign, nonatomic) AVTransportControlsView *transportControlsView;
@end

@interface AVPlayerViewControllerContentView
@property (assign, nonatomic) AVPlaybackControlsView *playbackControlsView;
@end

@interface AVFullScreenViewController
@property (assign, nonatomic) AVPlayerViewControllerContentView *contentView;
@end




extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void);

static UIButton *button = nil;
@@ -51,6 +68,12 @@ static void firstUpdate(CFNotificationCenterRef center, void *observer, CFString

}

%hook AVFullScreenViewController
-(void)viewDidLayoutSubviews{
%orig;
[self.contentView.playbackControlsView.transportControlsView deviceOrientationDidChange];
}
%end

%hook SBOrientationLockManager
-(SBOrientationLockManager*)init{
@@ -113,13 +136,6 @@ CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), CFSTR("avlock.firstUpdate"), (void*)myObserver, NULL, true);
button.contentMode = UIViewContentModeScaleAspectFit;

UIInterfaceOrientation orientation =[UIApplication sharedApplication].statusBarOrientation;
if (orientation == UIInterfaceOrientationLandscapeRight || orientation == UIInterfaceOrientationLandscapeLeft){
button.frame = CGRectMake(6.5, -40, 46, 46);
}
else if(orientation == UIInterfaceOrientationPortrait){
button.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width / 2) - 142.5, 43, 46, 46);
}
button.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);

[self addSubview:button];
@@ -136,14 +152,16 @@ CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
CFNotificationCenterRemoveObserver ( CFNotificationCenterGetDarwinNotifyCenter(), (void*)myObserver, NULL, NULL);
}



%new
-(void)deviceOrientationDidChange{
UIInterfaceOrientation orientation =[UIApplication sharedApplication].statusBarOrientation;
if (orientation == UIInterfaceOrientationLandscapeRight || orientation == UIInterfaceOrientationLandscapeLeft){
button.frame = CGRectMake(6.5, -40, 46, 46);
button.frame = CGRectMake(self.skipBackButton.frame.origin.x-13.5, -40, 46, 46);
}
else if(orientation == UIInterfaceOrientationPortrait){
button.frame = CGRectMake((self.frame.size.width / 2) - 115.5, 43, 46, 46);
button.frame = CGRectMake((self.skipBackButton.frame.origin.x - 62), self.skipBackButton.frame.origin.y, 46, 46);
}
}


BIN
com.gilshahar7.avlock_0.0.1-68+debug_iphoneos-arm.deb Datei anzeigen


Laden…
Abbrechen
Speichern