Skip to content

Commit

Permalink
Merge branch 'master' into deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
cb1kenobi committed May 24, 2024
2 parents a335afb + eb87849 commit d4b28c5
Show file tree
Hide file tree
Showing 60 changed files with 116 additions and 91 deletions.
16 changes: 8 additions & 8 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 "<module.id>.js" script file first.
let jsFilePath = path.join(module.modulePath, module.id + '.js');
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion android/cli/hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion android/cli/lib/android-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion android/cli/lib/gradle-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
2 changes: 1 addition & 1 deletion android/cli/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion android/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ protected void initialize()
}

properties = (Map<Object, Object>) 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, LocationProviderProxy> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ 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)
|| (yearFormatId != null)
|| (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)
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -471,7 +471,7 @@ private synchronized List<Processor> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public void setSwipeRefreshEnabled(boolean value)
* Updates this view's width and height based on the given width and height constraints.
* <p>
* 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* <p>
* Expected to be called on the main UI thread.
* @param key The unique name of the property.
Expand Down Expand Up @@ -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.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading

0 comments on commit d4b28c5

Please sign in to comment.