diff --git a/apidoc/Titanium/Android/Android.yml b/apidoc/Titanium/Android/Android.yml index 1898a8d159d..098371c846f 100644 --- a/apidoc/Titanium/Android/Android.yml +++ b/apidoc/Titanium/Android/Android.yml @@ -2148,6 +2148,8 @@ properties: - name: R summary: Accessor for Android system resources. + description: | + To access your application's resources, use . type: Titanium.Android.R permission: read-only accessors: false diff --git a/apidoc/Titanium/Android/R.yml b/apidoc/Titanium/Android/R.yml index 63c26223c86..4d204dc34e1 100644 --- a/apidoc/Titanium/Android/R.yml +++ b/apidoc/Titanium/Android/R.yml @@ -1,16 +1,30 @@ --- name: Titanium.Android.R -summary: The Titanium binding of the Android system-wide resources class. +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); - See also: [android.R](https://developer.android.com/reference/android/R.html) in the + 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 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 diff --git a/apidoc/Titanium/App/Android/Android.yml b/apidoc/Titanium/App/Android/Android.yml index 985d996db71..9086ce54484 100644 --- a/apidoc/Titanium/App/Android/Android.yml +++ b/apidoc/Titanium/App/Android/Android.yml @@ -11,7 +11,22 @@ 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 resource name, + as follows. + + var resid = Titanium.App.Android.R.drawable.icon; + + To access system-wide resources, rather than application resources, use + instead. + type: Titanium.Android.R 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