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/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/Classes/TiUITabGroup.m b/iphone/Classes/TiUITabGroup.m index bde83953801..44ae2d4f341 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 { diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m index 1f293a6faaf..7fe2950c247 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m @@ -712,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 6e3aed65195..0bb6b384908 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,13 +405,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; @@ -418,6 +413,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 { @@ -1017,6 +1061,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.json b/package.json index 6642765a3fb..0a3ca814be6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "titanium-mobile", - "description": "Titanium SDK", + "description": "TiDev Titanium Mobile", "version": "12.3.0", "moduleApiVersion": { "iphone": "2",