You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Tweak.xm 1.7KB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. @interface NCNotificationShortLookViewController
  2. -(id)_presentedLongLookViewController;
  3. -(void)addGestureRecognizer:(id)arg1;
  4. @property (assign, nonatomic) UIView *view;
  5. @end
  6. @interface NCNotificationListCell
  7. -(void)_executeDefaultActionIfCompleted;
  8. -(void)setExecutingDefaultAction:(BOOL)arg1;
  9. -(void)setSupportsSwipeToDefaultAction:(BOOL)arg1 ;
  10. -(BOOL)isActionButtonsFullyRevealed;
  11. -(NCNotificationShortLookViewController *)contentViewController;
  12. @end
  13. @interface SBLockScreenManager
  14. +(SBLockScreenManager *)sharedInstance;
  15. -(BOOL)isUILocked;
  16. @end
  17. %hook NCNotificationListCell
  18. bool changeThreshold = false;
  19. -(CGFloat)_defaultActionExecuteThreshold{
  20. if(changeThreshold == false){
  21. return %orig;
  22. }else{
  23. return -1;
  24. }
  25. }
  26. -(CGFloat)_defaultActionOvershootContentOffset{return 0;}
  27. -(void)layoutSubviews{
  28. %orig;
  29. bool isLocked = [[%c(SBLockScreenManager) sharedInstance] isUILocked];
  30. if(isLocked == true){
  31. if(MSHookIvar<NSMutableArray *>([self contentViewController].view, "_gestureRecognizers") == nil)
  32. {
  33. UITapGestureRecognizer *singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dood:)];
  34. [[self contentViewController].view addGestureRecognizer:singleFingerTap];
  35. [self setSupportsSwipeToDefaultAction:false];
  36. }
  37. }
  38. }
  39. %new
  40. -(void)dood:(UITapGestureRecognizer *)recognizer{
  41. bool isLocked = [[%c(SBLockScreenManager) sharedInstance] isUILocked];
  42. if((isLocked == true) && ([self isActionButtonsFullyRevealed] == false) && ([[self contentViewController] _presentedLongLookViewController] == nil))
  43. {
  44. changeThreshold = true;
  45. [self setSupportsSwipeToDefaultAction:true];
  46. [self _executeDefaultActionIfCompleted];
  47. [self setSupportsSwipeToDefaultAction:false];
  48. changeThreshold = false;
  49. }
  50. }
  51. %end