diff --git a/.github/actions/build-android/action.yml b/.github/actions/build-android/action.yml
index ac6d0389498..1915ee28320 100644
--- a/.github/actions/build-android/action.yml
+++ b/.github/actions/build-android/action.yml
@@ -20,13 +20,13 @@ runs:
shell: bash
- name: Setup Node.js
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
- name: Setup Java
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ inputs.java-version }}
@@ -36,7 +36,7 @@ runs:
shell: bash
- name: Cache Gradle packages
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: |
~/.gradle/caches
@@ -58,7 +58,7 @@ runs:
${{ runner.os }}-ccache-
- name: Cache V8
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: dist/android/libv8
key: libv8-${{ hashFiles('dist/android/libv8/**') }}
@@ -84,7 +84,7 @@ runs:
dist/tmp/common
shell: bash
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
with:
name: android-build
retention-days: 1
diff --git a/.github/actions/build-ios/action.yml b/.github/actions/build-ios/action.yml
index dfd37277f9b..facb2c2c713 100644
--- a/.github/actions/build-ios/action.yml
+++ b/.github/actions/build-ios/action.yml
@@ -9,10 +9,10 @@ inputs:
runs:
using: composite
steps:
- - name: Use Node.js 16.x
- uses: actions/setup-node@v3
+ - name: Use Node.js
+ uses: actions/setup-node@v4
with:
- node-version: '16.x'
+ node-version: ${{ inputs.node-version }}
cache: 'npm'
- name: Install dependencies
@@ -34,7 +34,7 @@ runs:
iphone/TitaniumKit/build/TitaniumKit.xcframework
shell: bash
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
with:
name: ios-build
retention-days: 1
diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml
index 71b593d5ac3..2b94b40f004 100644
--- a/.github/actions/package/action.yml
+++ b/.github/actions/package/action.yml
@@ -15,14 +15,14 @@ inputs:
runs:
using: composite
steps:
- - name: Use Node.js 16.x
- uses: actions/setup-node@v3
+ - name: Use Node.js
+ uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
- - name: Use JDK 11
- uses: actions/setup-java@v3
+ - name: Use JDK
+ uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ inputs.java-version }}
@@ -32,7 +32,7 @@ runs:
shell: bash
- name: Cache Gradle packages
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: |
~/.gradle/caches
@@ -41,7 +41,7 @@ runs:
restore-keys: |
${{ runner.os }}-gradle-
- - uses: actions/download-artifact@v3
+ - uses: actions/download-artifact@v4
with:
name: android-build
@@ -49,7 +49,7 @@ runs:
run: tar -xzvf android-build.tar.gz
shell: bash
- - uses: actions/download-artifact@v3
+ - uses: actions/download-artifact@v4
with:
name: ios-build
@@ -58,7 +58,7 @@ runs:
shell: bash
- name: Cache Native Modules
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ${{ env.SDK_BUILD_CACHE_DIR }}
key: native-modules-${{ github.sha }}
@@ -70,21 +70,21 @@ runs:
shell: bash
- name: Archive OSX artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: mobilesdk-${{ inputs.vtag }}-osx
path: |
dist/mobilesdk-*-osx.zip
- name: Archive win32 artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: mobilesdk-${{ inputs.vtag }}-win32
path: |
dist/mobilesdk-*-win32.zip
- name: Archive Linux artifact
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: mobilesdk-${{ inputs.vtag }}-linux
path: |
@@ -98,7 +98,7 @@ runs:
rm -f ~/.gradle/caches/modules-2/gc.properties
shell: bash
- - uses: geekyeggo/delete-artifact@v2
+ - uses: geekyeggo/delete-artifact@v5
with:
name: |
android-build
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
deleted file mode 100644
index 37acf53d70a..00000000000
--- a/.github/workflows/backport.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: Backport
-on:
- pull_request_target:
- types:
- - closed
- - labeled
-
-jobs:
- backport:
- runs-on: ubuntu-20.04
- name: Backport
- steps:
- - name: Backport
- uses: ewanharris/backport@v1.0.28-25
- with:
- bot_username: build
- bot_token: ${{ secrets.BOT_TOKEN }}
- bot_token_key: ${{ secrets.BOT_TOKEN_KEY }}
- github_token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f0c0afcb02d..9fc7635a35b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -15,14 +15,14 @@ jobs:
USE_CCACHE: 1
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Android build
uses: ./.github/actions/build-android
with:
- node-version: '16.x'
- java-version: '11'
+ node-version: '20.x'
+ java-version: '17'
ios:
runs-on: macos-13
@@ -33,27 +33,27 @@ jobs:
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: iOS build
uses: ./.github/actions/build-ios
with:
- node-version: '16.x'
+ node-version: '20.x'
js:
runs-on: ubuntu-latest
name: JavaScript
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- - name: Use Node.js 16.x
- uses: actions/setup-node@v3
+ - name: Use Node.js
+ uses: actions/setup-node@v4
with:
- node-version: '16.x'
+ node-version: '20.x'
cache: 'npm'
- name: Install dependencies
@@ -71,7 +71,7 @@ jobs:
needs: [android, ios, js]
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create version tag
@@ -83,6 +83,6 @@ jobs:
- name: Package
uses: ./.github/actions/package
with:
- node-version: '16.x'
- java-version: '11'
+ node-version: '20.x'
+ java-version: '17'
vtag: ${{ env.vtag }}
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index f8f60bad8bb..e8c5cde4165 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -13,13 +13,13 @@ jobs:
name: Docs
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- - name: Use Node.js 16.x
- uses: actions/setup-node@v3
+ - name: Use Node.js
+ uses: actions/setup-node@v4
with:
- node-version: '16.x'
+ node-version: '20.x'
cache: 'npm'
- run: npm ci
name: Install dependencies
diff --git a/.github/workflows/regen-builds.yml b/.github/workflows/regen-builds.yml
index c4bc936c500..27956f717b2 100644
--- a/.github/workflows/regen-builds.yml
+++ b/.github/workflows/regen-builds.yml
@@ -15,7 +15,7 @@ jobs:
steps:
- name: Repository Dispatch
if: github.event.workflow_run.conclusion == 'success'
- uses: peter-evans/repository-dispatch@v2
+ uses: peter-evans/repository-dispatch@v3
with:
event-type: regen-builds
repository: tidev/downloads-www
diff --git a/.github/workflows/regen-docs.yml b/.github/workflows/regen-docs.yml
index 23ce1a85cc1..a3be88243e4 100644
--- a/.github/workflows/regen-docs.yml
+++ b/.github/workflows/regen-docs.yml
@@ -14,12 +14,12 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
@@ -32,7 +32,7 @@ jobs:
name: Lint
- name: Repository Dispatch
- uses: peter-evans/repository-dispatch@v2
+ uses: peter-evans/repository-dispatch@v3
with:
event-type: regen-api-docs
token: ${{ secrets.REGEN_DOCS_GITHUB_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9ab7e263666..762ae53fd4d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -31,7 +31,7 @@ jobs:
vtag: ${{ steps.vtag.outputs.vtag }}
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
@@ -43,7 +43,7 @@ jobs:
echo "vtag=${VTAG}" >> $GITHUB_ENV
echo "vtag=${VTAG}" >> $GITHUB_OUTPUT
- name: Validate version
- uses: actions/github-script@v6
+ uses: actions/github-script@v7
env:
vtag: ${{ env.vtag }}
with:
@@ -70,15 +70,15 @@ jobs:
USE_CCACHE: 1
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Android build
uses: ./.github/actions/build-android
with:
- node-version: '16.x'
- java-version: '11'
+ node-version: '20.x'
+ java-version: '17'
ios:
runs-on: macos-13
@@ -90,14 +90,14 @@ jobs:
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: iOS build
uses: ./.github/actions/build-ios
with:
- node-version: '16.x'
+ node-version: '20.x'
package:
runs-on: macos-12
@@ -109,15 +109,15 @@ jobs:
needs: [validate, android, ios]
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Package
uses: ./.github/actions/package
with:
- node-version: '16.x'
- java-version: '11'
+ node-version: '20.x'
+ java-version: '17'
vtag: ${{ env.vtag }}
release:
@@ -129,21 +129,21 @@ jobs:
vtag: ${{ needs.validate.outputs.vtag }}
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- run: echo ${{ env.vtag }}
- name: Download Linux artifact
- uses: actions/download-artifact@v3
+ uses: actions/download-artifact@v4
with:
name: mobilesdk-${{ env.vtag }}-linux
- name: Download MacOS artifact
- uses: actions/download-artifact@v3
+ uses: actions/download-artifact@v4
with:
name: mobilesdk-${{ env.vtag }}-osx
- name: Download Windows artifact
- uses: actions/download-artifact@v3
+ uses: actions/download-artifact@v4
with:
name: mobilesdk-${{ env.vtag }}-win32
- name: Create and push tag
@@ -155,14 +155,14 @@ jobs:
git push origin "${TAG_VERSION}"
echo "clean-tag=${TAG_VERSION}" >> $GITHUB_ENV
- name: Upload SDK zips (GA)
- uses: softprops/action-gh-release@v1
+ uses: softprops/action-gh-release@v2
if: ${{ github.event.inputs.release-type == 'GA' }}
with:
files: mobilesdk-${{ env.vtag }}-*
tag_name: ${{ env.clean-tag }}
name: ${{ env.vtag }}
- name: Upload SDK zips (non-GA)
- uses: softprops/action-gh-release@v1
+ uses: softprops/action-gh-release@v2
if: ${{ github.event.inputs.release-type != 'GA' }}
with:
files: mobilesdk-${{ env.vtag }}-*
@@ -178,7 +178,7 @@ jobs:
git commit -m "chore(release): bump version"
git push
- name: Regen Builds
- uses: peter-evans/repository-dispatch@v2
+ uses: peter-evans/repository-dispatch@v3
with:
event-type: regen-builds
repository: tidev/downloads-www
diff --git a/.github/workflows/sponsors.yaml b/.github/workflows/sponsors.yaml
index 7e42d6a459c..f3bd3bcfdc6 100644
--- a/.github/workflows/sponsors.yaml
+++ b/.github/workflows/sponsors.yaml
@@ -10,7 +10,7 @@ jobs:
name: Update Sponsors
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update Sponsors in README.md
@@ -20,4 +20,4 @@ jobs:
token: ${{ secrets.SPONSORS_README_TOKEN }}
file: 'README.md'
- name: Commit changes
- uses: stefanzweifel/git-auto-commit-action@v4
+ uses: stefanzweifel/git-auto-commit-action@v5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 584645fff44..c5759037ef9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,52 @@
+## [12.5.1](https://github.com/tidev/titanium_mobile/compare/12_5_0_GA...12.5.1) (2024-10-02)
+
+## About this release
+
+Titanium SDK 12.5.1 is a patch release of the SDK, addressing high-priority issues from previous releases.
+
+As of this GA release, the previous Titanium SDK patch release (12.5.0) is no longer supported.
+
+## Community Credits
+
+* Hans Knöchel
+ * update ioslib to 1.7.38 to fix incremental builds in Xcode 16 ([a72b174](https://github.com/tidev/titanium_mobile/commit/a72b174030844f48b3bc173a13cb55ad639d31b9))
+ * update ioslib to 1.7.39 to support Xcode 16 provisioning profile handling ([a762523](https://github.com/tidev/titanium_mobile/commit/a762523f887c458f4312db8d664dbe33abb45d65))
+ * update compatibility for iOS 18+ and Xcode 16+ ([a55e6a8](https://github.com/tidev/titanium_mobile/commit/a55e6a8929a654dc8fbba53f810930f75b9c9891))
+
+* Prashant Saini
+ * marker event was only triggered for first and last visible section items ([edc6163](https://github.com/tidev/titanium_mobile/commit/edc6163ed1a6e267e3022d6f8aa1e0ff09999013))
+ * ListView has empty cells while scrolling up/down (#14119) ([d4abe90](https://github.com/tidev/titanium_mobile/commit/d4abe90817a7b971c9b3ac77149635277c4923c2))
+
+* Michael Gangolf
+ * allow ignoreLog to be a single string ([15b0eb6](https://github.com/tidev/titanium_mobile/commit/15b0eb64f8fec642b51895ccca7f7922704f1f33))
+ * fix ListView layout with header and footer only ([3012280](https://github.com/tidev/titanium_mobile/commit/3012280a418bc354bbfb7c1762ca0a241e696131))
+
+## Bug Fixes
+
+### Multiple platforms
+
+* allow ignoreLog to be a single string ([15b0eb6](https://github.com/tidev/titanium_mobile/commit/15b0eb64f8fec642b51895ccca7f7922704f1f33))
+* update ioslib to 1.7.38 to fix incremental builds in Xcode 16 ([a72b174](https://github.com/tidev/titanium_mobile/commit/a72b174030844f48b3bc173a13cb55ad639d31b9))
+
+### Android platform
+
+* fix ListView layout with header and footer only ([3012280](https://github.com/tidev/titanium_mobile/commit/3012280a418bc354bbfb7c1762ca0a241e696131))
+* fix toString() call when adb devices fails ([a6870b9](https://github.com/tidev/titanium_mobile/commit/a6870b9eca47f3e78f96f6c3c11f42dc7f42ffa4))
+
+## SDK Module Versions
+
+| Module | Android version | iOS Version |
+| ----------- | --------------- | ----------- |
+| facebook | 12.1.0 | 14.0.0 |
+| ti.map | 5.6.1 | 7.3.1 |
+| ti.webdialog | 2.3.0 | 3.0.2 |
+| ti.playservices | 18.3.0 | n/a |
+| ti.identity | 3.1.0 | 5.0.0 |
+| urlSession | n/a | 4.0.1 |
+| ti.coremotion | n/a | 4.0.1 |
+| ti.applesignin | n/a | 3.1.2 |
+| hyperloop | 7.0.6 | 7.0.6 |
+
# [12.5.0](https://github.com/tidev/titanium_mobile/compare/12_4_X...12.5.0) (2024-09-16)
## About this release
diff --git a/README.md b/README.md
index 91ae530b24d..d06de33e1b6 100644
--- a/README.md
+++ b/README.md
@@ -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) 🚀.
-
+
## Features
diff --git a/android/.gitignore b/android/.gitignore
index 56cacb3ced2..b6bd8f6c33d 100644
--- a/android/.gitignore
+++ b/android/.gitignore
@@ -14,3 +14,4 @@ build/
/kroll-apt/bin/
/local.properties
/titanium/assets/Resources/ti.internal/build.properties
+/.idea/
diff --git a/android/.idea/codeStyles/Project.xml b/android/.idea/codeStyles/Project.xml
index 8d13c04b12c..36d210ea229 100644
--- a/android/.idea/codeStyles/Project.xml
+++ b/android/.idea/codeStyles/Project.xml
@@ -9,6 +9,9 @@
+
+
+
diff --git a/android/app/build.gradle b/android/app/build.gradle
index d2ac439bee8..2577c868951 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -9,7 +9,8 @@ apply plugin: 'com.android.application'
// Set up Android app project.
android {
- compileSdkVersion 33
+ compileSdkVersion 34
+ ndkVersion project.ext.tiNdkVersion
defaultConfig {
applicationId 'com.titanium.test'
minSdkVersion 21
@@ -19,9 +20,6 @@ android {
manifestPlaceholders = project.ext.tiManifestPlaceholders
manifestPlaceholders.put('localApplicationId', applicationId) // Legacy placeholder old AARs sometimes use.
}
- lintOptions {
- checkReleaseBuilds false
- }
sourceSets {
main {
assets.srcDirs = [
@@ -31,8 +29,12 @@ android {
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+ namespace 'com.titanium.test'
+ lint {
+ checkReleaseBuilds false
}
}
diff --git a/android/build.gradle b/android/build.gradle
index 325c0af0c32..f03db25a724 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -6,17 +6,17 @@
*/
buildscript {
- ext.kotlin_version = '1.8.20'
+ ext.kotlin_version = '1.9.23'
repositories {
google()
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.0.4'
- classpath 'com.google.gms:google-services:4.3.15'
+ classpath 'com.android.tools.build:gradle:8.3.1'
+ classpath 'com.google.gms:google-services:4.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- classpath 'org.codehaus.groovy:groovy-json:3.0.11'
+ classpath 'org.codehaus.groovy:groovy-json:3.0.17'
}
}
diff --git a/android/cli/commands/_build.js b/android/cli/commands/_build.js
index ee4a6d17c9b..522adb32ceb 100644
--- a/android/cli/commands/_build.js
+++ b/android/cli/commands/_build.js
@@ -2042,7 +2042,6 @@ AndroidBuilder.prototype.generateLibProjectForModule = async function generateLi
// Load "AndroidManifest.xml", replace ${tiapp.properties['key']} variables, and save to above directories.
const manifest = await AndroidManifest.fromFilePath(sourceManifestFilePath);
- manifest.setPackageName(moduleInfo.manifest.moduleid);
manifest.replaceTiPlaceholdersUsing(this.tiapp, this.appid);
await manifest.writeToFilePath(path.join(debugDirPath, 'AndroidManifest.xml'));
await manifest.writeToFilePath(path.join(releaseDirPath, 'AndroidManifest.xml'));
@@ -2065,7 +2064,6 @@ AndroidBuilder.prototype.generateLibProjectForModule = async function generateLi
this.logger.error(`Unable to load Android content from: ${tiModuleXmlFilePath}`);
throw ex;
}
- mainManifest.setPackageName(moduleInfo.manifest.moduleid);
await mainManifest.writeToFilePath(path.join(projectSrcMainDirPath, 'AndroidManifest.xml'));
// Generate a "build.gradle" file for this project from the SDK's "lib.build.gradle" EJS template.
@@ -2156,8 +2154,9 @@ AndroidBuilder.prototype.generateRootProjectFiles = async function generateRootP
const gradleProperties = await gradlew.fetchDefaultGradleProperties();
gradleProperties.push({ key: 'android.useAndroidX', value: 'true' });
gradleProperties.push({ key: 'android.enableJetifier', value: 'true' });
- gradleProperties.push({ key: 'android.suppressUnsupportedCompileSdk', value: '33' });
+ gradleProperties.push({ key: 'android.nonTransitiveRClass', value: 'false' });
gradleProperties.push({ key: 'org.gradle.jvmargs', value: `-Xmx${this.javacMaxMemory}` });
+ gradleProperties.push({ key: 'org.gradle.configuration-cache', value: 'true' });
await gradlew.writeGradlePropertiesFile(gradleProperties);
// Copy optional "gradle.properties" file contents from Titanium project to the above generated file.
@@ -2175,10 +2174,12 @@ AndroidBuilder.prototype.generateRootProjectFiles = async function generateRootP
// Create a "local.properties" file providing a path to the Android SDK directory.
await gradlew.writeLocalPropertiesFile(this.androidInfo.sdk.path);
- // Copy our root "build.gradle" template script to the root build directory.
- await fs.copyFile(
- path.join(this.templatesDir, 'root.build.gradle'),
- path.join(this.buildDir, 'build.gradle'));
+ // Generate root "build.gradle" template script to the root build directory.
+ let buildGradleContent = await fs.readFile(path.join(this.templatesDir, 'root.build.gradle'));
+ buildGradleContent = ejs.render(buildGradleContent.toString(), {
+ classpaths: [],
+ });
+ await fs.writeFile(path.join(this.buildDir, 'build.gradle'), buildGradleContent);
// Copy our Titanium template's gradle constants file.
// This provides the Google library versions we use and defines our custom "AndroidManifest.xml" placeholders.
@@ -3681,9 +3682,6 @@ AndroidBuilder.prototype.generateAndroidManifest = async function generateAndroi
// Write secondary "AndroidManifest.xml" if not empty.
if (!secondaryManifest.isEmpty()) {
- // Make sure package name is set in so that ".ClassName" references in XML can be resolved.
- secondaryManifest.setPackageName(this.appid);
-
// Replace ${tiapp.properties['key']} placeholders in manifest.
secondaryManifest.replaceTiPlaceholdersUsing(this.tiapp, this.appid);
diff --git a/android/cli/commands/_buildModule.js b/android/cli/commands/_buildModule.js
index 1fdf5c78767..84614b78f57 100644
--- a/android/cli/commands/_buildModule.js
+++ b/android/cli/commands/_buildModule.js
@@ -58,7 +58,7 @@ AndroidModuleBuilder.prototype.migrate = async function migrate() {
const manifestModuleAPIVersion = this.manifest.apiversion;
const manifestTemplateFile = path.join(this.platformPath, 'templates', 'module', 'default', 'template', 'android', 'manifest.ejs');
let newVersion = semver.inc(this.manifest.version, 'major');
- this.tiSdkVersion = cliSDKVersion;
+ this.tiSdkVersion = this.cli.sdk.name;
// Determine if the "manifest" file's "apiversion" needs updating.
let isApiVersionUpdateRequired = false;
@@ -496,7 +496,6 @@ AndroidModuleBuilder.prototype.generateRootProjectFiles = async function generat
// Create a "gradle.properties" file. Will add network proxy settings if needed.
const gradleProperties = await gradlew.fetchDefaultGradleProperties();
gradleProperties.push({ key: 'android.useAndroidX', value: 'true' });
- gradleProperties.push({ key: 'android.suppressUnsupportedCompileSdk', value: '33' });
gradleProperties.push({
key: 'org.gradle.jvmargs',
value: `-Xmx${this.javacMaxMemory} -Dkotlin.daemon.jvm.options="-Xmx${this.javacMaxMemory}"`
@@ -512,11 +511,13 @@ AndroidModuleBuilder.prototype.generateRootProjectFiles = async function generat
// Create a "local.properties" file providing a path to the Android SDK directory.
await gradlew.writeLocalPropertiesFile(this.androidInfo.sdk.path);
- // Copy our root "build.gradle" template script to the root build directory.
+ // Generate root "build.gradle" template script to the root build directory.
const templatesDir = path.join(this.platformPath, 'templates', 'build');
- await fs.copyFile(
- path.join(templatesDir, 'root.build.gradle'),
- path.join(this.buildDir, 'build.gradle'));
+ let buildGradleContent = await fs.readFile(path.join(templatesDir, 'root.build.gradle'));
+ buildGradleContent = ejs.render(buildGradleContent.toString(), {
+ classpaths: (this.manifest.classpaths?.split(',') ?? []).filter(classpath => classpath !== ''),
+ });
+ await fs.writeFile(path.join(this.buildDir, 'build.gradle'), buildGradleContent);
// Copy our Titanium template's gradle constants file.
// This provides the Google library versions we use and defines our custom "AndroidManifest.xml" placeholders.
@@ -562,6 +563,7 @@ AndroidModuleBuilder.prototype.generateModuleProject = async function generateMo
let buildGradleContent = await fs.readFile(path.join(this.moduleTemplateDir, 'build.gradle'));
buildGradleContent = ejs.render(buildGradleContent.toString(), {
compileSdkVersion: this.compileSdkVersion,
+ plugins: (this.manifest.plugins?.split(',') ?? []).filter(plugin => plugin !== ''),
krollAptJarPath: path.join(this.platformPath, 'kroll-apt.jar'),
minSdkVersion: this.minSupportedApiLevel,
moduleAuthor: this.manifest.author,
@@ -613,12 +615,6 @@ AndroidModuleBuilder.prototype.generateModuleProject = async function generateMo
this.logger.error('Unable to load Android content from "timodule.xml" file.');
throw err;
}
- let packageName = moduleId;
- if (packageName.indexOf('.') < 0) {
- packageName = `ti.${packageName}`;
- }
- mainManifest.setPackageName(packageName);
- await mainManifest.writeToFilePath(path.join(moduleMainDir, 'AndroidManifest.xml'));
// Generate Java file used to provide this module's JS source code to Titanium's JS runtime.
let fileContent = await fs.readFile(path.join(this.moduleTemplateDir, 'CommonJsSourceProvider.java'));
diff --git a/android/cli/hooks/run.js b/android/cli/hooks/run.js
index b8b2e07ef06..091ed7f9458 100644
--- a/android/cli/hooks/run.js
+++ b/android/cli/hooks/run.js
@@ -87,7 +87,7 @@ exports.init = function (logger, config, cli) {
const adb = new ADB(config);
adb.devices(function (err, devices) {
if (err) {
- err.toString.split('\n').forEach(logger.error);
+ err.toString().split('\n').forEach(logger.error);
logger.log();
process.exit(1);
}
@@ -268,7 +268,11 @@ exports.init = function (logger, config, cli) {
}
// ignore some Android logs in info log level
- if (ignoreLog.some(ignoreItem => line.includes(ignoreItem))) {
+ if (typeof ignoreLog === 'string') {
+ if (line.includes(ignoreLog)) {
+ return;
+ }
+ } else if (ignoreLog.some(ignoreItem => line.includes(ignoreItem))) {
return;
}
diff --git a/android/gradle.properties b/android/gradle.properties
index a5678e41a60..073e209f36e 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -12,6 +12,4 @@ org.gradle.jvmargs=-Xmx1536m
# Note: Jetifier is not needed for test app since it doesn't use Google's deprecated support libraries.
android.useAndroidX=true
android.enableJetifier=false
-
-# remove if com.android.tools.build:gradle can be raised in /android/build.gradle
-android.suppressUnsupportedCompileSdk=33,34
+android.nonTransitiveRClass=false
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index e8be595e3c6..83dc05f6cc4 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
+#Tue Mar 19 21:28:34 EET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/android/kroll-apt/build.gradle b/android/kroll-apt/build.gradle
index addda9dcd4f..3254ac8abe3 100644
--- a/android/kroll-apt/build.gradle
+++ b/android/kroll-apt/build.gradle
@@ -7,8 +7,10 @@
apply plugin: 'java'
-sourceCompatibility = JavaVersion.VERSION_11
-targetCompatibility = JavaVersion.VERSION_11
+java {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+}
// Checks our Java code against our style guidelines and for common coding mistakes using "checkstyle.xml".
// Will trigger a build failure if any violations have been detected.
@@ -55,6 +57,7 @@ tasks.withType(JavaCompile).configureEach {
// building with JDK newer than the Java version we're targeting. (Ex: Build with JDK 8, but target Java 7.)
// Note: Build tool wants a reference to runtime JAR of the same version we're targeting. Not going to happen.
options.compilerArgs << '-Xlint:-options'
+ options.incremental = true
}
// Bundle the below library dependencies within this project's built JAR.
diff --git a/android/kroll-apt/src/main/java/org/appcelerator/kroll/annotations/generator/KrollJSONGenerator.java b/android/kroll-apt/src/main/java/org/appcelerator/kroll/annotations/generator/KrollJSONGenerator.java
index e97abe907c0..c87aa4cbc06 100644
--- a/android/kroll-apt/src/main/java/org/appcelerator/kroll/annotations/generator/KrollJSONGenerator.java
+++ b/android/kroll-apt/src/main/java/org/appcelerator/kroll/annotations/generator/KrollJSONGenerator.java
@@ -37,7 +37,7 @@
import org.json.simple.JSONValue;
-@SupportedSourceVersion(SourceVersion.RELEASE_11)
+@SupportedSourceVersion(SourceVersion.RELEASE_17)
@SuppressWarnings("unchecked")
@SupportedAnnotationTypes({
KrollJSONGenerator.Kroll_argument,
diff --git a/android/kroll-apt/src/main/resources/META-INF/gradle/incremental.annotation.processors b/android/kroll-apt/src/main/resources/META-INF/gradle/incremental.annotation.processors
new file mode 100644
index 00000000000..ea6589826e0
--- /dev/null
+++ b/android/kroll-apt/src/main/resources/META-INF/gradle/incremental.annotation.processors
@@ -0,0 +1 @@
+org.appcelerator.kroll.annotations.generator.KrollJSONGenerator,dynamic
diff --git a/android/modules/ui/res/layout/titanium_ui_listview_holder.xml b/android/modules/ui/res/layout/titanium_ui_listview_holder.xml
index de8cfbe1581..68888ce5ac0 100644
--- a/android/modules/ui/res/layout/titanium_ui_listview_holder.xml
+++ b/android/modules/ui/res/layout/titanium_ui_listview_holder.xml
@@ -12,9 +12,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:addStatesFromChildren="true"
- app:layout_constraintBottom_toTopOf="@+id/titanium_ui_listview_holder_footer_title"
app:layout_constraintStart_toEndOf="@id/titanium_ui_listview_holder_left_image"
- app:layout_constraintTop_toBottomOf="@+id/titanium_ui_listview_holder_header_title" />
+ app:layout_constraintTop_toBottomOf="@+id/barrierHeader" />
+ app:layout_constraintTop_toTopOf="@id/titanium_ui_listview_holder_content"
+ app:layout_constraintBottom_toBottomOf="@id/titanium_ui_listview_holder_content" />
+ app:layout_constraintTop_toTopOf="@id/titanium_ui_listview_holder_content"
+ app:layout_constraintBottom_toBottomOf="@id/titanium_ui_listview_holder_content" />
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/titanium_ui_listview_holder_content" />
+
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java
index d2536898cfc..5d8fcda701e 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java
@@ -30,11 +30,11 @@
import com.google.android.material.textfield.TextInputLayout;
import com.google.android.material.timepicker.MaterialTimePicker;
import com.google.android.material.timepicker.TimeFormat;
+import com.google.android.material.R;
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollFunction;
import org.appcelerator.kroll.annotations.Kroll;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.TiDimension;
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiImageView.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiImageView.java
index 769de54feeb..3d2792f5bb0 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiImageView.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiImageView.java
@@ -29,11 +29,11 @@
import com.google.android.material.color.MaterialColors;
import java.lang.ref.WeakReference;
import org.appcelerator.titanium.proxy.TiViewProxy;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.util.TiExifOrientation;
import org.appcelerator.titanium.util.TiUIHelper;
import org.appcelerator.titanium.util.TiColorHelper;
import ti.modules.titanium.media.MediaModule;
+import com.google.android.material.R;
public class TiImageView extends ViewGroup
{
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIActivityIndicator.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIActivityIndicator.java
index 5f56dcb2dfc..8bccff9f97d 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIActivityIndicator.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIActivityIndicator.java
@@ -20,12 +20,12 @@
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.common.Log;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiUIHelper;
import org.appcelerator.titanium.view.TiUIView;
+import com.google.android.material.R;
public class TiUIActivityIndicator extends TiUIView
{
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButton.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButton.java
index 6d5a773221e..a6b21eea233 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButton.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButton.java
@@ -20,11 +20,11 @@
import androidx.appcompat.widget.AppCompatButton;
import com.google.android.material.button.MaterialButton;
+import com.google.android.material.R;
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.common.Log;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButtonBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButtonBar.java
index cc9f66c6c3c..97aaf7a05ec 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButtonBar.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButtonBar.java
@@ -156,10 +156,10 @@ private void addButton(String title, String accessibilityLabel, Drawable imageDr
// Create a button with given settings and add it to view group.
Context context = buttonGroup.getContext();
- int attributeId = R.attr.materialButtonOutlinedStyle;
+ int attributeId = com.google.android.material.R.attr.materialButtonOutlinedStyle;
if (title.isEmpty() && (imageDrawable != null)) {
context = new ContextThemeWrapper(context, R.style.Widget_Titanium_OutlinedButton_IconOnly);
- attributeId = R.attr.materialButtonToggleGroupStyle;
+ attributeId = com.google.android.material.R.attr.materialButtonToggleGroupStyle;
}
MaterialButton button = new MaterialButton(context, null, attributeId);
button.setText(title);
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java
index cc18e9b3e95..6d7f70b8e52 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java
@@ -200,10 +200,10 @@ private void addButton(String title, String accessibilityLabel, Drawable imageDr
// Create a button with given settings and add it to view group.
Context context = buttonGroup.getContext();
- int attributeId = R.attr.materialButtonOutlinedStyle;
+ int attributeId = com.google.android.material.R.attr.materialButtonOutlinedStyle;
if (title.isEmpty() && (imageDrawable != null)) {
context = new ContextThemeWrapper(context, R.style.Widget_Titanium_OutlinedButton_IconOnly);
- attributeId = R.attr.materialButtonToggleGroupStyle;
+ attributeId = com.google.android.material.R.attr.materialButtonToggleGroupStyle;
}
MaterialButton button = new MaterialButton(context, null, attributeId);
button.setEnabled(isEnabled);
@@ -217,8 +217,8 @@ private void addButton(String title, String accessibilityLabel, Drawable imageDr
new int[] { android.R.attr.state_checked },
},
new int[] {
- oldColors.getColorForState(new int[] { -android.R.attr.state_checked }, R.attr.colorOnSurface),
- col
+ oldColors.getColorForState(new int[] { -android.R.attr.state_checked },
+ com.google.android.material.R.attr.colorOnSurface), col
}
);
button.setBackgroundTintList(trackStates);
@@ -232,8 +232,8 @@ private void addButton(String title, String accessibilityLabel, Drawable imageDr
new int[] { android.R.attr.state_checked },
},
new int[] {
- oldColors.getColorForState(new int[] { -android.R.attr.state_checked }, R.attr.colorOnSurface),
- col
+ oldColors.getColorForState(new int[] { -android.R.attr.state_checked },
+ com.google.android.material.R.attr.colorOnSurface), col
}
);
button.setStrokeColor(trackStates);
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIScrollView.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIScrollView.java
index 4dded6d0761..7dc6474ab45 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIScrollView.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIScrollView.java
@@ -53,6 +53,8 @@ public class TiUIScrollView extends TiUIView
private static int verticalAttrId = -1;
private static int horizontalAttrId = -1;
private int type;
+ private TiDimension xDimension;
+ private TiDimension yDimension;
public class TiScrollViewLayout extends TiCompositeLayout
{
@@ -405,6 +407,9 @@ public TiScrollViewLayout getLayout()
@Override
public boolean onTouchEvent(MotionEvent event)
{
+ xDimension = new TiDimension((double) event.getX(), TiDimension.TYPE_LEFT);
+ yDimension = new TiDimension((double) event.getY(), TiDimension.TYPE_TOP);
+
if (event.getAction() == MotionEvent.ACTION_MOVE && !mScrollingEnabled) {
return false;
}
@@ -416,6 +421,9 @@ public boolean onTouchEvent(MotionEvent event)
isTouching = false;
KrollDict data = new KrollDict();
data.put("decelerate", true);
+
+ data.put(TiC.EVENT_PROPERTY_X, xDimension.getAsDefault(scrollView));
+ data.put(TiC.EVENT_PROPERTY_Y, yDimension.getAsDefault(scrollView));
getProxy().fireEvent(TiC.EVENT_DRAGEND, data);
}
//There's a known Android bug (version 3.1 and above) that will throw an exception when we use 3+ fingers to touch the scrollview.
@@ -475,6 +483,8 @@ protected void onScrollChanged(int l, int t, int oldl, int oldt)
if (!isScrolling && isTouching) {
isScrolling = true;
KrollDict data = new KrollDict();
+ data.put(TiC.EVENT_PROPERTY_X, xDimension.getAsDefault(scrollView));
+ data.put(TiC.EVENT_PROPERTY_Y, yDimension.getAsDefault(scrollView));
getProxy().fireEvent(TiC.EVENT_DRAGSTART, data);
}
@@ -553,6 +563,9 @@ public TiScrollViewLayout getLayout()
@Override
public boolean onTouchEvent(MotionEvent event)
{
+ xDimension = new TiDimension((double) event.getX(), TiDimension.TYPE_LEFT);
+ yDimension = new TiDimension((double) event.getY(), TiDimension.TYPE_TOP);
+
if (event.getAction() == MotionEvent.ACTION_MOVE && !mScrollingEnabled) {
return false;
}
@@ -564,6 +577,8 @@ public boolean onTouchEvent(MotionEvent event)
isTouching = false;
KrollDict data = new KrollDict();
data.put("decelerate", true);
+ data.put(TiC.EVENT_PROPERTY_X, xDimension.getAsDefault(scrollView));
+ data.put(TiC.EVENT_PROPERTY_Y, yDimension.getAsDefault(scrollView));
getProxy().fireEvent(TiC.EVENT_DRAGEND, data);
}
//There's a known Android bug (version 3.1 and above) that will throw an exception when we use 3+ fingers to touch the scrollview.
@@ -603,6 +618,8 @@ protected void onScrollChanged(int l, int t, int oldl, int oldt)
if (!isScrolling && isTouching) {
isScrolling = true;
+ data.put(TiC.EVENT_PROPERTY_X, xDimension.getAsDefault(scrollView));
+ data.put(TiC.EVENT_PROPERTY_Y, yDimension.getAsDefault(scrollView));
getProxy().fireEvent(TiC.EVENT_DRAGSTART, data);
}
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java
index 8ca71d59e4b..24685db76f5 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java
@@ -451,6 +451,6 @@ private int getTabCount()
@ColorInt
private static int getTabRippleColorFrom(Context context)
{
- return MaterialColors.getColor(context, R.attr.colorPrimary, Color.DKGRAY);
+ return MaterialColors.getColor(context, com.google.android.material.R.attr.colorPrimary, Color.DKGRAY);
}
}
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java
index da19265a5b2..6de91925c5e 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java
@@ -15,7 +15,6 @@
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.common.Log;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.TiDimension;
@@ -57,6 +56,7 @@
import android.widget.TextView.OnEditorActionListener;
import androidx.appcompat.view.ContextThemeWrapper;
import com.google.android.material.textfield.TextInputLayout;
+import com.google.android.material.R;
public class TiUIText extends TiUIView implements TextWatcher, OnEditorActionListener, OnFocusChangeListener
{
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java
index 0a400cd4705..4b83ba48705 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java
@@ -34,8 +34,6 @@
import android.widget.ImageView;
import android.widget.TextView;
-import androidx.constraintlayout.widget.ConstraintLayout;
-import androidx.constraintlayout.widget.ConstraintSet;
import androidx.recyclerview.widget.RecyclerView;
import java.lang.ref.WeakReference;
@@ -365,16 +363,6 @@ private void setHeaderFooter(TiViewProxy listViewProxy,
this.header.addView(headerView, view.getLayoutParams());
this.header.setVisibility(View.VISIBLE);
-
- ConstraintSet constraintSet = new ConstraintSet();
- constraintSet.clone((ConstraintLayout) this.container);
- constraintSet.connect(R.id.titanium_ui_listview_holder_content, ConstraintSet.TOP,
- R.id.titanium_ui_listview_holder_header, ConstraintSet.BOTTOM, 0);
- constraintSet.connect(R.id.titanium_ui_listview_holder_left_image, ConstraintSet.TOP,
- R.id.titanium_ui_listview_holder_header, ConstraintSet.BOTTOM, 0);
- constraintSet.connect(R.id.titanium_ui_listview_holder_right_image, ConstraintSet.TOP,
- R.id.titanium_ui_listview_holder_header, ConstraintSet.BOTTOM, 0);
- constraintSet.applyTo((ConstraintLayout) this.container);
}
}
}
@@ -409,16 +397,6 @@ private void setHeaderFooter(TiViewProxy listViewProxy,
this.footer.addView(footerView, view.getLayoutParams());
this.footer.setVisibility(View.VISIBLE);
-
- ConstraintSet constraintSet = new ConstraintSet();
- constraintSet.clone((ConstraintLayout) this.container);
- constraintSet.connect(R.id.titanium_ui_listview_holder_content, ConstraintSet.BOTTOM,
- R.id.titanium_ui_listview_holder_footer, ConstraintSet.TOP, 0);
- constraintSet.connect(R.id.titanium_ui_listview_holder_left_image, ConstraintSet.BOTTOM,
- R.id.titanium_ui_listview_holder_footer, ConstraintSet.TOP, 0);
- constraintSet.connect(R.id.titanium_ui_listview_holder_right_image, ConstraintSet.BOTTOM,
- R.id.titanium_ui_listview_holder_footer, ConstraintSet.TOP, 0);
- constraintSet.applyTo((ConstraintLayout) this.container);
}
}
}
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewProxy.java
index 79b5769f8f8..f3b88eaf0cf 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewProxy.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewProxy.java
@@ -631,8 +631,15 @@ public void handleMarkers()
return;
}
- final ListItemProxy[] items =
- new ListItemProxy[] { listView.getFirstVisibleItem(), listView.getLastVisibleItem()};
+ final ArrayList items = new ArrayList<>();
+ final LinearLayoutManager lm = listView.getLayoutManager();
+ final int firstVisibleItemPos = lm.findFirstVisibleItemPosition();
+ final int lastVisibleItemPos = lm.findLastVisibleItemPosition();
+
+ // ideally markers should be triggered for all visible items between first and last visible ones
+ for (int i = firstVisibleItemPos; i <= lastVisibleItemPos; i++) {
+ items.add(listView.getVisibleItemAt(i));
+ }
for (final ListItemProxy item : items) {
if (item != null) {
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiListView.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiListView.java
index e4cee03582b..a169a10a0cc 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiListView.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiListView.java
@@ -153,6 +153,8 @@ public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy)
payload.put(TiC.PROPERTY_DIRECTION, "up");
} else if (dy < 0) {
payload.put(TiC.PROPERTY_DIRECTION, "down");
+ } else {
+ payload.put(TiC.PROPERTY_DIRECTION, "unknown");
}
payload.put(TiC.EVENT_PROPERTY_VELOCITY, 0);
if (continuousUpdate) {
@@ -571,6 +573,18 @@ public ListItemProxy getFirstVisibleItem()
return null;
}
+ public ListItemProxy getVisibleItemAt(int index)
+ {
+ final View itemView = getLayoutManager().findViewByPosition(index);
+
+ if (itemView == null) {
+ return null;
+ }
+
+ // Obtain list item proxy
+ return ((ListViewHolder) recyclerView.getChildViewHolder(itemView)).getProxy();
+ }
+
/**
* Obtain last visible list item proxy.
*
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiRecyclerViewHolder.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiRecyclerViewHolder.java
index ed14fd3f194..e0a223b7ce6 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiRecyclerViewHolder.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/TiRecyclerViewHolder.java
@@ -64,8 +64,9 @@ public TiRecyclerViewHolder(final Context context, final ViewGroup viewGroup)
{
super(viewGroup);
- COLOR_NORMAL = MaterialColors.getColor(context, R.attr.colorButtonNormal, Color.DKGRAY);
- COLOR_PRIMARY = MaterialColors.getColor(context, R.attr.colorPrimary, Color.DKGRAY);
+ COLOR_NORMAL = MaterialColors.getColor(context, com.google.android.material
+ .R.attr.colorButtonNormal, Color.DKGRAY);
+ COLOR_PRIMARY = MaterialColors.getColor(context, com.google.android.material.R.attr.colorPrimary, Color.DKGRAY);
COLOR_SELECTED = ColorUtils.setAlphaComponent(COLOR_PRIMARY, 20);
if (resources == null) {
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchbar/TiUISearchBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchbar/TiUISearchBar.java
index 9730dc4f64a..db672c19881 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchbar/TiUISearchBar.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchbar/TiUISearchBar.java
@@ -19,7 +19,6 @@
import androidx.appcompat.widget.SearchView;
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
@@ -27,6 +26,7 @@
import org.appcelerator.titanium.util.TiUIHelper;
import org.appcelerator.titanium.view.TiUIView;
import ti.modules.titanium.ui.UIModule;
+import com.google.android.material.R;
public class TiUISearchBar extends TiUIView
{
diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIAbstractTabGroup.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIAbstractTabGroup.java
index 67957c1309b..57d27a4ebab 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIAbstractTabGroup.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIAbstractTabGroup.java
@@ -33,7 +33,6 @@
import org.appcelerator.kroll.common.Log;
import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
-import org.appcelerator.titanium.R;
import org.appcelerator.titanium.TiBaseActivity;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.ActivityProxy;
@@ -51,6 +50,7 @@
import ti.modules.titanium.ui.TabGroupProxy;
import ti.modules.titanium.ui.TabProxy;
+import com.google.android.material.R;
/**
* Abstract class representing Tab Navigation in Titanium. Abstract methods in it
diff --git a/android/settings.gradle b/android/settings.gradle
index 8f0aafe7ada..80822af59ec 100644
--- a/android/settings.gradle
+++ b/android/settings.gradle
@@ -1,4 +1,2 @@
rootProject.name = 'TitaniumSDK'
-include ':app'
-include ':kroll-apt'
-include ':titanium'
+include ':app', ':kroll-apt', ':titanium'
diff --git a/android/templates/build/AndroidManifest.xml b/android/templates/build/AndroidManifest.xml
index 13b2d98ca66..c74fc72ff2b 100644
--- a/android/templates/build/AndroidManifest.xml
+++ b/android/templates/build/AndroidManifest.xml
@@ -1,7 +1,6 @@
<% if (usesPermissions) { for (const nextPermission of usesPermissions) { %>
diff --git a/android/templates/build/app.build.gradle b/android/templates/build/app.build.gradle
index 44f859dfa54..dcb91f38827 100644
--- a/android/templates/build/app.build.gradle
+++ b/android/templates/build/app.build.gradle
@@ -14,6 +14,7 @@ repositories {
android {
compileSdkVersion <%- compileSdkVersion %>
+ namespace '<%- applicationId %>'
defaultConfig {
applicationId '<%- applicationId %>'
minSdkVersion <%- minSdkVersion %>
@@ -35,8 +36,11 @@ android {
<% } %>
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+ buildFeatures {
+ buildConfig true
}
signingConfigs {
def tiKeystoreFilePath = <%- "'" + tiSdkAndroidDir.replace(/\\/g, '\\\\') + "/dev_keystore'" %>
diff --git a/android/templates/build/root.build.gradle b/android/templates/build/root.build.gradle
index c8b563a07cc..9ed2fe1d5c5 100644
--- a/android/templates/build/root.build.gradle
+++ b/android/templates/build/root.build.gradle
@@ -1,18 +1,27 @@
-
buildscript {
- ext.kotlin_version = '1.8.20'
+ ext.kotlin_version = '1.9.23'
repositories {
google()
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.0.4'
- classpath 'com.google.gms:google-services:4.3.10'
+ classpath 'com.android.tools.build:gradle:8.3.1'
+ classpath 'com.google.gms:google-services:4.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ <% for (let i = 0; i < classpaths.length; i++) {%>
+ classpath '<%= classpaths[i] %>'
+ <% } %>
}
}
+// Load the module developer's optional "root.build.gradle" file from "/android" directory.
+// This gradle file is expected to provide the module's "dependencies".
+def moduleRootBuildGradlePath = "${projectDir}/../root.build.gradle"
+if (file(moduleRootBuildGradlePath).exists()) {
+ apply from: moduleRootBuildGradlePath
+}
+
allprojects {
repositories {
google()
diff --git a/android/templates/build/ti.constants.gradle b/android/templates/build/ti.constants.gradle
index 503c2f006f1..6988acc5601 100644
--- a/android/templates/build/ti.constants.gradle
+++ b/android/templates/build/ti.constants.gradle
@@ -6,7 +6,8 @@
*/
project.ext {
- tiAndroidXAppCompatLibVersion = '1.6.1'
+ tiNdkVersion = '26.2.11394342'
+ tiAndroidXAppCompatLibVersion = '1.4.1'
tiAndroidXCoreLibVersion = '1.9.0'
tiAndroidXFragmentLibVersion = '1.5.7'
tiMaterialLibVersion = '1.6.1'
diff --git a/android/templates/module/default/template/android/manifest.ejs b/android/templates/module/default/template/android/manifest.ejs
index 0afbaac181a..b198ad393bc 100644
--- a/android/templates/module/default/template/android/manifest.ejs
+++ b/android/templates/module/default/template/android/manifest.ejs
@@ -15,4 +15,13 @@ name: <%- moduleName %>
moduleid: <%- moduleId %>
guid: <%- guid %>
platform: <%- platform %>
+#
+# Classpaths and plugins are used for android packages that requires them
+# to use them you have to add your classpaths and plugins comma separated
+# Ex:
+# classpaths: classpath1,classpath2
+# plugins: plugin1,plugin2
+#
+classpaths:
+plugins:
minsdk: <%- tisdkVersion %>
diff --git a/android/templates/module/default/template/android/root.build.gradle b/android/templates/module/default/template/android/root.build.gradle
new file mode 100644
index 00000000000..fa2361da412
--- /dev/null
+++ b/android/templates/module/default/template/android/root.build.gradle
@@ -0,0 +1,4 @@
+
+dependencies {
+ // Add the module's library root project dependencies here.
+}
diff --git a/android/templates/module/generated/build.gradle b/android/templates/module/generated/build.gradle
index 35106af223b..648bedebf4a 100644
--- a/android/templates/module/generated/build.gradle
+++ b/android/templates/module/generated/build.gradle
@@ -3,6 +3,9 @@ apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
+<% for(var i=0; i
+apply plugin: '<%= plugins[i] %>'
+<% } %>
repositories {
maven {
@@ -16,9 +19,10 @@ def tiModuleBindingsJsonPath = "${buildDir}/ti-generated/json/<%- moduleName %>.
android {
compileSdkVersion <%- compileSdkVersion %>
- ndkVersion '22.1.7171670'
+ namespace '<%- moduleId %>'
+ ndkVersion '26.2.11394342'
defaultConfig {
- minSdkVersion 19
+ minSdkVersion 21
targetSdkVersion <%- compileSdkVersion %>
versionName '<%- moduleVersion %>'
@@ -69,6 +73,9 @@ android {
abiFilters <%- "'" + moduleArchitectures.join("','") + "'" %>
}
}
+ buildFeatures {
+ buildConfig true
+ }
externalNativeBuild {
ndkBuild {
path "${projectDir}/src/main/jni/Android.mk"
@@ -124,11 +131,11 @@ android {
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
- jvmTarget = "11"
+ jvmTarget = "17"
}
// Exclude the C++ runtime and Titanium kroll libraries for all architectures when packaging the AAR file.
// Avoids app build failure due to library file name collision. (Apps will use "titanium.aar" bundled *.so files.)
@@ -157,10 +164,19 @@ preBuild.doFirst {
// Set up project to compile Java side before compiling the C/C++ side.
// We must do this because our "kroll-apt" Java annotation processor generates C++ source files.
project.afterEvaluate {
- externalNativeBuildDebug.dependsOn compileDebugJavaWithJavac
- externalNativeBuildRelease.dependsOn compileReleaseJavaWithJavac
- buildNdkBuildDebug.dependsOn compileDebugJavaWithJavac
- buildNdkBuildRelease.dependsOn compileReleaseJavaWithJavac
+ tasks.configureEach {
+ if (it.name == 'compileReleaseJavaWithJavac') {
+ externalNativeBuildRelease.mustRunAfter it
+ } else if (it.name == 'compileDebugJavaWithJavac') {
+ externalNativeBuildDebug.mustRunAfter it
+ } else if (it.name == 'buildNdkBuildRelease[armeabi-v7a]' || it.name == 'buildNdkBuildRelease[arm64-v8a]' || it.name == 'buildNdkBuildRelease[x86]' || it.name == 'buildNdkBuildRelease[x86_64]') {
+ it.mustRunAfter('compileReleaseJavaWithJavac')
+ } else if (it.name == 'buildNdkBuildDebug[armeabi-v7a]' || it.name == 'buildNdkBuildDebug[arm64-v8a]' || it.name == 'buildNdkBuildDebug[x86]' || it.name == 'buildNdkBuildDebug[x86_64]') {
+ it.mustRunAfter('compileDebugJavaWithJavac')
+ } else if (it.name == 'generateReleaseAssets') {
+ it.dependsOn generateReleaseRFile
+ }
+ }
}
// Hook into Java compile task.
@@ -178,7 +194,7 @@ tasks.withType(JavaCompile).configureEach {
environment 'TI_MODULE_GENERATED_JS_DIR', "${projectDir}/build/ti-generated/js"
environment 'TI_MODULE_ID', '<%- moduleId %>'
environment 'TI_MODULE_NAMESPACE', '<%- moduleId.toLowerCase() %>'
- environment 'TI_MODULE_TEMPLATE_DIR', '<%- tiSdkModuleTemplateDir.replace(/\\/g, '\\\\') %>'
+ environment 'TI_MODULE_TEMPLATE_DIR', '<%- tiSdkModuleTemplateDir.replace(/\\/g, ' \ \ \ \ ') %>'
executable = 'node'
workingDir = projectDir
args = ['generate-cpp-files.js']
diff --git a/android/titanium/AndroidManifest.xml b/android/titanium/AndroidManifest.xml
index 300b87bd3b2..98a8989b5f8 100644
--- a/android/titanium/AndroidManifest.xml
+++ b/android/titanium/AndroidManifest.xml
@@ -1,39 +1,40 @@
-
+
+
+ android:configChanges="${tiActivityConfigChanges}"
+ android:exported="false" />
+ android:exported="false"
+ android:theme="@style/Theme.AppDerived.Translucent" />
+ android:exported="false"
+ android:theme="@style/Theme.Titanium.Dark.Fullscreen" />
+ android:exported="false"
+ android:theme="@style/Theme.Titanium.Dark.Fullscreen" />
+ android:exported="false"
+ android:theme="@style/Theme.AppDerived.Fullscreen" />
+ android:exported="false" />
+ android:grantUriPermissions="true" />
diff --git a/android/titanium/build.gradle b/android/titanium/build.gradle
index 2e78280442e..c3078c48701 100644
--- a/android/titanium/build.gradle
+++ b/android/titanium/build.gradle
@@ -1,4 +1,5 @@
import com.android.build.gradle.tasks.ExternalNativeCleanTask
+import com.android.build.gradle.tasks.ExternalNativeBuildTask
import groovy.json.JsonSlurper
/**
@@ -11,6 +12,7 @@ import groovy.json.JsonSlurper
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
+
// Fetch Titanium version info to be applied to generated "BuildConfig" Java class and published AAR.
// Prefer environment variables assigned via build/package scripts under "titanium_mobile/build" folder.
def tiBuildVersionString = System.env.TI_SDK_BUILD_VERSION
@@ -41,8 +43,10 @@ for (nextString in tiBuildVersionString.split('\\.')) {
}
android {
- compileSdkVersion 33
+ ndkVersion project.ext.tiNdkVersion
+ namespace 'org.appcelerator.titanium'
defaultConfig {
+ compileSdk 33
minSdkVersion 21
targetSdkVersion 34
versionName tiBuildVersionString
@@ -58,8 +62,8 @@ android {
// Also have it produce a JSON file of all bindings to be used by module build system.
arguments = [
'kroll.outputJsonFilePath': "${projectDir}/../../dist/android/titanium.bindings.json".toString(),
- 'kroll.outputCppDirPath': "${projectDir}/../runtime/v8/generated".toString(),
- 'kroll.jsModuleName': 'titanium'
+ 'kroll.outputCppDirPath' : "${projectDir}/../runtime/v8/generated".toString(),
+ 'kroll.jsModuleName' : 'titanium'
]
}
}
@@ -72,6 +76,9 @@ android {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
+ buildFeatures {
+ buildConfig true
+ }
externalNativeBuild {
cmake {
version '3.22.1'
@@ -86,41 +93,36 @@ android {
"${projectDir}/../modules/ui/assets"
]
java.srcDirs = [
- 'src/java',
- "${projectDir}/../modules/accelerometer/src/java",
- "${projectDir}/../modules/analytics/src/java",
- "${projectDir}/../modules/android/src/java",
- "${projectDir}/../modules/app/src/java",
- "${projectDir}/../modules/calendar/src/java",
- "${projectDir}/../modules/contacts/src/java",
- "${projectDir}/../modules/database/src/java",
- "${projectDir}/../modules/filesystem/src/java",
- "${projectDir}/../modules/geolocation/src/java",
- "${projectDir}/../modules/gesture/src/java",
- "${projectDir}/../modules/locale/src/java",
- "${projectDir}/../modules/media/src/java",
- "${projectDir}/../modules/network/src/java",
- "${projectDir}/../modules/platform/src/java",
- "${projectDir}/../modules/ui/src/java",
- "${projectDir}/../modules/utils/src/java",
- "${projectDir}/../modules/xml/src/java",
- "${projectDir}/../runtime/common/src/java",
- "${projectDir}/../runtime/v8/src/java"
- ]
- jni.srcDirs = [
- "${projectDir}/../runtime/v8/src/native",
- "${projectDir}/../runtime/v8/src/native/modules",
- "${projectDir}/../runtime/v8/generated"
+ 'src/java',
+ "${projectDir}/../modules/accelerometer/src/java",
+ "${projectDir}/../modules/analytics/src/java",
+ "${projectDir}/../modules/android/src/java",
+ "${projectDir}/../modules/app/src/java",
+ "${projectDir}/../modules/calendar/src/java",
+ "${projectDir}/../modules/contacts/src/java",
+ "${projectDir}/../modules/database/src/java",
+ "${projectDir}/../modules/filesystem/src/java",
+ "${projectDir}/../modules/geolocation/src/java",
+ "${projectDir}/../modules/gesture/src/java",
+ "${projectDir}/../modules/locale/src/java",
+ "${projectDir}/../modules/media/src/java",
+ "${projectDir}/../modules/network/src/java",
+ "${projectDir}/../modules/platform/src/java",
+ "${projectDir}/../modules/ui/src/java",
+ "${projectDir}/../modules/utils/src/java",
+ "${projectDir}/../modules/xml/src/java",
+ "${projectDir}/../runtime/common/src/java",
+ "${projectDir}/../runtime/v8/src/java"
]
res.srcDirs = [
- 'res',
- "${projectDir}/../modules/ui/res"
+ 'res',
+ "${projectDir}/../modules/ui/res"
]
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
}
@@ -151,6 +153,7 @@ tasks.register('updateV8Library') {
}
}
}
+
preBuild.dependsOn updateV8Library
tasks.withType(ExternalNativeCleanTask).configureEach {
dependsOn updateV8Library
@@ -164,35 +167,17 @@ tasks.withType(Checkstyle).configureEach {
classpath = files()
source android.sourceSets.main.java.srcDirs
}
+
// Execute Checkstyle on all files
tasks.register('checkJavaStyle', Checkstyle) {
// include '**/*.java'
}
+
// Execute Checkstyle on all modified files
tasks.register('checkstyleChanged', Checkstyle) {
include getChangedFiles()
}
-// Used to strip the src dir prefixes from the changed java files
-def getChangedFiles() {
- if (!project.hasProperty('changedFiles')) {
- return new ArrayList<>()
- }
- def allFiles = project.changedFiles.split(',')
-
- // Remove the prefix
- List files = new ArrayList<>()
- for (file in allFiles) {
- def index = file.indexOf('src/java/')
- if (index != -1) {
- files.add(file.substring(index + 9))
- }
- }
-
- // Return the list of touched files
- files
-}
-
// Performs a transpile/polyfill/rollup of our "titanium_mobile/common/Resources" directory tree's JS files,
// takes a V8 snapshot of rolled-up files, and then generates a C++ header file of that snapshot to be compiled-in.
// Note: This supports incremental builds. Only executes when JS files change or snapshot output file is missing.
@@ -201,7 +186,7 @@ tasks.register('snapshotTiCommonFiles') {
inputs.file "${projectDir}/../../build/lib/builder.js"
inputs.file "${projectDir}/../../build/lib/android/index.js"
outputs.file "${projectDir}/../runtime/v8/generated/V8Snapshots.h"
- doLast {
+ doFirst {
exec {
executable = 'node'
workingDir = projectDir
@@ -210,15 +195,6 @@ tasks.register('snapshotTiCommonFiles') {
}
}
-// Set up project to compile Java side before compiling the C/C++ side.
-// We must do this because our "kroll-apt" Java annotation processor generates C++ source files.
-project.afterEvaluate {
- externalNativeBuildDebug.dependsOn compileDebugJavaWithJavac
- externalNativeBuildRelease.dependsOn compileReleaseJavaWithJavac
- buildCMakeDebug.dependsOn compileDebugJavaWithJavac
- buildCMakeRelWithDebInfo.dependsOn compileReleaseJavaWithJavac
-}
-
// Runs our "prebuild.js" script before the C/C++ compile, but after Java compile. (Mid-build script?)
// Generates C/C++ files providing our Android-only JS files via byte arrays.
tasks.withType(JavaCompile).configureEach {
@@ -233,6 +209,61 @@ tasks.withType(JavaCompile).configureEach {
}
}
+// Set up project to compile Java side before compiling the C/C++ side.
+// We must do this because our "kroll-apt" Java annotation processor generates C++ source files.
+project.afterEvaluate {
+ tasks.configureEach {
+ if (it.name == 'compileReleaseJavaWithJavac') {
+ externalNativeBuildRelease.mustRunAfter it
+ } else if (it.name == 'compileDebugJavaWithJavac') {
+ externalNativeBuildDebug.mustRunAfter it
+ } else if (it.name == 'buildCMakeRelWithDebInfo[armeabi-v7a]' || it.name == 'buildCMakeRelWithDebInfo[arm64-v8a]' || it.name == 'buildCMakeRelWithDebInfo[x86]' || it.name == 'buildCMakeRelWithDebInfo[x86_64]') {
+ it.mustRunAfter('compileReleaseJavaWithJavac')
+ } else if (it.name == 'buildCMakeDebug[armeabi-v7a]' || it.name == 'buildCMakeDebug[arm64-v8a]' || it.name == 'buildCMakeDebug[x86]' || it.name == 'buildCMakeDebug[x86_64]') {
+ it.mustRunAfter('compileDebugJavaWithJavac')
+ } else if (it.name == 'generateReleaseAssets') {
+ it.dependsOn generateReleaseRFile
+ }
+ }
+}
+
+tasks.withType(ExternalNativeBuildTask).configureEach {
+ it.mustRunAfter snapshotTiCommonFiles
+}
+
+tasks.withType(ExternalNativeCleanTask).configureEach {
+ dependsOn updateV8Library
+}
+
+// Checks our Java code against our style guidelines and for common coding mistakes using "checkstyle.xml".
+// Will trigger a build failure if any violations have been detected.
+// Customize all the Checkstyle tasks
+tasks.withType(Checkstyle).configureEach {
+ // Specify all files that should be checked
+ classpath = files()
+ source android.sourceSets.main.java.srcDirs
+}
+
+// Used to strip the src dir prefixes from the changed java files
+def getChangedFiles() {
+ if (!project.hasProperty('changedFiles')) {
+ return new ArrayList<>()
+ }
+ def allFiles = project.changedFiles.split(',')
+
+ // Remove the prefix
+ List files = new ArrayList<>()
+ for (file in allFiles) {
+ def index = file.indexOf('src/java/')
+ if (index != -1) {
+ files.add(file.substring(index + 9))
+ }
+ }
+
+ // Return the list of touched files
+ files
+}
+
clean.doLast {
// Delete generated C/C++ files.
project.delete file("${projectDir}/../runtime/v8/generated")
@@ -251,7 +282,7 @@ dependencies {
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.core:core:${project.ext.tiAndroidXCoreLibVersion}"
implementation 'androidx.drawerlayout:drawerlayout:1.2.0'
- implementation 'androidx.exifinterface:exifinterface:1.3.6'
+ implementation 'androidx.exifinterface:exifinterface:1.3.7'
implementation "androidx.fragment:fragment:${project.ext.tiAndroidXFragmentLibVersion}"
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
@@ -261,7 +292,7 @@ dependencies {
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
- implementation 'androidx.annotation:annotation:1.5.0'
+ implementation 'androidx.annotation:annotation:1.7.1'
// Google's "Material Components" themed UI library.
implementation "com.google.android.material:material:${project.ext.tiMaterialLibVersion}"
@@ -269,7 +300,7 @@ dependencies {
// The Google Play Services libraries are only used by Titanium's geolocation feature.
// We link to them dynamically at runtime. So, they can be safely excluded when in the app project.
implementation "com.google.android.gms:play-services-base:${project.ext.tiPlayServicesBaseLibVersion}"
- implementation 'com.google.android.gms:play-services-location:21.0.1'
+ implementation 'com.google.android.gms:play-services-location:21.2.0'
// XML library providing XPath support to our Ti.XML APIs.
implementation 'jaxen:jaxen:1.2.0'
@@ -329,6 +360,7 @@ publishing {
}
}
}
+
publish.doLast {
// After above publishing step, extract C/C++ "*.so" libraries from AAR to "./build/outputs/jniLibs" directory.
def jniLibsOutputDir = "${buildDir}/outputs/jniLibs"
diff --git a/android/untar.gradle b/android/untar.gradle
index 145bb23b4eb..20822112eb4 100644
--- a/android/untar.gradle
+++ b/android/untar.gradle
@@ -1,36 +1,36 @@
-/**
- * Titanium SDK
- * Copyright TiDev, Inc. 04/07/2022-Present
- * Licensed under the terms of the Apache Public License.
- * Please see the LICENSE included with this distribution for details.
- */
-
-// Extracts a "*.tar" file using the same parameters as the ant task.
-// Used by our prebuild step to extract our "libv8-*.tar.bz2" file.
-tasks.register('untar') {
- // Throw an error if required gradle property has not been set.
- if (!project.hasProperty('src')) {
- throw new InvalidUserDataException('You must set a "src" property.')
- }
-
- // Assign a default value to any unassigned properties.
- if (!project.hasProperty('compression')) {
- project.ext.compression = 'none'
- }
- if (!project.hasProperty('overwrite')) {
- project.ext.overwrite = 'true'
- }
- if (!project.hasProperty('dest')) {
- def sourceFile = new File(src)
- project.ext.dest = sourceFile.getParentFile().getPath()
- }
-
- // Use "ant" to extract the given tarball.
- ant.untar(
- compression: project.properties.compression,
- overwrite: project.properties.overwrite,
- src: project.properties.src,
- dest: project.properties.dest)
-}
-
-defaultTasks 'untar'
\ No newline at end of file
+/**
+ * Titanium SDK
+ * Copyright TiDev, Inc. 04/07/2022-Present
+ * Licensed under the terms of the Apache Public License.
+ * Please see the LICENSE included with this distribution for details.
+ */
+
+// Extracts a "*.tar" file using the same parameters as the ant task.
+// Used by our prebuild step to extract our "libv8-*.tar.bz2" file.
+tasks.register('untar') {
+ // Throw an error if required gradle property has not been set.
+ if (!project.hasProperty('src')) {
+ throw new InvalidUserDataException('You must set a "src" property.')
+ }
+
+ // Assign a default value to any unassigned properties.
+ if (!project.hasProperty('compression')) {
+ project.ext.compression = 'none'
+ }
+ if (!project.hasProperty('overwrite')) {
+ project.ext.overwrite = 'true'
+ }
+ if (!project.hasProperty('dest')) {
+ def sourceFile = new File(src)
+ project.ext.dest = sourceFile.getParentFile().getPath()
+ }
+
+ // Use "ant" to extract the given tarball.
+ ant.untar(
+ compression: project.properties.compression,
+ overwrite: project.properties.overwrite,
+ src: project.properties.src,
+ dest: project.properties.dest)
+}
+
+defaultTasks 'untar'
diff --git a/apidoc/Titanium/UI/ListView.yml b/apidoc/Titanium/UI/ListView.yml
index 5cbb58e0f68..b6ac0a46f03 100644
--- a/apidoc/Titanium/UI/ListView.yml
+++ b/apidoc/Titanium/UI/ListView.yml
@@ -648,7 +648,7 @@ events:
ipad: 5.4.0
properties:
- name: direction
- summary: Direction of the scroll either 'up', or 'down'.
+ summary: Direction of the scroll either 'up', 'down' or 'unknown'.
type: String
- name: velocity
diff --git a/apidoc/Titanium/UI/ScrollView.yml b/apidoc/Titanium/UI/ScrollView.yml
index 9121ebabc8d..ab0d72c79b9 100644
--- a/apidoc/Titanium/UI/ScrollView.yml
+++ b/apidoc/Titanium/UI/ScrollView.yml
@@ -198,6 +198,14 @@ events:
A dragging gesture is when a touch remains in contact with the display to physically drag
the view, as opposed to it being the result of scrolling momentum.
platforms: [android, iphone, ipad, macos]
+ properties:
+ - name: x
+ summary: X coordinate from the scrollable touch position.
+ type: Number
+
+ - name: y
+ summary: Y coordinate from the scrollable touch position.
+ type: Number
since: { iphone: "3.0.0", ipad: "3.0.0", android: "6.2.0" }
- name: dragend
@@ -213,6 +221,13 @@ events:
been released by the touch. If `false`, scrolling will stop immediately.
Is always `true` on Android.
type: Boolean
+ - name: x
+ summary: X coordinate from the scrollable touch position.
+ type: Number
+
+ - name: y
+ summary: Y coordinate from the scrollable touch position.
+ type: Number
since: { iphone: "3.0.0", ipad: "3.0.0", android: "6.2.0" }
properties:
diff --git a/apidoc/Titanium/UI/TableView.yml b/apidoc/Titanium/UI/TableView.yml
index 07837bbb172..6b53a579a52 100644
--- a/apidoc/Titanium/UI/TableView.yml
+++ b/apidoc/Titanium/UI/TableView.yml
@@ -453,7 +453,7 @@ events:
since: { android: "2.1.0", iphone: "2.1.0", ipad: "2.1.0" }
properties:
- name: direction
- summary: Direction of the swipe, either `left` or `right`.
+ summary: Direction of the swipe, either `left`, `right` or `unknown`.
type: String
- name: index
diff --git a/build/lib/test/test.js b/build/lib/test/test.js
index beb51094541..81392c1f4ef 100644
--- a/build/lib/test/test.js
+++ b/build/lib/test/test.js
@@ -315,7 +315,7 @@ async function addTiAppProperties() {
} else if (line.indexOf('') >= 0) {
content.pop();
content.push('\t\tfalse');
- // Grab contents of modules/modules.xml to inject as moduel listing for tiapp.xml
+ // Grab contents of modules/modules.xml to inject as module listing for tiapp.xml
// This allows PR to override
} else if (line.indexOf('') >= 0) {
// remove open tag
diff --git a/iphone/Classes/TiUIListView.m b/iphone/Classes/TiUIListView.m
index ae821bb0393..6a570920fc3 100644
--- a/iphone/Classes/TiUIListView.m
+++ b/iphone/Classes/TiUIListView.m
@@ -24,6 +24,7 @@ @interface TiUIListView ()
@property (nonatomic, readonly) TiUIListViewProxy *listViewProxy;
@property (nonatomic, copy, readwrite) NSString *searchString;
@property (nonatomic, copy, readwrite) NSString *searchedString;
+@property (nonatomic, assign) CGFloat lastContentOffset;
@end
static TiViewProxy *FindViewProxyWithBindIdContainingPoint(UIView *view, CGPoint point);
@@ -79,8 +80,8 @@ @implementation TiUIListView {
BOOL isSearched;
UIView *dimmingView;
BOOL isSearchBarInNavigation;
- int lastVisibleItem;
- int lastVisibleSection;
+ NSInteger lastVisibleItem;
+ NSInteger lastVisibleSection;
BOOL forceUpdates;
}
@@ -2011,6 +2012,15 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
TiUIListSectionProxy *section;
CGFloat topSpacing = scrollView.contentOffset.y + scrollView.adjustedContentInset.top;
+ NSString *direction = @"unknown";
+
+ if (self.lastContentOffset > scrollView.contentOffset.y) {
+ direction = @"down";
+ } else if (self.lastContentOffset < scrollView.contentOffset.y) {
+ direction = @"up";
+ }
+ self.lastContentOffset = scrollView.contentOffset.y;
+
if ([indexPaths count] > 0) {
NSIndexPath *indexPath = [self pathForSearchPath:[indexPaths objectAtIndex:0]];
NSUInteger visibleItemCount = [indexPaths count];
@@ -2022,6 +2032,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
[eventArgs setValue:section forKey:@"firstVisibleSection"];
[eventArgs setValue:[section itemAtIndex:[indexPath row]] forKey:@"firstVisibleItem"];
[eventArgs setValue:NUMINTEGER(topSpacing) forKey:@"top"];
+ [eventArgs setValue:direction forKey:@"direction"];
if (lastVisibleItem != [indexPath row] || lastVisibleSection != [indexPath section] || forceUpdates) {
// only log if the item changes or forced
@@ -2038,6 +2049,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
[eventArgs setValue:section forKey:@"firstVisibleSection"];
[eventArgs setValue:NUMINTEGER(-1) forKey:@"firstVisibleItem"];
[eventArgs setValue:NUMINTEGER(topSpacing) forKey:@"top"];
+ [eventArgs setValue:direction forKey:@"direction"];
}
});
}
@@ -2110,7 +2122,7 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
if ([[self proxy] _hasListeners:@"scrolling"]) {
- NSString *direction = nil;
+ NSString *direction = @"unknown";
if (velocity.y > 0) {
direction = @"up";
diff --git a/iphone/Classes/TiUIScrollViewProxy.m b/iphone/Classes/TiUIScrollViewProxy.m
index 33f75a7fa79..ae16566b8e1 100644
--- a/iphone/Classes/TiUIScrollViewProxy.m
+++ b/iphone/Classes/TiUIScrollViewProxy.m
@@ -430,23 +430,36 @@ - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)vi
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
+ CGPoint offset = [scrollView contentOffset];
+ NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
+ NUMFLOAT(offset.x), @"x",
+ NUMFLOAT(offset.y), @"y",
+ NUMBOOL([scrollView isDecelerating]), @"decelerating",
+ [TiUtils sizeToDictionary:scrollView.contentSize], @"contentSize",
+ nil];
if ([self _hasListeners:@"dragStart"]) { // TODO: Deprecate old event
- [self fireEvent:@"dragStart" withObject:nil];
+ [self fireEvent:@"dragStart" withObject:dict];
}
if ([self _hasListeners:@"dragstart"]) {
- [self fireEvent:@"dragstart" withObject:nil];
+ [self fireEvent:@"dragstart" withObject:dict];
}
}
// listerner which tells when dragging ended in the scroll view.
-
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
+ CGPoint offset = [scrollView contentOffset];
+ NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
+ NUMFLOAT(offset.x), @"x",
+ NUMFLOAT(offset.y), @"y",
+ [NSNumber numberWithBool:decelerate], @"decelerate", nil,
+ [TiUtils sizeToDictionary:scrollView.contentSize], @"contentSize",
+ nil];
if ([self _hasListeners:@"dragEnd"]) { // TODO: Deprecate old event
- [self fireEvent:@"dragEnd" withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:decelerate], @"decelerate", nil]];
+ [self fireEvent:@"dragEnd" withObject:dict];
}
if ([self _hasListeners:@"dragend"]) {
- [self fireEvent:@"dragend" withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:decelerate], @"decelerate", nil]];
+ [self fireEvent:@"dragend" withObject:dict];
}
}
diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/KrollModule.h b/iphone/TitaniumKit/TitaniumKit/Sources/API/KrollModule.h
index 2dbfa4541c4..7ab4a7198c2 100644
--- a/iphone/TitaniumKit/TitaniumKit/Sources/API/KrollModule.h
+++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/KrollModule.h
@@ -23,7 +23,7 @@
/**
* @param moduleID is assumed to be the module name (classname with the "Module" suffix stripped off) - i.e. "UI", "App", "Media"
* We will generate the full class name from the moduleID: "UI" => "UIModule", "com.appcelerator.urlSession" => "ComAppceleratorUrlSessionModule"
- * @return TiModule* or ObjcProxy* based on whether the module is an older style proxy moduel or a new Obj-C JSC API style (currently only 1st party in-SDK code)
+ * @return TiModule* or ObjcProxy* based on whether the module is an older style proxy module or a new Obj-C JSC API style (currently only 1st party in-SDK code)
*/
+ (id)loadCoreModule:(NSString *)moduleID inContext:(JSContext *)jsContext;
diff --git a/iphone/cli/hooks/run.js b/iphone/cli/hooks/run.js
index ec41e90b7c6..1c06ac6605d 100644
--- a/iphone/cli/hooks/run.js
+++ b/iphone/cli/hooks/run.js
@@ -75,7 +75,11 @@ exports.init = function (logger, config, cli) {
}
// ignore logs from cli ignoreLog
- if (ignoreLog.some(ignoreItem => line.includes(ignoreItem))) {
+ if (typeof ignoreLog === 'string') {
+ if (line.includes(ignoreLog)) {
+ return;
+ }
+ } else if (ignoreLog.some(ignoreItem => line.includes(ignoreItem))) {
return;
}
diff --git a/iphone/package.json b/iphone/package.json
index 3b69c0d0dad..a9697c57543 100644
--- a/iphone/package.json
+++ b/iphone/package.json
@@ -1,9 +1,9 @@
{
"name": "titanium-mobile-ios",
"title": "iOS",
- "description": "Titanium SDK iOS",
+ "description": "Titanium iOS SDK",
"keywords": [
- "appcelerator",
+ "tidev",
"titanium",
"mobile",
"ios",
@@ -15,8 +15,8 @@
"minIosVersion": "13.0",
"minWatchosVersion": "6.0",
"vendorDependencies": {
- "xcode": ">=12.0 <=14.x",
- "ios sdk": ">=13.0 <=16.x"
+ "xcode": ">=12.0 <=16.x",
+ "ios sdk": ">=13.0 <=18.x"
},
"engines": {
"node": ">=16.0.0"
diff --git a/maintainer-docs/ci-setup.md b/maintainer-docs/ci-setup.md
index 301c661927c..046b736f9e9 100644
--- a/maintainer-docs/ci-setup.md
+++ b/maintainer-docs/ci-setup.md
@@ -73,7 +73,7 @@ For example:
- name: Android build
uses: ./.github/actions/build-android
with:
- node-version: '16.x'
+ node-version: '20.x'
java-version: '11'
```
@@ -89,7 +89,7 @@ For example:
- name: iOS build
uses: ./.github/actions/build-ios
with:
- node-version: '16.x'
+ node-version: '20.x'
```
### Package
@@ -104,7 +104,7 @@ For example:
- name: Package
uses: ./.github/actions/package
with:
- node-version: '16.x'
+ node-version: '20.x'
java-version: '11'
vtag: ${{ env.vtag }}
```
diff --git a/package-lock.json b/package-lock.json
index 97000a2d7b1..3d7b346a791 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -25,7 +25,7 @@
"ejs": "3.1.9",
"fields": "0.1.24",
"fs-extra": "11.2.0",
- "ioslib": "1.7.37",
+ "ioslib": "1.7.39",
"liveview": "1.5.6",
"lodash.merge": "4.6.2",
"markdown": "0.5.0",
@@ -8822,10 +8822,9 @@
}
},
"node_modules/ioslib": {
- "version": "1.7.37",
- "resolved": "https://registry.npmjs.org/ioslib/-/ioslib-1.7.37.tgz",
- "integrity": "sha512-D4SrH3QocN2GBlzSBcv9V1WKpmcOVUk3F6rjHafWXtrAFs7ZrsPtyR0nA4t1ubqjOYwkTZLgMliEUrs5bpfqXQ==",
- "license": "Apache-2.0",
+ "version": "1.7.39",
+ "resolved": "https://registry.npmjs.org/ioslib/-/ioslib-1.7.39.tgz",
+ "integrity": "sha512-pe97cEv+6iABzP5lCLC1JELH77acunEvSxKl4YG+xLL4PqpRnNOaqKfp6omjpFJMLAHBo1CuOIUL5tk2gkYjLA==",
"dependencies": {
"always-tail": "0.2.0",
"async": "^3.2.4",
@@ -22726,9 +22725,9 @@
}
},
"ioslib": {
- "version": "1.7.37",
- "resolved": "https://registry.npmjs.org/ioslib/-/ioslib-1.7.37.tgz",
- "integrity": "sha512-D4SrH3QocN2GBlzSBcv9V1WKpmcOVUk3F6rjHafWXtrAFs7ZrsPtyR0nA4t1ubqjOYwkTZLgMliEUrs5bpfqXQ==",
+ "version": "1.7.39",
+ "resolved": "https://registry.npmjs.org/ioslib/-/ioslib-1.7.39.tgz",
+ "integrity": "sha512-pe97cEv+6iABzP5lCLC1JELH77acunEvSxKl4YG+xLL4PqpRnNOaqKfp6omjpFJMLAHBo1CuOIUL5tk2gkYjLA==",
"requires": {
"always-tail": "0.2.0",
"async": "^3.2.4",
diff --git a/package.json b/package.json
index 57779acbd5f..e9575c117c4 100644
--- a/package.json
+++ b/package.json
@@ -100,7 +100,7 @@
"ejs": "3.1.9",
"fields": "0.1.24",
"fs-extra": "11.2.0",
- "ioslib": "1.7.37",
+ "ioslib": "1.7.39",
"liveview": "1.5.6",
"lodash.merge": "4.6.2",
"markdown": "0.5.0",
diff --git a/support/module/packaged/modules.json b/support/module/packaged/modules.json
index 2d69caef138..9c7bb9c9a84 100644
--- a/support/module/packaged/modules.json
+++ b/support/module/packaged/modules.json
@@ -54,8 +54,8 @@
"commonjs": {},
"hyperloop": {
"hyperloop": {
- "url": "https://github.com/tidev/hyperloop.next/releases/download/v7.0.6/hyperloop-7.0.6.zip",
- "integrity": "sha512-ZHmm7GINiCyrjvNMn232G1Tkby6PhwsmSxPZlPNDWH4jRn6iCpjIqX1Ha12MBedma01a4hlvARLaiUQ9j3SPow=="
+ "url": "https://github.com/tidev/hyperloop.next/releases/download/v7.0.7/hyperloop-7.0.7.zip",
+ "integrity": "sha512-+CF+1G1ClJZrY4VzrZMUCX37JT/tSGvnWWUXouiAtd6WLlPPvUI+Q7ytNoTm/q/g/hPwiiV6qzV9Rgm61qsXOg=="
}
}
}