Skip to content

Commit

Permalink
Merge branch 'master' into androidTabTouchFeedbackColor
Browse files Browse the repository at this point in the history
  • Loading branch information
cb1kenobi authored May 13, 2024
2 parents fb0a032 + 90c4d1f commit f9062de
Show file tree
Hide file tree
Showing 19 changed files with 99 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
name: Verify contributor

steps:
- uses: tidev/tidev-cla-action@v1
- uses: tidev/tidev-cla-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ today and benefit from 1:1 sessions with the core team, exclusive modules, merch

Learn more about sponsoring TiDev, the organization behind the Titanium SDK, [here](https://github.com/sponsors/tidev) 🚀.

<!-- sponsors --><a href="https://github.com/Topener"><img src="https://github.com/Topener.png" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https://github.com/phobeous.png" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/jasonkneen"><img src="https://github.com/jasonkneen.png" width="60px" alt="Jason Kneen" /></a><a href="https://github.com/de1mat"><img src="https://github.com/de1mat.png" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https://github.com/dlewis23.png" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https://github.com/dethier1958.png" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/AvinashDalvi89"><img src="https://github.com/AvinashDalvi89.png" width="60px" alt="Avinash Dalvi" /></a><a href="https://github.com/zenjoe"><img src="https://github.com/zenjoe.png" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https://github.com/desarrollogotit.png" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https://github.com/Astrovic.png" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https://github.com/Arood.png" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https://github.com/Rearmachine.png" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https://github.com/alexlarocca.png" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https://github.com/reshopper.png" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https://github.com/safadig.png" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https://github.com/designbymind.png" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https://github.com/greatschism.png" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https://github.com/enzoq.png" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https://github.com/mighty-office.png" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https://github.com/Fruugul.png" width="60px" alt="Fruugul" /></a><a href="https://github.com/petervaradi"><img src="https://github.com/petervaradi.png" width="60px" alt="" /></a><a href="https://github.com/korelogic"><img src="https://github.com/korelogic.png" width="60px" alt="Korelogic Limited" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/Topener"><img src="https://github.com/Topener.png" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https://github.com/phobeous.png" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/jasonkneen"><img src="https://github.com/jasonkneen.png" width="60px" alt="Jason Kneen" /></a><a href="https://github.com/de1mat"><img src="https://github.com/de1mat.png" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https://github.com/dlewis23.png" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https://github.com/dethier1958.png" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/AvinashDalvi89"><img src="https://github.com/AvinashDalvi89.png" width="60px" alt="Avinash Dalvi" /></a><a href="https://github.com/zenjoe"><img src="https://github.com/zenjoe.png" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https://github.com/desarrollogotit.png" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https://github.com/Astrovic.png" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https://github.com/Arood.png" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https://github.com/Rearmachine.png" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https://github.com/alexlarocca.png" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https://github.com/reshopper.png" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https://github.com/safadig.png" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https://github.com/designbymind.png" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https://github.com/greatschism.png" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https://github.com/enzoq.png" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https://github.com/mighty-office.png" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https://github.com/Fruugul.png" width="60px" alt="Fruugul" /></a><a href="https://github.com/petervaradi"><img src="https://github.com/petervaradi.png" width="60px" alt="" /></a><a href="https://github.com/korelogic"><img src="https://github.com/korelogic.png" width="60px" alt="Korelogic Limited" /></a><a href="https://github.com/eddyinet"><img src="https://github.com/eddyinet.png" width="60px" alt="" /></a><!-- sponsors -->

## Features

Expand Down
3 changes: 2 additions & 1 deletion android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3206,7 +3206,8 @@ AndroidBuilder.prototype.generateI18N = async function generateI18N() {
root.appendChild(dom.createTextNode('\n'));

// Create the XML file under the Android "res/values-<locale>" folder.
const localeSuffixName = (locale === 'en' ? '' : '-' + resolveRegionName(locale));
const defaultLang = this.tiapp.defaultLang || 'en';
const localeSuffixName = (locale === defaultLang ? '' : '-' + resolveRegionName(locale));
const dirPath = path.join(this.buildAppMainResDir, `values${localeSuffixName}`);
const filePath = path.join(dirPath, 'ti_i18n_strings.xml');
this.logger.debug(__('Writing %s strings => %s', locale.cyan, filePath.cyan));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ public void onTabSelected(TabProxy tabProxy)
tabProxy.onSelectionChanged(true);
tabProxy.onFocusChanged(true, focusEventData);

tabProxy.fireEvent(TiC.EVENT_SELECTED, null, false);
tabProxy.fireEvent(TiC.EVENT_SELECTED, focusEventData, false);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion android/titanium/libv8-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async function generateSnapshot(v8SnapshotHeaderFilePath, rollupFileContent) {
}

// Delete snapshot blob.
await fs.unlink(blobPath);
await fs.remove(blobPath);
}

// Generate 'V8Snapshots.h' from template
Expand Down
9 changes: 4 additions & 5 deletions apidoc/Titanium/App/Properties/Properties.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ description: |
Then, you can retrieve the property during runtime with the following API call:
``` js
var foo = Ti.App.Properties.getString('foo');
const foo = Ti.App.Properties.getString('foo');
```
As of Release 3.2.0, any application properties defined in the `tiapp.xml` file are stored in the
Any application properties defined in the `tiapp.xml` file are stored in the
device's secure storage, making them read-only. Additionally, external access to these
properties is now restricted. Other iOS applications cannot access these properties and
native Android modules must use the Titanium module API TiApplication.getAppProperties()
Expand All @@ -33,9 +33,8 @@ description: |
If you need to change the values during runtime, initially create the property with these APIs
rather than defining them in the `tiapp.xml` file.
Prior to Release 3.2.0, application properties defined in the `tiapp.xml` file could be
overwritten by these APIs and accessed externally by other applications and modules.
**Important**: Using this API in the Apple ecosystem requires the `NSPrivacyAccessedAPICategoryUserDefaults`
property set in the privacy manifest that was introduced in iOS 17. You can learn more about it [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api).
extends: Titanium.Module
since: "0.5"

Expand Down
3 changes: 3 additions & 0 deletions apidoc/Titanium/App/iOS/UserDefaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ summary: |
The UserDefaults module is used for storing application-related data in property/value pairs
that persist beyond application sessions and device power cycles. UserDefaults allows the suiteName
of the UserDefaults to be specified at creation time.
**Important**: Using this API requires the `NSPrivacyAccessedAPICategoryUserDefaults` property set in the
privacy manifest that was introduced in iOS 17. You can learn more about it [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api).
description: |
Unlike Titanium.App.Properties, Titanium.App.iOS.UserDefaults does not pull properties defined in the `tiapp.xml` file.
Expand Down
9 changes: 9 additions & 0 deletions apidoc/Titanium/Filesystem/File.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ methods:
summary: Returns the creation Date for the file identified by this file object.
description: |
On Android, returns a Date whose `getTime()` value is 0 for resource files.
**Important**: When developing for the Apple ecosystem, using this API requires the `NSPrivacyAccessedAPICategoryFileTimestamp`
property set in the privacy manifest that was introduced in iOS 17. You can learn more about it [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api).
returns:
type: Date
platforms: [iphone, ipad, android, macos]
Expand Down Expand Up @@ -255,6 +258,9 @@ methods:
summary: Returns the last modification Date for the file identified by this file object.
description: |
On Android, returns a Date whose `getTime()` value is 0 for resource files.
**Important**: When developing for the Apple ecosystem, using this API requires the `NSPrivacyAccessedAPICategoryFileTimestamp`
property set in the privacy manifest that was introduced in iOS 17. You can learn more about it [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api).
returns:
type: Date
platforms: [iphone, ipad, android, macos]
Expand Down Expand Up @@ -346,6 +352,9 @@ methods:
identified by this file object is stored.
description: |
Free space is returned in bytes.
**Important**: When developing for the Apple ecosystem, using this API requires the `NSPrivacyAccessedAPICategoryDiskSpace`
property set in the privacy manifest that was introduced in iOS 17. You can learn more about it [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api).
returns:
type: Number

Expand Down
3 changes: 3 additions & 0 deletions apidoc/Titanium/Platform/Platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ properties:

- name: uptime
summary: System uptime since last boot in seconds.
description: |
**Important**: When developing for the Apple ecosystem, using this API requires the `NSPrivacyAccessedAPICategorySystemBootTime`
property set in the privacy manifest that was introduced in iOS 17. You can learn more about it [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api).
type: Number
permission: read-only
platforms: [android, iphone, ipad, macos]
Expand Down
8 changes: 8 additions & 0 deletions apidoc/Titanium/UI/RefreshControl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ properties:
platforms: [android, iphone, ipad, macos]
since: { android: "6.2.0", iphone: "3.2.0", ipad: "3.2.0" }

- name: backgroundColor
summary: The background color for the refresh control, as a color name or hex triplet.
description: |
For information about color values, see the "Colors" section of <Titanium.UI>.
type: [String, Titanium.UI.Color]
platforms: [iphone, ipad, macos]
since: { iphone: "12.4.0", ipad: "12.4.0", macos: "12.4.0" }

events:
- name: refreshstart
summary: |
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ exports.config = function config(logger, config, cli) {
if (fs.existsSync(path.join(projectDir, 'tiapp.xml'))) {
let tiapp;
try {
tiapp = cli.tiapp = new tiappxml(path.join(projectDir, 'tiapp.xml'));
tiapp = cli.tiapp = new tiappxml(path.join(projectDir, 'tiapp.xml'), cli.argv.platform);
} catch (ex) {
logger.error(ex);
logger.log();
Expand Down
2 changes: 2 additions & 0 deletions iphone/Classes/PlatformModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,12 @@ - (NSString *)macaddress
}
GETTER_IMPL(NSString *, macaddress, Macaddress);

#ifdef USE_TI_PLATFORMUPTIME
- (NSNumber *)uptime
{
return [NSNumber numberWithDouble:[[NSProcessInfo processInfo] systemUptime]];
}
#endif

- (NSString *)identifierForVendor
{
Expand Down
8 changes: 4 additions & 4 deletions iphone/Classes/TiFilesystemBlobProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ -(id)name \

- (NSDate *)createTimestamp:(id)unused
{
DEPRECATED_REPLACED(@"Filesystem.File.createTimestamp()", @"7.3.0", @"Filesystem.File.createdAt()");
return [self createdAt:unused];
DEPRECATED_REPLACED_REMOVED(@"Filesystem.Blob.createTimestamp()", @"7.3.0", @"12.4.0", @"Filesystem.File.createdAt()");
return [NSDate new];
}

- (NSDate *)createdAt:(id)unused
Expand All @@ -106,8 +106,8 @@ - (NSDate *)createdAt:(id)unused

- (NSDate *)modificationTimestamp:(id)unused
{
DEPRECATED_REPLACED(@"Filesystem.File.modificationTimestamp()", @"7.3.0", @"Filesystem.File.modifiedAt()");
return [self modifiedAt:nil];
DEPRECATED_REPLACED_REMOVED(@"Filesystem.File.modificationTimestamp()", @"7.3.0", @"12.4.0", @"Filesystem.File.modifiedAt()");
return [NSDate new];
}

- (NSDate *)modifiedAt:(id)unused
Expand Down
11 changes: 11 additions & 0 deletions iphone/Classes/TiUIRefreshControlProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ - (void)setTintColor:(id)value
NO);
}

- (void)setBackgroundColor:(id)value
{
[self replaceValue:value forKey:@"backgroundColor" notification:NO];

TiThreadPerformOnMainThread(
^{
[[self control] setBackgroundColor:[[TiUtils colorValue:value] color]];
},
NO);
}

- (void)beginRefreshing:(id)unused
{
TiThreadPerformOnMainThread(
Expand Down
27 changes: 24 additions & 3 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,20 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}

// Handle URL-schemes / iOS >= 9
- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts
{
UIOpenURLContext *primaryContext = URLContexts.allObjects.firstObject;

NSDictionary<UIApplicationOpenURLOptionsKey, id> *options = @{
UIApplicationOpenURLOptionsSourceApplicationKey : NULL_IF_NIL(primaryContext.options.sourceApplication)
};

[self application:[UIApplication sharedApplication] openURL:primaryContext.URL options:options];
}

// Handle URL-schemes. Note that this selector is not called automatically anymore in iOS 13+
// because of the scene management. Instead, the above "scene:openURLContexts:" selector is called
// that forwards the call for maximum backwards compatibility
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options
{
[self tryToInvokeSelector:@selector(application:openURL:options:)
Expand Down Expand Up @@ -1185,12 +1198,20 @@ - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session op
[self tryToInvokeSelector:@selector(scene:willConnectToSession:options:)
withArguments:[NSOrderedSet orderedSetWithObjects:scene, connectionOptions, nil]];

// If a "application-launch-url" is set, launch it directly
[self launchToUrl];
// Catch exceptions
[TiExceptionHandler defaultExceptionHandler];

// Enable device logs (e.g. for physical devices)
if ([[TiSharedConfig defaultConfig] logServerEnabled]) {
[[TiLogServer defaultLogServer] start];
}

// Initialize the root-controller
[self initController];

// If a "application-launch-url" is set, launch it directly
[self launchToUrl];

// Boot our kroll-core
[self boot];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@ - (NSNumber *)readonly

- (NSDate *)createTimestamp
{
DEPRECATED_REPLACED(@"Filesystem.File.createTimestamp", @"7.3.0", @"Filesystem.File.createdAt()");
return [self createdAt:nil];
DEPRECATED_REPLACED_REMOVED(@"Filesystem.File.createTimestamp", @"7.3.0", @"12.4.0", @"Filesystem.File.createdAt()");
return [NSDate new];
}

- (NSDate *)createTimestamp:(id)unused
{
DEPRECATED_REPLACED(@"Filesystem.File.createTimestamp()", @"7.3.0", @"Filesystem.File.createdAt()");
return [self createdAt:unused];
DEPRECATED_REPLACED_REMOVED(@"Filesystem.File.createTimestamp()", @"7.3.0", @"12.4.0", @"Filesystem.File.createdAt()");
return [NSDate new];
}

#ifdef USE_TI_FILESYSTEMCREATEDAT
- (NSDate *)createdAt:(id)unused
{
NSError *error = nil;
Expand All @@ -82,19 +83,21 @@ - (NSDate *)createdAt:(id)unused
}
return result;
}
#endif

- (NSDate *)modificationTimestamp
{
DEPRECATED_REPLACED(@"Filesystem.File.modificationTimestamp", @"7.3.0", @"Filesystem.File.modifiedAt()");
return [self modifiedAt:nil];
DEPRECATED_REPLACED_REMOVED(@"Filesystem.File.modificationTimestamp", @"7.3.0", @"12.4.0", @"Filesystem.File.modifiedAt()");
return [NSDate new];
}

- (NSDate *)modificationTimestamp:(id)unused
{
DEPRECATED_REPLACED(@"Filesystem.File.modificationTimestamp()", @"7.3.0", @"Filesystem.File.modifiedAt()");
return [self modifiedAt:nil];
DEPRECATED_REPLACED_REMOVED(@"Filesystem.File.modificationTimestamp()", @"7.3.0", @"12.4.0", @"Filesystem.File.modifiedAt()");
return [NSDate new];
}

#ifdef USE_TI_FILESYSTEMMODIFIEDAT
- (NSDate *)modifiedAt:(id)unused
{
NSError *error = nil;
Expand All @@ -104,6 +107,7 @@ - (NSDate *)modifiedAt:(id)unused
}
return [resultDict objectForKey:NSFileModificationDate];
}
#endif

- (NSNumber *)symbolicLink
{
Expand Down Expand Up @@ -147,6 +151,7 @@ - (NSArray *)getDirectoryListing:(id)args
return resultArray;
}

#ifdef USE_TI_FILESYSTEMSPACEAVAILABLE
- (NSNumber *)spaceAvailable:(id)unused
{
NSError *error = nil;
Expand All @@ -157,6 +162,7 @@ - (NSNumber *)spaceAvailable:(id)unused
}
return [resultDict objectForKey:NSFileSystemFreeSize];
}
#endif

- (NSString *)getProtectionKey:(id)args
{
Expand Down
Loading

0 comments on commit f9062de

Please sign in to comment.