Guest User

Untitled

a guest
Jun 19th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. void $SBStatusBarInWorkOutView$drawRect$(SBStatusBarInCallView *self, SEL sel, struct CGRect fp8)
  2. {
  3. NSLog(@"PC: %s", sel_getName(sel));
  4. Class $SBMediaController = objc_getClass("SBMediaController");
  5. NSDictionary *dict = nil;
  6. id sbmc = [$SBMediaController sharedInstance];
  7. object_getInstanceVariable(sbmc, "_nowPlayingInfo", reinterpret_cast<void **>(&dict));
  8.  
  9. if([dict objectForKey:@"title"])
  10. {
  11.  
  12. NSString *displayString = @"ThisIsAReallllllllllllylongTextStringThatNeedsToBeLongerToGoOffTheEdgeOfTheScreen,AmiRite?";
  13. //NSString *displayString = [NSString stringWithFormat:@"%@: %@", [dict objectForKey:@"artist"], [dict objectForKey:@"title"]];
  14. UIFont *_font;
  15. /*
  16. Ivar IV$_font = object_getInstanceVariable(self, "_font", reinterpret_cast<void **>(&_font));
  17. if(!_font)
  18. {
  19. //[UIFont fontWithName:@"Helvetica" size:(float) 14.0];
  20. //[_font retain];
  21. //object_setIvar(self, IV$_font, (id) _font);
  22. }
  23. */
  24. _font = [UIFont boldSystemFontOfSize:(CGFloat) 14.0];
  25.  
  26. UIColor *mainTextColor = [UIColor whiteColor];
  27. [mainTextColor set];
  28. [self performSelector:@selector(enableShadow)];
  29. CGSize displaySize = [displayString sizeWithFont: _font];
  30.  
  31. self.transform = CGAffineTransformIdentity;
  32. CGRect place;
  33. /* if(displaySize.width > fp8.size.width)
  34. { */
  35. place = CGRectMake(fp8.origin.x,
  36. fp8.origin.y+ (fp8.size.height / 2) - (displaySize.height/2),
  37. fp8.size.width, fp8.size.height);//displaySize.width, displaySize.height);
  38.  
  39. [displayString drawInRect:place withFont: _font lineBreakMode: UILineBreakModeWordWrap];
  40.  
  41. [UIView beginAnimations:nil context:NULL];
  42. [UIView setAnimationDuration:5.0f];
  43. [UIView setAnimationCurve:UIViewAnimationCurveLinear];
  44. [UIView setAnimationBeginsFromCurrentState:YES];
  45. CGAffineTransform transform = CGAffineTransformMakeTranslation(fp8.size.width - displaySize.width, 0);
  46. self.transform = transform;
  47. [UIView commitAnimations];
  48.  
  49. /*
  50. }
  51. else
  52. {
  53. place = CGRectMake(fp8.origin.x+ (fp8.size.width / 2) - (displaySize.width/2),
  54. fp8.origin.y+ (fp8.size.height / 2) - (displaySize.height/2),
  55. displaySize.width, displaySize.height);
  56. [displayString drawInRect:place withFont: _font lineBreakMode: UILineBreakModeClip];
  57. }
  58. */
  59.  
  60. }
  61. }
Add Comment
Please, Sign In to add comment