Skip to content

Commit 72c275c

Browse files
authored
chore(docs): plugins styling notes (#183)
1 parent 7d960a9 commit 72c275c

File tree

10 files changed

+27
-34
lines changed

10 files changed

+27
-34
lines changed

packages/animated-circle/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,4 @@ imports: [NativeScriptAnimatedCircleModule];
6161

6262
## License
6363

64-
Apache License Version 2.0
65-
66-
```
67-
68-
```
64+
Apache License Version 2.0

packages/appavailability/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ns plugin add @nativescript/appavailability
88

99
## Usage
1010

11-
> Note that version 1.3.0 added a synchronous version of this method that doesn't return a Promise. Need that? Use `availableSync` instead of `available`.
11+
> **Note:** Version 1.3.0 added a synchronous version of this method that doesn't return a Promise. Need that? Use `availableSync` instead of `available`.
1212
1313
### TypeScript
1414

packages/background-http/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ node server 8080
151151

152152
The above commands will start a server listening on port 8080. Remember to update the URL in your app to match the address/port where the server is running.
153153

154-
> Note: If you are using the iOS simulator then `http://localhost:8080` should be used to upload to the demo server. If you are using an Android emulator, `http://10.0.2.2:8080` should be used instead.
154+
> **Note**: If you are using the iOS simulator then `http://localhost:8080` should be used to upload to the demo server. If you are using an Android emulator, `http://10.0.2.2:8080` should be used instead.
155155
156156
## License
157157

packages/brightness/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ns plugin add @nativescript/brightness
66

77
This command automatically installs the necessary files, as well as stores @nativescript/brightness as a dependency in your project's `package.json` file.
88

9-
This plugin requires `<uses-permission android:name="android.permission.WRITE_SETTINGS"/>` to be added in the android manifest.
9+
> **Note:** This plugin requires `<uses-permission android:name="android.permission.WRITE_SETTINGS"/>` to be added in the android manifest.
1010
1111
## Usage
1212

packages/camera/README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ npm install @nativescript/camera --save
3737
| cameraFacing | rear | Both | The initial camera facing. Use `'front'` for selfies. |
3838
| modalPresentationStyle | 0 | iOS | Set a custom UIModalPresentationStyle (Defaults to UIModalPresentationStyle.FullScreen) |
3939

40-
> Note: The `saveToGallery` option might have unexpected behavior on Android! Some vendor camera apps (e.g. LG) will save all captured images to the gallery regardless of what the value of `saveToGallery` is. This behavior cannot be controlled by the camera plugin and if you must exclude the captured image from the photo gallery, you will need to get a local storage read/write permission and write custom code to find the gallery location and delete the new image from there.
40+
> **Note**: The `saveToGallery` option might have unexpected behavior on Android! Some vendor camera apps (e.g. LG) will save all captured images to the gallery regardless of what the value of `saveToGallery` is. This behavior cannot be controlled by the camera plugin and if you must exclude the captured image from the photo gallery, you will need to get a local storage read/write permission and write custom code to find the gallery location and delete the new image from there.
4141
4242
## Usage
4343

@@ -59,10 +59,9 @@ requestPermissions().then(
5959
}
6060
);
6161
```
62+
> **Note:** (**for Android**) Older versions of Android that don't use a request permissions popup won't be affected by the usage of the requestPermissions method.
6263
63-
> **Note for Android:** Older versions of Android that don't use a request permissions popup won't be affected by the usage of the requestPermissions method.
64-
65-
> **Note for iOS:** If the user rejects permissions from the iOS popup, the app is not allowed to ask again. You can instruct the user to go to app settings and enable the camera permission manually from there. Additionally, [App Store Guideline 5.1.1](https://developer.apple.com/app-store/review/guidelines/#data-collection-and-storage) requires apps to clarify the usage of the camera and photo library. To do so, edit your `app/App_Resources/iOS/Info.plist` and add the following clarifications:
64+
> **Note**: (**for iOS**) If the user rejects permissions from the iOS popup, the app is not allowed to ask again. You can instruct the user to go to app settings and enable the camera permission manually from there. Additionally, [App Store Guideline 5.1.1](https://developer.apple.com/app-store/review/guidelines/#data-collection-and-storage) requires apps to clarify the usage of the camera and photo library. To do so, edit your `app/App_Resources/iOS/Info.plist` and add the following clarifications:
6665
6766
```
6867
<key>NSCameraUsageDescription</key>
@@ -78,7 +77,7 @@ However, there are some points that need a little bit more explanation.
7877

7978
In order to use the camera module, just require it, as shown in Example 1:
8079

81-
> Example 1: Require camera module in the application
80+
#### Example 1: Require camera module in the application
8281

8382
```JavaScript
8483
// JavaScript
@@ -92,7 +91,7 @@ import * as camera from "@nativescript/camera";
9291

9392
Then you are ready to use it:
9493

95-
> Example 2: How to take a picture and to receive image asset
94+
#### Example 2: How to take a picture and to receive image asset
9695

9796
```JavaScript
9897
// JavaScript
@@ -140,7 +139,7 @@ Setting the `keepAspectRatio` property could result in a different than requeste
140139

141140
**Example 3** shows how to use the options parameter:
142141

143-
> Example 3: How to setup `width`, `height`, `keepAspectRatio` and `saveToGallery` properties for the camera module
142+
#### Example 3: How to setup `width`, `height`, `keepAspectRatio` and `saveToGallery` properties for the camera module
144143

145144
```JavaScript
146145
// JavaScript
@@ -218,4 +217,4 @@ The method isAvaiable will return true if the camera hardware is ready to use or
218217
const isAvailable = camera.isAvailable();
219218
```
220219

221-
> Note: This method will return false when used in iOS simulator (as the simulator does not have camera hardware)
220+
> **Note**: This method will return false when used in iOS simulator (as the simulator does not have camera hardware)

packages/detox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Here is a full example of a Detox configuration:
116116
}
117117
```
118118

119-
**NOTE:** A default NativeScript Android project uses 17 as the minimum SDK, but Detox requires >=18. Remove or modify the `minSdkVersion` in your `App_Resources/Android/app.gradle`.
119+
> **Note:** A default NativeScript Android project uses 17 as the minimum SDK, but Detox requires >=18. Remove or modify the `minSdkVersion` in your `App_Resources/Android/app.gradle`.
120120
121121
## Usage
122122

packages/email/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
You can use this plugin to compose an e-mail, have the user edit the draft manually, and send it.
1515

16-
> Note that this plugin depends on the default mail app. If you want a fallback to a third party client app like Gmail or Outlook, then check for availability, and if not available use a solution like [the Social Share plugin](https://github.com/tjvantoll/nativescript-social-share).
16+
> **Note:** This plugin depends on the default mail app. If you want a fallback to a third party client app like Gmail or Outlook, then check for availability, and if not available use a solution like [the Social Share plugin](https://github.com/tjvantoll/nativescript-social-share).
1717
1818
```cli
1919
ns plugin add @nativescript/email

packages/fingerprint-auth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ If you want to override the default texts of this popover screen, then drop a fi
9191

9292
**Use plugin version < 7.0.0 to be able to use this feature with NativeScript < 5.4.0**
9393

94-
> Skip this section if you're on NativeScript 5.4.0 or newer because it's all handled automatically!
94+
> **Note**: Skip this section if you're on NativeScript 5.4.0 or newer because it's all handled automatically!
9595
9696
To be able to use this screen, a change to `App_Resources/Android/AndroidManifest.xml` is required as our NativeScript activity needs to extend AppCompatActivity (note that in the future this may become the default for NativeScript apps).
9797

packages/geolocation/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ geolocation.getCurrentLocation({ desiredAccuracy: Accuracy.high, maximumAge: 500
7171
| iosAllowsBackgroundLocationUpdates | false | If enabled, UIBackgroundModes key in info.plist is required (check the hint below). Allow the application to receive location updates in background (ignored on Android). Read more in [Apple document](https://developer.apple.com/documentation/corelocation/cllocationmanager/1620568-allowsbackgroundlocationupdates?language=objc) |
7272
| iosPausesLocationUpdatesAutomatically | true | Allow deactivation of the automatic pause of location updates (ignored on Android). Read more in [Apple document](https://developer.apple.com/documentation/corelocation/cllocationmanager/1620553-pauseslocationupdatesautomatical?language=objc) |
7373

74-
> If iosAllowsBackgroundLocationUpdates is set to true, the following code is required in the info.plist file:
75-
>
76-
> ```
77-
> <key>UIBackgroundModes</key>
78-
> <array>
79-
> <string>location</string>
80-
> </array>
81-
> ```
74+
> **Note**: If `iosAllowsBackgroundLocationUpdates` is set to true, the following code is required in the `info.plist` file:
75+
76+
```
77+
<key>UIBackgroundModes</key>
78+
<array>
79+
<string>location</string>
80+
</array>
81+
```
8282

8383
### Methods
8484

packages/localize/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,16 @@ Keys starting with `ios.info.plist.` are used to localize iOS properties:
193193

194194
This plugin uses the native capabilities of each platform, language selection is therefore made by the OS.
195195

196-
## On iOS you can programmatically override this language since plugin version 4.2.0 by doing this:
196+
#### On iOS you can programmatically override this language since plugin version 4.2.0 by doing this:
197197

198198
```typescript
199199
import { overrideLocale } from '@nativescript/localize';
200200
const localeOverriddenSuccessfully = overrideLocale('en-GB'); // or "nl-NL", etc (or even just the part before the hyphen)
201201
```
202202

203-
## On Android you can programatically override this language since plugin version 4.2.1 by doing this:
203+
#### On Android you can programatically override this language since plugin version 4.2.1 by doing this:
204204

205-
In your app.ts / main.ts / app.js
205+
In your `app.ts` / `main.ts` / `app.js`
206206

207207
```ts
208208
import { Application } from '@nativescript/core';
@@ -244,8 +244,7 @@ alert({
244244
});
245245
```
246246

247-
> **Important:** In case you are using [Android app bundle](https://docs.nativescript.org/tooling/publishing/android-app-bundle) to release your android app, add this to
248-
> App_Resources/Android/app.gradle to make sure all lanugages are bundled in the split apks
247+
> **Important:** In case you are using [Android app bundle](https://docs.nativescript.org/tooling/publishing/android-app-bundle) to release your android app, add this to `App_Resources/Android/app.gradle` to make sure all lanugages are bundled in the split apks
249248
250249
```groovy
251250
android {
@@ -268,8 +267,7 @@ import { Device } from '@nativescript/core';
268267
console.log("user's language is", Device.language.split('-')[0]);
269268
```
270269

271-
> **Tip:** overrideLocale method stores the language in a special key in app-settings,
272-
> you can access it like this,
270+
> **Tip:** overrideLocale method stores the language in a special key in app-settings, you can access it like this
273271
274272
```ts
275273
import { ApplicationSettings } from '@nativescript/core';

0 commit comments

Comments
 (0)