From 15162bc6a3c942a8c36ea30ce0bd27042211bec4 Mon Sep 17 00:00:00 2001 From: Sergey Volkov Date: Fri, 21 Feb 2020 11:12:03 +0300 Subject: [PATCH 1/3] docs: update Ti.Android.R and Ti.App.Android.R docs --- apidoc/Titanium/Android/Android.yml | 2 +- apidoc/Titanium/App/Android/Android.yml | 21 +++++++++++++- apidoc/Titanium/App/Android/R.yml | 28 ------------------- .../Android/R.yml => common/RProxy.yml} | 21 ++++++++++---- 4 files changed, 37 insertions(+), 35 deletions(-) delete mode 100644 apidoc/Titanium/App/Android/R.yml rename apidoc/{Titanium/Android/R.yml => common/RProxy.yml} (89%) diff --git a/apidoc/Titanium/Android/Android.yml b/apidoc/Titanium/Android/Android.yml index 1898a8d159d..d4ebe2be69f 100644 --- a/apidoc/Titanium/Android/Android.yml +++ b/apidoc/Titanium/Android/Android.yml @@ -2148,7 +2148,7 @@ properties: - name: R summary: Accessor for Android system resources. - type: Titanium.Android.R + type: RProxy permission: read-only accessors: false diff --git a/apidoc/Titanium/App/Android/Android.yml b/apidoc/Titanium/App/Android/Android.yml index 985d996db71..015cdff7238 100644 --- a/apidoc/Titanium/App/Android/Android.yml +++ b/apidoc/Titanium/App/Android/Android.yml @@ -11,7 +11,26 @@ platforms: [android] properties: - name: R summary: The `R` namespace for application resources. - type: Titanium.App.Android.R + description: | + The properties and sub-properties of this object relate directly to the native application + resources `R` class, and thus have the same syntax. For more information, refer to the + official documentation on the Android Developer website about + [accessing application resources](https://developer.android.com/guide/topics/resources/accessing-resources.html). + + For example, if the file + `platform/android/res/drawable/icon.png` exists in the project, it can be accessed using its + integer id, as follows. + + var resid = Titanium.App.Android.R.drawable.icon; + + To access system-wide resources, rather than application resources, use + instead. + + Starting in Titanium SDK 7.3.0, this API exposes all Android related R classes + for the usage in Hyperloop. For example, it can be used to access `menu` resources + as part of native user interfaces, e.g. `BottomNavigationView` or `RecyclerView`. + See an example in the [Hyperloop Sample App](https://github.com/appcelerator/hyperloop-examples) for details! + type: RProxy permission: read-only - name: appVersionCode diff --git a/apidoc/Titanium/App/Android/R.yml b/apidoc/Titanium/App/Android/R.yml deleted file mode 100644 index 9f6f7389b2d..00000000000 --- a/apidoc/Titanium/App/Android/R.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Titanium.App.Android.R -summary: | - The Titanium binding of the native Android `R` class, giving access to application resources. -description: | - The properties and sub-properties of this object relate directly to the native application - resources `R` class, and thus have the same syntax. For more information, refer to the - official documentation on the Android Developer website about - [accessing application resources](https://developer.android.com/guide/topics/resources/accessing-resources.html). - - For example, if the file - `platform/android/res/drawable/icon.png` exists in the project, it can be accessed using its - integer id, as follows. - - var resid = Titanium.App.Android.R.drawable.icon; - - To access system-wide resources, rather than application resources, use - instead. - - Starting in Titanium SDK 7.3.0, this API exposes all Android related R classes - for the usage in Hyperloop. For example, it can be used to access `menu` resources - as part of native user interfaces, e.g. `BottomNavigationView` or `RecyclerView`. - See an example in the [Hyperloop Sample App](https://github.com/appcelerator/hyperloop-examples) for details! - -extends: Titanium.Proxy -since: "1.5" -platforms: [android] -createable: false diff --git a/apidoc/Titanium/Android/R.yml b/apidoc/common/RProxy.yml similarity index 89% rename from apidoc/Titanium/Android/R.yml rename to apidoc/common/RProxy.yml index 63c26223c86..988bdbba189 100644 --- a/apidoc/Titanium/Android/R.yml +++ b/apidoc/common/RProxy.yml @@ -1,16 +1,27 @@ --- -name: Titanium.Android.R -summary: The Titanium binding of the Android system-wide resources class. +name: RProxy +summary: | + The Titanium binding of the native Android `R` class, giving access to Android system-wide + resources or application resources. description: | + To access system-wide resources your application's resources, use . To access your application's resources, use . - These properties and sub-properties correspond directly to the properties of the the `android.R` - class, and should have the same syntax. For example, to retrieve the "OK" string in Android: - + These properties and sub-properties correspond directly to the properties of the the `android.R` + class, and should have the same syntax. + To retrieve the "OK" string from system resources in Android: + Ti.Android.currentActivity.getString(Ti.Android.R.string.ok); + If the file `platform/android/res/drawable/icon.png` exists in the project, it can be accessed + using its integer id, as follows: + + var resid = Titanium.App.Android.R.drawable.icon; + See also: [android.R](https://developer.android.com/reference/android/R.html) in the Android Developer Reference. + For more information, refer to the official documentation on the Android Developer website about + [accessing application resources](https://developer.android.com/guide/topics/resources/accessing-resources.html). Starting in Titanium SDK 7.3.0, this API exposes all Android related R classes for the usage in Hyperloop. For example, it can be used to access `menu` resources From 5cfa6ccbf949b70909bac3f7766de09472700ae8 Mon Sep 17 00:00:00 2001 From: Sergey Volkov Date: Wed, 4 Mar 2020 12:56:23 +0300 Subject: [PATCH 2/3] docs: update Ti.Android.R and Ti.App.Android.R docs --- apidoc/Titanium/Android/Android.yml | 4 +++- apidoc/Titanium/App/Android/Android.yml | 24 ++++++++++-------------- apidoc/common/{RProxy.yml => R.yml} | 23 +++++++++++++---------- 3 files changed, 26 insertions(+), 25 deletions(-) rename apidoc/common/{RProxy.yml => R.yml} (94%) diff --git a/apidoc/Titanium/Android/Android.yml b/apidoc/Titanium/Android/Android.yml index d4ebe2be69f..7e374f3dd37 100644 --- a/apidoc/Titanium/Android/Android.yml +++ b/apidoc/Titanium/Android/Android.yml @@ -2148,7 +2148,9 @@ properties: - name: R summary: Accessor for Android system resources. - type: RProxy + description: | + To access your application's resources, use . + type: R permission: read-only accessors: false diff --git a/apidoc/Titanium/App/Android/Android.yml b/apidoc/Titanium/App/Android/Android.yml index 015cdff7238..b5ac28fa39b 100644 --- a/apidoc/Titanium/App/Android/Android.yml +++ b/apidoc/Titanium/App/Android/Android.yml @@ -12,25 +12,21 @@ properties: - name: R summary: The `R` namespace for application resources. description: | - The properties and sub-properties of this object relate directly to the native application - resources `R` class, and thus have the same syntax. For more information, refer to the - official documentation on the Android Developer website about + The properties and sub-properties of this object relate directly to the + native application resources `R` class, and thus have the same syntax. + For more information, refer to the official documentation on the + Android Developer website about [accessing application resources](https://developer.android.com/guide/topics/resources/accessing-resources.html). - For example, if the file - `platform/android/res/drawable/icon.png` exists in the project, it can be accessed using its - integer id, as follows. + For example, if the file `platform/android/res/drawable/icon.png` + exists in the project, it can be accessed using its resource name, + as follows. var resid = Titanium.App.Android.R.drawable.icon; - To access system-wide resources, rather than application resources, use - instead. - - Starting in Titanium SDK 7.3.0, this API exposes all Android related R classes - for the usage in Hyperloop. For example, it can be used to access `menu` resources - as part of native user interfaces, e.g. `BottomNavigationView` or `RecyclerView`. - See an example in the [Hyperloop Sample App](https://github.com/appcelerator/hyperloop-examples) for details! - type: RProxy + To access system-wide resources, rather than application resources, use + instead. + type: R permission: read-only - name: appVersionCode diff --git a/apidoc/common/RProxy.yml b/apidoc/common/R.yml similarity index 94% rename from apidoc/common/RProxy.yml rename to apidoc/common/R.yml index 988bdbba189..c377b618725 100644 --- a/apidoc/common/RProxy.yml +++ b/apidoc/common/R.yml @@ -1,26 +1,29 @@ --- -name: RProxy +name: R summary: | - The Titanium binding of the native Android `R` class, giving access to Android system-wide - resources or application resources. + The Titanium binding of the native Android `R` class, giving access to + Android system-wide resources or application resources. description: | - To access system-wide resources your application's resources, use . + To access system-wide resources your application's resources, use + . To access your application's resources, use . - These properties and sub-properties correspond directly to the properties of the the `android.R` - class, and should have the same syntax. + These properties and sub-properties correspond directly to the properties + of the the `android.R` class, and should have the same syntax. To retrieve the "OK" string from system resources in Android: Ti.Android.currentActivity.getString(Ti.Android.R.string.ok); - If the file `platform/android/res/drawable/icon.png` exists in the project, it can be accessed - using its integer id, as follows: + If the file `platform/android/res/drawable/icon.png` exists in the + project, it can be accessed using its resource name, as follows: var resid = Titanium.App.Android.R.drawable.icon; - See also: [android.R](https://developer.android.com/reference/android/R.html) in the + See also: + [android.R](https://developer.android.com/reference/android/R.html) in the Android Developer Reference. - For more information, refer to the official documentation on the Android Developer website about + For more information, refer to the official documentation on the Android + Developer website about [accessing application resources](https://developer.android.com/guide/topics/resources/accessing-resources.html). Starting in Titanium SDK 7.3.0, this API exposes all Android related R classes From 0736cb2f25436b54b82e0874e03940d62b2338af Mon Sep 17 00:00:00 2001 From: Sergey Volkov Date: Wed, 4 Mar 2020 14:46:01 +0300 Subject: [PATCH 3/3] docs: update Ti.Android.R and Ti.App.Android.R docs --- apidoc/Titanium/Android/Android.yml | 2 +- apidoc/{common => Titanium/Android}/R.yml | 2 +- apidoc/Titanium/App/Android/Android.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename apidoc/{common => Titanium/Android}/R.yml (99%) diff --git a/apidoc/Titanium/Android/Android.yml b/apidoc/Titanium/Android/Android.yml index 7e374f3dd37..098371c846f 100644 --- a/apidoc/Titanium/Android/Android.yml +++ b/apidoc/Titanium/Android/Android.yml @@ -2150,7 +2150,7 @@ properties: summary: Accessor for Android system resources. description: | To access your application's resources, use . - type: R + type: Titanium.Android.R permission: read-only accessors: false diff --git a/apidoc/common/R.yml b/apidoc/Titanium/Android/R.yml similarity index 99% rename from apidoc/common/R.yml rename to apidoc/Titanium/Android/R.yml index c377b618725..4d204dc34e1 100644 --- a/apidoc/common/R.yml +++ b/apidoc/Titanium/Android/R.yml @@ -1,5 +1,5 @@ --- -name: R +name: Titanium.Android.R summary: | The Titanium binding of the native Android `R` class, giving access to Android system-wide resources or application resources. diff --git a/apidoc/Titanium/App/Android/Android.yml b/apidoc/Titanium/App/Android/Android.yml index b5ac28fa39b..9086ce54484 100644 --- a/apidoc/Titanium/App/Android/Android.yml +++ b/apidoc/Titanium/App/Android/Android.yml @@ -26,7 +26,7 @@ properties: To access system-wide resources, rather than application resources, use instead. - type: R + type: Titanium.Android.R permission: read-only - name: appVersionCode