diff --git a/android/cli/commands/_build.js b/android/cli/commands/_build.js index 2f87474305c..84e869b8b94 100644 --- a/android/cli/commands/_build.js +++ b/android/cli/commands/_build.js @@ -2487,7 +2487,7 @@ AndroidBuilder.prototype.copyResources = function copyResources(next) { copyDir.call(this, { src: src, dest: this.buildBinAssetsResourcesDir, - ignoreRootDirs: ti.availablePlatformsNames + ignoreRootDirs: ti.allPlatformNames }, cb); }, diff --git a/android/templates/module/default/template/android/timodule.xml b/android/templates/module/default/template/android/timodule.xml index 6affb2faec1..ae315971a58 100644 --- a/android/templates/module/default/template/android/timodule.xml +++ b/android/templates/module/default/template/android/timodule.xml @@ -2,12 +2,10 @@ - - diff --git a/apidoc/Global/Global.yml b/apidoc/Global/Global.yml index 34d92d2a750..2c7ddb8ed5f 100644 --- a/apidoc/Global/Global.yml +++ b/apidoc/Global/Global.yml @@ -2,84 +2,84 @@ name: Global summary: The APIs that reside in the global scope, which may be called without a namespace prefix. description: | - Titanium provides a number of global built-in objects, detailed below. - + Titanium provides a number of global built-in objects, detailed below. + #### JSON - + Titanium provides a built-in [JSON](Global.JSON) object two functions, `parse` and `stringify`. #### String Utilities Titanium includes several extra utility functions for formatting text, attached to the global [String](Global.String) object. - + #### console - + Titanium provides [console](Global.console) support familiar to many javascript developers for logging at the toplevel, in addition to the logging facilities. - + #### Timers - + Titanium has built-in support for one-off and repeating timers: - + * Use [setTimeout](Global.setTimeout) to start a one-off timer. * Use [setInterval](Global.setInterval) to start a repeating timer. - + #### Alert - - Titanium has a built-in convenience function [alert](Global.alert) which can be used as an alias + + Titanium has a built-in convenience function [alert](Global.alert) which can be used as an alias for the [AlertDialog](Titanium.UI.AlertDialog) module. - + #### Locale - + The `L` macro can also be used as an alias for the method. -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] methods: - name: alert summary: Displays a pop-up alert dialog with the passed in `message`. description: | - This function is a shortcut for creating and displaying an - [alert dialog](Titanium.UI.AlertDialog). For example, the following two statements produce + This function is a shortcut for creating and displaying an + [alert dialog](Titanium.UI.AlertDialog). For example, the following two statements produce the same result. - + alert('Danger, Will Robinson!'); - + Ti.UI.createAlertDialog({ message: 'Danger, Will Robinson!' }).show(); - - Note that unlike a web browser-based version of `alert`, the method is asynchronous. However, + + Note that unlike a web browser-based version of `alert`, the method is asynchronous. However, only one alert dialog will be visible and modal at a time. - + Be aware that this method may be removed in the future. parameters: - name: message summary: Alert message. type: String - + - name: clearInterval summary: Cancels an interval timer. parameters: - name: timerId summary: Unique timer identifier returned by [setInterval](Global.setInterval). type: Number - + - name: clearTimeout summary: Cancels a one-time timer. parameters: - name: timerId summary: Unique timer identifier returned by [setTimeout](Global.setTimeout). type: Number - + - name: decodeURIComponent summary: | - Replaces each escape sequence in the specified string, created using the `encodedURI` - method, with the character that it represents. - description: | - For more information, see the MDN website for - [encodeURIComponent](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent) + Replaces each escape sequence in the specified string, created using the `encodedURI` + method, with the character that it represents. + description: | + For more information, see the MDN website for + [encodeURIComponent](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent) and [decodeURIComponent](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/decodeURIComponent). returns: summary: Decoded string. @@ -91,11 +91,11 @@ methods: - name: encodeURIComponent summary: | - Replaces each special character in the specified string with the equivalent URI escape + Replaces each special character in the specified string with the equivalent URI escape sequence. Useful for encoding URIs. description: | - For more information, see the MDN website for - [encodeURIComponent](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent) + For more information, see the MDN website for + [encodeURIComponent](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent) and [decodeURIComponent](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/decodeURIComponent). returns: summary: Encoded string. @@ -114,18 +114,18 @@ methods: - name: key summary: Key used to lookup the localized string. type: String - + - name: hint summary: Text to return if `key` is not found. type: String optional: true - + - name: require summary: Loads either a native Titanium module or a CommonJS module. description: | - The `require` function takes a module identifier as its argument and returns an object with + The `require` function takes a module identifier as its argument and returns an object with references to the module's exported symbols. - + #### Native Titanium Module To load a native Titanium module: @@ -138,30 +138,30 @@ methods: [Using a Module](http://docs.appcelerator.com/platform/latest/#!/guide/Using_a_Module). #### CommonJS Module - + To load a local CommonJS module, place the CommonJS module in the `Resources` directory of your project. Pass the `require` method the path to the file without the `Resources` directory, platform-specific directory and the `.js` extension. - Note that the appropriate *platform-specific* `Resources` subdirectory is merged into the + Note that the appropriate *platform-specific* `Resources` subdirectory is merged into the main `Resources` directory at build time. For example, suppose the following files exist. - + * `Resources/app.js` * `Resources/ui/MainWindow.js` * `Resources/iphone/ui/TaskWindow.js` * `Resources/android/ui/TaskWindow.js` - - The appropriate `TaskWindow.js` file is moved into the `Resources/ui` directory of the - built application. To include both the MainWindow module and the platform-specific + + The appropriate `TaskWindow.js` file is moved into the `Resources/ui` directory of the + built application. To include both the MainWindow module and the platform-specific TaskWindow module from any JavaScript file in the project: // load main window module from ui subdirectory var mainWindow = require('ui/MainWindow'); - + // load platform-specific task window module - var taskWindow = require('ui/TaskWindow'); - - For more information, see the Official CommonJS website about + var taskWindow = require('ui/TaskWindow'); + + For more information, see the Official CommonJS website about [CommonJS Modules/1.1 Specification](http://wiki.commonjs.org/wiki/Modules/1.1). #### Alloy @@ -179,13 +179,13 @@ methods: require('myModule/module'); #### Android - + Additionally, on Android, an absolute path to a module may be specified using a path separator (`/`) at the beginning of the path. - + For example, a module file `Resources/myModule/module.js` may be required by `Resources/example/example.js` using either of the following: - + require('../myModule/module') require ('/myModule/module') @@ -201,29 +201,29 @@ methods: - title: Require a Native Module example: | To load a native module with the ID `com.mycompany.module`: - + var module = require('com.mycompany.module'); - title: Require a JavaScript Module example: | `myModule.js`: - + exports.message = "hello world"; - + `app.js`: - + var myModule = require('myModule'); alert(myModule.message); - + - name: setInterval summary: Executes a function repeatedly with a fixed time delay between each call to that function. description: | - Note that although the interval is not guaranteed to be exact, the interval between calls + Note that although the interval is not guaranteed to be exact, the interval between calls will be no less than the specified delay. - - Returns a unique timer identifier that can be passed to [clearInterval](Global.clearInterval) + + Returns a unique timer identifier that can be passed to [clearInterval](Global.clearInterval) to cancel this timer. - - For more information, see the MDN website for + + For more information, see the MDN website for [setInterval](https://developer.mozilla.org/en/DOM/window.setInterval). returns: summary: Unique timer identifier. @@ -232,14 +232,14 @@ methods: - name: function summary: Function to call. type: Callback - + - name: delay summary: Time in milliseconds to wait between calls to function. type: Number examples: - title: Update a label once every second, and stop at 10 seconds example: | - + var count = 0; var timer = setInterval(function(){ count++; @@ -248,17 +248,17 @@ methods: clearInterval(timer); } }, 1000); - + - name: setTimeout summary: Executes code or a function after a delay. description: | Note that although the timeout is not guaranteed to be exact, the delay before the function is invoked will be no less than the specified delay. - Returns a unique timer identifier that can be passed to [clearTimeout](Global.clearTimeout) + Returns a unique timer identifier that can be passed to [clearTimeout](Global.clearTimeout) to cancel this timer. - - For more information, see the MDN website for + + For more information, see the MDN website for [setTimeout](https://developer.mozilla.org/en/DOM/window.setTimeout). returns: summary: Unique timer identifier. @@ -267,14 +267,14 @@ methods: - name: function summary: Code or function to call. type: Callback - + - name: delay summary: Time in milliseconds to wait before the function is called. type: Number examples: - title: Execute a function in 500 milliseconds example: | - + setTimeout(function(){ Ti.API.debug('Called using setTimeout'); }, 500); diff --git a/apidoc/Global/JSON/JSON.yml b/apidoc/Global/JSON/JSON.yml index cfd1c7f6269..174e7de1409 100644 --- a/apidoc/Global/JSON/JSON.yml +++ b/apidoc/Global/JSON/JSON.yml @@ -3,7 +3,7 @@ --- name: Global.JSON summary: Global JSON object providing the [parse](Global.JSON.parse) and [stringify](Global.JSON.stringify) methods. -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] methods: - name: stringify @@ -48,7 +48,7 @@ methods: functions, will not be serialized. Such values in objects are dropped; in arrays they are replaced with null. You can use a replacer function to replace those with JSON values. - + JSON.stringify(undefined) returns undefined. The optional space parameter produces a stringification of the @@ -57,37 +57,37 @@ methods: If the space parameter is a non-empty string, then that string is used for indentation. If the space parameter is a number, then - each level is indented by the specified number of spaces. + each level is indented by the specified number of spaces. + + parameters: - parameters: - - name: value summary: Any JavaScript value, usually an object or array. type: Object - - - name: replacer + + - name: replacer summary: | Determines how object values are stringified for objects. See main text for usage. type: [Callback, Array] optional: true - - - name: space - summary: Specifies how nested structures are indented. If it is a number, it specifies the number - of spaces to indent at each level. If it is a string (such as '\\t' or ' '), it + + - name: space + summary: Specifies how nested structures are indented. If it is a number, it specifies the number + of spaces to indent at each level. If it is a string (such as '\\t' or ' '), it specifies the characters used to indent at each level. type: [Number, String] optional: true default: Text is packed without linebreaks or extra whitespace. - + returns: type: String - + examples: - title: Formatting with a Replacer Function example: | - The following example produces a readable version of a Titanium event object, + The following example produces a readable version of a Titanium event object, omitting the `source` and `type` properties and adding whitespace for readability: - + JSON.stringify(evt, function(key, value) { if(key === 'source' || key === 'type') { return undefined; @@ -106,23 +106,23 @@ methods: and its return value is used instead of the original value. If it returns what it received, then the structure is not modified. If it returns undefined then the member is deleted. - + parameters: - name: text summary: JSON text to parse. type: String - + - name: reviver - summary: Function to filter and transform the results. + summary: Function to filter and transform the results. type: Callback - + returns: type: Object - + examples: - title: Parse with Reviver Function example: - The following example parses the text, converting values that look like ISO date + The following example parses the text, converting values that look like ISO date strings into Date objects. myData = JSON.parse(text, function (key, value) { diff --git a/apidoc/Titanium/Blob.yml b/apidoc/Titanium/Blob.yml index fd943622fbf..a2d76332739 100644 --- a/apidoc/Titanium/Blob.yml +++ b/apidoc/Titanium/Blob.yml @@ -2,36 +2,36 @@ name: Titanium.Blob summary: A container for binary data. description: | - A `Blob` represents a chunk of binary information, often obtained through - an [HTTPClient](Titanium.Network.HTTPClient) or by reading a [File](Titanium.Filesystem.File). + A `Blob` represents a chunk of binary information, often obtained through + an [HTTPClient](Titanium.Network.HTTPClient) or by reading a [File](Titanium.Filesystem.File). - Blobs are often used to store text or image data. + Blobs are often used to store text or image data. The `Blob` object includes a number of properties and methods specific to image blobs. - Android and Mobile Web support an [append](Titanium.Blob.append) method, but - otherwise blobs are immutable. + Android supports an [append](Titanium.Blob.append) method, but + otherwise blobs are immutable. - The module provides several utility methods for working with + The module provides several utility methods for working with blobs, including methods for converting between blobs and Base64-encoded strings, and methods for generating SHA-1 and SHA-256 hashes and MD5 digests from blob data. - + The [Buffer](Titanium.Buffer) object can also contain binary data, and is more easily mutable. Extracting blob data to a buffer is somewhat roundabout: var blobStream = Ti.Stream.createStream({ source: myBlob, mode: Ti.Stream.MODE_READ }); var newBuffer = Ti.createBuffer({ length: myBlob.length }); var bytes = blobStream.read(newBuffer); - + Creating a blob from a buffer is much easier: - + var newBlob = myBuffer.toBlob(); - - In both cases, the conversion involves copying the data from one object to another, so + + In both cases, the conversion involves copying the data from one object to another, so you should be conscious of the amount of the data being copied. extends: Titanium.Proxy since: "0.9" -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] createable: false properties: @@ -49,7 +49,7 @@ properties: - name: text type: String - summary: UTF-8 string representation of the data in this blob. + summary: UTF-8 string representation of the data in this blob. description: | If this blob represents pure binary data, the value will be `null`. permission: read-only @@ -61,23 +61,17 @@ properties: - name: height type: Number - summary: If this blob represents an image, this is the height of the image in pixels. + summary: If this blob represents an image, this is the height of the image in pixels. description: | If this blob doesn't represent an image, `height` is 0. - On Mobile Web, the `height` is not available until the image loads. It is advised - to set a timeout to wait for the image to load before accessing the `height`. - permission: read-only - name: width type: Number - summary: If this blob represents an image, this is the width of the image in pixels. + summary: If this blob represents an image, this is the width of the image in pixels. description: | If this blob doesn't represent an image, `height` is 0. - - On Mobile Web, the `width` is not available until the image loads. It is advised to set a timeout - to wait for the image to load before accessing the `width`. permission: read-only - name: nativePath @@ -86,7 +80,7 @@ properties: If this blob represents a [File](Titanium.Filesystem.File), this is the file URL that represents it. description: | - If this blob doesn't represent a file, the value of `nativePath` is `null`. + If this blob doesn't represent a file, the value of `nativePath` is `null`. permission: read-only - name: size @@ -96,11 +90,7 @@ properties: description: | If this blob represents an image, this is the total number of pixels in the image. Otherwise it returns the number of bytes in the binary data. - - On Mobile Web, always returns the number of bytes of the blob. Note that internally, - binary data is stored base64 encoded and `size` represents the number of bytes before - base64 encoding. - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] permission: read-only methods: @@ -109,12 +99,10 @@ methods: returns: type: String summary: Returns a string representation of this blob. - description: | - On Mobile Web, if the blob is binary, `toString` returns a base64 encoded data URI. - name: append summary: Appends the data from another blob to this blob. - platforms: [android, mobileweb] + platforms: [android] parameters: - name: blob type: Titanium.Blob diff --git a/apidoc/Titanium/BlobStream.yml b/apidoc/Titanium/BlobStream.yml index 96e711ffdff..e2e78f81f7d 100644 --- a/apidoc/Titanium/BlobStream.yml +++ b/apidoc/Titanium/BlobStream.yml @@ -7,4 +7,4 @@ description: | `Blob`. since: "1.7" createable: false -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] diff --git a/apidoc/Titanium/Buffer.yml b/apidoc/Titanium/Buffer.yml index cddf3598dd4..3f544344b9a 100644 --- a/apidoc/Titanium/Buffer.yml +++ b/apidoc/Titanium/Buffer.yml @@ -1,23 +1,23 @@ --- name: Titanium.Buffer -summary: Buffer is a mutable, resizable container for raw data. +summary: Buffer is a mutable, resizable container for raw data. description: | A `Buffer` works like a resizable array of byte values. Use the method to create a buffer. extends: Titanium.Proxy since: "1.7" -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] properties: - name: length type: Number - summary: Length of the buffer in bytes. + summary: Length of the buffer in bytes. description: | - When `length` is modified the buffer will be re-sized while preserving existing data where - possible. If the new buffer length is smaller than the length of the existing data then the - existing data will be truncated down to the size of the new buffer. - + When `length` is modified the buffer will be re-sized while preserving existing data where + possible. If the new buffer length is smaller than the length of the existing data then the + existing data will be truncated down to the size of the new buffer. + Resizing a buffer by setting its length should be used sparingly due to the associated overhead. default: 0 unless `value` is specified, in which case the length of the encoded data is used. @@ -25,28 +25,28 @@ properties: - name: value type: [Number, String] availability: creation - summary: Data to be encoded. + summary: Data to be encoded. description: | - If `value` is a Number, `type` must also be set. (This is simply a convenient way of + If `value` is a Number, `type` must also be set. (This is simply a convenient way of calling or .) - name: type type: String availability: creation - summary: The type of data encoding to use with `value`. + summary: The type of data encoding to use with `value`. description: | - Required when `value` is a Number. For numbers, specify a `TYPE` constant + Required when `value` is a Number. For numbers, specify a `TYPE` constant from , for example, . - + When `value` is a String, specify a `CHARSET` constant from . default: For string values, defaults to . - name: byteOrder type: Number availability: creation - summary: Byte order of this buffer. + summary: Byte order of this buffer. description: | - Specify either or . + Specify either or . default: OS native byte order. methods: @@ -54,10 +54,10 @@ methods: returns: type: Number summary: The number of bytes appended. - summary: Appends `sourceBuffer` to the this buffer. + summary: Appends `sourceBuffer` to the this buffer. description: | This buffer is grown dynamically to accommodate the additional data if need be. - + If `sourceOffset` and `sourceLength` are specified, data from `sourceBuffer` is copied starting at position `sourceOffset`, and no more than `sourceLength` bytes are copied. @@ -87,7 +87,7 @@ methods: returns: type: Number summary: The number of bytes inserted. - summary: Inserts data from `sourceBuffer` into this buffer at `offset`. + summary: Inserts data from `sourceBuffer` into this buffer at `offset`. description: | Buffer is grown to accommodate the new data. @@ -128,7 +128,7 @@ methods: description: | Does not expand this buffer if there is not enough room to accomodate the data from `sourceBuffer`. - + If `sourceOffset` and `sourceLength` are specified, bytes are copied from `sourceBuffer` starting at `sourceOffset`, and a maximum of `sourceLength` bytes are copied. @@ -157,7 +157,7 @@ methods: type: Number optional: true default: Length of source buffer. - + - name: clone returns: type: Titanium.Buffer @@ -165,7 +165,7 @@ methods: description: | If called with no arguments, retuns a complete copy of the current buffer. - If `offset` and `length` are specified, creates a new buffer from the original + If `offset` and `length` are specified, creates a new buffer from the original buffer contents starting at `offset` and ending at `offset`+`length`-1. parameters: - name: offset @@ -187,7 +187,7 @@ methods: description: | Fills the buffer by setting byte values to `fillByte`. - If `offset` and `length` are specified, fills the buffer starting at + If `offset` and `length` are specified, fills the buffer starting at `offset` and ending at `offset`+`length`-1. If `offset` and `length` are omitted, fills the entire buffer. @@ -212,7 +212,7 @@ methods: summary: Clears this buffer's contents but does not change the size of the buffer. - name: release - summary: Releases the space allocated to the buffer, and sets its length to 0. + summary: Releases the space allocated to the buffer, and sets its length to 0. description: | This is effectively the same as `buffer.length = 0`. diff --git a/apidoc/Titanium/BufferStream.yml b/apidoc/Titanium/BufferStream.yml index beb1afa73e1..01229c5a990 100644 --- a/apidoc/Titanium/BufferStream.yml +++ b/apidoc/Titanium/BufferStream.yml @@ -8,4 +8,4 @@ description: | `Buffer`. since: "1.7" createable: false -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] diff --git a/apidoc/Titanium/Codec/Codec.yml b/apidoc/Titanium/Codec/Codec.yml index c7d7a3319d3..735e24211cc 100644 --- a/apidoc/Titanium/Codec/Codec.yml +++ b/apidoc/Titanium/Codec/Codec.yml @@ -3,16 +3,16 @@ name: Titanium.Codec summary: | A module for translating between primitive types and raw byte streams. description: | - The `Codec` module can be used for encoding strings and numbers into [Buffer](Titanium.Buffer) - objects, and decoding primitive types from buffers. + The `Codec` module can be used for encoding strings and numbers into [Buffer](Titanium.Buffer) + objects, and decoding primitive types from buffers. #### Byte Order Multi-byte data can be stored in two different byte orders: big-endian or little-endian. In big-endian byte order, the most significant or highest-value byte is stored first. For example, the 4-byte integer 0xFEDCBA98 is made up of the - bytes 0xFE, 0xDC, 0xBA and 0x98, from most-significant to least-significant. - + bytes 0xFE, 0xDC, 0xBA and 0x98, from most-significant to least-significant. + If we represent a buffer as an array of byte values, a big-endian encoding of 0xFEDCBA98 would look like this: @@ -21,7 +21,7 @@ description: | In little-endian order, the bytes would be stored in this order: [ 0x98, 0xBA, 0xDC, 0xFE ] - + For 8-bit character encodings, including ASCII, Latin-1 and UTF-8, byte order is not significant: the text is a sequence of individual bytes. @@ -37,10 +37,10 @@ description: | Note that the bytes for each character are stored least-significant byte first, but the order of the characters is unchanged. - + extends: Titanium.Module since: "1.7" -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] properties: - name: CHARSET_ASCII @@ -162,8 +162,6 @@ methods: ). description: | See "Byte Order" in the main discussion of for more information. - - On Mobile Web, this property always returns . returns: type: Number summary: OS native byte order. @@ -184,8 +182,6 @@ methods: * If `byteOrder` is included in the `options` dictionary, the specified byte order is used -- otherwise, the native byte order is assumed. - - On Mobile Web, `position` is not supported. parameters: - name: options summary: Named parameters. @@ -198,7 +194,7 @@ methods: example: | This example encodes a double-precision floating point value in 8 bytes using the OS byte order. - + var buffer = Ti.createBuffer({ length: 8 }); Ti.Codec.encodeNumber({ source: 1.23456789, @@ -208,9 +204,9 @@ methods: - title: Encode an Integer Specifying Start Position and Byte Order example: | - This example encodes a 4-byte integer using big endian encoding, and + This example encodes a 4-byte integer using big endian encoding, and writes it to the supplied buffer starting at index position 10. - + var buffer = Ti.createBuffer({ length: 100 }); Ti.Codec.encodeNumber({ source: 0x3456789a, @@ -231,15 +227,13 @@ methods: Two optional parameters can also be specified in `options`: - * If `position` is included in the `options` dictionary, reads data from the + * If `position` is included in the `options` dictionary, reads data from the buffer starting at `position`. * If `byteOrder` is included in the `options` dictionary, the specified byte order is used -- otherwise, the native byte order is assumed. Throws an exception if `source` is null, or `position` is greater than `source.length` - - On Mobile Web, `position` and `byteOrder` are not supported. parameters: - name: options summary: Named parameters. @@ -250,22 +244,22 @@ methods: examples: - - title: Decode a Double-Precision Floating Point Number + - title: Decode a Double-Precision Floating Point Number example: | This sample decodes an 8-byte double-precision floating point number using the OS byte order. - + var buffer = // a buffer containing (at least) one 8-byte floating-point number var value = Ti.Codec.decodeNumber({ source: buffer, type: Ti.Codec.TYPE_DOUBLE }); - + - title: Decode an Integer Specifying Start Position and Byte Order example: | This sample decodes a 4-byte integer starting at index position 10 in the buffer, using big endian encoding. - + var buffer = // a buffer containing a 4-byte integer at position 10. var value = Ti.Codec.decodeNumber({ source: buffer, @@ -282,26 +276,24 @@ methods: Takes a set of named parameters in the `options` argument. The string is read from `source` and written to the buffer `dest`. - + Several optional parameters can also be specified in `options`: - + * If `charset` is included, the string is encoded using the specified character encoding. - * If `destPosition` is included, data is written into the buffer starting at - the specified position. - - * If `sourcePosition` is included, a substring of the source string starting at the + * If `destPosition` is included, data is written into the buffer starting at + the specified position. + + * If `sourcePosition` is included, a substring of the source string starting at the specified position is encoded. - * If `sourceLength` is included, at most the specified numer of characters + * If `sourceLength` is included, at most the specified numer of characters are encoded. - + Throws an exception if `charset` is not a valid character set, `source` is null, or either `sourcePosition`, `sourceLength`, or `sourcePosition`+`sourceLength` is greater than `source.length`. - - On Mobile Web, the `charset` option is not supported. All strings are treated as UTF-8. parameters: - name: options @@ -316,7 +308,7 @@ methods: examples: - title: Encode String with Default Character Encoding example: | - This sample encodes a string using the default character encoding (UTF-8), then trims the + This sample encodes a string using the default character encoding (UTF-8), then trims the buffer to the length of the encoded string. var buffer = Ti.createBuffer({ length: 1024 }); @@ -325,10 +317,10 @@ methods: dest: buffer }); buffer.length = length; - + - title: Encode Substring with Specified Character Encoding example: | - This sample encodes the first 10 characters of a string using UTF-16 character encoding. + This sample encodes the first 10 characters of a string using UTF-16 character encoding. // (10 * 2) + BOM = 22 var buffer = Ti.createBuffer({ length: 22 }); @@ -353,14 +345,12 @@ methods: * If `position` is specified, bytes are read from `source` starting at `position`. * If `length` is specified, no more than `length` bytes are read. - + * If `charset` is specified, it determines the character encoding used to decode the string. Otherwise, UTF-8 is assumed. - Throws an exception if `charset` is not a valid character set, `source` is null, + Throws an exception if `charset` is not a valid character set, `source` is null, or either `position`, `length`, or `position`+`length` is greater than `source.length`. - - On Mobile Web, `charset` is not supported. All strings are treated as UTF-8. parameters: - name: options @@ -381,7 +371,7 @@ methods: - title: Decode a String with a Specified Character Encoding example: | This sample decodes a string using the UTF-16 character encoding. - + var buffer = // a buffer containing a UTF-16 encoded string var string = Ti.Codec.decodeString({ source: buffer, diff --git a/apidoc/Titanium/Filesystem/File.yml b/apidoc/Titanium/Filesystem/File.yml index 3d97f0668e0..b42f8dab305 100644 --- a/apidoc/Titanium/Filesystem/File.yml +++ b/apidoc/Titanium/Filesystem/File.yml @@ -3,13 +3,13 @@ name: Titanium.Filesystem.File summary: Object representing a path to a file or directory in the device's persistent storage. description: | Use the method to get a handle to a `File` object, - which represents a given path. There does not need to be an existing file or directory - does not need to exist before `getFile` is called. If the file doesn't exist, and - the file path identifies a file in a writable directory, writing to the file - creates the file implicitly. + which represents a given path. There does not need to be an existing file or directory + does not need to exist before `getFile` is called. If the file doesn't exist, and + the file path identifies a file in a writable directory, writing to the file + creates the file implicitly. See for constants identifying commonly-used device directories. - + Use the [exists](Titanium.Filesystem.File.exists) method to test whether the file exists. A file object can point to an ordinary file, a directory or a symbolic link. @@ -20,24 +20,24 @@ description: | The `File` object doesn't provide methods for random access into the file. The `read` method reads the file's entire contents into a `Blob` object. The `write` method can either overwrite the entire file or append to an - existing file. + existing file. - For random access to a file, such as accessing a small portion of a larger file, - you can open a file as a [FileStream](Titanium.Filesystem.FileStream) object. Use the + For random access to a file, such as accessing a small portion of a larger file, + you can open a file as a [FileStream](Titanium.Filesystem.FileStream) object. Use the [open](Titanium.Filesystem.File.open) method to get a `FileStream` for an - existing `File` object, or use the method + existing `File` object, or use the method to get a `FileStream` directly without calling `getFile` first. - The module defines a number of properties and methods related to - filesystem access, including properties that specify paths for application-specific + The module defines a number of properties and methods related to + filesystem access, including properties that specify paths for application-specific directories, and methods for creating temporary files and directories. - On Android, files may be stored on external storage (that is, removable media such as + On Android, files may be stored on external storage (that is, removable media such as SD Cards). Note that once created with `getFile`, the path associated with a file object is - immutable. If you move the underlying file using [move](Titanium.Filesystem.File.move) - or [rename](Titanium.Filesystem.File.rename), you can no longer access it with the + immutable. If you move the underlying file using [move](Titanium.Filesystem.File.move) + or [rename](Titanium.Filesystem.File.rename), you can no longer access it with the original `File` object. You must use `getFile` to get a handle to the new path. #### Resource Files @@ -49,14 +49,14 @@ description: | extends: Titanium.Proxy since: "0.1" createable: false -examples: +examples: - title: Reading a File example: | Data files shipped with the application are stored in the resources directory. This example reads string data from a text file. - // resourcesDirectory is actually the default location, so the first + // resourcesDirectory is actually the default location, so the first // argument could be omitted here. file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "textfile.txt"); var blob = file.read(); @@ -66,15 +66,15 @@ examples: blob = null; - title: Creating a Subdirectory example: | - Files that the application writes to need to be stored outside of the + Files that the application writes to need to be stored outside of the resources directory, since that directory is read-only. This example creates a subdirectory to store downloaded images. The example assumes that two variables are defined elsewhere in the code: - myImageID, a string containing some kind of ID for the downloaded image, + myImageID, a string containing some kind of ID for the downloaded image, and myImageData, a `Blob` containing JPEG image data. - var imageDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, + var imageDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'downloaded_images'); if (! imageDir.exists()) { imageDir.createDirectory(); @@ -99,23 +99,23 @@ methods: are appended to this file. Returns `true` if the operation succeeds. - parameters: + parameters: - name: data summary: Data to append. type: [String,Titanium.Blob,Titanium.Filesystem.File] returns: type: Boolean - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: copy summary: Copies the file identified by this file object to a new path. description: Returns `true` if the copy succeeds. - parameters: + parameters: - name: destinationPath summary: Destination path to copy to. type: String returns: type: Boolean - platforms: [android, mobileweb] + platforms: [android] - name: createDirectory summary: Creates a directory at the path identified by this file object. description: | @@ -128,13 +128,13 @@ methods: Note that if you write to a file that doesn't exist, the file is created automatically, so it is not necessary to call this method unless you want to explicitly create the file (for example, to create an empty file). - - Returns `true` if the file was created successfully. Returns `false` if the + + Returns `true` if the file was created successfully. Returns `false` if the file already exists, or if the file couldn't be created for some other reason. returns: type: Boolean - platforms: [iphone, ipad, android, mobileweb] - since: { iphone: "0.9.0", ipad: "0.9.0", mobileweb: "2.0.0", android: "6.1.0" } + platforms: [iphone, ipad, android] + since: { iphone: "0.9.0", ipad: "0.9.0", android: "6.1.0" } - name: createTimestamp summary: Returns the creation timestamp for the file identified by this file object. @@ -152,7 +152,7 @@ methods: type: Boolean parameters: - name: recursive - summary: Pass `true` to recursively delete any directory contents. + summary: Pass `true` to recursively delete any directory contents. type: Boolean optional: true default: false @@ -174,7 +174,7 @@ methods: summary: | Returns a listing of the directory identified by this file object, or `null` if this object doesn't identify a directory. - returns: + returns: type: Array - name: getParent summary: Returns the path of the parent directory holding the file identified by this @@ -182,7 +182,7 @@ methods: description: | On iOS, this method returns the path of the parent directory as a String. - Android supports a [parent](Titanium.Filesystem.File.parent) property, which + Android supports a [parent](Titanium.Filesystem.File.parent) property, which is a `File` object representing the parent directory path. The `getParent` method on Android is a getter for the `parent` property, so it returns a `File` object rather than a String. @@ -198,16 +198,16 @@ methods: type: String constants: Titanium.Filesystem.IOS_FILE_PROTECTION_* platforms: [iphone, ipad] - since: "4.1.0" + since: "4.1.0" - name: isDirectory - summary: Returns `true` if this file object represents a directory. + summary: Returns `true` if this file object represents a directory. returns: type: Boolean since: { iphone: "3.1.0", ipad: "3.1.0" } - name: isFile summary: Returns `true` if this file object represents an ordinary file. - returns: + returns: type: Boolean since: { iphone: "3.1.0", ipad: "3.1.0" } - name: modificationTimestamp @@ -220,7 +220,7 @@ methods: - name: move summary: Moves the file identified by this file object to another path. description: | - Note that this method moves the stored file, but doesn't update this + Note that this method moves the stored file, but doesn't update this file object to point to the new path. To access the file after moving it, you must call [getFile](Titanium.Filesystem.getFile) using the destination path to obtain a new file handle. @@ -232,16 +232,16 @@ methods: type: String - name: open - summary: Opens the file identified by this file object for random access. + summary: Opens the file identified by this file object for random access. description: | - You can open the file for reading, writing, or appending by specifying one of the + You can open the file for reading, writing, or appending by specifying one of the `MODE` constants from : - [MODE_READ](Titanium.Filesystem.MODE_READ), [MODE_WRITE](Titanium.Filesystem.MODE_WRITE), + [MODE_READ](Titanium.Filesystem.MODE_READ), [MODE_WRITE](Titanium.Filesystem.MODE_WRITE), or [MODE_APPEND](Titanium.Filesystem.MODE_APPEND). - The `FileStream` object returned by this call can be used to read from, write to, or + The `FileStream` object returned by this call can be used to read from, write to, or append to the file, depending on what mode the file is opened in. - parameters: + parameters: - name: mode summary: | Mode to open the file in: `MODE_READ`, `MODE_WRITE`, or `MODE_APPEND`. @@ -261,7 +261,7 @@ methods: Fails if the destination is in a different directory than the current file. Use [move](Titanium.Filesystem.File.move) to move a file to a different directory. - Note that this method renames the stored file, but doesn't update this + Note that this method renames the stored file, but doesn't update this file object to point to the new path. To access the file after renaming it, you must call [getFile](Titanium.Filesystem.getFile) using the destination path to obtain a new file handle. @@ -296,7 +296,7 @@ methods: constants: Titanium.Filesystem.IOS_FILE_PROTECTION_* type: String platforms: [iphone, ipad] - since: "4.1.0" + since: "4.1.0" - name: spaceAvailable summary: Returns the amount of free space available on the device where the file @@ -309,9 +309,9 @@ methods: - name: write summary: Writes the specified data to the file identified by this file object. description: | - If the `append` parameter is `false` or not specified, any existing data in - the file is overwritten. - + If the `append` parameter is `false` or not specified, any existing data in + the file is overwritten. + If `append` is `true`, the specified data is appended to the end of the file. returns: type: Boolean @@ -329,18 +329,18 @@ properties: summary: | `true` if the file is executable. description: | - On iOS, Mobile Web, this property exists but is always `false`. + On iOS, this property exists but is always `false`. type: Boolean - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] permission: read-only - name: hidden summary: Set to `true` if the file is hidden. description: | - On iOS, Mobile Web, this property exists but is always `false`. + On iOS, this property exists but is always `false`. type: Boolean - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: name summary: Name of the file. @@ -350,7 +350,7 @@ properties: - name: nativePath summary: Native path associated with this file object, as a file URL. description: | - On iOS, use the [resolve](Titanium.Filesystem.File.resolve) + On iOS, use the [resolve](Titanium.Filesystem.File.resolve) method to obtain a plain file path for use with native modules. type: String permission: read-only @@ -358,17 +358,14 @@ properties: summary: A `File` object representing the parent directory of the file identified by this object. type: Titanium.Filesystem.File permission: read-only - platforms: [android, mobileweb] + platforms: [android] - name: readonly summary: | `true` if the file identified by this object is read-only. - description: | - On Mobile Web, this property exists but is always `true` for files in the resources directory - and `false` for application data and temporary files. type: Boolean permission: read-only - platforms: [android, mobileweb] + platforms: [android] - name: size summary: Size, in bytes, of the file identified by this object. @@ -384,7 +381,7 @@ properties: multiple times will not cause problems. For files distributed with your app, this will need to be set on boot. This flag will only affect iOS versions 5.0.1 and later, but is safe to set on earlier versions. - + Note that setting this property to `false` will also prevent the file identified by this object from being backed up to iTunes. default: true @@ -394,8 +391,6 @@ properties: - name: symbolicLink summary: | `true` if the file identified by this object is a symbolic link. - description: | - On Mobile Web, this property exists but is always `false`. type: Boolean permission: read-only diff --git a/apidoc/Titanium/Filesystem/FileStream.yml b/apidoc/Titanium/Filesystem/FileStream.yml index 8cd7e0b8b9b..cb388e2d093 100644 --- a/apidoc/Titanium/Filesystem/FileStream.yml +++ b/apidoc/Titanium/Filesystem/FileStream.yml @@ -4,8 +4,7 @@ summary: Wrapper around `Titanium.Filesystem.File` that implements the `Titanium extends: Titanium.IOStream since: "1.7" createable: false -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] methods: - name: close summary: closes file stream, exception is thrown on error - diff --git a/apidoc/Titanium/Filesystem/Filesystem.yml b/apidoc/Titanium/Filesystem/Filesystem.yml index 17cae7df89e..859d54892d1 100644 --- a/apidoc/Titanium/Filesystem/Filesystem.yml +++ b/apidoc/Titanium/Filesystem/Filesystem.yml @@ -7,7 +7,7 @@ description: | as well as the other Filesystem submodule API documentation. extends: Titanium.Module since: "0.1" -examples: +examples: - title: Getting a directory for an application group (iOS) example: | This example writes a string to a text file in a shared directory @@ -36,27 +36,27 @@ methods: arguments. description: | Note that `getFile` does not create a file if one does not exist at the specified - path. It returns a new `File` object referring to the specified file path. The - application can create a file at that path by calling + path. It returns a new `File` object referring to the specified file path. The + application can create a file at that path by calling [write](Titanium.Filesystem.File.write) or create a directory by calling [createDirectory](Titanium.Filesystem.File.createDirectory) on the `File` object. - + This method takes a variable number of arguments, where each argument is treated as a path component. All of the arguments are joined together using the platform-specific path separator to make the final path. - + If a relative path is passed, the full path should be interpreted relative - to the current file. For example, if the file `Resources/login/login.js` + to the current file. For example, if the file `Resources/login/login.js` contains the following code: - + var icon = Titanium.Filesystem.getFile('icon.png'); - - The path is interpreted as `Resources/login/icon.png`. - + + The path is interpreted as `Resources/login/icon.png`. + On iOS, all relative paths are currently interpreted as relative to the `Resources` directory, **not** to the current context. This is a known issue that will be addressed in a future release. - + On iOS9, if app thinning is enabled, and the file of interest is an image file that was bundled with the app (not downloaded during runtime), this will not return the image file since it is already allocated inside the assets catalog. Please @@ -66,7 +66,7 @@ methods: type: Titanium.Filesystem.File parameters: - name: path - summary: One or more path components. Path arguments are joined together using + summary: One or more path components. Path arguments are joined together using the platform specific path separator to form the full path. type: String @@ -74,25 +74,25 @@ methods: summary: Returns a `Blob` object representing the asset catalog image identified by the path arguments. description: | - This method is only applicable on images in assets catalogs for apps with app-thinning - enabled on iOS. Since the bundled image has been reallocated into assets catalog, it is - no longer accessible via the original file path. To obtain a `Blob` object representing + This method is only applicable on images in assets catalogs for apps with app-thinning + enabled on iOS. Since the bundled image has been reallocated into assets catalog, it is + no longer accessible via the original file path. To obtain a `Blob` object representing this image, use the original file path as the parameter in this method instead of using it in [getFile](Titanium.Filesystem.getFile) - - Similar to [getFile](Titanium.Filesystem.getFile), this method takes a variable - number of arguments, where each argument is treated as a path component. - All of the arguments are joined together using the platform-specific path separator + + Similar to [getFile](Titanium.Filesystem.getFile), this method takes a variable + number of arguments, where each argument is treated as a path component. + All of the arguments are joined together using the platform-specific path separator to make the final path. - + If a relative path is passed, the full path should be interpreted relative - to the current file. For example, if the file `Resources/login/login.js` + to the current file. For example, if the file `Resources/login/login.js` contains the following code: - + var icon = Titanium.Filesystem.getAsset('icon.png'); - - The path is interpreted as `Resources/login/icon.png`. - + + The path is interpreted as `Resources/login/icon.png`. + On iOS, all relative paths are currently interpreted as relative to the `Resources` directory, **not** to the current context. This is a known issue that will be addressed in a future release. @@ -101,7 +101,7 @@ methods: type: Titanium.Blob parameters: - name: path - summary: One or more path components. Path arguments are joined together using + summary: One or more path components. Path arguments are joined together using the platform specific path separator to form the full path. type: String platforms: [iphone, ipad] @@ -115,7 +115,7 @@ methods: Returns `true` on Android if an external storage device, such as an SD card, is available for reading and writing. - Returns `false` on iOS and Mobile Web. + Returns `false` on iOS. returns: type: Boolean @@ -150,11 +150,11 @@ methods: Access mode. constants: Titanium.Filesystem.MODE_* type: Number - + - name: path summary: | - One or more path components. Path arguments are joined together using the - platform-specific path separator to form the full path. + One or more path components. Path arguments are joined together using the + platform-specific path separator to form the full path. type: String returns: type: Titanium.Filesystem.FileStream @@ -162,9 +162,9 @@ methods: - name: directoryForSuite summary: Returns the path to the container directory associated with the specified security application group ID. description: | - This is a writable directory used on iOS. Groups of sandboxed apps that need to share files + This is a writable directory used on iOS. Groups of sandboxed apps that need to share files and other information can request a container directory as part of their entitlements. - + When called with a valid group identifier, this method returns the location of that directory as a string. Returns null if the group identifier is invalid; check the app's entitlements. parameters: @@ -200,7 +200,7 @@ properties: type: String permission: read-only platforms: [iphone, ipad] - since: "4.1.0" + since: "4.1.0" - name: IOS_FILE_PROTECTION_COMPLETE summary: Constant used to set protection key to NSFileProtectionComplete in file attributes. @@ -210,29 +210,29 @@ properties: type: String permission: read-only platforms: [iphone, ipad] - since: "4.1.0" + since: "4.1.0" - name: IOS_FILE_PROTECTION_COMPLETE_UNLESS_OPEN summary: Constant used to set protection key to NSFileProtectionCompleteUnlessOpen in file attributes. description: | - File is stored in an encrypted format on disk. Can be created while the device is locked, - but once closed, cannot be opened again until the device is unlocked. If the file is opened when - unlocked, you may continue to access the file normally, even if the user locks the device. + File is stored in an encrypted format on disk. Can be created while the device is locked, + but once closed, cannot be opened again until the device is unlocked. If the file is opened when + unlocked, you may continue to access the file normally, even if the user locks the device. type: String permission: read-only platforms: [iphone, ipad] - since: "4.1.0" + since: "4.1.0" - name: IOS_FILE_PROTECTION_COMPLETE_UNTIL_FIRST_USER_AUTHENTICATION summary: Constant used to set protection key to NSFileProtectionCompleteUntilFirstUserAuthentication in file attributes. description: | File is stored in an encrypted format on disk. Cannot be accessed until after the device has booted. - After the user unlocks the device for the first time, your app can access the file and continue to + After the user unlocks the device for the first time, your app can access the file and continue to access it even if the user subsequently locks the device. type: String permission: read-only platforms: [iphone, ipad] - since: "4.1.0" + since: "4.1.0" - name: applicationCacheDirectory summary: Path to the application's internal cache directory. @@ -252,18 +252,18 @@ properties: - name: applicationDataDirectory summary: Path to the application's data directory. description: | - This is a writable directory that can be used to store applications-specific files. + This is a writable directory that can be used to store applications-specific files. On iOS, this directory is specifically designated for user documents, and a separate directory, [applicationSupportDirectory](Titanium.Filesystem.applicationSupportDirectory) is used for other application data. - + On iOS, files in this directory are backed up unless the [remoteBackup](Titanium.Filesystem.File.remoteBackup) flag is set to false. - On Android, files in this directory cannot be accessed by other applications, so - it should not be used for files that must be used by another application + On Android, files in this directory cannot be accessed by other applications, so + it should not be used for files that must be used by another application (for example, a video file that will be passed to the system's video player application). These files should be stored in the [externalStorageDirectory](Titanium.Filesystem.externalStorageDirectory). @@ -277,9 +277,9 @@ properties: - name: applicationSupportDirectory summary: Path to the application support directory. description: | - This is a writable directory used on iOS for application files that are *not* + This is a writable directory used on iOS for application files that are *not* user documents--including settings files, caches, and so on. - + On iOS, files in this directory are backed up unless the [remoteBackup](Titanium.Filesystem.File.remoteBackup) flag is set to false. type: String @@ -290,20 +290,20 @@ properties: description: | This directory can be used for storing arbitrary data. It is read/write and files in this directory can be passed to other applications, such as video - players--which is not possible with the + players--which is not possible with the [applicationDataDirectory](Titanium.Filesystem.applicationDataDirectory). This directory may not be subject to as many memory limitations as the `applicationDataDirectory`, which is stored in the device's internal storage. Note, however, that the user may remove or replace the removable storage device - without warning, so the application must be prepared to handle this case gracefully. - + without warning, so the application must be prepared to handle this case gracefully. + The application should check [isExternalStoragePresent](Titanium.Filesystem.isExternalStoragePresent) before - accessing this location. The application should also handle any exceptions generated - if the storage device is unmounted during use, or if the files stored on external + accessing this location. The application should also handle any exceptions generated + if the storage device is unmounted during use, or if the files stored on external storage are not available. - + type: String permission: read-only platforms: [android] @@ -316,14 +316,14 @@ properties: summary: Path to the application's resource directory. description: | This directory is read-only. If you need to modify any files in this directory, - they must first be copied to another directory, such as + they must first be copied to another directory, such as [applicationDataDirectory](Titanium.Filesystem.applicationDataDirectory) or - [tempDirectory](Titanium.Filesystem.tempDirectory). - - On iOS, - writable files can also be placed in the + [tempDirectory](Titanium.Filesystem.tempDirectory). + + On iOS, + writable files can also be placed in the [applicationSupportDirectory](Titanium.Filesystem.applicationSupportDirectory). - On Android, writable files can also be placed in the + On Android, writable files can also be placed in the [externalStorageDirectory](Titanium.Filesystem.externalStorageDirectory). Note that when running on the simulator, the resources directory may be writable, @@ -335,19 +335,19 @@ properties: description: | On Android, the raw resources directory can be used for resources that need to be accessed as individual files, not included in the Android resources bundle. For - example, sound files placed in the raw resources directory can be accessed by + example, sound files placed in the raw resources directory can be accessed by notifications, which cannot access sound files from the resource directory. - To use raw resources, place files in the `platform/android/res/raw` folder, where + To use raw resources, place files in the `platform/android/res/raw` folder, where `platform` is at the top level of the project, not inside the `Resources` folder. You will need to create the `platform` folder and subfolders. This directory is read-only. If you need to modify any files in this directory, - they must first be copied to another directory, such as + they must first be copied to another directory, such as [applicationDataDirectory](Titanium.Filesystem.applicationDataDirectory) or - [tempDirectory](Titanium.Filesystem.tempDirectory). - + [tempDirectory](Titanium.Filesystem.tempDirectory). + platforms: [android] since: "3.0.2" type: String @@ -358,15 +358,14 @@ properties: permission: read-only - name: tempDirectory - summary: Path for the application's temporary directory. + summary: Path for the application's temporary directory. description: | This directory can be used for storing temporary files. Files in this directory may not persist when the application is shut down and restarted. type: String permission: read-only - + --- name: RequestStorageAccessResult summary: Argument passed to the callback when a request finishes successfully or erroneously. extends: ErrorResponse - diff --git a/apidoc/Titanium/Geolocation/Geolocation.yml b/apidoc/Titanium/Geolocation/Geolocation.yml index 4b20cf9dfff..e86e814f324 100644 --- a/apidoc/Titanium/Geolocation/Geolocation.yml +++ b/apidoc/Titanium/Geolocation/Geolocation.yml @@ -9,16 +9,16 @@ description: | * Geocoding and reverse geocoding. Converting geographic coordinates into addresses, and converting addresses into geographic coordinates. - Using location services can have a significant impact on a device's battery life, + Using location services can have a significant impact on a device's battery life, so it's important to use them in the most efficient manner possible. Power consumption - is strongly influenced by the accuracy and frequency of location updates required by - your application. - + is strongly influenced by the accuracy and frequency of location updates required by + your application. + The location services systems of the underlying platforms are very different, so there are significant implementation differences between the platforms. The basic methods of requesting location information and receiving location updates - are essentially the same on all platforms. However, the method of configuring the + are essentially the same on all platforms. However, the method of configuring the accuracy and frequency of location updates is different for each platform. #### Getting Location Information @@ -39,12 +39,12 @@ description: | In iOS, the accuracy (and power consumption) of location services is primarily determined by the [accuracy](Titanium.Geolocation.accuracy) setting. This can be set to one of the following values: - + * [ACCURACY_BEST](Titanium.Geolocation.ACCURACY_BEST) (highest accuracy and power consumption) * [ACCURACY_HIGH](Titanium.Geolocation.ACCURACY_HIGH) - * [ACCURACY_NEAREST_TEN_METERS](Titanium.Geolocation.ACCURACY_NEAREST_TEN_METERS) - * [ACCURACY_HUNDRED_METERS](Titanium.Geolocation.ACCURACY_HUNDRED_METERS) - * [ACCURACY_KILOMETER](Titanium.Geolocation.ACCURACY_KILOMETER) + * [ACCURACY_NEAREST_TEN_METERS](Titanium.Geolocation.ACCURACY_NEAREST_TEN_METERS) + * [ACCURACY_HUNDRED_METERS](Titanium.Geolocation.ACCURACY_HUNDRED_METERS) + * [ACCURACY_KILOMETER](Titanium.Geolocation.ACCURACY_KILOMETER) * [ACCURACY_LOW](Titanium.Geolocation.ACCURACY_LOW) * [ACCURACY_THREE_KILOMETERS](Titanium.Geolocation.ACCURACY_THREE_KILOMETERS) (lowest accuracy and power consumption). @@ -81,72 +81,58 @@ description: | #### Configurating Location Updates on Android - + Prior to Titanium Mobile 2.0, Titanium attempted to follow the iOS model on Android, but this didn't fit the native Android model well. In Release 2.0, three different location service modes are supported on Android: *simple*, *manual*, and *legacy*. - * *Simple mode* provides a compromise mode that provides adaquate support for + * *Simple mode* provides a compromise mode that provides adaquate support for undemanding location applications without requiring developers to write a lot of Android-specific code. To use simple mode: - 1. Leave the flag set to `false` (the + 1. Leave the flag set to `false` (the default value). - - 2. Set the [accuracy](Titanium.Geolocation.accuracy) property to - either [ACCURACY_HIGH](Titanium.Geolocation.ACCURACY_HIGH) or + + 2. Set the [accuracy](Titanium.Geolocation.accuracy) property to + either [ACCURACY_HIGH](Titanium.Geolocation.ACCURACY_HIGH) or [ACCURACY_LOW](Titanium.Geolocation.ACCURACY_LOW). * *Manual mode* gives developers low-level control of location updates, including enabling individual location providers and filtering updates, for the best - combination of accuracy and battery life. + combination of accuracy and battery life. Manual mode is used when the flag is set to `true`. In manual mode, the `accuracy` property is not used, and all configuration is done through the module. - * *Legacy mode* is the mode that existed prior to 2.0. Legacy mode is - used when the `manualMode` flag is `false` and the `accuracy` property is + * *Legacy mode* is the mode that existed prior to 2.0. Legacy mode is + used when the `manualMode` flag is `false` and the `accuracy` property is set to one of the iOS `ACCURACY` constants: * [ACCURACY_BEST](Titanium.Geolocation.ACCURACY_BEST) (highest accuracy and power consumption) - * [ACCURACY_NEAREST_TEN_METERS](Titanium.Geolocation.ACCURACY_NEAREST_TEN_METERS) - * [ACCURACY_HUNDRED_METERS](Titanium.Geolocation.ACCURACY_HUNDRED_METERS) - * [ACCURACY_KILOMETER](Titanium.Geolocation.ACCURACY_KILOMETER) + * [ACCURACY_NEAREST_TEN_METERS](Titanium.Geolocation.ACCURACY_NEAREST_TEN_METERS) + * [ACCURACY_HUNDRED_METERS](Titanium.Geolocation.ACCURACY_HUNDRED_METERS) + * [ACCURACY_KILOMETER](Titanium.Geolocation.ACCURACY_KILOMETER) * [ACCURACY_THREE_KILOMETERS](Titanium.Geolocation.ACCURACY_THREE_KILOMETERS) (lowest - accuracy and power consumption). - - This mode is deprecated and should not be used for new development. + accuracy and power consumption). + + This mode is deprecated and should not be used for new development. - In this mode, the specified `accuracy` value determines the + In this mode, the specified `accuracy` value determines the *minimum distance between location updates*. If `accuracy` is set to `ACCURACY_BEST`, no distance filter is used on updates. - + In legacy mode, only a single location provider (GPS, network, or passive) is - enabled at a time. You can specify a the location provider using the + enabled at a time. You can specify a the location provider using the [preferredProvider](Titanium.Geolocation.preferredProvider) property. - + You can also specifying a desired update frequency using the [frequency](Titanium.Geolocation.frequency) property. The `preferredProvider` and `frequency` properties are not used in any other mode. - #### Configuring Location Updates on Mobile Web - - Location services on Mobile Web operate similarly to the *simple mode* operations on - Android. Setting [accuracy](Titanium.Geolocation.accuracy) property to - [ACCURACY_HIGH](Titanium.Geolocation.ACCURACY_HIGH) yeilds the best available location - updates, with the hightest power consumption. - Using [ACCURACY_LOW](Titanium.Geolocation.ACCURACY_LOW) provides lower-quality location - updates with lower power consumption. - - In addition to the accuracy setting, there are several Mobile Web-specific settings. - See for details. - #### Using the Compass Both iOS and Android support a receiving heading updates from a hardware compass, if available. - On Mobile Web, heading updates are supported if the browser supports this feature. - Currently, this support is only available on Mobile Safari. Check the [hasCompass](Titanium.Geolocation.hasCompass) property to see if the current device supports a compass. @@ -185,7 +171,7 @@ description: | The module provides two methods, [forwardGeocoder](Titanium.Geolocation.forwardGeocoder) and [reverseGeocoder](Titanium.Geolocation.reverseGeocoder) to convert between geographic coordinates and addresses. These methods map to MapQuest Open Nominatim Search Service. - While this API has the advantage that it has no daily usage limits, please note that the data backing this API is crowd sourced and might not return + While this API has the advantage that it has no daily usage limits, please note that the data backing this API is crowd sourced and might not return proper values for valid addresses and geographic coordinates. If geocoding services are essential component of the application, developers are encouraged to use commercial geocoding providers. @@ -200,9 +186,9 @@ methods: summary: address to resolve. type: String - name: callback - summary: Function to invoke on success or failure. + summary: Function to invoke on success or failure. type: Callback - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: getCurrentHeading summary: Retrieves the current compass heading. @@ -210,48 +196,48 @@ methods: - name: callback summary: Function to invoke on success or failure of obtaining the current heading. type: Callback - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: getCurrentPosition - summary: Retrieves the last known location from the device. + summary: Retrieves the last known location from the device. description: | On Android, the radios are not turned on to update the location, and a cached location is used. - - On iOS the radios **may** be used if the location is too "old". + + On iOS the radios **may** be used if the location is too "old". parameters: - name: callback - summary: Function to invoke on success or failure of obtaining the current location. + summary: Function to invoke on success or failure of obtaining the current location. type: Callback - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: hasLocationPermissions summary: Returns `true` if the app has location access. parameters: - name: authorizationType summary: | - Types of geolocation's authorizations. This is an iOS 8 and above only parameter and is ignored on + Types of geolocation's authorizations. This is an iOS 8 and above only parameter and is ignored on Android and iOS 7. constants: [Titanium.Geolocation.AUTHORIZATION_ALWAYS,Titanium.Geolocation.AUTHORIZATION_WHEN_IN_USE] - type: Number + type: Number returns: - type: Boolean + type: Boolean platforms: [iphone, ipad, android] since: "5.1.0" - + - name: requestLocationPermissions summary: Requests for location access. description: | On Android, the request view will show if the permission is not accepted by the user, and the user did not check the box "Never ask again" when denying the request. If the user checks the box "Never ask again," - the user has to manually enable the permission in device settings. If the user asks for permissions or - tries to get unauthorized location information, then the app should call the request method to show - the permission settings. This method requests `Manifest.permission.ACCESS_FINE_LOCATION` on Android. + the user has to manually enable the permission in device settings. If the user asks for permissions or + tries to get unauthorized location information, then the app should call the request method to show + the permission settings. This method requests `Manifest.permission.ACCESS_FINE_LOCATION` on Android. If you require other permissions, you can also use . In iOS 8, Apple introduced the Info.plist keys `NSLocationWhenInUseUsageDescription` and `NSLocationAlwaysUsageDescription` that are used to display an own description while requesting location permissions. In addition to this method, you need to - include one of these keys (based on how your location updates should behave) or the application will crash if your app does not. + include one of these keys (based on how your location updates should behave) or the application will crash if your app does not. Check the [Apple docs](https://developer.apple.com/library/prerelease/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html) for more information. parameters: - name: authorizationType @@ -281,14 +267,14 @@ methods: type: Number - name: callback - summary: Function to invoke on success or failure. + summary: Function to invoke on success or failure. type: Callback - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] events: - name: calibration - summary: Fired when the device detects interface and requires calibration. + summary: Fired when the device detects interface and requires calibration. description: | When this event is fired, the OS calibration UI is being displayed to the end user. platforms: [iphone, ipad] @@ -322,7 +308,7 @@ events: - name: code summary: if `success` is false, the error code if available. type: Number - + - name: success summary: Indicates if location data was successfully retrieved. type: Boolean @@ -343,9 +329,9 @@ events: - name: locationupdatepaused summary: Fired when location updates are paused by the OS. Available in iOS 6.0 and later. description: | - This event is fired when [pauseLocationUpdateAutomatically](Titanium.Geolocation.pauseLocationUpdateAutomatically) - is set to `true` and if the OS detects that the device's location is not changing, - causing it to pause the delivery of updates in order to shut down the appropriate + This event is fired when [pauseLocationUpdateAutomatically](Titanium.Geolocation.pauseLocationUpdateAutomatically) + is set to `true` and if the OS detects that the device's location is not changing, + causing it to pause the delivery of updates in order to shut down the appropriate hardware and save power. platforms: [iphone, ipad] since: "3.1.0" @@ -353,8 +339,8 @@ events: - name: locationupdateresumed summary: Fired when location manager is resumed by the OS. Available in iOS 6.0 and later. description: | - When location updates are paused and need to be resumed (perhaps because the user - is moving again), this event is fired to let the app know that it is about to + When location updates are paused and need to be resumed (perhaps because the user + is moving again), this event is fired to let the app know that it is about to begin the delivery of those updates again. platforms: [iphone, ipad] since: "3.1.0" @@ -362,7 +348,7 @@ events: - name: authorization summary: Fired when changes are made to the authorization status for location services. Available in iOS 8.0 and later. description: | - This event is fired whenever the application's ability to use location services changes. + This event is fired whenever the application's ability to use location services changes. Changes can occur because the user allowed or denied the use of location services for the app or the system as a whole. properties: - name: authorizationStatus @@ -384,7 +370,7 @@ properties: battery usage. Using this value on Android enables *legacy mode* operation, which is not - recommended. + recommended. type: Number permission: read-only platforms: [android, iphone, ipad] @@ -395,7 +381,7 @@ properties: updates accurate to the nearest 100 meters. description: | Using this value on Android enables *legacy mode* operation, which is not - recommended. + recommended. type: Number permission: read-only platforms: [android, iphone, ipad] @@ -406,7 +392,7 @@ properties: updates accurate to the nearest kilometer. description: | Using this value on Android enables *legacy mode* operation, which is not - recommended. + recommended. type: Number permission: read-only platforms: [android, iphone, ipad] @@ -417,7 +403,7 @@ properties: updates accurate to the nearest 10 meters. description: | Using this value on Android enables *legacy mode* operation, which is not - recommended. + recommended. type: Number permission: read-only platforms: [android, iphone, ipad] @@ -428,7 +414,7 @@ properties: updates accurate to the nearest three kilometers. description: | Using this value on Android enables *legacy mode* operation, which is not - recommended. + recommended. type: Number permission: read-only platforms: [android, iphone, ipad] @@ -441,16 +427,16 @@ properties: Using this value on Android enables *simple mode* operation. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] since: "2.0.0" - + - name: ACCURACY_BEST_FOR_NAVIGATION summary: | - Use with [accuracy](Titanium.Geolocation.accuracy) to request highest possible + Use with [accuracy](Titanium.Geolocation.accuracy) to request highest possible accuracy and combine it with additional sensor data. description: | - Using this value is intended for use in navigation applications that require - precise position information at all times and are intended to be used only while + Using this value is intended for use in navigation applications that require + precise position information at all times and are intended to be used only while the device is plugged in. type: Number permission: read-only @@ -466,12 +452,12 @@ properties: Using this value on Android enables *simple mode* operation. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] since: "2.0.0" - name: AUTHORIZATION_AUTHORIZED summary: | - A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value indicating that the application is authorized to use location services. type: Number permission: read-only @@ -479,7 +465,7 @@ properties: - name: AUTHORIZATION_DENIED summary: | - A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value indicating that the application is not authorized to use location services, *or* location services are disabled. type: Number @@ -488,7 +474,7 @@ properties: - name: AUTHORIZATION_RESTRICTED summary: | - A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value indicating that the application is not authorized to use location servies *and* the user cannot change this application's status. type: Number @@ -497,7 +483,7 @@ properties: - name: AUTHORIZATION_UNKNOWN summary: | - A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value indicating that the authorization state is unknown. description: | This value is always returned if the device is running an iOS release prior to 4.2. @@ -507,7 +493,7 @@ properties: - name: AUTHORIZATION_ALWAYS summary: | - A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value indicating that the application is authorized to start location services at any time. This authorization includes the use of all location services, including monitoring regions and significant location changes. type: Number @@ -518,7 +504,7 @@ properties: - name: AUTHORIZATION_WHEN_IN_USE summary: | - A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value indicating that the application is authorized to start most location services only while running in the foreground. type: Number permission: read-only @@ -579,7 +565,7 @@ properties: - name: ERROR_TIMEOUT summary: Error indicating a timeout. - platforms: [mobileweb] + platforms: [] type: Number permission: read-only @@ -587,12 +573,12 @@ properties: summary: | Specifies the GPS location provider. description: | - Used with [preferredProvider](Titanium.Geolocation.preferredProvider), + Used with [preferredProvider](Titanium.Geolocation.preferredProvider), [LocationProvider.name](Titanium.Geolocation.Android.LocationProvider), [LocationRule.provider](Titanium.Geolocation.Android.LocationRule). - In general, the GPS provider has the highest power consumption and the - highest accuracy, but this may vary. In some circumstances, the network + In general, the GPS provider has the highest power consumption and the + highest accuracy, but this may vary. In some circumstances, the network provider may be more reliable. type: String permission: read-only @@ -602,7 +588,7 @@ properties: summary: | Specifies the network location provider. description: | - Used with [preferredProvider](Titanium.Geolocation.preferredProvider), + Used with [preferredProvider](Titanium.Geolocation.preferredProvider), [LocationProvider.name](Titanium.Geolocation.Android.LocationProvider), [LocationRule.provider](Titanium.Geolocation.Android.LocationRule). @@ -617,7 +603,7 @@ properties: summary: | Specifies the passive location provider. description: | - Used with [preferredProvider](Titanium.Geolocation.preferredProvider), + Used with [preferredProvider](Titanium.Geolocation.preferredProvider), [LocationProvider.name](Titanium.Geolocation.Android.LocationProvider), [LocationRule.provider](Titanium.Geolocation.Android.LocationRule). @@ -635,12 +621,12 @@ properties: permission: read-only platforms: [iphone,ipad] since: "3.1.0" - + - name: ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION summary: The location data is used for tracking location changes to the automobile specifically during vehicular navigation. description: | - Used with [activityType](Titanium.Geolocation.activityType). This activity might - cause location updates to be paused only when the vehicle does not move for an + Used with [activityType](Titanium.Geolocation.activityType). This activity might + cause location updates to be paused only when the vehicle does not move for an extended period of time. Available in iOS 6.0 and later. type: String permission: read-only @@ -650,8 +636,8 @@ properties: - name: ACTIVITYTYPE_FITNESS summary: The location data is used for tracking any pedestrian-related activity. description: | - Used with [activityType](Titanium.Geolocation.activityType). This activity might - cause location updates to be paused only when the user does not move a significant + Used with [activityType](Titanium.Geolocation.activityType). This activity might + cause location updates to be paused only when the user does not move a significant distance over a period of time.Available in iOS 6.0 and later. type: String permission: read-only @@ -660,13 +646,13 @@ properties: - name: ACTIVITYTYPE_OTHER_NAVIGATION summary: | - The location data is used for tracking movements of other types of vehicular + The location data is used for tracking movements of other types of vehicular navigation that are not automobile related. description: | - Used with [activityType](Titanium.Geolocation.activityType). You would use this - to track navigation by boat, train, or plane. Do not use this type for pedestrian - navigation tracking. This activity might cause location updates to be paused only - when the vehicle does not move a significant distance over a period of time. + Used with [activityType](Titanium.Geolocation.activityType). You would use this + to track navigation by boat, train, or plane. Do not use this type for pedestrian + navigation tracking. This activity might cause location updates to be paused only + when the vehicle does not move a significant distance over a period of time. Available in iOS 6.0 and later. type: String permission: read-only @@ -684,26 +670,26 @@ properties: * [ACCURACY_LOW](Titanium.Geolocation.ACCURACY_LOW) for lower-quality location updates with lower power consumption. - For finer-grained control on iOS, specify one of `ACCURACY_BEST`, + For finer-grained control on iOS, specify one of `ACCURACY_BEST`, `ACCURACY_NEAREST_TEN_METERS`, `ACCURACY_HUNDRED_METERS`, `ACCURACY_KILOMETER`, or - `ACCURACY_THREE_KILOMETERS`. + `ACCURACY_THREE_KILOMETERS`. - For finer-grained control on Android, use *manual mode*, instead of specifing an accuracy. - This mode requires more active management on the part of the application, but it + For finer-grained control on Android, use *manual mode*, instead of specifing an accuracy. + This mode requires more active management on the part of the application, but it is recommended to maximize accuracy and battery life. See for details on using manual mode. - Note that for backwards compatibility, Android supports using the iOS accuracy constants. + Note that for backwards compatibility, Android supports using the iOS accuracy constants. This usage is deprecated. Applications using one of the iOS constants should migrate to using `ACCURACY_HIGH`, `ACCURACY_LOW`, or Android manual mode. type: Number constants: Titanium.Geolocation.ACCURACY_* - + - name: distanceFilter - summary: The minimum change of position (in meters) before a 'location' event is fired. + summary: The minimum change of position (in meters) before a 'location' event is fired. description: | - If set to 0, distance filtering is disabled, meaning that location events are + If set to 0, distance filtering is disabled, meaning that location events are generated continuously. type: Number default: 0 @@ -723,8 +709,8 @@ properties: Note that the frequency value is used as a guideline: there are no guarantees that the device will provide updates at the specified frequency. - - A lower frequency value generally increases power consumption. + + A lower frequency value generally increases power consumption. A value of 0 means that updates should be generated as quickly as possible. type: Number @@ -733,11 +719,10 @@ properties: summary: Indicates whether the current device supports a compass. type: Boolean permission: read-only - platforms: [android, iphone, ipad, mobileweb] - since: { mobileweb: "2.1.0" } + platforms: [android, iphone, ipad] - name: headingFilter - summary: Minimum heading change (in degrees) before a `heading` event is fired. + summary: Minimum heading change (in degrees) before a `heading` event is fired. description: | Set to a value greater than zero to reduce the number of heading events generated. type: Number @@ -747,8 +732,8 @@ properties: - name: locationServicesAuthorization summary: Returns an authorization constant indicating if the application has access to location services. description: | - Always returns `AUTHORIZATION_UNKNOWN` on pre-4.2 devices. - + Always returns `AUTHORIZATION_UNKNOWN` on pre-4.2 devices. + If `locationServicesAuthorization` is `AUTHORIZATION_RESTRICTED`, you should not attempt to re-authorize: this will lead to issues. type: Number @@ -782,7 +767,7 @@ properties: Setting a preferred provider enables legacy location mode on Android. Note that only a single provider can be active at one time in legacy mode. - The preferred provider affects power consumption. In general, `PROVIDER_GPS` + The preferred provider affects power consumption. In general, `PROVIDER_GPS` requires the most power, and `PROVIDER_PASSIVE` requires the least. If `undefined`, the preferred provider is auto-detected. @@ -796,7 +781,7 @@ properties: Text to display in the permission dialog when requesting location services. description: | - This property informs the end user why location services are being requested by + This property informs the end user why location services are being requested by the application. This property is **required** starting in iOS 4.0. deprecated for >= iOS6, include the `NSLocationUsageDescription` key with your description in tiapp.xml instead. @@ -808,23 +793,23 @@ properties: summary: Determines whether the compass calibration UI is shown if needed. description: | Set to `false` to disable display of the compass calibration UI. This may result - in invalid heading data. + in invalid heading data. type: Boolean default: true platforms: [iphone, ipad] - name: trackSignificantLocationChange summary: | - Indicates if the location changes should be updated only when a significant change + Indicates if the location changes should be updated only when a significant change in location occurs. description: | - The trackSignificantLocationChange service offers a low-power location service for + The trackSignificantLocationChange service offers a low-power location service for devices with cellular radios.This service is available only in iOS 4.0 and later. - This service offers a significant power savings and provides accuracy that is good - enough for most applications. It uses the device's cellular radio to determine the - user's location and report changes in that location, allowing the system to manage - power usage much more aggressively than it could otherwise. This service is also - capable of waking up an application that is currently suspended or not running in + This service offers a significant power savings and provides accuracy that is good + enough for most applications. It uses the device's cellular radio to determine the + user's location and report changes in that location, allowing the system to manage + power usage much more aggressively than it could otherwise. This service is also + capable of waking up an application that is currently suspended or not running in order to deliver new location data. type: Boolean default: false @@ -835,7 +820,7 @@ properties: summary: | Determines if the app can do background location updates. description: | - When `UIBackgroundModes` include `location` in tiapp.xml, this property is + When `UIBackgroundModes` include `location` in tiapp.xml, this property is set to `true` by default. Available in iOS 9.0 and later. type: Boolean default: true @@ -847,13 +832,13 @@ properties: summary: | The type of user activity to be associated with the location updates. Available in iOS 6.0 and later. description: | - The information in this property is used as a cue to determine when location - updates may be automatically paused. Pausing updates gives the system the - opportunity to save power in situations where the user's location is not likely - to be changing. For example, if the activity type is - [ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION](Titanium.Geolocation.ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION) - and no location changes have occurred recently, the radios might be powered down - until movement is detected again. + The information in this property is used as a cue to determine when location + updates may be automatically paused. Pausing updates gives the system the + opportunity to save power in situations where the user's location is not likely + to be changing. For example, if the activity type is + [ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION](Titanium.Geolocation.ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION) + and no location changes have occurred recently, the radios might be powered down + until movement is detected again. type: Number constants: Titanium.Geolocation.ACTIVITYTYPE_* default: @@ -863,12 +848,12 @@ properties: - name: pauseLocationUpdateAutomatically summary: Indicates whether the location updates may be paused. Available in iOS 6.0 and later. description: | - Allowing the location updates to be paused can improve battery life on the - target device without sacrificing location data. When this property is set to YES, - the location updates are paused (and powers down the appropriate hardware) at - times when the location data is unlikely to change. For example, if the user stops - for food while using a navigation app, the location manager might pause updates for - a period of time. You can help the determination of when to pause location updates + Allowing the location updates to be paused can improve battery life on the + target device without sacrificing location data. When this property is set to YES, + the location updates are paused (and powers down the appropriate hardware) at + times when the location data is unlikely to change. For example, if the user stops + for food while using a navigation app, the location manager might pause updates for + a period of time. You can help the determination of when to pause location updates by assigning a value to the [activityType](Titanium.Geolocation.activityType) property. type: Boolean default: false @@ -928,16 +913,16 @@ properties: - name: heading summary: | - Compass heading, in degrees. May be unknown if device is not moving. On + Compass heading, in degrees. May be unknown if device is not moving. On iOS, a negative value indicates that the heading data is not valid. type: Number - name: speed summary: | - Current speed in meters/second. On iOS, a negative value indicates that the - heading data is not valid or the accuracy is configured incorrectly. - Note: Due to the Apple Geolocation API, set the - property to in order to properly + Current speed in meters/second. On iOS, a negative value indicates that the + heading data is not valid or the accuracy is configured incorrectly. + Note: Due to the Apple Geolocation API, set the + property to in order to properly measure speed changes and prevent the app from returning negative values. type: Number @@ -962,38 +947,38 @@ properties: - name: level summary: The logical floor of the building. description: | - Level values represent logical levels above or below ground level and are not + Level values represent logical levels above or below ground level and are not intended to correspond to any numbering scheme in use by the building itself. - The ground floor of a building is always represented by the value 0. Floors - above the ground floor are represented by positive integers, so a value of 1 - represents the floor above ground level, a value of 2 represents two floors - above ground level, and so on. Floors below the ground floor are represented - by corresponding negative integers, with a value of -1 representing the floor + The ground floor of a building is always represented by the value 0. Floors + above the ground floor are represented by positive integers, so a value of 1 + represents the floor above ground level, a value of 2 represents two floors + above ground level, and so on. Floors below the ground floor are represented + by corresponding negative integers, with a value of -1 representing the floor immediately below ground level and so on. type: Number --- name: ForwardGeocodeResponse summary: | - Simple object returned in the callback from the + Simple object returned in the callback from the [forwardGeocoder](Titanium.Geolocation.forwardGeocoder) method. Note that Android includes a number of extra fields. extends: ErrorResponse -properties: +properties: - name: success summary: Indicates if the operation succeeded. description: Returns `true` if request succeeded, `false` otherwise. type: Boolean - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: error summary: Error message, if any returned. description: Will be undefined if `success` is `true`. type: String - platforms: [android, iphone, ipad, mobileweb] - + platforms: [android, iphone, ipad] + - name: code summary: Error code. Returns 0 if `success` is `true`. description: | @@ -1001,8 +986,8 @@ properties: was generated by the operating system, that system's error value is used. Otherwise, this value will be -1. type: Number - since: { android: "3.1.0", iphone: "3.1.0", ipad: "3.1.0", mobileweb: "3.1.1" } - platforms: [android, iphone, ipad, mobileweb] + since: { android: "3.1.0", iphone: "3.1.0", ipad: "3.1.0" } + platforms: [android, iphone, ipad] - name: accuracy summary: Estimated accuracy of the geocoding, in meters. @@ -1012,14 +997,12 @@ properties: - name: longitude summary: Longitude of the geocoded address. type: String - since: { mobileweb: "3.1.1" } - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: latitude summary: Latitude of the geocoded address. type: String - since: { mobileweb: "3.1.1" } - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: street summary: Street name, without street address. @@ -1047,7 +1030,7 @@ properties: platforms: [android] - name: postalCode - summary: Postal code. + summary: Postal code. type: String platforms: [android] @@ -1057,7 +1040,7 @@ properties: platforms: [android] - name: countryCode - summary: Country code. + summary: Country code. type: String platforms: [android] @@ -1094,7 +1077,7 @@ properties: description: Will be undefined if `success` is `true`. type: String platforms: [iphone, ipad] - + - name: code summary: Error code. description: | @@ -1116,16 +1099,13 @@ properties: - name: accuracy summary: Accuracy of the compass heading, in platform-specific units. description: | - On iOS, accuracy is returned as a maximum deviation in degrees, - the smaller the value, the more accurate the heading is. For example, - a value of 10 means the heading is plus or minus 10 degrees from the - actual value. A negative value indicates the compass heading is invalid; + On iOS, accuracy is returned as a maximum deviation in degrees, + the smaller the value, the more accurate the heading is. For example, + a value of 10 means the heading is plus or minus 10 degrees from the + actual value. A negative value indicates the compass heading is invalid; for example, if there is magnetic interference, or if the compass is not calibrated. - - On Mobile Web, compass is currently supported only on iOS, and returns - the same value as iOS native. - - On Android, the value is set to either 1 (low accuracy), 2 (medium accuracy) + + On Android, the value is set to either 1 (low accuracy), 2 (medium accuracy) or 3 (high accuracy). No specific definition of these accuracy values is supplied. type: Number @@ -1170,9 +1150,9 @@ properties: name: LocationProviderDict summary: Simple object describing a location provider. description: | - The `accuracy` and `power` values correspond to constants defined in the + The `accuracy` and `power` values correspond to constants defined in the Android API. See - [android.location.Criteria](http://developer.android.com/reference/android/location/Criteria.html) + [android.location.Criteria](http://developer.android.com/reference/android/location/Criteria.html) in the Android API Reference. These values are generalizations. In general, a provider with coarse accuracy will @@ -1198,7 +1178,7 @@ properties: --- name: ReverseGeocodeResponse summary: | - Simple object returned in the callback from the + Simple object returned in the callback from the [reverseGeocoder](Titanium.Geolocation.reverseGeocoder) method. extends: ErrorResponse properties: @@ -1212,7 +1192,7 @@ properties: description: Will be undefined if `success` is `true`. type: String since: "3.1.0" - + - name: code summary: Error code. Returns 0 if `success` is `true`. description: | @@ -1225,7 +1205,7 @@ properties: --- name: GeocodedAddress summary: | - Simple object representing a place, returned in the callback from the + Simple object representing a place, returned in the callback from the [reverseGeocoder](Titanium.Geolocation.reverseGeocoder) method. properties: diff --git a/apidoc/Titanium/Geolocation/MobileWeb/MobileWeb.yml b/apidoc/Titanium/Geolocation/MobileWeb/MobileWeb.yml deleted file mode 100644 index 172ce7583b6..00000000000 --- a/apidoc/Titanium/Geolocation/MobileWeb/MobileWeb.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Titanium.Geolocation.MobileWeb -summary: The Mobile Web specific geolocation capabilities. -extends: Titanium.Module -since: "2.0.0" -platforms: [mobileweb] -properties: - - name: locationTimeout - summary: The time within which location requests must succeed, in milliseconds. - default: Infinity - type: Number - - name: maximumLocationAge - summary: The maximum age of cached locations acceptible for location requests, in milliseconds. - default: 0 - type: Number - - name: maximumHeadingAge - summary: The maximum age of cached locations acceptible for heading requests, in milliseconds. - default: 1000 - type: Number - - name: forwardGeocoderTimeout - summary: The time within which forward geocoder requests must succeed, in milliseconds. - type: Number - - name: reverseGeocoderTimeout - summary: The time within which reverse geocoder requests must succeed, in milliseconds. - type: Number \ No newline at end of file diff --git a/apidoc/Titanium/Gesture/Gesture.yml b/apidoc/Titanium/Gesture/Gesture.yml index 6b85690a229..f37f644d7a4 100644 --- a/apidoc/Titanium/Gesture/Gesture.yml +++ b/apidoc/Titanium/Gesture/Gesture.yml @@ -1,7 +1,7 @@ --- name: Titanium.Gesture summary: | - The Gesture module is responsible for high-level device gestures such as orientation changes + The Gesture module is responsible for high-level device gestures such as orientation changes and shake gestures. extends: Titanium.Module since: "0.8" @@ -9,19 +9,19 @@ since: "0.8" methods: - name: isLandscape summary: Returns whether current window is considered landscape by the device. - description: Value returns `true` if in landscape, and `false` otherwise. + description: Value returns `true` if in landscape, and `false` otherwise. deprecated: since: 6.1.0 - notes: Use for parity instead. + notes: Use for parity instead. returns: type: Boolean - name: isPortrait summary: Returns whether current window is considered portrait by the device. - description: Value returns `true` if in portrait, and `false` otherwise. + description: Value returns `true` if in portrait, and `false` otherwise. deprecated: since: 6.1.0 - notes: Use for parity instead. + notes: Use for parity instead. returns: type: Boolean @@ -29,44 +29,40 @@ properties: - name: portrait summary: Indicates whether current window is considered portrait by the device. description: | - Value is `true` if in portrait, and `false` otherwise. + Value is `true` if in portrait, and `false` otherwise. type: Boolean accessors: false permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: landscape summary: Indicates whether current window is considered landscape by the device. description: | - Value is `true` if in landscape, and `false` otherwise. + Value is `true` if in landscape, and `false` otherwise. type: Boolean accessors: false permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: orientation - summary: Orientation of the current window. + summary: Orientation of the current window. description: | - Value may be one of the group of orientation constants, - , - , - , - , - , - , - or . - - On iOS and Windows, returns the current orientation of the *device*, - regardless of the window orientation. To determine the current window orientation, + Value may be one of the group of orientation constants, + , + , + , + , + , + , + or . + + On iOS and Windows, returns the current orientation of the *device*, + regardless of the window orientation. To determine the current window orientation, use [Window.orientation](Titanium.UI.Window.orientation). - On Android and Mobile Web, returns the orientation of the current window, and never reports - the "reverse" orientations (`LANDSCAPE_RIGHT` and `UPSIDE_PORTRAIT`). - - For Mobile Web, the orientation reported by `Gesture.orientation` and - [Window.orientation](Titanium.UI.Window.orientation) is always the same, and corresponds to - the orientation of the browser window. - + On Android, returns the orientation of the current window, and never reports + the "reverse" orientations (`LANDSCAPE_RIGHT` and `UPSIDE_PORTRAIT`). + To set the *allowable* orientations for a window, see . type: Number permission: read-only @@ -75,17 +71,17 @@ events: - name: orientationchange summary: Fired when the device orientation changes. description: | - On Android, note that the application must have a heavyweight window or tab group open + On Android, note that the application must have a heavyweight window or tab group open in order to receive the `orientationchange` event. It is not necessary for the heavyweight window to be the topmost window. - - Almost all real-world applications will have a heavyweight window or a tab group. This is - only likely to be an issue if you create a test case or test application that adds an - orientation change listener from `app.js` without opening a heavyweight window. - - Android and Mobile Web do not report the "reverse" orientations, - `UPSIDE_PORTRAIT` and `LANDSCAPE_RIGHT`. These are reported as - `PORTRAIT` and `LANDSCAPE_LEFT`, respectively. + + Almost all real-world applications will have a heavyweight window or a tab group. This is + only likely to be an issue if you create a test case or test application that adds an + orientation change listener from `app.js` without opening a heavyweight window. + + Android does not report the "reverse" orientations, + `UPSIDE_PORTRAIT` and `LANDSCAPE_RIGHT`. These are reported as + `PORTRAIT` and `LANDSCAPE_LEFT`, respectively. properties: - name: orientation summary: Orientation of the current window. @@ -97,27 +93,22 @@ events: summary: Fired when the device is shaken. description: | A shake gesture consists of a series of quick accelerations, and is represented by a series - of shake events. - - The `timestamp` property represents the interval between shake events. It is measured in - milliseconds on Android and Mobile Web, and in seconds on iOS. - - Note that Mobile Web detect shake gestures using the device accelerometer, if the device - and browser support this. This event cannot be generated on Mobile Web in the iOS simulator. - The simulator's **Shake Gesture** menu item generates a native shake event, but does not - generate accelerometer events to the browser. + of shake events. + + The `timestamp` property represents the interval between shake events. It is measured in + milliseconds on Android, and in seconds on iOS. properties: - name: timestamp summary: | - Time interval since previous shake event. On iOS, this value is 0 for the first shake + Time interval since previous shake event. On iOS, this value is 0 for the first shake event in a series. type: Number - name: x summary: Acceleration along the X axis, in Gs. type: Number - + - name: y summary: Acceleration along the Y axis, in Gs. type: Number diff --git a/apidoc/Titanium/IOStream.yml b/apidoc/Titanium/IOStream.yml index d0c835f1964..c61106089d7 100644 --- a/apidoc/Titanium/IOStream.yml +++ b/apidoc/Titanium/IOStream.yml @@ -7,14 +7,14 @@ description: | since: "1.7" extends: Titanium.Proxy createable: false -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] methods: - name: read summary: Reads data from this stream into a buffer. description: | - If `offset` and `length` are specified, data is written into the buffer starting at + If `offset` and `length` are specified, data is written into the buffer starting at position `offset`. Data is read from this stream until one of the following occurs: * the end of this stream is reached @@ -23,16 +23,16 @@ methods: If `offset` and `length` are omitted, data is written starting at the beginning of the buffer. - + Returns the number of bytes read, or -1 if the end of stream was reached before any data was read. Throws an exception on error. For example, if the `offset` value is past - the last byte of `buffer`. + the last byte of `buffer`. This method is synchronous. To perform an asynchronous read on an `IOStream`, use . - + returns: type: Number summary: Number of bytes read. @@ -69,9 +69,9 @@ methods: If `offset` and `length` are omitted, all of the data in the buffer is written to this stream. - + Returns the number of bytes actually written. - + Throws an exception if an error is encountered. returns: type: Number @@ -123,35 +123,35 @@ examples: var outBuffer = Ti.createBuffer({data: "write me"}); // stream object could be socket, file, buffer or blob var outStream = Ti.Stream.createStream({mode: Ti.Stream.MODE_WRITE}); - + var bytesWritten = outStream.write(outBuffer); // writes entire buffer to stream Ti.API.info("Bytes written:" + bytesWritten); // should be 8 - + bytesWritten = outStream.write(outBuffer, 2, 5); // only writes "ite m" to stream Ti.API.info("Bytes written:" + bytesWritten); // should be 5 - - title: Read Data From a Stream + - title: Read Data From a Stream example: | This shows a simple example of reading data from a stream, one buffer full at a - time. - + time. + var size = 0; // read data one buffer full at a time while ((size = instream.read(buffer)) > -1) { // do something with the data here ... Ti.API.info("Read " + size + " bytes."); } - + - title: Read Data With Offset and Length example: | This example shows how to read data from a stream into a buffer. We assume that - the `inStream` variable holds a previously initialized stream that contains the + the `inStream` variable holds a previously initialized stream that contains the string, "World Titanium". var inBuffer = Ti.createBuffer({ value: "Hello [ ]" }); // Read the first 6 bytes from the stream to the buffer, starting at position 10. - var bytesRead = inStream.read(inBuffer, 10, 6); + var bytesRead = inStream.read(inBuffer, 10, 6); Ti.API.info("Bytes read: " + bytesRead); Ti.API.info(inBuffer.toString()); @@ -169,4 +169,3 @@ examples: [INFO] Hello [ World ] [INFO] Bytes read: 8 [INFO] Hello [ Titanium ] - diff --git a/apidoc/Titanium/Locale/Locale.yml b/apidoc/Titanium/Locale/Locale.yml index 0a720655209..82624935816 100644 --- a/apidoc/Titanium/Locale/Locale.yml +++ b/apidoc/Titanium/Locale/Locale.yml @@ -167,7 +167,7 @@ properties: This property holds a value such as `US` or `GB`. See the [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) country codes section of wikipedia for reference. - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] type: String permission: read-only diff --git a/apidoc/Titanium/Map/Annotation.yml b/apidoc/Titanium/Map/Annotation.yml index 6375bbe8764..4ae94110e4e 100644 --- a/apidoc/Titanium/Map/Annotation.yml +++ b/apidoc/Titanium/Map/Annotation.yml @@ -219,7 +219,7 @@ events: `title`, or `subtitle`. If the user deselects the annotation by clicking elsewhere in the map view, `clicksource` is `null`. - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] properties: diff --git a/apidoc/Titanium/Map/Map.yml b/apidoc/Titanium/Map/Map.yml index 9ee11cefde5..c5e69306105 100644 --- a/apidoc/Titanium/Map/Map.yml +++ b/apidoc/Titanium/Map/Map.yml @@ -127,7 +127,7 @@ properties: summary: Used with [mapType](Titanium.Map.View.mapType) to display the terrain that shows the position of all roads and some road names. type: Number permission: read-only - platforms: [mobileweb] + platforms: [] examples: - title: Map Example diff --git a/apidoc/Titanium/Map/View.yml b/apidoc/Titanium/Map/View.yml index 58b992f9f40..3a9f16fe5d3 100644 --- a/apidoc/Titanium/Map/View.yml +++ b/apidoc/Titanium/Map/View.yml @@ -1,22 +1,22 @@ --- name: Titanium.Map.View -summary: Map view is used for embedding native mapping capabilities as a view in your application. +summary: Map view is used for embedding native mapping capabilities as a view in your application. description: | - With native maps, you can control the mapping location, the type of map, the zoom level + With native maps, you can control the mapping location, the type of map, the zoom level and you can add custom annotations directly to the map. Once the map view is displayed, the user can pan and zoom the map using the native control gestures. - + Use the method to create a map view. - + All latitude and longitude values are specified in decimal degrees. Values in degrees, minutes and seconds (DMS) must be converted to decimal degrees before being passed to the map view. - + You can add [Annotation](Titanium.Map.Annotation) objects to the map to mark points of - interest. An annotation has two states: selected and deselected. A deselected annotation + interest. An annotation has two states: selected and deselected. A deselected annotation is marked by a pin image. When selected, the full annotation is displayed, typically including a title, an optional subtitle, and one or more images. - + #### Android Platform Notes On Android, this module requires a Google Maps API v1 key. As of March 3, 2013, @@ -29,37 +29,20 @@ description: | If you have a Maps API v1 key, edit your `tiapp.xml` file and add your new key as the value for the `ti.android.google.map.api.key.production` property. - + A development API key is included in the default `tiapp.xml` file. You can use this - key for development and testing as long as you are building your application with the + key for development and testing as long as you are building your application with the default Titanium development keystore. - + #### iOS Platform Notes Since Release 3.2.0, use the [ti.map add-on module](Modules.Map). Support for this module was removed. - + On iOS, you cannot call any methods on a map view until it has been added to a view. - + In addition to annotations, iOS supports adding routes to a map view, using [addRoute](Titanium.Map.View.addRoute). - - #### Mobile Web Platform Notes - - For Mobile Web, the default map provider is Google. Google Maps does not require you to obtain an API key, - however it is encouraged that you use an API key so that you can monitor your Maps API usage. You can sign - up for the Maps API key on the Google Code web site: - - * developers.google.com/maps/signup - - If you get a Maps API key, edit your `tiapp.xml` file and add your new key as the - value for the `` tag. - - - - [key goes here] - - extends: Titanium.UI.View excludes: events: [ 'singletap', 'doubletap', 'dblclick', 'focus', 'longclick', 'pinch', 'swipe', 'touchstart', 'touchend', 'touchcancel', 'touchmove', 'twofingertap' ] @@ -88,7 +71,7 @@ methods: Array of [Annotation](Titanium.Map.Annotation) objects, or an array of dictionaries describing of properties for the annotation. type: [Array, Array>] - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: addRoute summary: Adds a route to the map. @@ -96,7 +79,7 @@ methods: - name: route summary: Simple dictionary object describing the route. type: MapRouteType - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] since: { android: "2.1.0" } - name: deselectAnnotation @@ -107,11 +90,11 @@ methods: - name: annotation summary: Annotation to deselect, identified by an annotation title or a reference. type: [String,Titanium.Map.Annotation] - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: removeAllAnnotations summary: Removes all annotations from the map. - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: removeAnnotation summary: Removes an existing annotation from the map. @@ -129,15 +112,15 @@ methods: - name: annotations summary: Array of annotations to remove. type: [Array, Array] - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] - name: removeRoute - summary: Remove a previously added route. + summary: Remove a previously added route. parameters: - name: route summary: Same route object passed to [addRoute](Titanium.Map.View.addRoute). type: MapRouteType - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] since: { android: "2.1.0" } - name: selectAnnotation @@ -168,7 +151,7 @@ methods: parameters: - name: mapType summary: | - Map type constant, either , or + Map type constant, either , or . type: Number @@ -178,7 +161,7 @@ methods: description: | Zooms in or out by specifying a relative zoom level. A positive value increases the current zoom level and a negative value decreases the zoom level. - + Each increase in zoom level increases the magnification by a factor of two. parameters: - name: level @@ -204,12 +187,12 @@ events: the annotation. Otherwise, the user deselects an annotation by clicking on the annotation pin. - The `click` event includes a value, `clicksource`, which describes the part of the + The `click` event includes a value, `clicksource`, which describes the part of the annotation that was clicked. Note that the possible values for `clicksource` differ between platforms. - On iOS, if the user clicks on the pin or annotation, the `clicksource` is one of: - `pin`, `annotation`, `leftButton`, `rightButton`, `leftView`, `rightView`, + On iOS, if the user clicks on the pin or annotation, the `clicksource` is one of: + `pin`, `annotation`, `leftButton`, `rightButton`, `leftView`, `rightView`, `title`, or `subtitle`. If the user deselects the annotation by clicking elsewhere in the map view, `clicksource` is `null`. @@ -223,21 +206,21 @@ events: - name: index summary: the annotation index. type: Number - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] - name: title summary: Title of the annotation. type: String - + - name: subtitle summary: Subtitle of the annotation. type: String - platforms: [android, mobileweb] - + platforms: [android] + - name: map summary: The map view instance. type: Titanium.Map.View - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] - name: clicksource summary: Source of the click event, such as `pin`, or `leftButton`. @@ -250,29 +233,29 @@ events: - name: latitude summary: Latitude of the clicked annotation. type: Number - platforms: [android, mobileweb] - + platforms: [android] + - name: longitude summary: Longitude of the clicked annotation. type: Number - platforms: [android, mobileweb] + platforms: [android] - name: complete summary: Fired when the map completes loading. - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] properties: - name: success summary: Indicates a successful operation. Returns `true`. type: Boolean - + - name: error summary: Error message, if any returned. Will be undefined. type: String - + - name: code summary: Error code. Error code will be 0. type: Number - + - name: error summary: Fired when the map receives a mapping error. platforms: [iphone, ipad] @@ -284,7 +267,7 @@ events: - name: error summary: Error message, if any returned. May be undefined. type: String - + - name: code summary: | Error code. @@ -294,11 +277,11 @@ events: - name: loading summary: Fired when the map begins loading. - platforms: [iphone, ipad, mobileweb] - + platforms: [iphone, ipad] + - name: longpress since: { android: 3.1.0 } - + - name: pinchangedragstate summary: Fired when the user interacts with a draggable annotation. properties: @@ -310,7 +293,7 @@ events: - name: map summary: This map view. type: Titanium.Map.View - + - name: title summary: Annotation title. type: String @@ -390,14 +373,14 @@ properties: - name: animated summary: Indicates if changes to the mapping region should be animated. type: Boolean - platforms: [mobileweb] + platforms: [] - name: annotations summary: An array of annotations to add to the map. description: | - There is no guarantee that the order of elements in the `annotations` property will be + There is no guarantee that the order of elements in the `annotations` property will be maintained when creating, adding or deleting annotations from the Ti.Map.View object. - If the application depends on the annotations being in a set order, it should keep + If the application depends on the annotations being in a set order, it should keep references to all of the annotations in a separate array. type: Array @@ -427,7 +410,7 @@ properties: - name: regionFit summary: | - Boolean indicating if the map region should be modified + Boolean indicating if the map region should be modified to fit the map view's aspect ratio. description: | If `true`, the specified region is modified to fit the aspect ratio of the @@ -439,20 +422,20 @@ properties: Boolean indicating if the user's current device location should be shown on the map. description: | - If `true`, the user's location is marked with a pin. + If `true`, the user's location is marked with a pin. type: Boolean - name: latitudeDelta summary: The amount of north-to-south distance displayed on the map, measured in decimal degrees. type: Number permission: read-only - since: {android: "3.0.0", iphone: "2.0.0", ipad: "2.0.0", mobileweb: "2.0.0"} + since: {android: "3.0.0", iphone: "2.0.0", ipad: "2.0.0"} - name: longitudeDelta summary: The amount of east-to-west distance displayed on the map, measured in decimal degrees. type: Number permission: read-only - since: {android: "3.0.0", iphone: "2.0.0", ipad: "2.0.0", mobileweb: "2.0.0"} + since: {android: "3.0.0", iphone: "2.0.0", ipad: "2.0.0"} --- name: MapRegionType @@ -510,7 +493,7 @@ properties: --- name: MapRouteType summary: Simple object defining a map route. -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] properties: - name: name @@ -527,7 +510,7 @@ properties: summary: | Color to use when drawing the route, as a color name or hex triplet. description: | - For information about color values, see the "Colors" section of . + For information about color values, see the "Colors" section of . type: String - name: width diff --git a/apidoc/Titanium/Media/Media.yml b/apidoc/Titanium/Media/Media.yml index b99c9296d9a..4bb429da1d2 100644 --- a/apidoc/Titanium/Media/Media.yml +++ b/apidoc/Titanium/Media/Media.yml @@ -328,7 +328,7 @@ methods: - name: vibrate summary: Makes the device vibrate. description: | - On Android and Mobile Web, a `pattern` argument can be provided to specify a + On Android, a `pattern` argument can be provided to specify a vibration pattern. The `pattern` is an array of Number values. Each number in the array is @@ -340,14 +340,12 @@ methods: Would cause the vibration to start immediately (delay = 0), and perform three long vibrations (500 ms) separated by short pauses (100ms). - - On Mobile Web, calling `vibrate` without a `pattern` will stop the vibration. parameters: - name: pattern summary: Array of values identifying a vibrate pattern (only used on Android). optional: true type: Array - platforms: [iphone, ipad, android, mobileweb] + platforms: [iphone, ipad, android] - name: requestAuthorization summary: Request the user's permission for audio recording. @@ -407,7 +405,7 @@ methods: type: Boolean platforms: [android, iphone, ipad] since: - android: "6.2.0" + android: "6.2.0" iphone: "6.1.0" ipad: "6.1.0" @@ -447,7 +445,7 @@ methods: for more information. platforms: [android, iphone, ipad] since: - android: "6.2.0" + android: "6.2.0" iphone: "6.1.0" ipad: "6.1.0" parameters: @@ -1271,22 +1269,22 @@ properties: summary: Current media is playable. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: VIDEO_LOAD_STATE_PLAYTHROUGH_OK summary: Playback will be automatically started in this state when `autoplay` is true. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: VIDEO_LOAD_STATE_STALLED summary: Playback will be automatically paused in this state, if started. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: VIDEO_LOAD_STATE_UNKNOWN summary: Current load state is not known. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: VIDEO_MEDIA_TYPE_AUDIO summary: A audio type of media in the movie returned by `mediaTypes` property. type: Number @@ -1311,12 +1309,12 @@ properties: summary: Video playback is paused. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: VIDEO_PLAYBACK_STATE_PLAYING summary: Video is being played. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD summary: Video playback is rewinding. type: Number @@ -1331,19 +1329,19 @@ properties: summary: Video playback is stopped. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: VIDEO_REPEAT_MODE_NONE summary: Constant for disabling repeat on video playback. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] - since: {android: "6.2.0", iphone: "0.9.0", ipad: "0.9.0", mobileweb: "1.8"} + platforms: [android, iphone, ipad] + since: {android: "6.2.0", iphone: "0.9.0", ipad: "0.9.0"} - name: VIDEO_REPEAT_MODE_ONE summary: Constant for repeating one video (i.e., the one video will repeat constantly) during playback. type: Number permission: read-only - platforms: [android, iphone, ipad, mobileweb] - since: {android: "6.2.0", iphone: "0.9.0", ipad: "0.9.0", mobileweb: "1.8"} + platforms: [android, iphone, ipad] + since: {android: "6.2.0", iphone: "0.9.0", ipad: "0.9.0"} - name: VIDEO_SCALING_ASPECT_FILL summary: Scale video to fill the screen, clipping edges if necessary. description: | @@ -1665,7 +1663,7 @@ properties: type: [MediaQueryInfoType, String] - name: isCompilation summary: | - Filter by whether or not the item is a compilation. + Filter by whether or not the item is a compilation. The value should be a Boolean. type: [MediaQueryInfoType, Boolean] - name: playCount @@ -1693,14 +1691,14 @@ properties: description: Available in Titanium SDK 6.1.0 and later. type: [MediaQueryInfoType, Number] - name: isCloudItem - summary: | - Filter by whether or not the item is a cloud item. + summary: | + Filter by whether or not the item is a cloud item. Value should be a Boolean. description: Available in Titanium SDK 6.1.0 and later. type: [MediaQueryInfoType, Boolean] - name: hasProtectedAsset - summary: | - Filter by whether or not the item is a protected asset. + summary: | + Filter by whether or not the item is a protected asset. Value should be a Boolean. description: Available in Titanium SDK 6.1.0 and later. type: [MediaQueryInfoType, Boolean] @@ -1817,7 +1815,7 @@ properties: summary: Transformation matrix to apply to the camera or photogallery view. description: | Can be used to size and position the camera or photogallery view behind an overlay view. - iOS 10 note: There was a [known iOS 10 issue](http://openradar.appspot.com/28232651) caused by Apple + iOS 10 note: There was a [known iOS 10 issue](http://openradar.appspot.com/28232651) caused by Apple that breaks the native camera transformation. Apple fixed this issue in the iOS 10.2 release. type: Titanium.UI.2DMatrix default: identity matrix diff --git a/apidoc/Titanium/Media/VideoPlayer.yml b/apidoc/Titanium/Media/VideoPlayer.yml index 45b362e8974..fce1415bd5f 100644 --- a/apidoc/Titanium/Media/VideoPlayer.yml +++ b/apidoc/Titanium/Media/VideoPlayer.yml @@ -1,7 +1,7 @@ --- name: Titanium.Media.VideoPlayer summary: A native control for playing videos. -description: | +description: | The video player is a native view that can be used to play videos, either stored locally or streamed from a web server. The player can occupy the full screen, or can be used as a view that can be added to other views. @@ -19,21 +19,21 @@ description: | On iOS, a video player can dynamically switch back and forth between fullscreen mode and standard mode. If the native video controls are displayed, the user can use them - to switch between standard and fullscreen mode. + to switch between standard and fullscreen mode. #### Android Implementation Notes On Android, the video player cannot switch modes. To create a fullscreen player, you must specify `fullscreen: true` when you create the player. This fullscreen player creates its own Android [Activity](Titanium.Android.Activity) on top of the activity stack. - Unlike a normal view, this fullscreen video player appears as soon as it is created. - The user can close the player by pressing the **Back** button. See the code examples for + Unlike a normal view, this fullscreen video player appears as soon as it is created. + The user can close the player by pressing the **Back** button. See the code examples for a sample using the fullscreen player on Android. - There are several known issues with clipping on the Android video player. + There are several known issues with clipping on the Android video player. * When used with `scalingMode` set to VIDEO_SCALING_ASPECT_FILL or VIDEO_SCALING_NONE, - the video content is not correctly clipped to the boundaries of the view. + the video content is not correctly clipped to the boundaries of the view. ([TIMOB-7628](https://jira.appcelerator.org/browse/TIMOB-7628)) * When a border is set on the view, the video content does not take the border width @@ -42,7 +42,7 @@ description: | * If a borderRadius is specified, the video content is not clipped to the rounded corners. ([TIMOB-7629](https://jira.appcelerator.org/browse/TIMOB-7629)) - + On Android, using a video player inside a scroll view is not recommended. When scrolling, black bars may appear over the video content. @@ -58,7 +58,7 @@ excludes: events: ['focus', 'pinch', 'longclick', 'twofingertap'] since: "0.9" -examples: +examples: - title: Simple Video Player Example example: | The following code creates a simple video player to play a local video file. @@ -67,7 +67,7 @@ examples: title : 'Video View Demo', backgroundColor : '#fff' }); - + var videoPlayer = Titanium.Media.createVideoPlayer({ top : 2, autoplay : true, @@ -77,7 +77,7 @@ examples: mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT, scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT }); - + videoPlayer.url = 'movie.mp4'; vidWin.add(videoPlayer); vidWin.open(); @@ -86,23 +86,23 @@ examples: example: | The Android fullscreen video player operates differently from other video players. The following example shows how to create, show, and close a fullscreen video - player. - + player. + Note that in this example, a button is included to close the player, to demonstrate a method for dismissing the player programmatically. In practice, the user can always dismiss the player by using the **Back** button, so an on-screen control would not be required. - + Titanium.UI.setBackgroundColor('#000'); var win = Titanium.UI.createWindow({ title : 'Test', backgroundColor : '#fff', exitOnClose : true }); - + // Change to a valid URL var contentURL = "http://www.example.com/stream.mp4"; - + var openButton = Ti.UI.createButton({ title : "Start Video", top : "0dp", @@ -110,7 +110,7 @@ examples: left : "10dp", right : "10dp" }); - + openButton.addEventListener('click', function() { var activeMovie = Titanium.Media.createVideoPlayer({ url : contentURL, @@ -120,7 +120,7 @@ examples: fullscreen : true, autoplay : true }); - + var closeButton = Ti.UI.createButton({ title : "Exit Video", top : "0dp", @@ -128,13 +128,13 @@ examples: left : "10dp", right : "10dp" }); - + closeButton.addEventListener('click', function() { activeMovie.hide(); activeMovie.release(); activeMovie = null; }); - + activeMovie.add(closeButton); }); win.add(openButton); @@ -158,7 +158,7 @@ methods: - name: cancelAllThumbnailImageRequests summary: Cancels all pending asynchronous thumbnail requests. description: | - Asynchronous thumbnail requests initiated with + Asynchronous thumbnail requests initiated with [requestThumbnailImagesAtTimes](Titanium.Media.VideoPlayer.requestThumbnailImagesAtTimes). platforms: [iphone, ipad, android] since: @@ -171,20 +171,20 @@ methods: summary: Starts playing the video. - name: release - summary: Releases the internal video resources immediately. + summary: Releases the internal video resources immediately. description: | - This is not usually necessary but can help if you no longer need to use the player after + This is not usually necessary but can help if you no longer need to use the player after it is used to help converse memory. - name: requestThumbnailImagesAtTimes summary: Asynchronously request thumbnail images for one or more points in time in the video. description: | The `times` parameter specifies an array of time values, in - **seconds**. For each time value, the platform generates an image + **seconds**. For each time value, the platform generates an image representing the video at that point in time. - + The callback function is invoked when a thumbnail is available. - + Calling this method will cancel all pending asynchronous thumbnail requests. platforms: [iphone, ipad, android] since: @@ -250,7 +250,7 @@ events: summary: Error message, if any returned. Will be undefined if `success` is `true`. type: String platforms: [iphone, ipad, android] - + - name: code summary: | Error code. @@ -294,7 +294,7 @@ events: - name: error summary: Error message, if any returned. May be undefined. type: String - platforms: [android] + platforms: [android] - name: code summary: | Error code. @@ -302,15 +302,15 @@ events: is used. Otherwise, this value will be -1. type: Number platforms: [android] - platforms: [android, mobileweb] + platforms: [android] - name: fullscreen summary: Fired when a movie changes to or from fullscreen view. description: | - On iOS, this event is fired at the beginning of the transition to + On iOS, this event is fired at the beginning of the transition to fullscreen mode. A `duration` property is provided, indicating the duration of the animated transition to or from fullscreen mode. - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] properties: - name: entering @@ -405,7 +405,7 @@ events: - name: playing summary: Fired when the currently playing movie changes. - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] properties: - name: url summary: URL of the media. @@ -413,7 +413,7 @@ events: - name: preload summary: Fired when the movie has preloaded and is ready to play. - platforms: [android, mobileweb] + platforms: [android] - name: resize summary: Fired when the movie player is resized. @@ -450,7 +450,7 @@ events: A singletap event is generated when the user taps the screen briefly without moving their finger. This gesture will also generate a click event. - However, a click event can also be generated when the user touches, + However, a click event can also be generated when the user touches, moves their finger, and then removes it from the screen. On Android, a click event can also be generated by a trackball click. @@ -461,7 +461,7 @@ events: - name: x type: Number summary: X coordinate of the event from the `source` view's coordinate system. - platforms: [android, mobileweb] + platforms: [android] - name: singletap summary: Fired when the device detects a single tap against the view. @@ -472,12 +472,12 @@ events: - name: x type: Number summary: X coordinate of the event from the `source` view's coordinate system. - platforms: [android, mobileweb] + platforms: [android] - name: touchcancel summary: Fired when a touch event is interrupted by the device. description: | - A touchcancel can happen in circumstances such as an incoming call to allow the + A touchcancel can happen in circumstances such as an incoming call to allow the UI to clean up state. properties: - name: y @@ -486,8 +486,8 @@ events: - name: x type: Number summary: X coordinate of the event from the `source` view's coordinate system. - platforms: [android, mobileweb] - + platforms: [android] + - name: touchend summary: Fired when a touch event is completed. description: | @@ -500,8 +500,8 @@ events: - name: x type: Number summary: X coordinate of the event from the `source` view's coordinate system. - platforms: [android, mobileweb] - + platforms: [android] + - name: touchmove summary: Fired as soon as the device detects movement of a touch. description: | @@ -513,7 +513,7 @@ events: - name: x type: Number summary: X coordinate of the event from the `source` view's coordinate system. - platforms: [android, mobileweb] + platforms: [android] properties: @@ -528,21 +528,21 @@ properties: - name: autoplay summary: Indicates if a movie should automatically start playback. description: | - On iOS, playback starts automatically if `autoplay` is `true` *and* the movie is likely to + On iOS, playback starts automatically if `autoplay` is `true` *and* the movie is likely to finish uninterrupted. The OS determines whether the movie is likely to finish uninterrupted based on factors including the bit rate of the movie and network conditions (if the movie is being streamed from a remote source). type: Boolean default: true - + - name: backgroundView summary: Sets the background view for customization which is always displayed behind movie content. description: | - To create a background behind the movie content on iOS, you can specify a + To create a background behind the movie content on iOS, you can specify a background view. On iOS, you can set the `backgroundColor` property directly on the video player, but not a background image or background gradient. For this kind - of effect, specify a background view. - + of effect, specify a background view. + Note that the background view must be sized explicitly: percentage sizes do not work properly. The following code sample creates a video player with a background image: @@ -560,8 +560,8 @@ properties: borderColor : 'blue', }); - Note that if [scalingMode](Titanium.Media.VideoPlayer.scalingMode) is set to - [VIDEO_SCALING_MODE_FILL](Titanium.Media.VIDEO_SCALING_MODE_FILL) or + Note that if [scalingMode](Titanium.Media.VideoPlayer.scalingMode) is set to + [VIDEO_SCALING_MODE_FILL](Titanium.Media.VIDEO_SCALING_MODE_FILL) or [VIDEO_SCALING_ASPECT_FILL](Titanium.Media.VIDEO_SCALING_ASPECT_FILL), the playing video will fill the entire video player area, obscuring any background view. @@ -584,7 +584,7 @@ properties: summary: The duration of the current movie in milliseconds, or 0.0 if not known. description: | The duration of the movie may not be available when playback is started. The - [durationavailable](Titanium.Media.VideoPlayer.durationavailable) event is + [durationavailable](Titanium.Media.VideoPlayer.durationavailable) event is fired when the duration is known. type: Number @@ -592,29 +592,29 @@ properties: summary: The end time of movie playback, in milliseconds. description: | On iOS, defaults to NaN, which indicates natural end time of the movie. - Changing the value to a value less than `duration` causes the movie to + Changing the value to a value less than `duration` causes the movie to stop playing at the specified point. On iOS, this value is not applicable to streaming media, so NaN is returned if the current media is being streamed. - + On Android, this is always the same as [duration](Titanium.Media.VideoPlayer.duration) (the natural end time), and changing the value has no effect. type: Number - name: fullscreen summary: | - Determines if the movie is presented in the entire screen (obscuring all other application content). + Determines if the movie is presented in the entire screen (obscuring all other application content). description: | Note that this must be set at different times on different platforms: On iOS, setting this property to `true` before the movie player's view is visible - has no effect. - + has no effect. + On Android, this property must be set at creation time. For example: var player = Ti.Media.createVideoPlayer({fullscreen: true}); - On Android, setting this value to `true` means that the video will have its own Android Activity - rather than being embedded as a view. + On Android, setting this value to `true` means that the video will have its own Android Activity + rather than being embedded as a view. type: Boolean default: false @@ -638,7 +638,7 @@ properties: - name: mediaControlStyle summary: The style of the playback controls. description: | - Mobile web only supports and + Mobile web only supports and . type: Number constants: Titanium.Media.VIDEO_CONTROL_* @@ -648,7 +648,7 @@ properties: summary: The types of media in the movie, or if not known. description: | A movie can contain video - ([VIDEO_MEDIA_TYPE_VIDEO](Titanium.Media.VIDEO_MEDIA_TYPE_VIDEO)), + ([VIDEO_MEDIA_TYPE_VIDEO](Titanium.Media.VIDEO_MEDIA_TYPE_VIDEO)), audio, ([VIDEO_MEDIA_TYPE_AUDIO](Titanium.Media.VIDEO_MEDIA_TYPE_AUDIO)), or both. A movie with both audio and video media is represented by a bitwise OR of the two @@ -666,7 +666,7 @@ properties: removed: '6.0.0' summary: Style of the media playback controls. description: | - Provides the ability to set the control mode of the movie player. + Provides the ability to set the control mode of the movie player. platforms: [iphone, ipad] type: Number default: @@ -677,8 +677,8 @@ properties: - name: naturalSize summary: Returns the natural size of the movie. description: | - Returns a dictionary with properties `width` and `height`. Returns 0 for both properties if not - known or applicable. + Returns a dictionary with properties `width` and `height`. Returns 0 for both properties if not + known or applicable. The [naturalSizeAvailable](Titanium.Media.VideoPlayer.naturalSizeAvailable) event is fired when the natural size is known. @@ -687,7 +687,7 @@ properties: - name: playableDuration summary: | - Currently playable duration of the movie, in milliseconds, for progressively + Currently playable duration of the movie, in milliseconds, for progressively downloaded network content, or 0.0 if not known. description: | On Android, this is always the same as [duration](Titanium.Media.VideoPlayer.duration). @@ -709,24 +709,24 @@ properties: permission: read-only - name: repeatMode - summary: Determines how the movie player repeats when reaching the end of playback. - platforms: [android, iphone, ipad, mobileweb] + summary: Determines how the movie player repeats when reaching the end of playback. + platforms: [android, iphone, ipad] type: Number constants: Titanium.Media.VIDEO_REPEAT_MODE_* default: Titanium.Media.VIDEO_REPEAT_MODE_NONE - since: {android: "6.2.0", iphone: "0.9.0", ipad: "0.9.0", mobileweb: "1.8"} + since: {android: "6.2.0", iphone: "0.9.0", ipad: "0.9.0"} - name: scalingMode summary: Determines how the content scales to fit the view. description: | - Mobile web only supports + Mobile web only supports and . type: Number constants: Titanium.Media.VIDEO_SCALING_* default: - name: sourceType - summary: The playback type of the movie. + summary: The playback type of the movie. description: | Specifying a playback type before playing the movie can result in faster load times. @@ -741,10 +741,6 @@ properties: summary: URL of the media to play. description: | URL identifying a local or remote video to play. - - On Mobile Web, video format support depends on the web browser. You can specify an - array of URLs to videos of different formats. The web browser will select the first - video URL in the array that it is able to play. This is not supported on iOS and Android. type: [String, Array] - name: useApplicationAudioSession @@ -757,7 +753,7 @@ properties: description: | Creating a new session interrupts the application's session. - Setting this property during playback will not take effect until playback is stopped + Setting this property during playback will not take effect until playback is stopped and started again. platforms: [iphone, ipad] type: Boolean @@ -766,7 +762,7 @@ properties: - name: volume summary: | - Volume of the audio portion of the video. + Volume of the audio portion of the video. description: | On iOS, this adjusts the volume of the application's session as well, and will not work if useApplicationAudioSession has been set false. On the iOS device, @@ -810,7 +806,7 @@ properties: was generated by the operating system, that system's error value is used. Otherwise, this value will be -1. type: Number - since: + since: iphone: "3.1.0" ipad: "3.1.0" android: "3.6.0" diff --git a/apidoc/Titanium/Module.yml b/apidoc/Titanium/Module.yml index 154e97d3964..9098707aba6 100644 --- a/apidoc/Titanium/Module.yml +++ b/apidoc/Titanium/Module.yml @@ -11,4 +11,4 @@ description: | extends: Titanium.Proxy since: "0.1" -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] diff --git a/apidoc/Titanium/Network/HTTPClient.yml b/apidoc/Titanium/Network/HTTPClient.yml index df254b680ad..ecd886c5419 100644 --- a/apidoc/Titanium/Network/HTTPClient.yml +++ b/apidoc/Titanium/Network/HTTPClient.yml @@ -38,9 +38,6 @@ description: | * For all other data types on Android, the content type is set to `application/x-www-form-urlencoded`. * For all other data types on iOS, the content type is **NOT** set. - On the Mobile Web platforms, the content type is always set to - `application/x-www-form-urlencoded` as the default. - Use the [setRequestHeader](Titanium.Network.HTTPClient.setRequestHeader) method to override the default Content-Type header. @@ -50,7 +47,7 @@ description: | the application and use callbacks to process responses when they are received. Synchronous requests block the execution of the application until it receives a response. - On the iOS and Mobile Web platforms, you can make synchronous requests by setting the optional + On the iOS platform, you can make synchronous requests by setting the optional `async` parameter to `false` when calling the [open](Titanium.Network.HTTPClient.open) method. The Android platform does not support synchronous requests. @@ -93,29 +90,6 @@ description: | , , , , , , , . - - #### Mobile Web Platform Implementation Notes - - Mobile Web is limited by the same-origin policy. According to W3C: "User agents - commonly apply same-origin restrictions to network requests. These restrictions - prevent a client-side Web application running from one origin from obtaining - data retrieved from another origin, and also limit unsafe HTTP requests that can - be automatically launched toward destinations that differ from the running - application's origin." This means that browsers cannot request information from - a domain that the app itself does not reside on. If you are hosting the app at - foo.example.com, then requests to any domain other than *.example.com will fail. - - There are two solutions to get around this problem: - - * Configure the destination server to support Cross-Origin Resource Sharing. - * Use [Ti.Network.httpURLFormatter](Titanium.Network.httpURLFormatter) in conjunction - with a proxy on the server hosting the application. - - If you use a proxy, be sure to properly configure how cookies are passed through. You - may not want cookies proxied to third parties that could identify a user. - - More information about Cross-Origin Resource Sharing can be found on the - [W3C Cross-Origin Resource Sharing](http://www.w3.org/TR/cors/) specification page. extends: Titanium.Proxy since: "0.1" @@ -204,7 +178,7 @@ methods: type: String - name: async - summary: Determines whether the request should be made asynchronously. Only used on iOS and Mobile Web. + summary: Determines whether the request should be made asynchronously. Only used on iOS. type: Boolean optional: true default: true @@ -257,8 +231,6 @@ methods: - name: setTimeout summary: Sets the request timeout. - description: | - On Mobile Web, the timeout only works when making asynchronous requests. parameters: - name: timeout summary: Timeout in milliseconds. @@ -310,7 +282,7 @@ properties: type: String permission: read-only platforms: [android] - + - name: responseHeaders summary: Returns all the response headers returned with the request. description: | @@ -320,7 +292,7 @@ properties: type: Dictionary permission: read-only platforms: [iphone, ipad] - + - name: autoEncodeUrl summary: Determines whether automatic encoding is enabled for the specified URL. description: Set to `false` to disable automatic URL-encoding. @@ -355,7 +327,7 @@ properties: Must be set before calling [open](Titanium.Network.HTTPClient.open). type: String default: Undefined - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] since: 3.0.0 - name: enableKeepAlive @@ -370,11 +342,11 @@ properties: description: | On iOS, can only be set **after** calling [open](Titanium.Network.HTTPClient.open). - - On Android and Mobile Web, can be set anytime prior to calling [send](Titanium.Network.HTTPClient.send). + + On Android, can be set anytime prior to calling [send](Titanium.Network.HTTPClient.send). The file must be writable such as the application data directory or temp directory. type: String - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] since: {android: 3.4.0} - name: location @@ -390,7 +362,7 @@ properties: Must be set before calling `open`. The `progress` property of the event will contain a value from 0.0-1.0 with the progress of - the request. On iOS and Android as of 3.5.0, if the progress can not be calculated, + the request. On iOS and Android as of 3.5.0, if the progress can not be calculated, the value will be [PROGRESS_UNKNOWN](Titanium.Network.PROGRESS_UNKNOWN). type: Callback @@ -411,7 +383,7 @@ properties: To access response data and headers, access the `HTTPClient` object itself (accessible as `this` during the callback, or the `source` property of the callback event). type: Callback - + - name: onreadystatechange summary: | Function to be called for each [readyState](Titanium.Network.HTTPClient.readyState) change. @@ -426,10 +398,10 @@ properties: [LOADING](Titanium.Network.HTTPClient.LOADING), or [DONE](Titanium.Network.HTTPClient.DONE). - Due to the asynchronous nature of the Titanium platform, the internal value of - [readyState](Titanium.Network.HTTPClient.readyState) might be different from the state change - for which the event was fired. To address this discrepancy, the function is now invoked with a - payload object of type . This was introduced in version 3.4.2 of the SDK and is + Due to the asynchronous nature of the Titanium platform, the internal value of + [readyState](Titanium.Network.HTTPClient.readyState) might be different from the state change + for which the event was fired. To address this discrepancy, the function is now invoked with a + payload object of type . This was introduced in version 3.4.2 of the SDK and is supported on the iOS and android platforms. - name: onsendstream @@ -446,7 +418,7 @@ properties: description: Must be set before calling [open](Titanium.Network.HTTPClient.open). type: String default: Undefined - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] since: 3.0.0 - name: readyState @@ -494,7 +466,7 @@ properties: This property **must** be specified during creation. Set this property on the HTTPClient to participate in the authentication and resource management of the connection. - See for further information. + See for further information. type: SecurityManagerProtocol platforms: [ipad, iphone, android] since: "3.3.0" @@ -512,8 +484,6 @@ properties: - name: timeout summary: Timeout in milliseconds when the connection should be aborted. - description: | - On Mobile Web, the timeout only works when making asynchronous requests. type: Number - name: username @@ -521,7 +491,7 @@ properties: description: Must be set before calling [open](Titanium.Network.HTTPClient.open). type: String default: Undefined - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] since: 3.0.0 - name: validatesSecureCertificate @@ -545,8 +515,8 @@ properties: request to be asynchronous. type: Boolean default: false - platforms: [mobileweb] - + platforms: [] + - name: tlsVersion summary: Sets the TLS version to use for handshakes. description: | @@ -618,10 +588,10 @@ methods: - name: willHandleURL summary: Returns if the security manager will participate in authentication of this end point. description: | - The parameter passed to this method is a [NSURL](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html) - on iOS and a [Uri](http://developer.android.com/reference/android/net/Uri.html) on android. + The parameter passed to this method is a [NSURL](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html) + on iOS and a [Uri](http://developer.android.com/reference/android/net/Uri.html) on android. - Return **true** to participate, **false** to allow default authentication flow. + Return **true** to participate, **false** to allow default authentication flow. returns: type: Boolean parameters: @@ -677,9 +647,9 @@ platforms: [iphone, ipad, android] name: APSConnectionDelegate summary: An extension of the [NSURLConnectionDelegate](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate) protocol to allow users to participate in authentication and resource management for this HTTPClient. description: | - The APSConnectionDelegate protocol is an extension of the NSURLConnectionDelegate protocol. - - Although all methods in this protocol are optional, the connection delegate must implement at least one of the methods to + The APSConnectionDelegate protocol is an extension of the NSURLConnectionDelegate protocol. + + Although all methods in this protocol are optional, the connection delegate must implement at least one of the methods to participate in the authentication and resource management. The deprecated methods as defined by the NSURLConnectionDelegate protocol are not supported. @@ -687,13 +657,13 @@ description: | In addition to the methods defined in the NSURLConnectionDelegate protocol this protocol defines one additional method. `-(BOOL)willHandleChallenge:(NSURLAuthenticationChallenge *)challenge forConnection:(NSURLConnection *)connection`. - - This method is called on the connection delegate only if it also implements the + + This method is called on the connection delegate only if it also implements the `connection:willSendRequestForAuthenticationChallenge:` method of the NSURLConnectionDelegate protocol. - Return `true` if the connection delegate wants to handle this challenge. + Return `true` if the connection delegate wants to handle this challenge. Return `false` if the default delegate will handle this challenge. - If the connection delegate does not implement this method but implements `connection:willSendRequestForAuthenticationChallenge:`, the return + If the connection delegate does not implement this method but implements `connection:willSendRequestForAuthenticationChallenge:`, the return value is assumed to be `true` and all challenges will be forwarded to the connection delegate. since: 3.3.0 @@ -703,7 +673,7 @@ name: ReadyStatePayload summary: An Object describing the current ready state. See [onreadystatechange](Titanium.Network.HTTPClient.onreadystatechange) for more information. platforms: [iphone, ipad, android] since: "3.4.2" -properties: +properties: - name: readyState summary: The state for which `onreadystatechange` was invoked. Set to one of `Titanium.Network.HTTPClient` ready-state constants type: Number diff --git a/apidoc/Titanium/Network/Network.yml b/apidoc/Titanium/Network/Network.yml index de4f954b4a2..4895255197b 100644 --- a/apidoc/Titanium/Network/Network.yml +++ b/apidoc/Titanium/Network/Network.yml @@ -1,6 +1,6 @@ --- name: Titanium.Network -summary: The top level network module. +summary: The top level network module. description: | The `Network` module is used to access networking related functionality. @@ -32,14 +32,14 @@ description: | ... - + - NSAppTransportSecurity + NSAppTransportSecurity NSAllowsArbitraryLoads - - + + ... @@ -77,9 +77,9 @@ description: | ... - + - NSAppTransportSecurity + NSAppTransportSecurity NSAllowsArbitraryLoads NSExceptionDomains @@ -99,8 +99,8 @@ description: | - - + + ... @@ -158,7 +158,7 @@ methods: summary: | Adds a cookie to the system cookie store. description: | - On Android, uses the system cookie store. Any existing cookie with the same + On Android, uses the system cookie store. Any existing cookie with the same domain, path and name will be replaced with the new cookie. parameters: - name: cookie @@ -177,7 +177,7 @@ methods: summary: Service to search for, must include the protocol type suffix (._tcp). type: String - name: domain - summary: Bonjour service domain to conduct the search in. + summary: Bonjour service domain to conduct the search in. default: | `local.` (The trailing period is intentional.) type: String @@ -219,7 +219,7 @@ methods: description: | Note that `TCPSocket` is still used with the Bonjour services. For other uses, see . - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] returns: type: Titanium.Network.TCPSocket parameters: @@ -231,7 +231,7 @@ methods: type: Number - name: mode summary: | - Socket's mode; one of , , + Socket's mode; one of , , . type: Number - name: parameters @@ -252,7 +252,7 @@ methods: - name: encodeURIComponent summary: Returns a URI encoded version of the specified URI component. description: | - On iOS, this also escapes the following characters, which are allowed in a + On iOS, this also escapes the following characters, which are allowed in a URL but may not be allowed or desirable inside a path component: !*'();:@+$,/?%#[]=& @@ -395,7 +395,7 @@ methods: platforms: [iphone, ipad] parameters: - name: config - summary: Dictionary specifying push-notification related options. + summary: Dictionary specifying push-notification related options. type: PushNotificationConfig - name: removeConnectivityListener @@ -410,16 +410,16 @@ methods: summary: Callback function to remove. type: Callback platforms: [iphone, ipad] - + - name: unregisterForPushNotifications summary: Unregisters the application for push notifications. description: | Per Apple's documentation, it is rarely necessary to call this method. See: [unregisterForRemoteNotifications in the UIApplication Class - Reference](http://developer.apple.com/library/IOs/#documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/unregisterForRemoteNotifications) + Reference](http://developer.apple.com/library/IOs/#documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/unregisterForRemoteNotifications) - For example, calling this method would be required if a new version of + For example, calling this method would be required if a new version of your application no longer supports push notifications. events: - name: change @@ -438,7 +438,7 @@ events: - name: reason summary: Human-readable text describing the reason for the change. type: String - platforms: [android, mobileweb] + platforms: [android] properties: - name: INADDR_ANY summary: | @@ -457,9 +457,6 @@ properties: communicating over a local-area network. description: | - This network type is only used by the Mobile Web platform, when the application - is running in a desktop browser attached to a LAN. - This constant is also a possible value for the `networkType` property of the [change](Titanium.Network.change) event. type: Number @@ -471,40 +468,40 @@ properties: communicating over a mobile network. description: | - This constant is also a possible value for the `networkType` property of the + This constant is also a possible value for the `networkType` property of the [change](Titanium.Network.change) event. type: Number permission: read-only - name: NETWORK_NONE summary: | - A [networkType](Titanium.Network.networkType) value indicating that no + A [networkType](Titanium.Network.networkType) value indicating that no network is available. description: | - This constant is also a possible value for the `networkType` property of the + This constant is also a possible value for the `networkType` property of the [change](Titanium.Network.change) event. type: Number permission: read-only - name: NETWORK_UNKNOWN summary: | - A [networkType](Titanium.Network.networkType) value indicating that the + A [networkType](Titanium.Network.networkType) value indicating that the current network type is unknown. description: | - This constant is also a possible value for the `networkType` property of the + This constant is also a possible value for the `networkType` property of the [change](Titanium.Network.change) event. type: Number permission: read-only - name: NETWORK_WIFI summary: | - A [networkType](Titanium.Network.networkType) value indicating that the + A [networkType](Titanium.Network.networkType) value indicating that the device is communicating over a WiFi network. description: | - This constant is also a possible value for the `networkType` property of the + This constant is also a possible value for the `networkType` property of the [change](Titanium.Network.change) event. type: Number permission: read-only @@ -711,23 +708,23 @@ properties: - name: remoteNotificationsEnabled summary: | - Indicates whether push notifications have been enabled using + Indicates whether push notifications have been enabled using [registerForPushNotifications](Titanium.Network.registerForPushNotifications). platforms: [iphone, ipad] type: Boolean permission: read-only - name: httpURLFormatter - summary: User-defined function that is called everytime HTTPClient connects to a remote resource. + summary: User-defined function that is called everytime HTTPClient connects to a remote resource. description: | - The URL to connect to is passed in as the only function argument, and the function - is expected to return a URL. The function should return `null` if an error occurs, - which will cancel the HTTP request. - - This function allows URLs to be formatted for use with the application's proxy to + The URL to connect to is passed in as the only function argument, and the function + is expected to return a URL. The function should return `null` if an error occurs, + which will cancel the HTTP request. + + This function allows URLs to be formatted for use with the application's proxy to get around cross domain issues. type: Callback - platforms: [mobileweb] + platforms: [] --- name: PushNotificationConfig @@ -735,7 +732,7 @@ summary: | Simple object for specifying push notification options to [registerForPushNotifications](Titanium.Network.registerForPushNotifications). properties: - - name: types + - name: types summary: Array of `NOTIFICATION_TYPE` constants that the application would like to receive. description: | For iOS 8 and later, setting the `types` property with the @@ -746,7 +743,7 @@ properties: method to register the notification types to receive. type: Array constants: Titanium.Network.NOTIFICATION_TYPE_* - - name: success + - name: success summary: | Callback function called when the push registration is successfully completed. type: Callback @@ -755,20 +752,20 @@ properties: Callback function called when an error occurs during registration. type: Callback - name: callback - summary: Callback function invoked upon receiving a new push notification. + summary: Callback function invoked upon receiving a new push notification. type: Callback --- name: PushNotificationSuccessArg summary: | - A simple object passed to the + A simple object passed to the [registerForPushNotifications](Titanium.Network.registerForPushNotifications) success callback. extends: SuccessResponse -properties: +properties: - name: type summary: The value of this string is always "remote". type: String - - name: deviceToken + - name: deviceToken summary: The device token which this device was registered for. type: String @@ -783,7 +780,7 @@ properties: description: Will be undefined. type: String since: "3.1.0" - + - name: code summary: Error code. Returns 0. description: Error code will be 0. @@ -793,10 +790,10 @@ properties: --- name: PushNotificationErrorArg summary: | - A simple object passed to the + A simple object passed to the [registerForPushNotifications](Titanium.Network.registerForPushNotifications) error callback. extends: FailureResponse -properties: +properties: - name: type summary: The value of this string is always "remote". type: String @@ -805,7 +802,7 @@ properties: description: Returns `false`. type: Boolean since: "3.1.0" - + - name: code summary: Error code. Returns a non-zero value. description: | @@ -817,7 +814,7 @@ properties: --- name: PushNotificationData summary: A simple object representing a push notification. -properties: +properties: - name: data summary: The `userinfo` dictionary passed to the Apple Push Notification Service. description: | @@ -828,6 +825,6 @@ properties: type: Dictionary - name: inBackground summary: | - Boolean indicating if notification was received while app was in background. + Boolean indicating if notification was received while app was in background. This property became available in Titanium Mobile 3.1.0 for iOS. type: Boolean diff --git a/apidoc/Titanium/Platform/Platform.yml b/apidoc/Titanium/Platform/Platform.yml index 3201288c3db..6455401b147 100644 --- a/apidoc/Titanium/Platform/Platform.yml +++ b/apidoc/Titanium/Platform/Platform.yml @@ -1,7 +1,7 @@ --- name: Titanium.Platform summary: | - The top-level Platform module. The Platform module is used to access the device's platform-related + The top-level Platform module. The Platform module is used to access the device's platform-related functionality. extends: Titanium.Module since: "0.1" @@ -14,20 +14,17 @@ events: summary: The battery state. type: Number constants: Titanium.Platform.BATTERY_* - + - name: level summary: Percentage battery power level. type: Number platforms: [android, iphone, ipad] - + methods: - name: canOpenURL summary: | Returns whether the system is configured with a default application to handle the URL's protocol. description: | - On Mobile Web, this method always returns true, even if the browser can't open the specific URL, - unless the URL is empty or undefined. - On iOS, this method might return false if you have not whitelisted the URL schemes you query in your [tiapp.xml](http://docs.appcelerator.com/platform/latest/#!/guide/tiapp.xml_and_timodule.xml_Reference-section-29004921_tiapp.xmlandtimodule.xmlReference-iOS9SecurityandcanOpenUrl). returns: type: Boolean @@ -36,129 +33,123 @@ methods: - name: url summary: The url to check. type: String - + - name: createUUID summary: Creates a globally-unique identifier. - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] returns: type: String - + - name: openURL summary: | Opens this URL using the system's default application for its protocol. - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] returns: type: Boolean parameters: - name: url summary: The url to open. type: String - + - name: is24HourTimeFormat summary: Returns whether the system settings are configured to show times in 24-hour format. - description: | - On Mobile Web, this function always returns false. returns: type: Boolean - platforms: [android, iphone, ipad, mobileweb] - + platforms: [android, iphone, ipad] + properties: - name: BATTERY_STATE_CHARGING summary: Constant to indicate that the system is plugged in and currently being charged. type: Number permission: read-only - + - name: BATTERY_STATE_FULL summary: Constant to indicate that the battery is fully charged. - description: On Mobile Web, `BATTERY_STATE_FULL` is defined, but will never be a valid state. type: Number permission: read-only - + - name: BATTERY_STATE_UNKNOWN summary: Constant to indicate that the battery state is not known or monitoring is disabled. type: Number permission: read-only - + - name: BATTERY_STATE_UNPLUGGED summary: Constant to indicate that the system is unplugged. type: Number permission: read-only - + - name: address summary: System's WIFI IP address. No other network types are supported. type: String permission: read-only platforms: [android, iphone, ipad] - + - name: architecture summary: System's processor architecture. type: String permission: read-only platforms: [android, iphone, ipad] - + - name: availableMemory summary: System's unused memory, measured in megabytes on iOS and bytes on Android. type: Number permission: read-only platforms: [android, iphone, ipad] - + - name: batteryLevel summary: | - Battery level in percent, accessible only when `batteryMonitoring` is enabled. Measured + Battery level in percent, accessible only when `batteryMonitoring` is enabled. Measured in 5% increments on iPhone/iPad. type: Number permission: read-only - + - name: batteryMonitoring summary: Determines whether battery monitoring is enabled. - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] default: false type: Boolean - + - name: batteryState summary: Indicates the state of the battery. Accessible only when `batteryMonitoring` is enabled. - description: | - On Mobile Web, battery state will either be charging, unplugged, or unknown. Full charge state - is not supported. type: Number constants: Titanium.Platform.BATTERY_STATE_* permission: read-only - + - name: displayCaps summary: | Returns the DisplayCaps object. description: | - Note that the `displayCaps` property begins with a lowercase letter, which differentiates it + Note that the `displayCaps` property begins with a lowercase letter, which differentiates it from the `DisplayCaps` object that it returns. type: Titanium.Platform.DisplayCaps permission: read-only - + - name: id summary: Applications's globally-unique ID (UUID). description: | On Android, this may be the UDID (unique device ID). For iOS, this is a unique identifier for this install of the application. - + Previously on iOS this may have been a UDID, but access to this has been restricted by Apple. For more information, see [Apple's uniqueIdentifier](https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIDevice_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/occ/instp/UIDevice/uniqueIdentifier) documentation. - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] type: String permission: read-only - + - name: locale summary: System's default language. description: | - Locale, as a combination of ISO 2-letter language and country codes. For example, - `en-US` or `en-GB`. See the - [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) and - [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + Locale, as a combination of ISO 2-letter language and country codes. For example, + `en-US` or `en-GB`. See the + [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) and + [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) sections of wikipedia for reference. - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] type: String permission: read-only - + - name: macaddress summary: System's network interface mac address, or app UUID. description: | @@ -168,7 +159,7 @@ properties: type: String permission: read-only platforms: [android, iphone, ipad] - + - name: manufacturer summary: Manufacturer of the device. description: | @@ -183,14 +174,10 @@ properties: summary: Model of the device. description: | An identifier of the hardware model of the device. For example, `HTC Sensation Z710e`. - - Virtual devices will also return a value. For example, `sdk` for the standard Android SDK - and `google_sdk` for the enhanced Android Google APIs SDK running in an emulator, and + + Virtual devices will also return a value. For example, `sdk` for the standard Android SDK + and `google_sdk` for the enhanced Android Google APIs SDK running in an emulator, and `Simulator` for iOS running in a simulator. - - Mobile Web will return the browser Agent information, such as - `Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0` for - Firefox 12 running on Ubuntu. type: String permission: read-only platforms: [android, iphone, ipad] @@ -203,57 +190,56 @@ properties: } else { // Add Accelerometer event listener } - + - name: name summary: | Name of the platform. Returns `android` for the Android platform, `iPhone OS` for the iOS - platform (iPhone, iPad, or iPod Touch), `windows` for the Windows platform, and `mobileweb` for the Mobile Web platform. - + platform (iPhone, iPad, or iPod Touch), and `windows` for the Windows platform. + Since iOS 10 this property returns `iOS` for for the iOS platform (iPhone, iPad, or iPod Touch). type: String permission: read-only - + - name: netmask summary: System's WIFI network mask. No other network types are supported. type: String permission: read-only platforms: [android, iphone, ipad] - + - name: osname summary: | Short name of the system's Operating System. Returns `android` for the Android platfrom, - `iphone` for the iPhone or iPod Touch, `ipad` for the iPad, `windowsphone` for Windows Phone, `windowsstore` for Windows Store, and `mobileweb` for the Mobile Web + `iphone` for the iPhone or iPod Touch, `ipad` for the iPad, `windowsphone` for Windows Phone, and `windowsstore` for Windows Store platform. type: String permission: read-only - + - name: ostype summary: Operating System architecture. On Android, this is `32bit`. - platforms: [android, iphone, mobileweb, ipad] + platforms: [android, iphone, ipad] type: String permission: read-only - + - name: processorCount summary: Number of processing cores. type: Number permission: read-only platforms: [android, iphone, ipad] - + - name: runtime summary: Short name of the JavaScript runtime in use. description: | - On iOS this is "javascriptcore", on Android either "v8" or "rhino" and on Mobile Web it is - determined by the browser used. + On iOS this is "javascriptcore", on Android either "v8" or "rhino". type: String permission: read-only - + - name: username summary: | System name, if set. On iOS, this can be found in Settings > General > About > Name. type: String permission: read-only platforms: [android, iphone, ipad] - + - name: version summary: System's OS version. type: String @@ -263,11 +249,10 @@ examples: - title: Battery Event Example example: | Obtaining battery data when the battery state changes. - + Titanium.Platform.addEventListener('battery', function(e){ Ti.API.info('The battery state has changed to ' + e.state); Ti.API.info('The battery level is ' + e.level); Ti.API.info('The battery event source is ' + e.source); Ti.API.info('The battery event name ' + e.type); }); - diff --git a/apidoc/Titanium/Proxy.yml b/apidoc/Titanium/Proxy.yml index 20d1b54fa0e..d36ecfc8bef 100644 --- a/apidoc/Titanium/Proxy.yml +++ b/apidoc/Titanium/Proxy.yml @@ -8,9 +8,6 @@ description: | calling a method on the proxy object results in a method invokation on the native object. - In Mobile Web, there is no true `Proxy` type -- all Titanium objects are ordinary JavaScript - objects. - Some Titanium objects are _createable_: new instances of these objects can be created using factory methods. For example, a [Window](Titanium.UI.Window) object can be created using the method. @@ -32,15 +29,15 @@ methods: - name: removeEventListener summary: Removes the specified callback as an event listener for the named event. description: | - Multiple listeners can be registered for the same event, so the - `callback` parameter is used to determine which listener to remove. - + Multiple listeners can be registered for the same event, so the + `callback` parameter is used to determine which listener to remove. + When adding a listener, you must save a reference to the callback function in order to remove the listener later: var listener = function() { Ti.API.info("Event listener called."); } window.addEventListener('click', listener); - + To remove the listener, pass in a reference to the callback function: window.removeEventListener('click', listener); @@ -70,7 +67,7 @@ methods: - name: props summary: A dictionary of properties to apply. type: Dictionary - since: {android: "3.0.0", iphone: "3.0.0", ipad: "3.0.0", mobileweb: "3.0.0"} + since: {android: "3.0.0", iphone: "3.0.0", ipad: "3.0.0"} properties: @@ -94,7 +91,7 @@ properties: returns `Ti.UI.Button`. permission: read-only type: String - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] since: "3.2.0" - name: lifecycleContainer diff --git a/apidoc/Titanium/Stream/Stream.yml b/apidoc/Titanium/Stream/Stream.yml index dffee33fe9e..d0009f49e87 100644 --- a/apidoc/Titanium/Stream/Stream.yml +++ b/apidoc/Titanium/Stream/Stream.yml @@ -297,7 +297,7 @@ methods: --- name: CreateStreamArgs -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] summary: Argument passed to [createStream](Titanium.Stream.createStream). since: "1.7" @@ -316,7 +316,7 @@ properties: --- name: ReadCallbackArgs -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] summary: | Argument passed to the read callback when an asynchronous [read](Titanium.Stream.read) operation finishes. @@ -373,7 +373,7 @@ properties: --- name: WriteCallbackArgs -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] summary: | Argument passed to the write callback when an asynchronous [write](Titanium.Stream.write) operation @@ -427,7 +427,7 @@ properties: --- name: WriteStreamCallbackArgs -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] summary: | Argument passed to the callback when an asynchronous [writeStream](Titanium.Stream.writeStream) operation finishes. @@ -464,7 +464,7 @@ properties: --- name: PumpCallbackArgs -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] summary: | Argument passed to the callback each time the [pump](Titanium.Stream.pump) operation has new data to deliver. diff --git a/apidoc/Titanium/Titanium.yml b/apidoc/Titanium/Titanium.yml index f5964a98f3b..3e45c6afc31 100644 --- a/apidoc/Titanium/Titanium.yml +++ b/apidoc/Titanium/Titanium.yml @@ -3,8 +3,7 @@ name: Titanium summary: The top-level Titanium module. description: | The Titanium module provides the Titanium Mobile API, allowing developers to access native - features of each target environment. Currently, the Android, iOS and Mobile Web (beta) - environments are supported. + features of each target environment. Currently, the Android and iOSenvironments are supported. #### Titanium Namespace @@ -40,9 +39,6 @@ properties: type: String summary: User-agent string used by Titanium. - description: | - On Mobile Web, the browser's user agent cannot be overridden. Writing to this property has no - effect and reading the property will always return the browser's user agent. - name: version type: String summary: Version of Titanium that is executing. @@ -67,7 +63,7 @@ methods: returns: type: Titanium.Buffer summary: The new buffer. - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] examples: - title: Create a buffer with 1K bytes example: | @@ -90,7 +86,7 @@ methods: name: CreateBufferArgs summary: Arguments to be passed to createBuffer since: "1.7" -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] properties: - name: value diff --git a/apidoc/Titanium/UI/2DMatrix.yml b/apidoc/Titanium/UI/2DMatrix.yml index eb9d973348c..82f52e90282 100644 --- a/apidoc/Titanium/UI/2DMatrix.yml +++ b/apidoc/Titanium/UI/2DMatrix.yml @@ -2,7 +2,7 @@ name: Titanium.UI.2DMatrix summary: The 2D Matrix is an object for holding values for an affine transformation matrix. description: | - A 2D matrix is used to rotate, scale, translate, or skew the objects in a two-dimensional space. + A 2D matrix is used to rotate, scale, translate, or skew the objects in a two-dimensional space. A 2D affine transformation can be represented by a 3 by 3 matrix: @@ -11,24 +11,24 @@ description: |
txty1
- The third column is constant (0,0,1). + The third column is constant (0,0,1). - On iOS and Mobile Web, the matrix terms, `a`, `b`, `c`, `d`, `tx`, and `ty`, + On iOS, the matrix terms, `a`, `b`, `c`, `d`, `tx`, and `ty`, are available as properties. On Android, the matrix terms are not available as properties. - - Use the method to create a new 2D matrix. You can - pass an optional dictionary to the method to initialize the - matrix. For example, the following creates a new matrix with a 45 degree rotation. - var m = Ti.UI.create2DMatrix({ - rotate: 45 + Use the method to create a new 2D matrix. You can + pass an optional dictionary to the method to initialize the + matrix. For example, the following creates a new matrix with a 45 degree rotation. + + var m = Ti.UI.create2DMatrix({ + rotate: 45 }); If you pass no arguments, `create2DMatrix` returns an identity matrix. extends: Titanium.Proxy since: "0.9" -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] methods: - name: invert summary: Returns a matrix constructed by inverting this matrix. @@ -37,52 +37,52 @@ methods: - name: multiply summary: Returns a matrix constructed by combining two existing matrices. description: | - The argument, `t2` is concatenated to the matrix instance against which the function is invoked. The - resulting matrix is the result of multiplying this matrix by `t2`. You might perform several - multiplications in order to create a single matrix that contains the cumulative effects of - several transformations. - - Note that matrix operations are not commutative -- the order in which you concatenate matrices - is important. That is, the result of multiplying matrix `t1` by matrix `t2` does not necessarily + The argument, `t2` is concatenated to the matrix instance against which the function is invoked. The + resulting matrix is the result of multiplying this matrix by `t2`. You might perform several + multiplications in order to create a single matrix that contains the cumulative effects of + several transformations. + + Note that matrix operations are not commutative -- the order in which you concatenate matrices + is important. That is, the result of multiplying matrix `t1` by matrix `t2` does not necessarily equal the result of multiplying matrix `t2` by matrix `t1`. returns: type: Titanium.UI.2DMatrix parameters: - name: t2 - summary: The second matrix. + summary: The second matrix. type: Titanium.UI.2DMatrix - name: rotate summary: Returns a matrix constructed by rotating this matrix. description: | There are two distinct versions of this method, depending on whether one argument - or two are specified. + or two are specified. * `rotate(angle)`. The standard `rotate` method. * `rotate(fromAngle, toAngle)`. Android only. Used for specifying rotation animations. - - In both cases, a positive value specifies clockwise rotation and a negative value - specifies counter-clockwise rotation. + + In both cases, a positive value specifies clockwise rotation and a negative value + specifies counter-clockwise rotation. Details for each version are discussed below. - + #### rotate(angle) Returns a matrix constructed by rotating this matrix. - Note that the resulting matrix only expresses the final transformation, not the + Note that the resulting matrix only expresses the final transformation, not the direction of the rotation. For example, the matrix produced by `m1.rotate(-10)` is identical to the matrix produced by `m1.rotate(350)` and `m1.rotate(710)`. Note that if you specify a rotation matrix as the `transform` property of an - animation, the animation animates the view from its current rotation to the - rotation represented by the matrix by its shortest path. So to rotate a view + animation, the animation animates the view from its current rotation to the + rotation represented by the matrix by its shortest path. So to rotate a view in a complete circle, the easiest method is to chain together three animations, rotating 120 degrees each time. - For the purposes of animation, it should be noted that the rotation angle is - normalized to the range -180 <= angle < 180. In other + For the purposes of animation, it should be noted that the rotation angle is + normalized to the range -180 <= angle < 180. In other words, an angle of 180 degrees is normalized to -180. This makes no difference except when determining which direction an animation rotates. 179 degrees rotates rotate clockwise, but 180 degrees is normalized to -180, so rotates counter-clockwise. @@ -90,13 +90,13 @@ methods: #### rotate(angle, toAngle) -- Android Only This is an Android-specific method used for creating rotation animations. - Returns a `2DMatrix` object that represents a rotation from `angle` to `toAngle`. + Returns a `2DMatrix` object that represents a rotation from `angle` to `toAngle`. Angles are specified in degrees. Positive values represent clockwise rotation, and negative values - represent counter-clockwise rotation. Values are not normalized, so for example an + represent counter-clockwise rotation. Values are not normalized, so for example an angle of 720 degrees represents two complete clockwise revolutions. - - The resulting object cannot be expressed as an affine transform, but can be used with the + + The resulting object cannot be expressed as an affine transform, but can be used with the property to specify a rotation animation. returns: @@ -119,13 +119,13 @@ methods: Returns a `2DMatrix` object that specifies a scaling animation from one scale to another. description: | There are two distinct versions of this method, depending on whether two arguments - or four are specified. + or four are specified. * `scale(sx, sy)`. The standard `scale` method. - * `scale(fromSx, fromSy, toSx, toSy)`. Android only. Used for specifying a + * `scale(fromSx, fromSy, toSx, toSy)`. Android only. Used for specifying a scaling animation from one size to another. - #### scale(sx, sy) + #### scale(sx, sy) Returns a matrix constructed by applying a scale transform to this matrix. Scaling the current matrix by `sx` along the X axis and by `sy` along the Y axis. @@ -133,9 +133,9 @@ methods: #### scale(sx, sy, toSx, toSy) -- Android Only This Android-specific method returns a `2DMatrix` object that can be used to - create a scaling animation from one scale factor to another scale factor. + create a scaling animation from one scale factor to another scale factor. - The resulting object cannot be expressed as an affine transform, but can be used with the + The resulting object cannot be expressed as an affine transform, but can be used with the property to specify a scaling animation. returns: type: Titanium.UI.2DMatrix @@ -143,15 +143,15 @@ methods: - name: sx summary: | - Horizontal scaling factor. If `toSx` and `toSy` are specified, - this specifies the starting horizontal scaling factor, at the beginning + Horizontal scaling factor. If `toSx` and `toSy` are specified, + this specifies the starting horizontal scaling factor, at the beginning of an animation. type: Number - name: sy summary: | - Vertical scaling factor. If `toSx` and `toSy` are specified, - this specifies the starting vertical scaling factor, at the beginning of + Vertical scaling factor. If `toSx` and `toSy` are specified, + this specifies the starting vertical scaling factor, at the beginning of an animation. type: Number @@ -247,13 +247,13 @@ summary: Simple object passed to to initialize a ma description: | The matrix is initialized with the specified transforms. - On iOS, rotation is always performed first, regardless of the order the + On iOS, rotation is always performed first, regardless of the order the properties are specified in. On Android, specifying both `scale` and `rotate` the same dictionary results in an incorrect transformation. -properties: +properties: - name: scale summary: | Scale the matrix by the specified scaling factor. The same scaling factor is used @@ -275,5 +275,5 @@ properties: rotated. type: Dictionary optional: true - default: (0.5, 0.5) + default: (0.5, 0.5) platforms: [android] diff --git a/apidoc/Titanium/UI/ActivityIndicator.yml b/apidoc/Titanium/UI/ActivityIndicator.yml index 7625a592c01..93ada4efe25 100644 --- a/apidoc/Titanium/UI/ActivityIndicator.yml +++ b/apidoc/Titanium/UI/ActivityIndicator.yml @@ -1,25 +1,24 @@ --- name: Titanium.UI.ActivityIndicator -summary: An activity indicator that lets the user know an action is taking place. +summary: An activity indicator that lets the user know an action is taking place. description: | - - +
AndroidiOSMobile WebWindows Phone
AndroidiOSWindows Phone
- An activity indicator can be used to show the progress of an operation in the UI to let the - user know that some action is taking place. An activity indicator consists of a spinning - animation and an optional text message, and is used to indicate an ongoing activity of + An activity indicator can be used to show the progress of an operation in the UI to let the + user know that some action is taking place. An activity indicator consists of a spinning + animation and an optional text message, and is used to indicate an ongoing activity of indeterminate length. To show progress, use instead. Use the method or **``** Alloy element to create an `ActivityIndicator` object. - + `ActivityIndicator` is a view and, like any view, must be added to a window or other top-level view before it can be shown. Unlike most views, `ActivityIndicator` is hidden by default and must be shown explicitly by calling its method. @@ -53,12 +52,12 @@ methods: description: | Adding children to an `ActivityIndicator` is not supported on all platforms. - If you need to display views on top of this object, consider using - another view as a container for both this object and the views you want + If you need to display views on top of this object, consider using + another view as a container for both this object and the views you want to appear on top of it. See also: . - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] - name: hide summary: Hides the activity indicator and stops the animation. @@ -69,26 +68,26 @@ methods: Adding children to an `ActivityIndicator` is not supported on all platforms. See also: [add](Titanium.UI.ActivityIndicator.add), . - platforms: [iphone, ipad, mobileweb] - + platforms: [iphone, ipad] + - name: show summary: Shows the activity indicator and starts the animation. properties: - name: bottom summary: Bottom position of the view. description: | - Determines the absolute position of the view relative to its parent. - + Determines the absolute position of the view relative to its parent. + Can be either a float value or a dimension string (for example `100` or `'50%'`.) type: [Number, String] - + - name: color summary: | Color of the message text, as a color name or hex triplet. description: | For information about color values, see the "Colors" section of . type: String - + - name: font summary: Font used for the message text. type: Font @@ -103,35 +102,33 @@ properties: - name: left summary: Left position of the view. description: | - Determines the absolute position of the view relative to its parent. - + Determines the absolute position of the view relative to its parent. + Can be either a float value or a dimension string (for example `100` or `'50%'`.) type: [Number, String] - + - name: message summary: Message text. type: String - + - name: messageid - summary: Key identifying a string in the locale file to use for the message text. + summary: Key identifying a string in the locale file to use for the message text. description: Only one of `message` or `messageid` should be specified. type: String - + - name: right summary: Right position of the view. description: | - Determines the absolute position of the view relative to its parent. - + Determines the absolute position of the view relative to its parent. + Can be either a float value or a dimension string (for example `100` or `'50%'`.) type: [Number, String] - + - name: style summary: The style for the activity indicator. description: | One of the activity indicator style constants. - On Mobile Web, setting the style automatically sets the indicator color and diameter. - See also: [indicatorColor](Titanium.UI.ActivityIndicator.indicatorColor), [indicatorDiameter](Titanium.UI.ActivityIndicator.indicatorDiameter) type: Number @@ -143,8 +140,8 @@ properties: since: "2.1.0" type: String default:
#fff
- platforms: [mobileweb,iphone,ipad,android] - + platforms: [iphone,ipad,android] + - name: indicatorDiameter summary: Diameter of the indicator. description: | @@ -152,13 +149,13 @@ properties: since: "2.1.0" type: String default: 36 - platforms: [mobileweb] + platforms: [] - name: top summary: Top position of the view. description: | - Determines the absolute position of the view relative to its parent. - + Determines the absolute position of the view relative to its parent. + Can be either a float value or a dimension string (for example `100` or`'50%'`.) type: [Number, String] @@ -168,13 +165,13 @@ properties: display the message and to position the view correctly. type: String constants: Titanium.UI.SIZE - + examples: - title: Simple Activity Indicator example: | - Open a yellow window immediately after a blue window. Show an activity indicator while + Open a yellow window immediately after a blue window. Show an activity indicator while some code executes and hide it on completion. Then close the yellow window. - + Ti.UI.backgroundColor = 'white'; var win1 = Ti.UI.createWindow({ diff --git a/apidoc/Titanium/UI/ActivityIndicatorStyle.yml b/apidoc/Titanium/UI/ActivityIndicatorStyle.yml index c2d163775af..bdfba597c2b 100644 --- a/apidoc/Titanium/UI/ActivityIndicatorStyle.yml +++ b/apidoc/Titanium/UI/ActivityIndicatorStyle.yml @@ -2,8 +2,8 @@ name: Titanium.UI.ActivityIndicatorStyle summary: A set of constants for the styles available for objects. extends: Titanium.Module -since: {iphone: "5.1.0", ipad: "5.1.0", android: "3.0.0", mobileweb: "2.1.0"} -platforms: [iphone, ipad, android, mobileweb] +since: {iphone: "5.1.0", ipad: "5.1.0", android: "3.0.0"} +platforms: [iphone, ipad, android] createable: false properties: @@ -11,59 +11,59 @@ properties: summary: Large white spinning indicator. description: | Used with the property. - - One of the group of activity indicator style constants - [DARK](Titanium.UI.ActivityIndicatorStyle.DARK), - [BIG](Titanium.UI.ActivityIndicatorStyle.BIG), - [BIG](Titanium.UI.ActivityIndicatorStyle.BIG_DARK), + + One of the group of activity indicator style constants + [DARK](Titanium.UI.ActivityIndicatorStyle.DARK), + [BIG](Titanium.UI.ActivityIndicatorStyle.BIG), + [BIG](Titanium.UI.ActivityIndicatorStyle.BIG_DARK), and [PLAIN](Titanium.UI.ActivityIndicatorStyle.PLAIN). type: Number permission: read-only - platforms: [iphone, ipad, android, mobileweb] - + platforms: [iphone, ipad, android] + - name: DARK summary: Small gray spinning indicator. description: | Used with the property. - - One of the group of activity indicator style constants - [DARK](Titanium.UI.ActivityIndicatorStyle.DARK), - [BIG](Titanium.UI.ActivityIndicatorStyle.BIG), - [BIG](Titanium.UI.ActivityIndicatorStyle.BIG_DARK), + + One of the group of activity indicator style constants + [DARK](Titanium.UI.ActivityIndicatorStyle.DARK), + [BIG](Titanium.UI.ActivityIndicatorStyle.BIG), + [BIG](Titanium.UI.ActivityIndicatorStyle.BIG_DARK), and [PLAIN](Titanium.UI.ActivityIndicatorStyle.PLAIN). type: Number permission: read-only - platforms: [iphone, ipad, android, mobileweb] - + platforms: [iphone, ipad, android] + - name: BIG_DARK summary: Large gray spinning indicator. description: | Used with the property. - + Note: Although this constant is not available on iOS, you accomplish this behavior by setting the style to `Ti.UI.ActivityIndicatorStyle.BIG` - and use the property to + and use the property to tint the indicator. - - One of the group of activity indicator style constants - [DARK](Titanium.UI.ActivityIndicatorStyle.DARK), - [BIG](Titanium.UI.ActivityIndicatorStyle.BIG), - [BIG](Titanium.UI.ActivityIndicatorStyle.BIG_DARK), + + One of the group of activity indicator style constants + [DARK](Titanium.UI.ActivityIndicatorStyle.DARK), + [BIG](Titanium.UI.ActivityIndicatorStyle.BIG), + [BIG](Titanium.UI.ActivityIndicatorStyle.BIG_DARK), and [PLAIN](Titanium.UI.ActivityIndicatorStyle.PLAIN). type: Number permission: read-only - platforms: [android, mobileweb] - + platforms: [android] + - name: PLAIN summary: Small white spinning indicator (default). description: | Used with the property. - - One of the group of activity indicator style constants - [DARK](Titanium.UI.ActivityIndicatorStyle.DARK), - [BIG](Titanium.UI.ActivityIndicatorStyle.BIG), - [BIG](Titanium.UI.ActivityIndicatorStyle.BIG_DARK), + + One of the group of activity indicator style constants + [DARK](Titanium.UI.ActivityIndicatorStyle.DARK), + [BIG](Titanium.UI.ActivityIndicatorStyle.BIG), + [BIG](Titanium.UI.ActivityIndicatorStyle.BIG_DARK), and [PLAIN](Titanium.UI.ActivityIndicatorStyle.PLAIN). type: Number permission: read-only - platforms: [iphone, ipad, android, mobileweb] + platforms: [iphone, ipad, android] diff --git a/apidoc/Titanium/UI/AlertDialog.yml b/apidoc/Titanium/UI/AlertDialog.yml index c570474eda4..8e045dc58d2 100644 --- a/apidoc/Titanium/UI/AlertDialog.yml +++ b/apidoc/Titanium/UI/AlertDialog.yml @@ -8,10 +8,9 @@ description: | - - AndroidiOSMobile WebWindows Phone + AndroidiOSWindows Phone An alert dialog is created using or **``** Alloy element. @@ -90,9 +89,9 @@ events: properties: - name: cancel summary: | - Boolean type on Android and Mobile Web; Number on iOS. + Boolean type on Android; Number on iOS. - On Android and Mobile Web, indicates whether the cancel button was clicked, in which + On Android, indicates whether the cancel button was clicked, in which case returns `true`. On iOS, the value of the [cancel](Titanium.UI.AlertDialog.cancel) property is @@ -189,16 +188,16 @@ properties: type: Array - default: No buttons (Android), Single "OK" button (iOS, Mobile Web) + default: No buttons (Android), Single "OK" button (iOS) availability: creation - name: cancel summary: Index to define the cancel button. description: | - On iOS and Mobile Web, set to `-1` to disable the cancel option. + On iOS, set to `-1` to disable the cancel option. type: Number - default: undefined (Android), -1 (iOS, Mobile Web) + default: undefined (Android), -1 (iOS) - name: canceledOnTouchOutside summary: | @@ -327,7 +326,7 @@ properties: - name: messageid summary: Key identifying a string in the locale file to use for the message text. type: String - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: ok summary: Text for the `OK` button. @@ -341,7 +340,7 @@ properties: description: | If `buttonNames` is defined, this property is ignored. type: String - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] - name: passwordPlaceholder summary: Placeholder of the password text field inside the dialog. @@ -484,7 +483,7 @@ properties: - name: titleid summary: Key identifying a string in the locale file to use for the title text. type: String - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: value summary: Value of the text field inside the dialog. diff --git a/apidoc/Titanium/UI/Animation.yml b/apidoc/Titanium/UI/Animation.yml index 92566231565..2e0b242e06b 100644 --- a/apidoc/Titanium/UI/Animation.yml +++ b/apidoc/Titanium/UI/Animation.yml @@ -2,64 +2,56 @@ name: Titanium.UI.Animation summary: The `Animation` object defines an animation that can be applied to a view. description: | - An animation object describes the properties of an animation. At its most basic, an animation - object represents a single-phase animation with an end state and a duration. - - When [animate](Titanium.UI.View.animate) is called on a [View](Titanium.UI.View), the view is - animated from its current state to the state described by the animation object. The properties - that can be animated include the view's position, size, colors, transformation matrix and opacity. - - Animations can be set to reverse themselves automatically on completion, and to repeat a given - number of times. For more complicated effects, multiple animations can be combined in sequence, + An animation object describes the properties of an animation. At its most basic, an animation + object represents a single-phase animation with an end state and a duration. + + When [animate](Titanium.UI.View.animate) is called on a [View](Titanium.UI.View), the view is + animated from its current state to the state described by the animation object. The properties + that can be animated include the view's position, size, colors, transformation matrix and opacity. + + Animations can be set to reverse themselves automatically on completion, and to repeat a given + number of times. For more complicated effects, multiple animations can be combined in sequence, starting one animation when the previous animation completes. - + Use the method to create an animation object. - - Note that when you animate a view's size or position, the actual layout properties (such as - `top`, `left`, `width`, `height`) are not changed by the animation. See the description of the + + Note that when you animate a view's size or position, the actual layout properties (such as + `top`, `left`, `width`, `height`) are not changed by the animation. See the description of the [animate](Titanium.UI.View.animate) method for more information. - + #### iOS Platform Notes - + iOS supports both 2D and 3D matrix transformations in animations. - - In iOS, you can also specify an animation curve or *easing function* to control the pace of the - animation. To use an easing function, set the animation's `curve` property to one of the - `ANIMATION_CURVE` constants defined in . For example, - [ANIMATION_CURVE_EASE_IN](Titanium.UI.ANIMATION_CURVE_EASE_IN) specifies an animation that + + In iOS, you can also specify an animation curve or *easing function* to control the pace of the + animation. To use an easing function, set the animation's `curve` property to one of the + `ANIMATION_CURVE` constants defined in . For example, + [ANIMATION_CURVE_EASE_IN](Titanium.UI.ANIMATION_CURVE_EASE_IN) specifies an animation that starts slowly and then speeds up. - - Finally, iOS also supports *transitions* between windows or views. You can create a transition - by creating an animation object and setting the `view` property to the view you want to - transition to. The `transition` property specifies the transition effect to apply. Use one of + + Finally, iOS also supports *transitions* between windows or views. You can create a transition + by creating an animation object and setting the `view` property to the view you want to + transition to. The `transition` property specifies the transition effect to apply. Use one of the transition style constants defined in . - + #### Android Platform Notes - - Android supports 2D matrix transformations. Note that the - [2DMatrix.rotate](Titanium.UI.2DMatrix.rotate) method operates differently on Android. Called - with a single argument, it rotates from zero to the specified angle. That is, it ignores any - existing rotation. Called with two arguments, it interprets the first argument as a "from" - angle and the second argument as a "to" angle. - - Android doesn't support any animation curves or easing functions. Animations always interpolate + + Android supports 2D matrix transformations. Note that the + [2DMatrix.rotate](Titanium.UI.2DMatrix.rotate) method operates differently on Android. Called + with a single argument, it rotates from zero to the specified angle. That is, it ignores any + existing rotation. Called with two arguments, it interprets the first argument as a "from" + angle and the second argument as a "to" angle. + + Android doesn't support any animation curves or easing functions. Animations always interpolate linearly between the start state and the end state. - - #### Mobile Web Platform Notes - - Mobile Web supports 2D matrix transformations and animation curves in animations. - - iOS 5.1 and older as well as Safari 5 have a bug where you cannot animate both a position and - transform matrix at the same time. The matrix transform animation will override the position - animation until the matrix transform animation is complete, then jumps to the animated position. extends: Titanium.Proxy since: "0.9" -platforms: [android, iphone, ipad, mobileweb] +platforms: [android, iphone, ipad] events: - name: complete summary: Fired when the animation completes. - + - name: start summary: Fired when the animation starts. @@ -67,12 +59,12 @@ properties: - name: anchorPoint summary: Coordinate of the view about which to pivot an animation. description: | - Used on Android only. For iOS, use . - - Anchor point is specified as a fraction of the view's size. For example, `{0, 0}` is at - the view's top-left corner, `{0.5, 0.5}` at its center and `{1, 1}` at its bottom-right - corner. - + Used on Android only. For iOS, use . + + Anchor point is specified as a fraction of the view's size. For example, `{0, 0}` is at + the view's top-left corner, `{0.5, 0.5}` at its center and `{1, 1}` at its bottom-right + corner. + See the "Using an anchorPoint" example for a demonstration. type: Point platforms: [android] @@ -82,103 +74,103 @@ properties: type: Boolean default: false - + - name: backgroundColor summary: | - Value of the `backgroundColor` property at the end of the animation, as a color name + Value of the `backgroundColor` property at the end of the animation, as a color name or hex triplet. description: | - For information about color values, see the "Colors" section of . + For information about color values, see the "Colors" section of . type: String - platforms: [android, iphone, ipad, mobileweb] - + platforms: [android, iphone, ipad] + - name: bottom summary: Value of the `bottom` property at the end of the animation. type: Number - + - name: center summary: Value of the `center` property at the end of the animation. type: Object - + - name: color summary: | Value of the `color` property at the end of the animation, as a color name or hex triplet. description: | - For information about color values, see the "Colors" section of . + For information about color values, see the "Colors" section of . type: String - platforms: [iphone, ipad, mobileweb] - + platforms: [iphone, ipad] + - name: curve summary: Animation curve or easing function to apply to the animation. type: Number constants: Titanium.UI.ANIMATION_CURVE_* - platforms: [iphone, ipad, mobileweb] - + platforms: [iphone, ipad] + - name: delay summary: Delay, in milliseconds before starting the animation. type: Number - + - name: duration summary: Duration of the animation, in milliseconds. type: Number - + - name: height summary: Value of the `height` property at the end of the animation. type: Number - name: left summary: Value of the `left` property at the end of the animation. type: Number - + - name: opacity summary: Value of the `opacity` property at the end of the animation. type: Number - + - name: opaque summary: Value of the `opaque` property at the end of the animation. type: Boolean platforms: [iphone, ipad] - + - name: repeat summary: Number of times the animation should be performed. description: | - If `autoreverse` is `true`, then one repeat of the animation consists of the animation + If `autoreverse` is `true`, then one repeat of the animation consists of the animation being played once forward, and once backward. type: Number default: 1 (no repeat) - + - name: right summary: Value of the `right` property at the end of the animation. type: Number - + - name: top summary: Value of the `top` property at the end of the animation. type: Number - + - name: transform summary: Animate the view from its current tranform to the specified transform. description: | - Over the course of the animation, the view interpolates from its current transform to the + Over the course of the animation, the view interpolates from its current transform to the specified transform. - + 3D transforms are only supported on iOS. type: [Titanium.UI.2DMatrix, Titanium.UI.3DMatrix] - + - name: transition summary: Transition type to use during a transition animation. description: | - The new view being transitioned to **should NOT** be a child of another view or - of the animating view. The animation replaces the current view from the + The new view being transitioned to **should NOT** be a child of another view or + of the animating view. The animation replaces the current view from the view heirarchy and adds the new view to it. type: Number constants: Titanium.UI.iOS.AnimationStyle.* platforms: [iphone, ipad] - name: view - summary: New view to transition to. + summary: New view to transition to. description: | - Specify the `transition` property with one of the transition style constants defined + Specify the `transition` property with one of the transition style constants defined in to select the effect to apply. The new view being transitioned to **should NOT** be a child of another view or @@ -190,24 +182,24 @@ properties: - name: visible summary: Value of the `visible` property at the end of the animation. type: Boolean - platforms: [iphone, ipad, mobileweb] - + platforms: [iphone, ipad] + - name: width summary: Value of the `width` property at the end of the animation. type: Number - + - name: zIndex summary: Value of the `zIndex` property at the end of the animation. description: Refer to for an explanation of z-index. type: Number - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] examples: - title: Simple Animation Applied to a View example: | - Create a simple animation and apply it to the view. In this example, the view will animate + Create a simple animation and apply it to the view. In this example, the view will animate from red to black to orange over 2 seconds. - + var view = Titanium.UI.createView({ backgroundColor:'red' }); @@ -221,21 +213,21 @@ examples: }; animation.addEventListener('complete',animationHandler); view.animate(animation); - + - title: Animation Using Matrix Transforms example: | The following example uses a transformation matrix to animate a view when the view is clicked. The animation rotates and scales the view, then returns it to its original size and position. The entire animation is repeated three times. - + var box = Ti.UI.createView({ backgroundColor : 'red', height : '100', width : '100' }); win.add(box); - + box.addEventListener('click', function() { var matrix = Ti.UI.create2DMatrix() matrix = matrix.rotate(180); @@ -248,14 +240,14 @@ examples: }); box.animate(a); }); - + - title: Using an anchorPoint (Android and iOS) example: | - Create a button and a blue square view. For each click of the button, apply a 90 degree - rotation animation pivoted at one of a series of anchor points. In particular, note that - an anchor point is configured using the property for + Create a button and a blue square view. For each click of the button, apply a 90 degree + rotation animation pivoted at one of a series of anchor points. In particular, note that + an anchor point is configured using the property for Android and the property for iOS. - + var animationType = [ { name: 'Top Left', anchorPoint: {x:0, y:0} }, { name: 'Top Right', anchorPoint: {x:1, y:0} }, @@ -266,26 +258,26 @@ examples: var animationTypeLength = animationType.length; var animationCount = 0; var animationTypePointer = 0; - + var t = Ti.UI.create2DMatrix(); t = t.rotate(90); - + // animation properties var a = { transform: t, duration: 2000, autoreverse: true }; - + Ti.UI.backgroundColor = 'white'; var win = Ti.UI.createWindow(); - + var view = Ti.UI.createView({ backgroundColor:'#336699', width:100, height:100 }); win.add(view); - + var button = Ti.UI.createButton({ title:'Animate ' + animationType[animationTypePointer].name, height: (Ti.UI.Android) ? 80 : 40, @@ -293,28 +285,28 @@ examples: top:30 }); win.add(button); - + function updateButton(name){ button.title = 'Animate ' + name; } - + button.addEventListener('click', function(){ // set new anchorPoint on animation for Android a.anchorPoint = animationType[animationTypePointer].anchorPoint; - + // set new anchorPoint on view for iOS view.anchorPoint = animationType[animationTypePointer].anchorPoint; - + animationCount++; - + // determine position of next object in animationType array or return to first item // using modulus operator animationTypePointer = animationCount % animationTypeLength; - + // animate view, followed by callback to set next button title view.animate(a, function(){ updateButton(animationType[animationTypePointer].name); }); }); - + win.open(); diff --git a/apidoc/Titanium/UI/Button.yml b/apidoc/Titanium/UI/Button.yml index ac652f82a64..f907f4b0711 100644 --- a/apidoc/Titanium/UI/Button.yml +++ b/apidoc/Titanium/UI/Button.yml @@ -7,65 +7,64 @@ description: | - - AndroidiOSMobile WebWindows Phone + AndroidiOSWindows Phone A button displays its selected state while it is being pressed. The focused state is only used on Android devices that have navigation keys or a keyboard, to indicate which button has input focus. - + You can specify background images for each state, as well as button text and a button icon. On iOS, there are button styles which define appearance for each state, even if no button images are set. - Use the method or a **` Note that the `systemButton` property specifies *appearance*, not behavior. For - example, to bring up the camera when the user presses the **Camera** button, you must - add an event listener to the button and call when the + example, to bring up the camera when the user presses the **Camera** button, you must + add an event listener to the button and call when the button is clicked. ##### iOS Pressed Button Effects @@ -131,34 +130,34 @@ description: | For toolbar buttons that use the [PLAIN](Titanium.UI.iOS.SystemButtonStyle.PLAIN) style or use system icons such as [CAMERA](Titanium.UI.iOS.SystemButton.CAMERA), a glow effect is used. The glow effect shows as a white circular glow or highlight at the center of the button - when the button is pressed. + when the button is pressed. extends: Titanium.UI.View since: "0.8" -methods: +methods: - name: add description: | Adding children to a `Button` is not supported on all platforms. - If you need to display views on top of this object, consider using - another view as a container for both this object and the views you want + If you need to display views on top of this object, consider using + another view as a container for both this object and the views you want to appear on top of it. See also: . - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] - name: remove description: | See also: [add](Titanium.UI.Button.add), . - platforms: [iphone, ipad, mobileweb] + platforms: [iphone, ipad] properties: - name: backgroundImage summary: | - Background image for the button in its normal state, specified as a local file path or URL. + Background image for the button in its normal state, specified as a local file path or URL. description: | - Also sets the background image for the other button states (disabled, focused, selected), + Also sets the background image for the other button states (disabled, focused, selected), unless they've been specified explicitly. On iOS, if backgroundDisabledImage is unset, the image will appear faded to indicate being disabled. Also on iOS, if backgroundSelectedImage is unset, the image will be darkened to indicate being selected. @@ -167,47 +166,47 @@ properties: - name: backgroundDisabledImage summary: | - Background image for the button in its disabled state, specified as a local file path - or URL. + Background image for the button in its disabled state, specified as a local file path + or URL. description: | - Also sets the background image for the other button states (normal, focused, selected), + Also sets the background image for the other button states (normal, focused, selected), unless they've been specified explicitly, except for iOS, which requires a backgroundImage. type: String - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: backgroundFocusedImage summary: | - Background image for the button in its focused state, specified as a local file path - or URL. + Background image for the button in its focused state, specified as a local file path + or URL. description: | - Focusable must be true for normal views. Sets the background image for the focused + Focusable must be true for normal views. Sets the background image for the focused state only. For iOS, since there is not a trackball, this does nothing. type: String - platforms: [android, iphone, ipad, mobileweb] - + platforms: [android, iphone, ipad] + - name: backgroundSelectedColor summary: Selected background color of the view, as a color name or hex triplet. description: | - For information about color values, see the "Colors" section of . + For information about color values, see the "Colors" section of . type: String - platforms: [iphone, ipad, android, mobileweb] + platforms: [iphone, ipad, android] default: Background color of this view. - since: {iphone: "6.1.0", ipad: "6.1.0", android: 0.9.0, mobileweb: 1.8.0} - + since: {iphone: "6.1.0", ipad: "6.1.0", android: 0.9.0} + - name: backgroundSelectedImage summary: | - Background image for the button in its selected state, specified as a local file - path or URL. + Background image for the button in its selected state, specified as a local file + path or URL. description: | - On Android, Focusable must be true in order to be selected. Sets the background image for the selected + On Android, Focusable must be true in order to be selected. Sets the background image for the selected state only. type: String - platforms: [android, iphone, ipad, mobileweb] + platforms: [android, iphone, ipad] - name: color summary: Default button text color, as a color name or hex triplet. description: | - For information about color values, see the "Colors" section of . + For information about color values, see the "Colors" section of . type: String @@ -221,7 +220,7 @@ properties: summary: Set to `true` to enable the button, `false` to disable the button. type: Boolean default: true - platforms: [android, iphone, ipad , mobileweb] + platforms: [android, iphone, ipad ] - name: font summary: Font to use for the button text. @@ -240,17 +239,17 @@ properties: - name: selectedColor summary: Button text color used to indicate the selected state, as a color name or hex triplet. description: | - For information about color values, see the "Colors" section of . + For information about color values, see the "Colors" section of . type: String - platforms: [iphone,ipad,mobileweb] + platforms: [iphone,ipad] - name: shadowColor summary: Shadow color of the [title](Titanium.UI.Button.title), as a color name or hex triplet. description: | Use in conjunction with [shadowOffset](Titanium.UI.Button.shadowOffset) and [shadowRadius](Titanium.UI.Button.shadowRadius). - For information about color values, see the "Colors" section of . + For information about color values, see the "Colors" section of . type: String - platforms: [android, mobileweb] + platforms: [android] since: "3.2.0" - name: shadowOffset @@ -258,7 +257,7 @@ properties: description: | Use in conjunction with [shadowColor](Titanium.UI.Button.shadowColor) and [shadowRadius](Titanium.UI.Button.shadowRadius). type: Dictionary - platforms: [android, mobileweb] + platforms: [android] since: "3.2.0" - name: shadowRadius @@ -266,7 +265,7 @@ properties: description: | Use in conjunction with [shadowColor](Titanium.UI.Button.shadowColor) and [shadowOffset](Titanium.UI.Button.shadowOffset). type: Number - platforms: [android, mobileweb] + platforms: [android] since: "3.2.0" - name: style @@ -279,8 +278,8 @@ properties: description: | In JavaScript: - var cancelButton = Ti.UI.createButton({ - systemButton: Ti.UI.iOS.SystemButton.CANCEL + var cancelButton = Ti.UI.createButton({ + systemButton: Ti.UI.iOS.SystemButton.CANCEL }); In Alloy, you can omit the namespace when setting the `systemButton` property on a `