Add files via upload
This commit is contained in:
parent
5bc433a7e3
commit
c49c91fa9f
4 changed files with 103 additions and 0 deletions
5
DateUnderTimeX.plist
Normal file
5
DateUnderTimeX.plist
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
Filter = {
|
||||||
|
Classes = ( "_UIStatusBarStringView", "_UIStatusBarTimeItem", "_UIStatusBarNavigationItem" );
|
||||||
|
};
|
||||||
|
}
|
9
Makefile
Normal file
9
Makefile
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
|
TWEAK_NAME = DateUnderTimeX
|
||||||
|
DateUnderTimeX_FILES = Tweak.xm
|
||||||
|
|
||||||
|
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||||
|
|
||||||
|
after-install::
|
||||||
|
install.exec "killall -9 SpringBoard"
|
80
Tweak.xm
Normal file
80
Tweak.xm
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
@interface _UIStatusBarStringView : UIView
|
||||||
|
@property (copy) NSString *text;
|
||||||
|
@property NSInteger numberOfLines;
|
||||||
|
@property (copy) UIFont *font;
|
||||||
|
@property NSInteger textAlignment;
|
||||||
|
@end
|
||||||
|
|
||||||
|
%hook _UIStatusBarStringView
|
||||||
|
|
||||||
|
- (void)setText:(NSString *)text {
|
||||||
|
if([text containsString:@":"]) {
|
||||||
|
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||||
|
dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
|
||||||
|
dateFormatter.dateStyle = NSDateFormatterShortStyle;
|
||||||
|
NSDate *now = [NSDate date];
|
||||||
|
NSString *shortDate = [dateFormatter stringFromDate:now];
|
||||||
|
shortDate = [shortDate substringToIndex:[shortDate length]-3];
|
||||||
|
NSString *newString = [NSString stringWithFormat:@"%@\n%@", text, shortDate];
|
||||||
|
self.numberOfLines = 2;
|
||||||
|
self.textAlignment = 1;
|
||||||
|
[self setFont: [self.font fontWithSize:12]];
|
||||||
|
%orig(newString);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
%orig(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setCenter:(CGPoint)point {
|
||||||
|
if([self.text containsString:@":"]) {
|
||||||
|
point.x = 26.83333333333;
|
||||||
|
point.y = 6.666666666666;
|
||||||
|
}
|
||||||
|
%orig(point);
|
||||||
|
}
|
||||||
|
|
||||||
|
%end
|
||||||
|
|
||||||
|
@interface _UIStatusBarTimeItem
|
||||||
|
@property (copy) _UIStatusBarStringView *shortTimeView;
|
||||||
|
@property (copy) _UIStatusBarStringView *pillTimeView;
|
||||||
|
@end
|
||||||
|
|
||||||
|
%hook _UIStatusBarTimeItem
|
||||||
|
|
||||||
|
- (id)applyUpdate:(id)arg1 toDisplayItem:(id)arg2 {
|
||||||
|
id returnThis = %orig;
|
||||||
|
[self.shortTimeView setFont: [self.shortTimeView.font fontWithSize:12]];
|
||||||
|
[self.pillTimeView setFont: [self.pillTimeView.font fontWithSize:12]];
|
||||||
|
return returnThis;
|
||||||
|
}
|
||||||
|
|
||||||
|
%end
|
||||||
|
|
||||||
|
@interface _UIStatusBarBackgroundActivityView : UIView
|
||||||
|
@property (copy) CALayer *pulseLayer;
|
||||||
|
@end
|
||||||
|
|
||||||
|
%hook _UIStatusBarBackgroundActivityView
|
||||||
|
|
||||||
|
- (void)setCenter:(CGPoint)point {
|
||||||
|
point.y = 11;
|
||||||
|
self.frame = CGRectMake(0, 0, self.frame.size.width, 31);
|
||||||
|
self.pulseLayer.frame = CGRectMake(0, 0, self.frame.size.width, 31);
|
||||||
|
%orig(point);
|
||||||
|
}
|
||||||
|
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook _UIStatusBarNavigationItem
|
||||||
|
|
||||||
|
- (id)applyStyleAttributes:(id)arg1 toDisplayItem:(id)arg2 {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)applyUpdate:(id)arg1 toDisplayItem:(id)arg2 {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
%end
|
9
control
Normal file
9
control
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Package: com.neinzedd9.dateundertimex
|
||||||
|
Name: DateUnderTimeX
|
||||||
|
Depends: mobilesubstrate
|
||||||
|
Version: 1.1.1
|
||||||
|
Architecture: iphoneos-arm
|
||||||
|
Description: Adds the date under the status bar on iPhone X.
|
||||||
|
Maintainer: NeinZedd9
|
||||||
|
Author: NeinZedd9
|
||||||
|
Section: Tweaks
|
Reference in a new issue