diff --git a/android/cli/commands/_build.js b/android/cli/commands/_build.js index 052395b4446..e2b784efec0 100644 --- a/android/cli/commands/_build.js +++ b/android/cli/commands/_build.js @@ -410,7 +410,7 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) { // if there are no devices/emulators, error if (!Object.keys(opts).length) { if (cli.argv.target === 'device') { - logger.warn(__('Unable to find any devices, possibily due to missing dependencies.') + '\n'); + logger.warn(__('Unable to find any devices, possibly due to missing dependencies.') + '\n'); logger.log(__('Continuing with build... (will attempt to install missing dependencies)') + '\n'); } else { logger.warn(__('Unable to find any emulators, possibily due to missing dependencies.') + '\n'); @@ -756,7 +756,7 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) { return callback(new Error(msg)); } - // empty the alias array. it is important that we don't destory the original + // empty the alias array. it is important that we don't destroy the original // instance since it was passed by reference to the alias select list while (_t.keystoreAliases.length) { _t.keystoreAliases.pop(); @@ -1101,7 +1101,7 @@ AndroidBuilder.prototype.validate = function validate(logger, config, cli) { } // we need to translate the sdk to a real api level (i.e. L => 20, MNC => 22) so that - // we can valiate them + // we can validate them function getRealAPILevel(ver) { return (ver && targetSDKMap[ver] && targetSDKMap[ver].sdk) || ver; } @@ -1462,7 +1462,7 @@ AndroidBuilder.prototype.validate = function validate(logger, config, cli) { process.exit(1); } - // For CommonJS modules, verfiy we can find the main script to be loaded by require() method. + // For CommonJS modules, verify we can find the main script to be loaded by require() method. if (!module.native) { // Look for legacy ".js" script file first. let jsFilePath = path.join(module.modulePath, module.id + '.js'); @@ -1541,7 +1541,7 @@ AndroidBuilder.prototype.run = async function run(logger, config, cli, finished) // Notify plugins that we're about to begin. await new Promise(resolve => cli.emit('build.pre.construct', this, resolve)); - // Post build anlytics. + // Post build analytics. await this.doAnalytics(); // Initialize build system. Checks if we need to do a clean or incremental build. @@ -1956,7 +1956,7 @@ AndroidBuilder.prototype.checkIfShouldForceRebuild = function checkIfShouldForce } if (this.activitiesHash !== manifest.activitiesHash) { - this.logger.info(__('Forcing rebuild: Android activites in tiapp.xml changed since last build')); + this.logger.info(__('Forcing rebuild: Android activities in tiapp.xml changed since last build')); this.logger.info(' ' + __('Was: %s', manifest.activitiesHash)); this.logger.info(' ' + __('Now: %s', this.activitiesHash)); return true; @@ -2143,7 +2143,7 @@ AndroidBuilder.prototype.processLibraries = async function processLibraries() { } // Check if the module has a maven repository directory. - // If it does, then we can leverage gradle/maven's depency management system. + // If it does, then we can leverage gradle/maven's dependency management system. let dependencyString = null; const repositoryDirPath = path.join(nextModule.modulePath, 'm2repository'); if (await fs.exists(repositoryDirPath)) { @@ -2198,7 +2198,7 @@ AndroidBuilder.prototype.generateRootProjectFiles = async function generateRootP gradleProperties.push({ key: 'org.gradle.jvmargs', value: `-Xmx${this.javacMaxMemory}` }); await gradlew.writeGradlePropertiesFile(gradleProperties); - // Copy optional "gradle.properties" file contents from Titainum project to the above generated file. + // Copy optional "gradle.properties" file contents from Titanium project to the above generated file. // These properties must be copied to the end of the file so that they can override Titanium's default properties. const customGradlePropertiesFilePath = path.join(this.projectDir, 'platform', 'android', 'gradle.properties'); if (await fs.exists(customGradlePropertiesFilePath)) { diff --git a/android/cli/commands/_buildModule.js b/android/cli/commands/_buildModule.js index 71d41a8d499..30e6f003cf5 100644 --- a/android/cli/commands/_buildModule.js +++ b/android/cli/commands/_buildModule.js @@ -65,7 +65,7 @@ AndroidModuleBuilder.prototype.migrate = async function migrate() { isApiVersionUpdateRequired = (this.manifest.apiversion !== cliModuleAPIVersion); } - // Determin if the "manifest" file's "minsdk" needs updating. + // Determine if the "manifest" file's "minsdk" needs updating. // As of Titanium 9.0.0, modules are built as AARs to an "m2repository". Not supported on older Titanium versions. let isMinSdkUpdateRequired = false; const minSupportedSdkVersionMajorNumber = 9; @@ -860,7 +860,7 @@ AndroidModuleBuilder.prototype.runModule = async function (cli) { await fs.mkdirs(tmpDir); // Generate a new Titanium app in the temp directory which we'll later copy the "example" files to. - // Note: App must have a diffentent id/package-name. Avoids class name collision with module generating Java code. + // Note: App must have a different id/package-name. Avoids class name collision with module generating Java code. this.logger.debug(__('Staging module project at %s', tmpDir.cyan)); await runTiCommand( process.execPath, diff --git a/android/cli/hooks/run.js b/android/cli/hooks/run.js index af2a72d81ec..b8b2e07ef06 100644 --- a/android/cli/hooks/run.js +++ b/android/cli/hooks/run.js @@ -262,7 +262,7 @@ exports.init = function (logger, config, cli) { line = line.replace(/^\w\/(\w+)\s*:/g, '$1:').grey; } line = deviceName + line; - // if it begins with something like "E/SQLiteLog( 1659):" it's not a contination, don't log it. + // if it begins with something like "E/SQLiteLog( 1659):" it's not a continuation, don't log it. } else if (nonTiLogRegexp.test(line)) { return; } diff --git a/android/cli/lib/android-manifest.js b/android/cli/lib/android-manifest.js index 888e7ee7dd9..fec4761eca7 100644 --- a/android/cli/lib/android-manifest.js +++ b/android/cli/lib/android-manifest.js @@ -711,7 +711,7 @@ function isElementNode(node) { * @param {Object} node The XML node object to check. Can be null/undefined. * @returns {Boolean} * Returns true if given node is text between XLM elements or attributes. - * Returns false if not or given an invalild argument. + * Returns false if not or given an invalid argument. * @private */ function isTextNode(node) { diff --git a/android/cli/lib/gradle-wrapper.js b/android/cli/lib/gradle-wrapper.js index 8668a2a1393..0cc8e60a064 100644 --- a/android/cli/lib/gradle-wrapper.js +++ b/android/cli/lib/gradle-wrapper.js @@ -174,7 +174,7 @@ class GradleWrapper { } // Function which returns a stdout/stderr "data" reading function object and outputs it to given "logFunction". - // The "logFunction" argument is expected to be a "logger" object that conatins "logger.info" or "logger.error". + // The "logFunction" argument is expected to be a "logger" object that contains "logger.info" or "logger.error". // The "logType" is a string "error" or "info" to call the correct logger function const createReadableDataHandlerUsing = (logFunction, logType) => { let stringBuffer = ''; diff --git a/android/cli/locales/en.js b/android/cli/locales/en.js index a6bcb0a91f6..5537438a580 100644 --- a/android/cli/locales/en.js +++ b/android/cli/locales/en.js @@ -208,7 +208,7 @@ "Forcing rebuild: Android minimum SDK changed since last build": "Forcing rebuild: Android minimum SDK changed since last build", "Forcing rebuild: Android target SDK changed since last build": "Forcing rebuild: Android target SDK changed since last build", "Forcing rebuild: tiapp.xml properties changed since last build": "Forcing rebuild: tiapp.xml properties changed since last build", - "Forcing rebuild: Android activites in tiapp.xml changed since last build": "Forcing rebuild: Android activites in tiapp.xml changed since last build", + "Forcing rebuild: Android activities in tiapp.xml changed since last build": "Forcing rebuild: Android activites in tiapp.xml changed since last build", "Forcing rebuild: Android services in tiapp.xml SDK changed since last build": "Forcing rebuild: Android services in tiapp.xml SDK changed since last build", "Forcing rebuild: One or more JSS files changed since last build": "Forcing rebuild: One or more JSS files changed since last build", "Forcing rebuild: mergeCustomAndroidManifest config has changed since last build": "Forcing rebuild: mergeCustomAndroidManifest config has changed since last build", diff --git a/android/debugger.md b/android/debugger.md index 44f2d81bc3a..4cb90a59e99 100644 --- a/android/debugger.md +++ b/android/debugger.md @@ -52,7 +52,7 @@ That simply places the message in a queue. One of the two threads spun up after ### Handling messages coming from the Debugger -The second thread spun up after a connection is made simply reads lines from the debugger's stream and does very basic parsing of the message. Once the headers are stripped, we grab the JSON body and call down into C++ to do a V8::Debug::SendCommand to give the command to V8. +The second thread spun up after a connection is made simply reads lines from the debuggers stream and does very basic parsing of the message. Once the headers are stripped, we grab the JSON body and call down into C++ to do a V8::Debug::SendCommand to give the command to V8. The next step is to call V8::Debug::ProcessDebugMessages(). We do so indirectly by using a Handler.post(Runnable) to ensure this gets called on the main thread. 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 58a6ad271cc..e97abe907c0 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 @@ -210,7 +210,7 @@ protected void initialize() } properties = (Map) JSONValue.parseWithException(new FileReader(jsonPath)); - debug("Succesfully loaded existing binding data: " + jsonPath); + debug("Successfully loaded existing binding data: " + jsonPath); } catch (Exception e) { // file doesn't exist, we'll just create it later debug("No binding data found, creating new data file: %s/%s", this.jarJsonPackageName, diff --git a/android/modules/android/src/java/ti/modules/titanium/android/AndroidModule.java b/android/modules/android/src/java/ti/modules/titanium/android/AndroidModule.java index ff99dade02d..947cc59cde4 100644 --- a/android/modules/android/src/java/ti/modules/titanium/android/AndroidModule.java +++ b/android/modules/android/src/java/ti/modules/titanium/android/AndroidModule.java @@ -561,7 +561,7 @@ public void onDisposing(KrollRuntime runtime) // Remove this listener from the runtime's static collection. KrollRuntime.removeOnDisposingListener(this); - // Unregister all currently registerd broadcast receviers. + // Unregister all currently registered broadcast receivers. // They can no longer be handled by the terminating JavaScript runtime. while (registeredBroadcastReceiverProxyList.isEmpty() == false) { unregisterBroadcastReceiver(registeredBroadcastReceiverProxyList.pollFirst()); diff --git a/android/modules/database/src/java/ti/modules/titanium/database/DatabaseModule.java b/android/modules/database/src/java/ti/modules/titanium/database/DatabaseModule.java index 43a984a20ed..434ea620543 100644 --- a/android/modules/database/src/java/ti/modules/titanium/database/DatabaseModule.java +++ b/android/modules/database/src/java/ti/modules/titanium/database/DatabaseModule.java @@ -73,7 +73,7 @@ public TiDatabaseProxy open(Object file) throw new IllegalArgumentException("Ti.Database.open() was given invalid URL: " + fileString); } } else { - // Assume we were given a databas file name only. (This is the most common case.) + // Assume we were given a database file name only. (This is the most common case.) dbName = fileString; } } else if (file != null) { diff --git a/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/GeolocationModule.java b/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/GeolocationModule.java index caaf7f4473e..b43d22f214e 100644 --- a/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/GeolocationModule.java +++ b/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/GeolocationModule.java @@ -392,7 +392,7 @@ protected void eventListenerAdded(String event, int count, KrollProxy proxy) // FIXME: Why can't we just track some boolean flag for this? if (currentPositionCallback.size() == 0) { HashMap locationProviders = simpleLocationProviders; - // FIXME: why does this differ from how we enable in getCurrentPostion()? + // FIXME: why does this differ from how we enable in getCurrentPosition()? if (getManualMode()) { locationProviders = androidModule.manualLocationProviders; } diff --git a/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/android/LocationProviderProxy.java b/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/android/LocationProviderProxy.java index 10f27aa0371..6dab8970620 100644 --- a/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/android/LocationProviderProxy.java +++ b/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/android/LocationProviderProxy.java @@ -181,7 +181,7 @@ public String getName() if (property == null) { Log.e(TAG, "No name found for location provider"); - return ""; // this shouldnt be possible + return ""; // this shouldn't be possible } return (String) property; diff --git a/android/modules/gesture/src/java/ti/modules/titanium/gesture/TiDeviceOrientationMonitor.java b/android/modules/gesture/src/java/ti/modules/titanium/gesture/TiDeviceOrientationMonitor.java index f67ce2f0989..aaabed786a4 100644 --- a/android/modules/gesture/src/java/ti/modules/titanium/gesture/TiDeviceOrientationMonitor.java +++ b/android/modules/gesture/src/java/ti/modules/titanium/gesture/TiDeviceOrientationMonitor.java @@ -82,7 +82,7 @@ public TiDeviceOrientationMonitor(Handler handler) if (value instanceof SensorManager) { this.sensorManager = (SensorManager) value; } else { - Log.w(TAG, "Unable to aquire SensorManager."); + Log.w(TAG, "Unable to acquire SensorManager."); } // Create an event handler for the Android "OrientationEventListener". @@ -370,7 +370,7 @@ public void onSensorChanged(SensorEvent event) break; } - // Do not continue if the device rotation matrix has not been udpated above. + // Do not continue if the device rotation matrix has not been updated above. if (!wasRotationMatrixUpdated) { return; } diff --git a/android/modules/locale/src/java/ti/modules/titanium/locale/CollatorProxy.java b/android/modules/locale/src/java/ti/modules/titanium/locale/CollatorProxy.java index df41a8005dc..009a389bdc3 100644 --- a/android/modules/locale/src/java/ti/modules/titanium/locale/CollatorProxy.java +++ b/android/modules/locale/src/java/ti/modules/titanium/locale/CollatorProxy.java @@ -55,7 +55,7 @@ public void handleCreationDict(KrollDict properties) options = new KrollDict(); } - // Determine the collatior setting we need to use. + // Determine the collator setting we need to use. int strengthId; int decompositionId = Collator.CANONICAL_DECOMPOSITION; this.isStrippingAccents = false; diff --git a/android/modules/locale/src/java/ti/modules/titanium/locale/DateTimeFormatProxy.java b/android/modules/locale/src/java/ti/modules/titanium/locale/DateTimeFormatProxy.java index b60eff0d305..720e03220ae 100644 --- a/android/modules/locale/src/java/ti/modules/titanium/locale/DateTimeFormatProxy.java +++ b/android/modules/locale/src/java/ti/modules/titanium/locale/DateTimeFormatProxy.java @@ -121,7 +121,7 @@ public void handleCreationDict(KrollDict properties) String dateStyleStringId = TiConvert.toString(options.get("dateStyle")); String timeStyleStringId = TiConvert.toString(options.get("timeStyle")); - // Determine if at least 1 "date" componoent has been configured. + // Determine if at least 1 "date" component has been configured. boolean hasCustomDateSettings = (weekdayFormatId != null) || (eraFormatId != null) @@ -129,7 +129,7 @@ public void handleCreationDict(KrollDict properties) || (monthFormatId != null) || (dayFormatId != null); - // Determine if at least 1 "time" componoent has been configured. + // Determine if at least 1 "time" component has been configured. boolean hasCustomTimeSettings = (hourFormatId != null) || (minuteFormatId != null) @@ -315,7 +315,7 @@ public KrollDict[] formatToParts(Date value) index = endIndex; } - // Add the substring part enttry to the collection. + // Add the substring part entry to the collection. KrollDict entry = new KrollDict(); entry.put(TiC.PROPERTY_TYPE, typeName); entry.put(TiC.PROPERTY_VALUE, substring); diff --git a/android/modules/media/src/java/ti/modules/titanium/media/AudioPlayerProxy.java b/android/modules/media/src/java/ti/modules/titanium/media/AudioPlayerProxy.java index 0fedb405717..58bc45f48a9 100644 --- a/android/modules/media/src/java/ti/modules/titanium/media/AudioPlayerProxy.java +++ b/android/modules/media/src/java/ti/modules/titanium/media/AudioPlayerProxy.java @@ -64,7 +64,7 @@ public AudioPlayerProxy() { super(); - // TODO - we shouldnt need this as this proxy is created only from the runtime - double check + // TODO - we shouldn't need this as this proxy is created only from the runtime - double check // TODO this needs to happen post-set //((TiBaseActivity)getActivity()).addOnLifecycleEventListener(this); diff --git a/android/modules/media/src/java/ti/modules/titanium/media/MediaModule.java b/android/modules/media/src/java/ti/modules/titanium/media/MediaModule.java index 36f2a4fe516..306c99ed35a 100644 --- a/android/modules/media/src/java/ti/modules/titanium/media/MediaModule.java +++ b/android/modules/media/src/java/ti/modules/titanium/media/MediaModule.java @@ -1700,6 +1700,7 @@ public void switchCamera(int whichCamera) Log.e(TAG, "Camera preview is not open, unable to switch camera."); return; } + activity.switchCamera(whichCamera); } } diff --git a/android/modules/media/src/java/ti/modules/titanium/media/VideoPlayerProxy.java b/android/modules/media/src/java/ti/modules/titanium/media/VideoPlayerProxy.java index 7e3c54c74bc..f7fd67028c4 100644 --- a/android/modules/media/src/java/ti/modules/titanium/media/VideoPlayerProxy.java +++ b/android/modules/media/src/java/ti/modules/titanium/media/VideoPlayerProxy.java @@ -761,7 +761,7 @@ public void onDestroy(Activity activity) fireComplete(MediaModule.VIDEO_FINISH_REASON_USER_EXITED); } - // Cancel any Thumbnail requests and releasing TiMediaMetadataRetriver resource + // Cancel any Thumbnail requests and releasing TiMediaMetadataRetriever resource cancelAllThumbnailImageRequests(); } @@ -793,7 +793,7 @@ public void cancelAllThumbnailImageRequests() /** * Convenience method for creating a response handler that is used when getting a - * bitmmap. + * bitmap. * * @param callback Javascript function that the response handler will invoke * once the bitmap response is ready diff --git a/android/modules/network/src/java/ti/modules/titanium/network/socket/TCPProxy.java b/android/modules/network/src/java/ti/modules/titanium/network/socket/TCPProxy.java index ef500b4b799..0037dc40031 100644 --- a/android/modules/network/src/java/ti/modules/titanium/network/socket/TCPProxy.java +++ b/android/modules/network/src/java/ti/modules/titanium/network/socket/TCPProxy.java @@ -449,7 +449,7 @@ public void close() throws IOException } catch (Exception e) { e.printStackTrace(); - throw new IOException("Error occured when closing socket"); + throw new IOException("Error occurred when closing socket"); } } diff --git a/android/modules/platform/src/java/ti/modules/titanium/platform/PlatformModule.java b/android/modules/platform/src/java/ti/modules/titanium/platform/PlatformModule.java index da68156e563..b83a70af2b1 100644 --- a/android/modules/platform/src/java/ti/modules/titanium/platform/PlatformModule.java +++ b/android/modules/platform/src/java/ti/modules/titanium/platform/PlatformModule.java @@ -259,7 +259,7 @@ public boolean openURL(KrollInvocation invocation, String url, @Kroll.argument(optional = true) Object arg2, @Kroll.argument(optional = true) Object arg3) { // If given an optional callback, then call this method recursively without the callback. - // Note: We might also receieve an optional KrollDict argument. This is iOS only and should be ignored. + // Note: We might also receive an optional KrollDict argument. This is iOS only and should be ignored. KrollFunction callback = null; if (arg2 instanceof KrollFunction) { callback = (KrollFunction) arg2; @@ -471,7 +471,7 @@ private synchronized List getProcessors() // TODO Sort processors by index, fill in model name by preceding if unknown } catch (IOException ex) { - // somethign went wrong, create "default" set of processors? + // something went wrong, create "default" set of processors? this.processors = new ArrayList<>(processorCount); for (int i = 0; i < processorCount; i++) { this.processors.add(Processor.unknown(i)); diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/TableViewRowProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/TableViewRowProxy.java index bda1ac7ac0f..04781c1de63 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/TableViewRowProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/TableViewRowProxy.java @@ -234,7 +234,7 @@ public void setHolder(TableViewHolder holder) /** * Override getRect() to amend dimensions. * - * @return Dictinary of view dimensions. + * @return Dictionary of view dimensions. */ @Override public KrollDict getRect() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiSwipeRefreshLayout.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiSwipeRefreshLayout.java index c525cf4478b..4459cc9e422 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiSwipeRefreshLayout.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiSwipeRefreshLayout.java @@ -93,8 +93,8 @@ public void setSwipeRefreshEnabled(boolean value) * Updates this view's width and height based on the given width and height constraints. *

* Given arguments size and size mode can be extracted by the Android "View.MeasureSpec" class. - * @param widthMeasureSpec Provides the parent's width contraints and size mode. - * @param heightMeasureSpec Provides the parent's height contraints and size mode. + * @param widthMeasureSpec Provides the parent's width constraints and size mode. + * @param heightMeasureSpec Provides the parent's height constraints and size mode. */ @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIEditText.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIEditText.java index 5757f2cabb4..d17f7fe63cb 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIEditText.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIEditText.java @@ -443,7 +443,7 @@ public boolean onTouchEvent(MotionEvent event) // Request the parent to scroll if one of the following is true: // - EditText is not scrollable. (ie: All text fits within the box.) - // - EditText is scrollabe, but cannot scroll any further in given direction. + // - EditText is scrollable, but cannot scroll any further in given direction. if (!isScrollEnabled || !canScrollFurther) { wasHandled = dispatchNestedPreScroll(deltaX, deltaY, null, null); wasHandled |= dispatchNestedScroll(0, 0, deltaX, deltaY, null); diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUILabel.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUILabel.java index bc765e17d17..3198fdbea7a 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUILabel.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUILabel.java @@ -247,7 +247,7 @@ private void adjustTextFontSize(@NonNull MaterialTextView textView) { int value = textView.getWidth(); { - // Exlude the view's padding and borders. + // Exclude the view's padding and borders. value -= textView.getTotalPaddingLeft() + textView.getTotalPaddingRight(); } if ((this.layoutParams != null) && (this.layoutParams.optionWidth != null) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIMaskedImage.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIMaskedImage.java index 6621170cdbe..96815bd63f0 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIMaskedImage.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIMaskedImage.java @@ -125,7 +125,7 @@ public void processProperties(KrollDict properties) } /** - * Called when one of the proxy's properies have changed. + * Called when one of the proxy's properties have changed. *

* Expected to be called on the main UI thread. * @param key The unique name of the property. @@ -1295,7 +1295,7 @@ public boolean drawTo(Canvas canvas) Drawable imageDrawable = getMaskedDrawable().getImageDrawable(); Bitmap imageBitmap = getBitmapFrom(imageDrawable); if (imageBitmap != null) { - // Draw the image drawable's bitmap ourselves with given blend mode. (Most optmized.) + // Draw the image drawable's bitmap ourselves with given blend mode. (Most optimized.) bufferedCanvas.drawBitmap(imageBitmap, null, targetBounds, bufferedPaint); } else if (imageDrawable != null) { // Draw the image via its drawable with given blend mode. (Least optimized.) 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 7dc36c1d96d..4dded6d0761 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 @@ -114,7 +114,7 @@ public void setParentContentWidth(int width) /** * Gets the value set via the setParentContentWidth() method. - * Note that this value is not assignd automatically. The owner must assign it. + * Note that this value is not assigned automatically. The owner must assign it. * @return Returns the parent view's width, excluding its left/right padding. */ public int getParentContentWidth() @@ -136,7 +136,7 @@ public void setParentContentHeight(int height) /** * Gets the value set via the setParentContentHeight() method. - * Note that this value is not assignd automatically. The owner must assign it. + * Note that this value is not assigned automatically. The owner must assign it. * @return Returns the parent view's height, excluding its top/bottom padding. */ public int getParentContentHeight() 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 ada2e209be7..b5cc0adbc88 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 @@ -781,7 +781,7 @@ public void handleKeyboard(KrollDict d) } // Update fullscreen edit handling. - // We might have to diable it due to Google bugs with password handling of certain input types. + // We might have to disable it due to Google bugs with password handling of certain input types. handleFullscreen(d); // Force keyboard to use English if enabled. (Not all keyboards honor this setting.) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListItemProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListItemProxy.java index 491454559a6..4de91d69ff7 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListItemProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListItemProxy.java @@ -580,7 +580,7 @@ public ListViewProxy getListViewProxy() /** * Override getRect() to amend dimensions. * - * @return Dictinary of view dimensions. + * @return Dictionary of view dimensions. */ @Override public KrollDict getRect() 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 d242d6b18ec..6b7defa8ae1 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 @@ -311,7 +311,7 @@ private void reset() * Set header and footer views of holder. * * @param listViewProxy ListView proxy. - * @param properties Properties containing header and footer entires. + * @param properties Properties containing header and footer entries. * @param updateHeader Boolean to determine if the header should be updated. * @param updateFooter Boolean to determine if the footer should be updated. */ 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 ea910787c9c..6d43dab93dc 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 @@ -632,7 +632,7 @@ public void setSeparator(int color, int height) } /** - * Starts dragging programatically. + * Starts dragging programmatically. * * @param vHolder The dedicated view holder */ 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 67317c878cd..67957c1309b 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 @@ -357,7 +357,7 @@ protected boolean hasCustomBackground(TiViewProxy tabProxy) } /** - * Method for creating a RippleDrawable to be used as a bacgkround for an item in the Controller. + * Method for creating a RippleDrawable to be used as a background for an item in the Controller. * Creates the RippleDrawable for two states - the provided state and its negative value. * If the properties are not set the method falls back to the colorPrimary of the current theme. * The previous implementation of TabGroup added the ripple effect by default for tabs, thus this diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java index 517d1191022..f63c4790757 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java @@ -25,7 +25,7 @@ import com.google.android.material.bottomnavigation.BottomNavigationItemView; import com.google.android.material.bottomnavigation.BottomNavigationMenuView; import com.google.android.material.bottomnavigation.BottomNavigationView; -import com.google.android.material.bottomnavigation.LabelVisibilityMode; +import com.google.android.material.navigation.NavigationBarView; import com.google.android.material.shape.CornerFamily; import com.google.android.material.shape.MaterialShapeDrawable; import com.google.android.material.shape.ShapeAppearanceModel; @@ -238,14 +238,14 @@ public void addTabItemInController(TiViewProxy tabProxy) final int shiftMode = proxy.getProperties().optInt(TiC.PROPERTY_SHIFT_MODE, 1); switch (shiftMode) { case 0: - this.mBottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + this.mBottomNavigationView.setLabelVisibilityMode(NavigationBarView.LABEL_VISIBILITY_LABELED); break; case 1: - this.mBottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_AUTO); + this.mBottomNavigationView.setLabelVisibilityMode(NavigationBarView.LABEL_VISIBILITY_AUTO); break; case 2: // NOTE: Undocumented for now, will create new property that has parity with iOS. - this.mBottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED); + this.mBottomNavigationView.setLabelVisibilityMode(NavigationBarView.LABEL_VISIBILITY_UNLABELED); break; } } diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java index fceba8a9414..9dc644f4e28 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java @@ -135,7 +135,7 @@ public void onRequestPermissionsResult( /** * Called when the HTML is requesting permission to do WebRTC audio/video capture or access a media resource. * This method will prompt the end-user for permission to grant access to the requested web resource. - * @param request Object providing the grant/deny callback and the resoruces being requested. + * @param request Object providing the grant/deny callback and the resources being requested. */ @Override public void onPermissionRequest(final PermissionRequest request) @@ -539,7 +539,7 @@ public void onError(Activity activity, int requestCode, Exception ex) } }; - // Display the file chooser or catpure activity. + // Display the file chooser or capture activity. try { Intent intent = createFileChooserIntentFrom(chooserParams); activity.launchActivityForResult(intent, activity.getUniqueResultCode(), resultHandler); diff --git a/android/notes.md b/android/notes.md index a7140dc4a46..af6e08f5d2e 100644 --- a/android/notes.md +++ b/android/notes.md @@ -19,7 +19,7 @@ TODOs!!! Testing V8-inspector/debugger ======== The goal is to be able to debug apps via Chrome Devtools or Studio. -We hook up a websocket server in JSDebugger.java to talk to DevTools. This carries the messages back and forth (basically wbesaockets are the "base" protocol that the isnpector protocol travels over) +We hook up a websocket server in JSDebugger.java to talk to DevTools. This carries the messages back and forth (basically websockets are the "base" protocol that the inspector protocol travels over) - Use multiple terminal tabs/windows: - One for running a test app to debug with: diff --git a/android/package.json b/android/package.json index 92b80bfedc6..ad6f5134f67 100644 --- a/android/package.json +++ b/android/package.json @@ -19,7 +19,7 @@ "minSDKVersion": "21", "compileSDKVersion": "33", "vendorDependencies": { - "android sdk": ">=23.x <=33.x", + "android sdk": ">=23.x <=34.x", "android build tools": ">=30.0.2 <=33.x", "android platform tools": "33.x", "android tools": "<=26.x", diff --git a/android/runtime/common/src/java/org/appcelerator/kroll/common/TiConfig.java b/android/runtime/common/src/java/org/appcelerator/kroll/common/TiConfig.java index fce22c5b393..737e07ba7d8 100644 --- a/android/runtime/common/src/java/org/appcelerator/kroll/common/TiConfig.java +++ b/android/runtime/common/src/java/org/appcelerator/kroll/common/TiConfig.java @@ -6,8 +6,6 @@ */ package org.appcelerator.kroll.common; -import android.util.Config; - /** * A replacement class for org.appcelerator.titanium.config.TitaniumConfig so that I can change * settings via tiapp.xml @@ -24,9 +22,9 @@ public class TiConfig * <property name="ti.android.debug" type="bool">true</property> * */ - public static boolean LOGD = Config.DEBUG; - public static boolean LOGV = Config.DEBUG; - public static boolean DEBUG = Config.DEBUG; - public static boolean RELEASE = !Config.DEBUG; - public static boolean PROFILE = Config.PROFILE; + public static boolean LOGD = false; + public static boolean LOGV = false; + public static boolean DEBUG = false; + public static boolean RELEASE = true; + public static boolean PROFILE = false; } diff --git a/android/runtime/v8/src/java/org/appcelerator/kroll/runtime/v8/JSDebugger.java b/android/runtime/v8/src/java/org/appcelerator/kroll/runtime/v8/JSDebugger.java index ffa9995a277..7bcce6ab960 100644 --- a/android/runtime/v8/src/java/org/appcelerator/kroll/runtime/v8/JSDebugger.java +++ b/android/runtime/v8/src/java/org/appcelerator/kroll/runtime/v8/JSDebugger.java @@ -205,7 +205,7 @@ public void onMessage(WebSocket conn, String message) { inspectorMessages.offer(message); // put message into queue - // if we haven't initialied yet, sniff the incoming messages + // if we haven't initialized yet, sniff the incoming messages if (!JSDebugger.this.ready.get()) { // copy any waiting messages into our initial queue String nextMessage = inspectorMessages.poll(); diff --git a/android/runtime/v8/src/native/InspectorClient.cpp b/android/runtime/v8/src/native/InspectorClient.cpp index 0f39ee89432..ef3cc91fa9d 100644 --- a/android/runtime/v8/src/native/InspectorClient.cpp +++ b/android/runtime/v8/src/native/InspectorClient.cpp @@ -112,7 +112,7 @@ void InspectorClient::CallAndPauseOnStart(const v8::FunctionCallbackInfoIsString()); assert(args[1]->IsString()); - // Note that this differs from Node's implementation wher ethey expect the first arg to be a pre-compiled function + // Note that this differs from Node's implementation where they expect the first arg to be a pre-compiled function // And a variable number of additional arguments to pass to that function. // They wrap the source with a function just like Module.wrap for standard code // Then compile the function and pass it into this method to schedule a pause and then invoke it. diff --git a/android/runtime/v8/src/native/JavaObject.h b/android/runtime/v8/src/native/JavaObject.h index 36b815eec6e..0c7349eeb34 100644 --- a/android/runtime/v8/src/native/JavaObject.h +++ b/android/runtime/v8/src/native/JavaObject.h @@ -15,7 +15,7 @@ namespace titanium { // Provides an interface between a JavaScript object // and a Java object instance. This class is also responsible -// for mangaging the lifetime of the Java object reference +// for managing the lifetime of the Java object reference // so that it is properly collected once becoming unreachable // from the JavaScript code. class JavaObject : public EventEmitter diff --git a/android/runtime/v8/src/native/modules/APIModule.cpp b/android/runtime/v8/src/native/modules/APIModule.cpp index 669be7264ca..a2628327880 100644 --- a/android/runtime/v8/src/native/modules/APIModule.cpp +++ b/android/runtime/v8/src/native/modules/APIModule.cpp @@ -48,7 +48,7 @@ void APIModule::Initialize(Local target, Local context) // Hook methods to the API prototype, notice these aren't hooked to API // itself, instead we return a singleton of an API instance and export it // as Ti.API - // Not sure why we then hook apiName as instance proprty, since + // Not sure why we then hook apiName as instance property, since // the difference is made moot by the singleton! SetProtoMethod(isolate, constructor, "debug", logDebug); SetProtoMethod(isolate, constructor, "info", logInfo); diff --git a/android/runtime/v8/src/native/modules/ScriptsModule.cpp b/android/runtime/v8/src/native/modules/ScriptsModule.cpp index 3b9a50375b8..40092181e64 100644 --- a/android/runtime/v8/src/native/modules/ScriptsModule.cpp +++ b/android/runtime/v8/src/native/modules/ScriptsModule.cpp @@ -253,7 +253,7 @@ void WrappedScript::EvalMachine(const FunctionCallbackInfo& args) // Use the passed in context MaybeLocal contextArg = args[sandbox_index]->ToObject(currentContext); if (contextArg.IsEmpty()) { - // FIXME Will this ever happen? This is not likley and probably the wrong way to handle this. We should at least log it... + // FIXME Will this ever happen? This is not likely and probably the wrong way to handle this. We should at least log it... context.Reset(isolate, Context::New(isolate)); } else { nContext = WrappedContext::Unwrap(isolate, contextArg.ToLocalChecked()); @@ -261,7 +261,7 @@ void WrappedScript::EvalMachine(const FunctionCallbackInfo& args) } } - // Explicitly set up var to track context we shoudl use for compile/run of script. + // Explicitly set up var to track context we should use for compile/run of script. // When "thisContext", use teh current context from the isolate. Otherwise use the context we set in the Persistent above Local contextToUse = (context_flag == thisContext) ? currentContext : context.Get(isolate); diff --git a/android/templates/module/generated/build.gradle b/android/templates/module/generated/build.gradle index f28a5aee09c..50de55cf776 100644 --- a/android/templates/module/generated/build.gradle +++ b/android/templates/module/generated/build.gradle @@ -168,7 +168,7 @@ tasks.withType(JavaCompile) { // Execute our "generate-cpp-files.js" script after Java compile to finish generating C++ files. // Depends on the JSON file produced by our "kroll-apt" Java annotation processor. - // TODO: Our annnotation processor should do ALL of the proxy code generation. Don't piece-meal it. + // TODO: Our annotation processor should do ALL of the proxy code generation. Don't piece-meal it. doLast { exec { environment 'TI_MODULE_BINDINGS_JSON_FILE', tiModuleBindingsJsonPath @@ -246,7 +246,7 @@ publishing { } } -// Load the module developer's optional "build.gradle" file from "/android" directory. +// Load the module developer's optional "build.gradle" file from "/android" directory. // This gradle file is expected to provide the module's "dependencies". def moduleBuildGradlePath = "${projectDir}/../../build.gradle" if (file(moduleBuildGradlePath).exists()) { diff --git a/android/templates/module/generated/generate-cpp-files.js b/android/templates/module/generated/generate-cpp-files.js index 2b64acd8aa6..a383a506681 100644 --- a/android/templates/module/generated/generate-cpp-files.js +++ b/android/templates/module/generated/generate-cpp-files.js @@ -60,7 +60,7 @@ function replacePlaceholders(text, placeholders) { /** Generates C++ source files for the module. */ async function main() { - // Load module's JSON file containing all proxy bindings generated by "kroll-apt" Java annotatation processor. + // Load module's JSON file containing all proxy bindings generated by "kroll-apt" Java annotation processor. const bindingJsonPath = process.env.TI_MODULE_BINDINGS_JSON_FILE; const bindingJson = JSON.parse(fs.readFileSync(bindingJsonPath)); const moduleClassName = Object.keys(bindingJson.modules)[0]; diff --git a/android/titanium/bootstrap.lazymodule.js.ejs b/android/titanium/bootstrap.lazymodule.js.ejs index 833adce2d8c..eafa53fbe17 100644 --- a/android/titanium/bootstrap.lazymodule.js.ejs +++ b/android/titanium/bootstrap.lazymodule.js.ejs @@ -4,7 +4,7 @@ if (!('__propertiesDefined__' in <%- name %>)) { if (mod.children) { for (const child of mod.children) { let fullAPIName = child.proxyAttrs.fullAPIName; - // Drop leading 'Tiatnium' if in full aAPI name + // Drop leading 'Titanium' if in full aAPI name if (fullAPIName.startsWith('Titanium.')) { fullAPIName = fullAPIName.slice(9); } @@ -42,4 +42,4 @@ _%> _%> } <%- name %>.__propertiesDefined__ = true; -return <%- name %>; \ No newline at end of file +return <%- name %>; diff --git a/android/titanium/libv8-services.js b/android/titanium/libv8-services.js index d3e8100e0fe..cd737d24ad3 100644 --- a/android/titanium/libv8-services.js +++ b/android/titanium/libv8-services.js @@ -222,7 +222,7 @@ async function createSnapshot() { process.exit(1); } - // Generaet an empty C++ header. Allows build to succeed and app will load "ti.main.js" normally instead. + // Generate an empty C++ header. Allows build to succeed and app will load "ti.main.js" normally instead. await fs.writeFile(v8SnapshotHeaderFilePath, '// Failed to generate V8 snapshots. See build log.'); } } @@ -277,7 +277,7 @@ function createSnapshotThenExit() { /** * Checks if the V8 library referenced by the "titanium_mobile/android/package.json" file is installed. - * If not, then this function will automatically download/install it. Function will do nothing if alredy installed. + * If not, then this function will automatically download/install it. Function will do nothing if already installed. * * Will exit the process when the async operation ends. Intended to be called from the command line. */ diff --git a/android/titanium/src/java/org/appcelerator/kroll/KrollProxy.java b/android/titanium/src/java/org/appcelerator/kroll/KrollProxy.java index 9b430472bf2..110371b523b 100644 --- a/android/titanium/src/java/org/appcelerator/kroll/KrollProxy.java +++ b/android/titanium/src/java/org/appcelerator/kroll/KrollProxy.java @@ -513,7 +513,7 @@ public void extend(KrollDict options) Object oldValue = properties.get(name); Object value = options.get(name); - // dont just fire the change event, make sure we set the property back on the KrollObject + // don't just fire the change event, make sure we set the property back on the KrollObject // since the property change may not be driven from JS (KrollObject->Java proxy) setProperty(name, value); diff --git a/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java b/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java index e7365e4b7e8..8421b066570 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java +++ b/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java @@ -345,7 +345,7 @@ protected void updateTitle() String oldTitle = (String) getTitle(); String newTitle = TiConvert.toString(window.getProperty(TiC.PROPERTY_TITLE)); int colorInt = -1; - + if (oldTitle == null) { oldTitle = ""; } @@ -1602,7 +1602,7 @@ protected void onDestroy() // "isFinishing" will return true if the Android OS won't restore this destroyed activity later. // This happens when finish() method is called of end-user back navigates out of the activity. - // Note: Will breturn false if system intends to restore the activity later, which happens if + // Note: Will return false if system intends to restore the activity later, which happens if // system setting "Don't keep activities" is enabled or "Background process limit" was exceeded. boolean isFinishing = isFinishing(); diff --git a/android/titanium/src/java/org/appcelerator/titanium/TiBaseService.java b/android/titanium/src/java/org/appcelerator/titanium/TiBaseService.java index 4a816200c28..644e14bd3cc 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/TiBaseService.java +++ b/android/titanium/src/java/org/appcelerator/titanium/TiBaseService.java @@ -150,7 +150,7 @@ public void unsubscribe() /** * Called just before the JavaScript runtime is terminated. *

- * Stops the service since the JavaScript file binded to it can no longer control it. + * Stops the service since the JavaScript file bound to it can no longer control it. * @param runtime The runtime instance that is about to be terminated/disposed. */ @Override diff --git a/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java b/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java index 1a9b397ec6e..aa8c61cbf36 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java +++ b/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java @@ -91,7 +91,7 @@ public static TiBlob blobFromString(String data) /** * Creates a blob from a file and sets a mimeType based on the file name. * @param file the file used to create blob. - * @return new instane of TiBlob. + * @return new instance of TiBlob. */ public static TiBlob blobFromFile(TiBaseFile file) { diff --git a/android/titanium/src/java/org/appcelerator/titanium/TiRootActivity.java b/android/titanium/src/java/org/appcelerator/titanium/TiRootActivity.java index f99301788e2..7603287301b 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/TiRootActivity.java +++ b/android/titanium/src/java/org/appcelerator/titanium/TiRootActivity.java @@ -186,7 +186,7 @@ protected void onCreate(Bundle savedInstanceState) // Recreate this activity on the current task. if (isActivityForResult) { - // This activtiy was created via startActivityForResult(). + // This activity was created via startActivityForResult(). // "Forward" the result handling to the next activity we're about to start-up. Intent relaunchIntent = newIntent; if (relaunchIntent == null) { @@ -304,9 +304,9 @@ public void onDisposing(KrollRuntime runtime) } }); if (KrollRuntime.getActivityRefCount() > 0) { - Activity currentActvitiy = getTiApp().getCurrentActivity(); - if (currentActvitiy != null) { - currentActvitiy.finishAffinity(); + Activity currentActivity = getTiApp().getCurrentActivity(); + if (currentActivity != null) { + currentActivity.finishAffinity(); } TiApplication.terminateActivityStack(); } else { diff --git a/android/titanium/src/java/org/appcelerator/titanium/io/TiFile.java b/android/titanium/src/java/org/appcelerator/titanium/io/TiFile.java index ec3d736226f..bcd12aca1b3 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/io/TiFile.java +++ b/android/titanium/src/java/org/appcelerator/titanium/io/TiFile.java @@ -100,7 +100,7 @@ public boolean isWriteable() /** * Attempts to create a directory named by the trailing filename of this file. * @param recursive whether to recursively create any missing parent directories in the path. - * @return true if directory was sucessfully created, false otherwise. + * @return true if directory was successfully created, false otherwise. */ @Override public boolean createDirectory(boolean recursive) diff --git a/android/titanium/src/java/org/appcelerator/titanium/util/TiDeviceOrientation.java b/android/titanium/src/java/org/appcelerator/titanium/util/TiDeviceOrientation.java index f36807e62f6..8a974798c34 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/util/TiDeviceOrientation.java +++ b/android/titanium/src/java/org/appcelerator/titanium/util/TiDeviceOrientation.java @@ -165,7 +165,7 @@ public static TiDeviceOrientation fromAndroidSurfaceRotationId(int value) boolean isUprightOrientationPortrait = displayInfo.isUprightOrientationPortrait(); // Configure display info object with given rotation and device's upright orientation. - // Note: The below width/height doesn't need to match the device's actual dispaly size. + // Note: The below width/height doesn't need to match the device's actual display size. // They just need to indicate if the device is portrait/landscape for given rotation. switch (value) { case Surface.ROTATION_0: @@ -302,7 +302,7 @@ public static TiDeviceOrientation from(Display display) * Returns a portrait or landscape orientation if the display's upright orientation * was successfully acquired. *

- * Returns UNKNOWN if failed to aquire the default display's information. + * Returns UNKNOWN if failed to acquire the default display's information. */ public static TiDeviceOrientation fromUprightPositionOfDefaultDisplay() { @@ -321,7 +321,7 @@ public static TiDeviceOrientation fromUprightPositionOfDefaultDisplay() * Returns a portrait or landscape orientation if the display's upright orientation * was successfully acquired. *

- * Returns UNKNOWN if given a null argument or failed to aquire display info. + * Returns UNKNOWN if given a null argument or failed to acquire display info. */ public static TiDeviceOrientation fromUprightPositionOf(Display display) { @@ -395,7 +395,7 @@ public int getHeight() public boolean isUprightOrientationPortrait() { // Determine if the display size is portrait. - // Note: A square display size is considred portrait. (The most commonly used orientation.) + // Note: A square display size is considered portrait. (The most commonly used orientation.) boolean result; switch (this.rotationId) { case Surface.ROTATION_0: diff --git a/android/titanium/src/java/org/appcelerator/titanium/util/TiDownloadManager.java b/android/titanium/src/java/org/appcelerator/titanium/util/TiDownloadManager.java index 1ab2f967972..e22eb5580e9 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/util/TiDownloadManager.java +++ b/android/titanium/src/java/org/appcelerator/titanium/util/TiDownloadManager.java @@ -211,7 +211,7 @@ public InputStream blockingDownload(final URI uri) throws Exception } } - // If we've acquried an HTTP/HTTPS download stream, then wrap the stream. + // If we've acquired an HTTP/HTTPS download stream, then wrap the stream. // The stream wrapper will automatically close the HTTP connection when the stream has been closed. if ((inputStream != null) && (connection instanceof HttpURLConnection)) { final HttpURLConnection httpConnection = (HttpURLConnection) connection; diff --git a/android/titanium/src/java/org/appcelerator/titanium/util/TiFileHelper2.java b/android/titanium/src/java/org/appcelerator/titanium/util/TiFileHelper2.java index 7122505645f..060100776ac 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/util/TiFileHelper2.java +++ b/android/titanium/src/java/org/appcelerator/titanium/util/TiFileHelper2.java @@ -29,7 +29,7 @@ public static String getResourcesPath(String path) /** * Joins many String path segments into one path * @param segments A vararg (or String array) of path segments - * @return The passed-in segements normalized and joined by "/" + * @return The passed-in segments normalized and joined by "/" */ public static String joinSegments(String... segments) { diff --git a/android/titanium/src/java/org/appcelerator/titanium/util/TiResponseCache.java b/android/titanium/src/java/org/appcelerator/titanium/util/TiResponseCache.java index cf0a725389d..abbae3d34d4 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/util/TiResponseCache.java +++ b/android/titanium/src/java/org/appcelerator/titanium/util/TiResponseCache.java @@ -231,7 +231,7 @@ public static boolean peekFollowingRedirects(URI uri) * @param uri The URI to fetch the endpoint of. Can be null. * @return * If the given URI is cached and references a redirect response, then the returned URI will - * be the redirect's "location" URI. + * be the redirects "location" URI. *

* If the given URI does not reference a redirect, then the given URI is returned. *

diff --git a/android/titanium/src/java/org/appcelerator/titanium/util/TiUIHelper.java b/android/titanium/src/java/org/appcelerator/titanium/util/TiUIHelper.java index efd98b92ce1..126de992a6d 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/util/TiUIHelper.java +++ b/android/titanium/src/java/org/appcelerator/titanium/util/TiUIHelper.java @@ -713,7 +713,7 @@ public ImageDrawableLoader() /** * Loads the given image and returns it's decode bitmap wrapped in a drawable. * @param filePath Path or URL to the image file to be loaded. Can be null. - * @return Returns a drawble object used to draw the give image file. + * @return Returns a drawable object used to draw the give image file. *

* Returns null if failed to load the image or if given a null argument. */ diff --git a/android/titanium/src/java/org/appcelerator/titanium/view/TiCompositeLayout.java b/android/titanium/src/java/org/appcelerator/titanium/view/TiCompositeLayout.java index c8f15cc1815..4ad50ad3d7d 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/view/TiCompositeLayout.java +++ b/android/titanium/src/java/org/appcelerator/titanium/view/TiCompositeLayout.java @@ -60,13 +60,13 @@ public enum LayoutArrangement { private boolean needsSort; protected LayoutArrangement arrangement; - // Used by horizonal arrangement calculations + // Used by horizontal arrangement calculations private int horizontalLayoutTopBuffer = 0; private int horizontalLayoutCurrentLeft = 0; private int horizontalLayoutLineHeight = 0; private boolean enableHorizontalWrap = true; private int horizontalLayoutLastIndexBeforeWrap = 0; - private int horiztonalLayoutPreviousRight = 0; + private int horizontalLayoutPreviousRight = 0; int[] horizontal = new int[2]; int[] vertical = new int[2]; /** @@ -252,7 +252,7 @@ public void setChildRelativeSizingTo(int width, int height) /** * Configures this layout to size and position child views that use a percentage based - * width/height and top/bottom/left/right/center properties reatlive to this parent + * width/height and top/bottom/left/right/center properties relative to this parent * layout's width and height. *

* This is the default setting. @@ -875,7 +875,7 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) horizontalLayoutLineHeight = 0; horizontalLayoutTopBuffer = 0; horizontalLayoutLastIndexBeforeWrap = 0; - horiztonalLayoutPreviousRight = 0; + horizontalLayoutPreviousRight = 0; updateRowForHorizontalWrap(right, i); } computeHorizontalLayoutPosition(params, childMeasuredWidth, childMeasuredHeight, right, top, bottom, @@ -1002,19 +1002,19 @@ private void computeHorizontalLayoutPosition(TiCompositeLayout.LayoutParams para TiDimension optionLeft = params.optionLeft; TiDimension optionRight = params.optionRight; - int left = horizontalLayoutCurrentLeft + horiztonalLayoutPreviousRight; + int left = horizontalLayoutCurrentLeft + horizontalLayoutPreviousRight; int optionLeftValue = 0; if (optionLeft != null) { optionLeftValue = optionLeft.getAsPixels(this); left += optionLeftValue; } - horiztonalLayoutPreviousRight = (optionRight == null) ? 0 : optionRight.getAsPixels(this); + horizontalLayoutPreviousRight = (optionRight == null) ? 0 : optionRight.getAsPixels(this); // If it's fill width with horizontal wrap, just take up remaining // space. int right = left + measuredWidth; - if (enableHorizontalWrap && ((right + horiztonalLayoutPreviousRight) > layoutRight || left >= layoutRight)) { + if (enableHorizontalWrap && ((right + horizontalLayoutPreviousRight) > layoutRight || left >= layoutRight)) { // Too long for the current "line" that it's on. Need to move it // down. left = optionLeftValue; diff --git a/android/titanium/src/java/org/appcelerator/titanium/view/TiDrawableReference.java b/android/titanium/src/java/org/appcelerator/titanium/view/TiDrawableReference.java index 7bcccbaaf4d..bcfb1f89777 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/view/TiDrawableReference.java +++ b/android/titanium/src/java/org/appcelerator/titanium/view/TiDrawableReference.java @@ -272,7 +272,7 @@ public static TiDrawableReference fromDictionary(Activity activity, HashMap dict * Does its best to determine the type of reference (url, blob, etc) based on object parameter. *

* Uses the given proxy to resolve relative paths to an image file, if applicable. - * @param proxy Used to acquire an activty and resolve relative paths if given object is a string path. + * @param proxy Used to acquire an activity and resolve relative paths if given object is a string path. * @param object Reference to the image to be loaded such as a file, path, blob, etc. * @return Returns an instance of TiDrawableReference wrapping the given object. */ diff --git a/android/titanium/src/java/org/appcelerator/titanium/view/TiUIFragment.java b/android/titanium/src/java/org/appcelerator/titanium/view/TiUIFragment.java index e7189380b02..51f60f8eda2 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/view/TiUIFragment.java +++ b/android/titanium/src/java/org/appcelerator/titanium/view/TiUIFragment.java @@ -131,7 +131,7 @@ public Fragment getFragment() public boolean handleMessage(Message msg) { - //overwriting so descendents don't have to + //overwriting so descendants don't have to return true; } diff --git a/android/titanium/src/java/ti/modules/titanium/TitaniumModule.java b/android/titanium/src/java/ti/modules/titanium/TitaniumModule.java index 92b21825bf4..365e373862a 100644 --- a/android/titanium/src/java/ti/modules/titanium/TitaniumModule.java +++ b/android/titanium/src/java/ti/modules/titanium/TitaniumModule.java @@ -263,7 +263,7 @@ public String stringFormat(String format, Object[] args) } } catch (Exception ex) { - Log.e(TAG, "Error occured while formatting string", ex); + Log.e(TAG, "Error occurred while formatting string", ex); return null; } } diff --git a/apidoc/Titanium/UI/Picker.yml b/apidoc/Titanium/UI/Picker.yml index f32ace414ae..84235b4a4eb 100644 --- a/apidoc/Titanium/UI/Picker.yml +++ b/apidoc/Titanium/UI/Picker.yml @@ -282,6 +282,21 @@ properties: since: "5.2.0" default: "black" + - name: overrideUserInterfaceStyle + summary: Forces the picker to used assigned theme instead of the system theme. + description: | + When set to [USER_INTERFACE_STYLE_DARK](Titanium.UI.USER_INTERFACE_STYLE_DARK) or + [USER_INTERFACE_STYLE_LIGHT](Titanium.UI.USER_INTERFACE_STYLE_LIGHT), the picker will ignore + the system's current theme and use the theme assigned to this property instead. + + When set to [USER_INTERFACE_STYLE_UNSPECIFIED](Titanium.UI.USER_INTERFACE_STYLE_UNSPECIFIED), + the picker will use the system's current theme. + type: Number + default: Titanium.UI.USER_INTERFACE_STYLE_UNSPECIFIED + constants: Titanium.UI.USER_INTERFACE_STYLE_* + osver: {ios: {min: "13.0"}} + since: "12.4.0" + - name: format24 summary: | Determines whether the Time pickers display in 24-hour or 12-hour clock format. diff --git a/apidoc/Titanium/UI/ScrollableView.yml b/apidoc/Titanium/UI/ScrollableView.yml index febe7bacaf3..b7709d1b090 100644 --- a/apidoc/Titanium/UI/ScrollableView.yml +++ b/apidoc/Titanium/UI/ScrollableView.yml @@ -389,7 +389,10 @@ properties: description: | Set to `false` to allow the previous or next pages to be seen. Note that ScrollableView's [width](Titanium.UI.ScrollableView.width) must be smaller than its parent - view in order to make this property effective. + view in order to make this property effective on iOS. + For Android you have to set the [padding](Titanium.UI.ScrollableView.padding) property. + + Check the `Scrollable View with multiple visible views` example for both platforms. type: Boolean availability: creation default: true diff --git a/iphone/Classes/TiUIPicker.m b/iphone/Classes/TiUIPicker.m index 37c4daaa87e..1f06ad8cdd5 100644 --- a/iphone/Classes/TiUIPicker.m +++ b/iphone/Classes/TiUIPicker.m @@ -225,6 +225,15 @@ - (void)setBackgroundColor_:(id)value } } +- (void)setOverrideUserInterfaceStyle_:(id)args +{ + ENSURE_SINGLE_ARG(args, NSNumber); + if (picker != nil) { + int style = [TiUtils intValue:args def:UIUserInterfaceStyleUnspecified]; + ((UIDatePicker *)[self picker]).overrideUserInterfaceStyle = style; + } +} + - (void)setDateTimeColor_:(id)value { // Guard date picker and iOS 14+ date picker style