Skip to content

Commit

Permalink
Merge pull request NativeScript#165 from NativeScript/tsonevn_revamp
Browse files Browse the repository at this point in the history
feat: update application-settings/color examples
  • Loading branch information
tsonevn authored Oct 15, 2019
2 parents 66e950d + 1e9a3bf commit d5686ec
Show file tree
Hide file tree
Showing 36 changed files with 198 additions and 557 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const ListViewLinksModel = require("../../links-view-model");
const link = require("../../link");
const navigationLinks = [
new link("Basics", "ns-framework-modules-category/application-settings/basics/basics-page"),
new link("Native Access", "ns-framework-modules-category/application-settings/native-access/native-access-page")
new link("Usage", "ns-framework-modules-category/application-settings/usage/usage-page")
];
const navigationLinksTsc = [
new link("Basics", "ns-framework-modules-category/application-settings/basics/basics-ts-page"),
new link("Native Access", "ns-framework-modules-category/application-settings/native-access/native-access-ts-page")
new link("Usage", "ns-framework-modules-category/application-settings/usage/usage-ts-page")
];
function onNavigatingTo(args) {
const page = args.object;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

27 changes: 25 additions & 2 deletions app/ns-framework-modules-category/application-settings/end.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
**Native Component**
## Methods

| Name | Type | Description |
|----------|---------|----------------|
| `clear` | `void` | Removes all stored values. |
| `flush` | `boolean` | Flush all changes to disk synchronously. The return flag indicates if changes were saved successfully to disk. |
| `getAllKeys` | `Array<string>` | Array containing all stored keys |
| `getBoolean(key: string, deafaultValue?: boolean)` | `boolean` | Gets a value (if existing) for a key as a Boolean Object. A default value can be provided in case there is no existing value. |
| `getNumber(key: string, deafaultValue?: number)` | `number` | Gets a value (if existing) for a key as a Number Object. A default value can be provided in case there is no existing value |
| `getString(key: string, deafaultValue?: string)` | `string` | Gets a value (if existing) for a key as a String Object. A default value can be provided in case there is no existing value. |
| `hasKey(key: string)` | `boolean` | Checks whether such a key exists. |
| `remove` | `void` | Removes an entry by its key name. |
| `setBoolean(key: string, value: boolean)` | `void` | Sets a Boolean Object for a key. |
| `setNumber(key: string, value: number)` | `void` | Sets a Number Object for a key. |
| `setString(key: string, value: string)` | `void` | Sets a String Object for a key. |


## API References

| Name | Type |
|----------|---------|
| [tns-core-modules/application-settings](https://docs.nativescript.org/api-reference/modules/_application_settings_.html) | `Module` |

## Native Component

| Android | iOS |
|:----------------------|:---------|
| [android.content.SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences.html) | [NSUserDefaults](https://developer.apple.com/documentation/foundation/userdefaults) |
| [android.content.SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences.html) | [NSUserDefaults](https://developer.apple.com/documentation/foundation/nsuserdefaults) |

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d5686ec

Please sign in to comment.