From 0ccd1c898c0b3ba76e2cda78ef7dfc5eeec59b7b Mon Sep 17 00:00:00 2001 From: Marian Kucharcik Date: Tue, 9 May 2023 10:50:16 +0200 Subject: [PATCH 1/9] kotlin 1.8.10, ios logging --- .../TitaniumKit/Sources/API/APIModule.m | 6 +++++- .../android/.gradle/7.4.2/checksums/checksums.lock | Bin 0 -> 17 bytes .../dependencies-accessors.lock | Bin 0 -> 17 bytes .../7.4.2/dependencies-accessors/gc.properties | 0 .../7.4.2/executionHistory/executionHistory.lock | Bin 0 -> 17 bytes .../.gradle/7.4.2/fileChanges/last-build.bin | Bin 0 -> 1 bytes .../.gradle/7.4.2/fileHashes/fileHashes.lock | Bin 0 -> 17 bytes .../android/.gradle/7.4.2/gc.properties | 0 .../buildOutputCleanup/buildOutputCleanup.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/cache.properties | 2 ++ .../android/.gradle/vcs-1/gc.properties | 0 .../android/.gradle/7.4.2/checksums/checksums.lock | Bin 0 -> 17 bytes .../dependencies-accessors.lock | Bin 0 -> 17 bytes .../7.4.2/dependencies-accessors/gc.properties | 0 .../.gradle/7.4.2/fileChanges/last-build.bin | Bin 0 -> 1 bytes .../.gradle/7.4.2/fileHashes/fileHashes.lock | Bin 0 -> 17 bytes tests/platform/android/.gradle/7.4.2/gc.properties | 0 .../buildOutputCleanup/buildOutputCleanup.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/cache.properties | 2 ++ tests/platform/android/.gradle/vcs-1/gc.properties | 0 20 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/checksums/checksums.lock create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/dependencies-accessors/gc.properties create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/executionHistory/executionHistory.lock create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/fileChanges/last-build.bin create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/fileHashes/fileHashes.lock create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/gc.properties create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/buildOutputCleanup/cache.properties create mode 100644 tests/modules-source/ti.modulesdk920/android/.gradle/vcs-1/gc.properties create mode 100644 tests/platform/android/.gradle/7.4.2/checksums/checksums.lock create mode 100644 tests/platform/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock create mode 100644 tests/platform/android/.gradle/7.4.2/dependencies-accessors/gc.properties create mode 100644 tests/platform/android/.gradle/7.4.2/fileChanges/last-build.bin create mode 100644 tests/platform/android/.gradle/7.4.2/fileHashes/fileHashes.lock create mode 100644 tests/platform/android/.gradle/7.4.2/gc.properties create mode 100644 tests/platform/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock create mode 100644 tests/platform/android/.gradle/buildOutputCleanup/cache.properties create mode 100644 tests/platform/android/.gradle/vcs-1/gc.properties diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/APIModule.m b/iphone/TitaniumKit/TitaniumKit/Sources/API/APIModule.m index c7504252dbd..ac116ac4aee 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/API/APIModule.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/APIModule.m @@ -40,7 +40,11 @@ - (void)logMessage:(id)args severity:(NSString *)severity } [newArray addObject:obj]; }]; - NSLog(@"[%@] %@", [severity uppercaseString], [newArray componentsJoinedByString:@" "]); + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; + // or @"yyyy-MM-dd hh:mm:ss a" if you prefer the time with AM/PM + + NSLog(@"[%@] %@ %@", [severity uppercaseString], [dateFormatter stringFromDate:[NSDate date]], [newArray componentsJoinedByString:@" "]); } - (id)transform:(id)arg diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/checksums/checksums.lock b/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/checksums/checksums.lock new file mode 100644 index 0000000000000000000000000000000000000000..3d0a4f3e18449ba496e472a42fad3ab548baf228 GIT binary patch literal 17 TcmZSHdGUV`tLv)|3{U_7KK2Cz literal 0 HcmV?d00001 diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock b/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000000000000000000000000000000000000..83f3445bf82801dfec7e816ca8132d42090d639a GIT binary patch literal 17 TcmZP;&7JhG`^2`R3{U_7IsOFX literal 0 HcmV?d00001 diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/dependencies-accessors/gc.properties b/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/dependencies-accessors/gc.properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/executionHistory/executionHistory.lock b/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/executionHistory/executionHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..1a4cee8fd404475e8b19b0e63a0a460cbeff230d GIT binary patch literal 17 TcmZP${QK+9>}Zu-1}FdkJ!u55 literal 0 HcmV?d00001 diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/fileChanges/last-build.bin b/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/fileChanges/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/fileHashes/fileHashes.lock b/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/fileHashes/fileHashes.lock new file mode 100644 index 0000000000000000000000000000000000000000..5236c60ea525211d147964c8b77a1daab815d5c3 GIT binary patch literal 17 TcmZR!ZZYezUA^cX0~7!NE~f+i literal 0 HcmV?d00001 diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/gc.properties b/tests/modules-source/ti.modulesdk920/android/.gradle/7.4.2/gc.properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/tests/modules-source/ti.modulesdk920/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000000000000000000000000000000000000..e786380d9a9bc3ed8a8f0b1465066b21953cc2a6 GIT binary patch literal 17 UcmZQBW4`febI;5m1_)pT05>oMasU7T literal 0 HcmV?d00001 diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/buildOutputCleanup/cache.properties b/tests/modules-source/ti.modulesdk920/android/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 00000000000..ad7b3bc9d09 --- /dev/null +++ b/tests/modules-source/ti.modulesdk920/android/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Thu Apr 13 14:27:51 CEST 2023 +gradle.version=7.4.2 diff --git a/tests/modules-source/ti.modulesdk920/android/.gradle/vcs-1/gc.properties b/tests/modules-source/ti.modulesdk920/android/.gradle/vcs-1/gc.properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/platform/android/.gradle/7.4.2/checksums/checksums.lock b/tests/platform/android/.gradle/7.4.2/checksums/checksums.lock new file mode 100644 index 0000000000000000000000000000000000000000..143ae7eabf46a9562647f6c7da34d5bb2b373725 GIT binary patch literal 17 TcmZQRIF(7jX><201}FdkE^GtV literal 0 HcmV?d00001 diff --git a/tests/platform/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock b/tests/platform/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000000000000000000000000000000000000..8d55192421c05f8a9540558841937a4425c2d7ea GIT binary patch literal 17 ScmZQxw?lzTH%6b20SW*hk^))) literal 0 HcmV?d00001 diff --git a/tests/platform/android/.gradle/7.4.2/dependencies-accessors/gc.properties b/tests/platform/android/.gradle/7.4.2/dependencies-accessors/gc.properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/platform/android/.gradle/7.4.2/fileChanges/last-build.bin b/tests/platform/android/.gradle/7.4.2/fileChanges/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/tests/platform/android/.gradle/7.4.2/fileHashes/fileHashes.lock b/tests/platform/android/.gradle/7.4.2/fileHashes/fileHashes.lock new file mode 100644 index 0000000000000000000000000000000000000000..f1c8bcdd3e4d4d7efe0863a358f6129e57fb614d GIT binary patch literal 17 ScmZQJmDBR=3i&I^00jUbVgkYd literal 0 HcmV?d00001 diff --git a/tests/platform/android/.gradle/7.4.2/gc.properties b/tests/platform/android/.gradle/7.4.2/gc.properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/platform/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/tests/platform/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000000000000000000000000000000000000..4b93a21f6ce4e2152207dbdf2a3f1ec373002092 GIT binary patch literal 17 TcmZSnE5sIhKT*7w0Rk8SDnbKO literal 0 HcmV?d00001 diff --git a/tests/platform/android/.gradle/buildOutputCleanup/cache.properties b/tests/platform/android/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 00000000000..5cf38808526 --- /dev/null +++ b/tests/platform/android/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Thu Apr 13 14:27:49 CEST 2023 +gradle.version=7.4.2 diff --git a/tests/platform/android/.gradle/vcs-1/gc.properties b/tests/platform/android/.gradle/vcs-1/gc.properties new file mode 100644 index 00000000000..e69de29bb2d From 927899af02b835e9de24a6222f457e4c10cd51f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Kn=C3=B6chel?= Date: Tue, 1 Aug 2023 21:07:49 +0200 Subject: [PATCH 2/9] feat: add spring animations --- apidoc/Titanium/UI/Animation.yml | 10 ++++++ .../TitaniumKit/Sources/API/TiAnimation.h | 1 + .../TitaniumKit/Sources/API/TiAnimation.m | 32 ++++++++++++++----- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/apidoc/Titanium/UI/Animation.yml b/apidoc/Titanium/UI/Animation.yml index 5a4fbfcc10b..1a035486fd9 100644 --- a/apidoc/Titanium/UI/Animation.yml +++ b/apidoc/Titanium/UI/Animation.yml @@ -189,6 +189,16 @@ properties: platforms: [iphone, ipad, macos] since: "8.1.0" + - name: bounce + summary: The animation bounce. If set, the animation uses the iOS 17+ spring animation. + description: | + When `bounce` is 0, there are no bounces, positive values indicate increasing amounts of bounciness up to a maximum + of 1.0 (corresponding to undamped oscillation), and negative values indicate overdamped springs with a minimum value of -1.0. + type: Number + platforms: [iphone, ipad, macos] + since: "12.2.0" + osver: { ios: { min: "17.0" } } + - name: top summary: Value of the `top` property at the end of the animation. type: Number diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.h b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.h index 7f66bec502d..fad643681fa 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.h +++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.h @@ -139,6 +139,7 @@ @property (nonatomic, retain, readwrite) TiProxy *view; @property (nonatomic, retain, readwrite) NSNumber *dampingRatio; @property (nonatomic, retain, readwrite) NSNumber *springVelocity; +@property (nonatomic, retain, readwrite) NSNumber *bounce; + (TiAnimation *)animationFromArg:(id)args context:(id)context create:(BOOL)yn; diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m index d9e2a84eeaf..311ba8c1bc6 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m @@ -23,7 +23,7 @@ @implementation TiAnimation @synthesize delegate; @synthesize zIndex, left, right, top, bottom, width, height; @synthesize duration, color, backgroundColor, opacity, opaque, view; -@synthesize visible, curve, repeat, autoreverse, delay, transform, transition, dampingRatio, springVelocity; +@synthesize visible, curve, repeat, autoreverse, delay, transform, transition, dampingRatio, springVelocity, bounce; @synthesize animatedView, callback, isReverse, reverseAnimation, resetState; - (id)initWithDictionary:(NSDictionary *)properties_ context:(id)context_ callback:(KrollCallback *)callback_ @@ -99,6 +99,7 @@ - (id)initWithDictionary:(NSDictionary *)properties_ context:(id)co SET_FLOAT_PROP(delay, properties); SET_FLOAT_PROP(dampingRatio, properties); SET_FLOAT_PROP(springVelocity, properties); + SET_FLOAT_PROP(bounce, properties); SET_INT_PROP(curve, properties); SET_INT_PROP(repeat, properties); SET_BOOL_PROP(visible, properties); @@ -159,6 +160,7 @@ - (void)dealloc RELEASE_TO_NIL(view); RELEASE_TO_NIL(dampingRatio); RELEASE_TO_NIL(springVelocity); + RELEASE_TO_NIL(bounce); RELEASE_TO_NIL(properties); [animatedViewProxy release]; [super dealloc]; @@ -638,13 +640,27 @@ - (void)animate:(id)args }; if (dampingRatio != nil || springVelocity != nil) { - [UIView animateWithDuration:animationDuration - delay:([delay doubleValue] / 1000) - usingSpringWithDamping:[dampingRatio floatValue] - initialSpringVelocity:[springVelocity floatValue] - options:options - animations:animation - completion:complete]; +#ifdef __IPHONE_17_0 + if ([TiUtils isIOSVersionOrGreater:@"17.0"] && bounce != nil) { + [UIView animateWithSpringDuration:animationDuration + bounce:[bounce floatValue] + initialSpringVelocity:[springVelocity floatValue] + delay:([delay doubleValue] / 1000) + options:options + animations:animation + completion:complete]; + } else { +#endif + [UIView animateWithDuration:animationDuration + delay:([delay doubleValue] / 1000) + usingSpringWithDamping:[dampingRatio floatValue] + initialSpringVelocity:[springVelocity floatValue] + options:options + animations:animation + completion:complete]; +#ifdef __IPHONE_16_4 + } +#endif } else { [UIView animateWithDuration:animationDuration delay:([delay doubleValue] / 1000) From 9cfb8f9d3b6fd73c2457f05c2755a1e096f5f4af Mon Sep 17 00:00:00 2001 From: Marian Kucharcik Date: Fri, 4 Aug 2023 14:41:13 +0200 Subject: [PATCH 3/9] (fix):network client fix --- .../java/ti/modules/titanium/network/TiHTTPClient.java | 8 ++++++++ iphone/Classes/TiNetworkHTTPClientProxy.m | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java index af6dead9276..d176aeb89b6 100644 --- a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java +++ b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java @@ -945,6 +945,14 @@ public void open(String method, String url) setReadyState(READY_STATE_OPENED); setRequestHeader("User-Agent", TITANIUM_USER_AGENT); + // Causes Auth to Fail with twitter and other size apparently block X- as well + // Ticket #729, ignore twitter for now + // if (!hostString.contains("twitter.com")) { + // setRequestHeader("X-Requested-With", "XMLHttpRequest"); + + // } else { + // Log.d(TAG, "Twitter: not sending X-Requested-With header", Log.DEBUG_MODE); + // } } public void setRawData(Object data) diff --git a/iphone/Classes/TiNetworkHTTPClientProxy.m b/iphone/Classes/TiNetworkHTTPClientProxy.m index d9968803ed5..65602242773 100644 --- a/iphone/Classes/TiNetworkHTTPClientProxy.m +++ b/iphone/Classes/TiNetworkHTTPClientProxy.m @@ -84,6 +84,12 @@ - (void)open:(id)args [httpRequest setMethod:method]; [httpRequest setUrl:url]; + // twitter specifically disallows X-Requested-With so we only add this normal + // XHR header if not going to twitter. however, other services generally expect + // this header to indicate an XHR request (such as RoR) + // if ([[url absoluteString] rangeOfString:@"twitter.com"].location == NSNotFound) { + // [httpRequest addRequestHeader:@"X-Requested-With" value:@"XMLHttpRequest"]; + // } if ((apsConnectionManager != nil) && ([apsConnectionManager willHandleURL:url])) { apsConnectionDelegate = [[apsConnectionManager connectionDelegateForUrl:url] retain]; } From 88867b70c17c54eb978776ed41ae49cc7d22ecd1 Mon Sep 17 00:00:00 2001 From: Marian Kucharcik Date: Fri, 4 Aug 2023 14:41:13 +0200 Subject: [PATCH 4/9] network client fix --- .../java/ti/modules/titanium/network/TiHTTPClient.java | 10 +++++----- iphone/Classes/TiNetworkHTTPClientProxy.m | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java index 17d52dd60c7..d176aeb89b6 100644 --- a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java +++ b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java @@ -947,12 +947,12 @@ public void open(String method, String url) setRequestHeader("User-Agent", TITANIUM_USER_AGENT); // Causes Auth to Fail with twitter and other size apparently block X- as well // Ticket #729, ignore twitter for now - if (!hostString.contains("twitter.com")) { - setRequestHeader("X-Requested-With", "XMLHttpRequest"); + // if (!hostString.contains("twitter.com")) { + // setRequestHeader("X-Requested-With", "XMLHttpRequest"); - } else { - Log.d(TAG, "Twitter: not sending X-Requested-With header", Log.DEBUG_MODE); - } + // } else { + // Log.d(TAG, "Twitter: not sending X-Requested-With header", Log.DEBUG_MODE); + // } } public void setRawData(Object data) diff --git a/iphone/Classes/TiNetworkHTTPClientProxy.m b/iphone/Classes/TiNetworkHTTPClientProxy.m index 64ae959375f..65602242773 100644 --- a/iphone/Classes/TiNetworkHTTPClientProxy.m +++ b/iphone/Classes/TiNetworkHTTPClientProxy.m @@ -87,9 +87,9 @@ - (void)open:(id)args // twitter specifically disallows X-Requested-With so we only add this normal // XHR header if not going to twitter. however, other services generally expect // this header to indicate an XHR request (such as RoR) - if ([[url absoluteString] rangeOfString:@"twitter.com"].location == NSNotFound) { - [httpRequest addRequestHeader:@"X-Requested-With" value:@"XMLHttpRequest"]; - } + // if ([[url absoluteString] rangeOfString:@"twitter.com"].location == NSNotFound) { + // [httpRequest addRequestHeader:@"X-Requested-With" value:@"XMLHttpRequest"]; + // } if ((apsConnectionManager != nil) && ([apsConnectionManager willHandleURL:url])) { apsConnectionDelegate = [[apsConnectionManager connectionDelegateForUrl:url] retain]; } From 2fbe62bd8613a38b97997c4b369b38b69300e9c7 Mon Sep 17 00:00:00 2001 From: Marian Kucharcik Date: Thu, 10 Aug 2023 01:01:16 +0200 Subject: [PATCH 5/9] feat(ios): largeTitleAttributes --- iphone/Classes/TiUITabGroup.m | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/iphone/Classes/TiUITabGroup.m b/iphone/Classes/TiUITabGroup.m index e616d2d5e20..5c1d12676a1 100644 --- a/iphone/Classes/TiUITabGroup.m +++ b/iphone/Classes/TiUITabGroup.m @@ -522,6 +522,39 @@ - (void)setTitleAttributes_:(id)args } [self updateMoreBar:[controller moreNavigationController]]; } +- (void)setLargeTitleAttributes_:(id)args +{ + ENSURE_SINGLE_ARG_OR_NIL(args, NSDictionary); + [self.proxy replaceValue:args forKey:@"largeTitleAttributes" notification:NO]; + RELEASE_TO_NIL(theAttributes) + if (args != nil) { + theAttributes = [[NSMutableDictionary dictionary] retain]; + if ([args objectForKey:@"color"] != nil) { + UIColor *theColor = [[TiUtils colorValue:@"color" properties:args] _color]; + if (theColor != nil) { + [theAttributes setObject:theColor forKey:NSForegroundColorAttributeName]; + } + } + if ([args objectForKey:@"shadow"] != nil) { + NSShadow *shadow = [TiUtils shadowValue:[args objectForKey:@"shadow"]]; + if (shadow != nil) { + [theAttributes setObject:shadow forKey:NSShadowAttributeName]; + } + } + + if ([args objectForKey:@"font"] != nil) { + UIFont *theFont = [[TiUtils fontValue:[args objectForKey:@"font"] def:nil] font]; + if (theFont != nil) { + [theAttributes setObject:theFont forKey:NSFontAttributeName]; + } + } + + if ([theAttributes count] == 0) { + RELEASE_TO_NIL(theAttributes) + } + } + [self updateMoreBar:[controller moreNavigationController]]; +} - (void)setNavTintColor_:(id)value { From b012d46714a3eeb0d4948a16972a9024419f2772 Mon Sep 17 00:00:00 2001 From: Marian Kucharcik Date: Thu, 10 Aug 2023 01:02:18 +0200 Subject: [PATCH 6/9] feat(ios): largeTitleAttributes --- .../Sources/Modules/TiUIWindowProxy.m | 59 +++++++++++++++++-- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 57 insertions(+), 6 deletions(-) diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m b/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m index 2eb03590520..826a0b10ccc 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m @@ -126,6 +126,7 @@ - (void)_configure [self replaceValue:nil forKey:@"barImage" notification:NO]; [self replaceValue:nil forKey:@"translucent" notification:NO]; [self replaceValue:nil forKey:@"titleAttributes" notification:NO]; + [self replaceValue:nil forKey:@"largeTitleAttributes" notification:NO]; [self replaceValue:NUMBOOL(NO) forKey:@"tabBarHidden" notification:NO]; [self replaceValue:NUMBOOL(NO) forKey:@"navBarHidden" notification:NO]; [self replaceValue:NUMBOOL(NO) forKey:@"hidesBarsOnSwipe" notification:NO]; @@ -404,10 +405,10 @@ - (void)setTitleAttributes:(id)args if (shouldUpdateNavBar && ([controller navigationController] != nil)) { UINavigationBar *navigationBar = controller.navigationController.navigationBar; if ([TiUtils boolValue:[self valueForKey:@"largeTitleEnabled"] def:NO]) { - if ([self shouldUseNavBarApperance]) { - navigationBar.standardAppearance.largeTitleTextAttributes = theAttributes; - navigationBar.scrollEdgeAppearance.largeTitleTextAttributes = theAttributes; - } + // if ([self shouldUseNavBarApperance]) { + // navigationBar.standardAppearance.largeTitleTextAttributes = theAttributes; + // navigationBar.scrollEdgeAppearance.largeTitleTextAttributes = theAttributes; + // } navigationBar.largeTitleTextAttributes = theAttributes; } if ([self shouldUseNavBarApperance]) { @@ -417,6 +418,55 @@ - (void)setTitleAttributes:(id)args navigationBar.titleTextAttributes = theAttributes; } } +- (void)setLargeTitleAttributes:(id)args +{ + ENSURE_UI_THREAD(setLargeTitleAttributes, args); + ENSURE_SINGLE_ARG_OR_NIL(args, NSDictionary); + [self replaceValue:args forKey:@"largeTitleAttributes" notification:NO]; + + if (args == nil) { + args = [[self tabGroup] valueForUndefinedKey:@"largeTitleAttributes"]; + } + + NSMutableDictionary *theAttributes = nil; + if (args != nil) { + theAttributes = [NSMutableDictionary dictionary]; + if ([args objectForKey:@"color"] != nil) { + UIColor *theColor = [[TiUtils colorValue:@"color" properties:args] _color]; + if (theColor != nil) { + [theAttributes setObject:theColor forKey:NSForegroundColorAttributeName]; + } + } + if ([args objectForKey:@"shadow"] != nil) { + NSShadow *shadow = [TiUtils shadowValue:[args objectForKey:@"shadow"]]; + if (shadow != nil) { + [theAttributes setObject:shadow forKey:NSShadowAttributeName]; + } + } + + if ([args objectForKey:@"font"] != nil) { + UIFont *theFont = [[TiUtils fontValue:[args objectForKey:@"font"] def:nil] font]; + if (theFont != nil) { + [theAttributes setObject:theFont forKey:NSFontAttributeName]; + } + } + + if ([theAttributes count] == 0) { + theAttributes = nil; + } + } + + if (shouldUpdateNavBar && ([controller navigationController] != nil)) { + UINavigationBar *navigationBar = controller.navigationController.navigationBar; + if ([TiUtils boolValue:[self valueForKey:@"largeTitleEnabled"] def:NO]) { + if ([self shouldUseNavBarApperance]) { + navigationBar.standardAppearance.largeTitleTextAttributes = theAttributes; + navigationBar.scrollEdgeAppearance.largeTitleTextAttributes = theAttributes; + } + navigationBar.largeTitleTextAttributes = theAttributes; + } + } +} - (BOOL)shouldUseNavBarApperance { @@ -1016,6 +1066,7 @@ - (void)setupWindowDecorations //Need to clear title for titleAttributes to apply correctly on iOS6. [[controller navigationItem] setTitle:nil]; SETPROP(@"titleAttributes", setTitleAttributes); + SETPROP(@"largeTitleAttributes", setLargeTitleAttributes); SETPROP(@"title", setTitle); SETPROP(@"titlePrompt", setTitlePrompt); SETPROP(@"largeTitleEnabled", setLargeTitleEnabled); diff --git a/package-lock.json b/package-lock.json index a31c6d85986..fcc2ea1a26b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "titanium-mobile", - "version": "12.2.0", + "version": "12.2.1", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index f2557b22cfd..cff6a8103db 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "titanium-mobile", "description": "TiDev Titanium Mobile", - "version": "12.2.0", + "version": "12.2.2", "moduleApiVersion": { "iphone": "2", "android": "4" From ebb3917c73e2350fd5ee340eee2a84af85701d6d Mon Sep 17 00:00:00 2001 From: Marian Kucharcik Date: Thu, 10 Aug 2023 10:52:10 +0200 Subject: [PATCH 7/9] fix(ios): removed commented code --- .../java/ti/modules/titanium/network/TiHTTPClient.java | 9 +-------- iphone/Classes/TiNetworkHTTPClientProxy.m | 6 ------ .../TitaniumKit/Sources/Modules/TiUIWindowProxy.m | 8 +------- package.json | 2 +- 4 files changed, 3 insertions(+), 22 deletions(-) diff --git a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java index d176aeb89b6..9089764d835 100644 --- a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java +++ b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java @@ -945,14 +945,7 @@ public void open(String method, String url) setReadyState(READY_STATE_OPENED); setRequestHeader("User-Agent", TITANIUM_USER_AGENT); - // Causes Auth to Fail with twitter and other size apparently block X- as well - // Ticket #729, ignore twitter for now - // if (!hostString.contains("twitter.com")) { - // setRequestHeader("X-Requested-With", "XMLHttpRequest"); - - // } else { - // Log.d(TAG, "Twitter: not sending X-Requested-With header", Log.DEBUG_MODE); - // } + } public void setRawData(Object data) diff --git a/iphone/Classes/TiNetworkHTTPClientProxy.m b/iphone/Classes/TiNetworkHTTPClientProxy.m index 65602242773..d9968803ed5 100644 --- a/iphone/Classes/TiNetworkHTTPClientProxy.m +++ b/iphone/Classes/TiNetworkHTTPClientProxy.m @@ -84,12 +84,6 @@ - (void)open:(id)args [httpRequest setMethod:method]; [httpRequest setUrl:url]; - // twitter specifically disallows X-Requested-With so we only add this normal - // XHR header if not going to twitter. however, other services generally expect - // this header to indicate an XHR request (such as RoR) - // if ([[url absoluteString] rangeOfString:@"twitter.com"].location == NSNotFound) { - // [httpRequest addRequestHeader:@"X-Requested-With" value:@"XMLHttpRequest"]; - // } if ((apsConnectionManager != nil) && ([apsConnectionManager willHandleURL:url])) { apsConnectionDelegate = [[apsConnectionManager connectionDelegateForUrl:url] retain]; } diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m b/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m index 826a0b10ccc..d0628265b0d 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m @@ -404,13 +404,7 @@ - (void)setTitleAttributes:(id)args if (shouldUpdateNavBar && ([controller navigationController] != nil)) { UINavigationBar *navigationBar = controller.navigationController.navigationBar; - if ([TiUtils boolValue:[self valueForKey:@"largeTitleEnabled"] def:NO]) { - // if ([self shouldUseNavBarApperance]) { - // navigationBar.standardAppearance.largeTitleTextAttributes = theAttributes; - // navigationBar.scrollEdgeAppearance.largeTitleTextAttributes = theAttributes; - // } - navigationBar.largeTitleTextAttributes = theAttributes; - } + if ([self shouldUseNavBarApperance]) { navigationBar.standardAppearance.titleTextAttributes = theAttributes; navigationBar.scrollEdgeAppearance.titleTextAttributes = theAttributes; diff --git a/package.json b/package.json index cff6a8103db..f2557b22cfd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "titanium-mobile", "description": "TiDev Titanium Mobile", - "version": "12.2.2", + "version": "12.2.0", "moduleApiVersion": { "iphone": "2", "android": "4" From fd3c8d615acaca2d1538eba184e413826eff657c Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Fri, 22 Sep 2023 21:48:22 +0200 Subject: [PATCH 8/9] Update android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java --- .../src/java/ti/modules/titanium/network/TiHTTPClient.java | 1 - 1 file changed, 1 deletion(-) diff --git a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java index 9089764d835..af6dead9276 100644 --- a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java +++ b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java @@ -945,7 +945,6 @@ public void open(String method, String url) setReadyState(READY_STATE_OPENED); setRequestHeader("User-Agent", TITANIUM_USER_AGENT); - } public void setRawData(Object data) From 612999021e154a9f39261e5eb3b5e19747f9fd7e Mon Sep 17 00:00:00 2001 From: Marian Kucharcik Date: Sun, 29 Oct 2023 16:57:35 +0100 Subject: [PATCH 9/9] fix(ios): removed setLargeTitleAttributes duplicity fix(ios): removed bounce from TiAnimation feat(android): Added collapse_toolbar props --- .../layout/titanium_ui_collapse_toolbar.xml | 4 +- .../titanium_ui_collapse_toolbar_centered.xml | 55 +++++++++++++++++++ .../TitaniumKit/Sources/API/TiAnimation.h | 1 - .../TitaniumKit/Sources/API/TiAnimation.m | 34 +++--------- .../Sources/Modules/TiUIWindowProxy.m | 49 ----------------- 5 files changed, 67 insertions(+), 76 deletions(-) create mode 100644 android/modules/ui/res/layout/titanium_ui_collapse_toolbar_centered.xml diff --git a/android/modules/ui/res/layout/titanium_ui_collapse_toolbar.xml b/android/modules/ui/res/layout/titanium_ui_collapse_toolbar.xml index bc7df177ffc..d3b7761ac34 100644 --- a/android/modules/ui/res/layout/titanium_ui_collapse_toolbar.xml +++ b/android/modules/ui/res/layout/titanium_ui_collapse_toolbar.xml @@ -29,7 +29,9 @@ android:id="@+id/collapseToolbarLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - app:layout_scrollFlags="scroll|snap|exitUntilCollapsed"> + app:layout_scrollFlags="scroll|snap|exitUntilCollapsed" + app:titleCentered="true" + app:collapsedTitleGravity="center|center_horizontal"> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.h b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.h index f4cae31bf59..165ec53b586 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.h +++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.h @@ -139,7 +139,6 @@ @property (nonatomic, retain, readwrite) TiProxy *view; @property (nonatomic, retain, readwrite) NSNumber *dampingRatio; @property (nonatomic, retain, readwrite) NSNumber *springVelocity; -@property (nonatomic, retain, readwrite) NSNumber *bounce; + (TiAnimation *)animationFromArg:(id)args context:(id)context create:(BOOL)yn; diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m index cbecaa7c69d..7fe2950c247 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m @@ -23,7 +23,7 @@ @implementation TiAnimation @synthesize delegate; @synthesize zIndex, left, right, top, bottom, width, height; @synthesize duration, color, backgroundColor, opacity, opaque, view; -@synthesize visible, curve, repeat, autoreverse, delay, transform, transition, dampingRatio, springVelocity, bounce; +@synthesize visible, curve, repeat, autoreverse, delay, transform, transition, dampingRatio, springVelocity; @synthesize animatedView, callback, isReverse, reverseAnimation, resetState; - (id)initWithDictionary:(NSDictionary *)properties_ context:(id)context_ callback:(KrollCallback *)callback_ @@ -99,7 +99,6 @@ - (id)initWithDictionary:(NSDictionary *)properties_ context:(id)co SET_FLOAT_PROP(delay, properties); SET_FLOAT_PROP(dampingRatio, properties); SET_FLOAT_PROP(springVelocity, properties); - SET_FLOAT_PROP(bounce, properties); SET_INT_PROP(curve, properties); SET_INT_PROP(repeat, properties); SET_BOOL_PROP(visible, properties); @@ -160,7 +159,6 @@ - (void)dealloc RELEASE_TO_NIL(view); RELEASE_TO_NIL(dampingRatio); RELEASE_TO_NIL(springVelocity); - RELEASE_TO_NIL(bounce); RELEASE_TO_NIL(properties); [animatedViewProxy release]; [super dealloc]; @@ -640,27 +638,13 @@ - (void)animate:(id)args }; if (dampingRatio != nil || springVelocity != nil) { -#ifdef __IPHONE_17_0 - if ([TiUtils isIOSVersionOrGreater:@"17.0"] && bounce != nil) { - [UIView animateWithSpringDuration:animationDuration - bounce:[bounce floatValue] - initialSpringVelocity:[springVelocity floatValue] - delay:([delay doubleValue] / 1000) - options:options - animations:animation - completion:complete]; - } else { -#endif - [UIView animateWithDuration:animationDuration - delay:([delay doubleValue] / 1000) - usingSpringWithDamping:[dampingRatio floatValue] - initialSpringVelocity:[springVelocity floatValue] - options:options - animations:animation - completion:complete]; -#ifdef __IPHONE_16_4 - } -#endif + [UIView animateWithDuration:animationDuration + delay:([delay doubleValue] / 1000) + usingSpringWithDamping:[dampingRatio floatValue] + initialSpringVelocity:[springVelocity floatValue] + options:options + animations:animation + completion:complete]; } else { [UIView animateWithDuration:animationDuration delay:([delay doubleValue] / 1000) @@ -728,4 +712,4 @@ - (void)animate:(id)args #endif } -@end +@end \ No newline at end of file diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m b/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m index cc375971f09..0bb6b384908 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/Modules/TiUIWindowProxy.m @@ -462,55 +462,6 @@ - (void)setLargeTitleAttributes:(id)args } } } -- (void)setLargeTitleAttributes:(id)args -{ - ENSURE_UI_THREAD(setLargeTitleAttributes, args); - ENSURE_SINGLE_ARG_OR_NIL(args, NSDictionary); - [self replaceValue:args forKey:@"largeTitleAttributes" notification:NO]; - - if (args == nil) { - args = [[self tabGroup] valueForUndefinedKey:@"largeTitleAttributes"]; - } - - NSMutableDictionary *theAttributes = nil; - if (args != nil) { - theAttributes = [NSMutableDictionary dictionary]; - if ([args objectForKey:@"color"] != nil) { - UIColor *theColor = [[TiUtils colorValue:@"color" properties:args] _color]; - if (theColor != nil) { - [theAttributes setObject:theColor forKey:NSForegroundColorAttributeName]; - } - } - if ([args objectForKey:@"shadow"] != nil) { - NSShadow *shadow = [TiUtils shadowValue:[args objectForKey:@"shadow"]]; - if (shadow != nil) { - [theAttributes setObject:shadow forKey:NSShadowAttributeName]; - } - } - - if ([args objectForKey:@"font"] != nil) { - UIFont *theFont = [[TiUtils fontValue:[args objectForKey:@"font"] def:nil] font]; - if (theFont != nil) { - [theAttributes setObject:theFont forKey:NSFontAttributeName]; - } - } - - if ([theAttributes count] == 0) { - theAttributes = nil; - } - } - - if (shouldUpdateNavBar && ([controller navigationController] != nil)) { - UINavigationBar *navigationBar = controller.navigationController.navigationBar; - if ([TiUtils boolValue:[self valueForKey:@"largeTitleEnabled"] def:NO]) { - if ([self shouldUseNavBarApperance]) { - navigationBar.standardAppearance.largeTitleTextAttributes = theAttributes; - navigationBar.scrollEdgeAppearance.largeTitleTextAttributes = theAttributes; - } - navigationBar.largeTitleTextAttributes = theAttributes; - } - } -} - (BOOL)shouldUseNavBarApperance {