diff --git a/en/application-dev/device/sensor-overview.md b/en/application-dev/device/sensor-overview.md index c45dd69eea4372c41a1d5f1dbf93de14e4b40ea5..a360fac2f6f95b3b36046b33b5f0da9d24d83bd9 100644 --- a/en/application-dev/device/sensor-overview.md +++ b/en/application-dev/device/sensor-overview.md @@ -6,29 +6,29 @@ Sensors in OpenHarmony are an abstraction of underlying hardware-based sensors. A sensor is a device to detect events or changes in an environment and send messages about the events or changes to another device (for example, a CPU). Generally, a sensor is composed of sensitive components and conversion components. Sensors are the cornerstone of the IoT. A unified sensor management framework is required to achieve data sensing at a low latency and low power consumption, thereby keeping up with requirements of "1+8+N" products or business in the Seamless AI Life Strategy. The sensor list is as follows: -| Sensor Type | Sensor Name | Description | Usage | -| --------------------------------------- | ------------------ | ------------------------------------------------------------ | ---------------------------------------- | -| SENSOR_TYPE_ACCELEROMETER | Acceleration sensor | Measures the acceleration (including the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s2.| Detecting the motion status | -| SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED | Uncalibrated acceleration sensor| Measures the uncalibrated acceleration (including the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s2.| Measuring the acceleration bias estimation | -| SENSOR_TYPE_LINEAR_ACCELERATION | Linear acceleration sensor | Measures the linear acceleration (excluding the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s2.| Detecting the linear acceleration in each axis | -| SENSOR_TYPE_GRAVITY | Gravity sensor | Measures the gravity acceleration applied to a device on three physical axes (X, Y, and Z), in the unit of m/s2.| Measuring the gravity | -| SENSOR_TYPE_GYROSCOPE | Gyroscope sensor | Measures the rotation angular velocity of a device on three physical axes (X, Y, and Z), in the unit of rad/s.| Measuring the rotation angular velocity | -| SENSOR_TYPE_GYROSCOPE_UNCALIBRATED | Uncalibrated gyroscope sensor| Measures the uncalibrated rotation angular velocity of a device on three physical axes (X, Y, and Z), in the unit of rad/s.| Measuring the bias estimation of the rotation angular velocity | -| SENSOR_TYPE_SIGNIFICANT_MOTION | Significant motion sensor | Checks whether a device has a significant motion on three physical axes (X, Y, and Z). The value **0** means that the device does not have a significant motion, and **1** means the opposite.| Detecting significant motions of a device | -| SENSOR_TYPE_PEDOMETER_DETECTION | Pedometer detection sensor | Detects whether a user takes a step. The value can be **0** (the user does not take a step) or **1** (the user takes a step).| Detecting whether a user takes a step | -| SENSOR_TYPE_PEDOMETER | Pedometer sensor | Records the number of steps a user has walked. | Providing the number of steps a user has walked | -| SENSOR_TYPE_AMBIENT_TEMPERATURE | Ambient temperature sensor | Measures the ambient temperature, in the unit of degree Celsius (°C). | Measuring the ambient temperature | -| SENSOR_TYPE_MAGNETIC_FIELD | Magnetic field sensor | Measures the magnetic field on three physical axes (X, Y, and Z), in the unit of μT.| Creating a compass | -| SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED | Uncalibrated magnetic field sensor | Measures the uncalibrated magnetic field on three physical axes (X, Y, and Z), in the unit of μT.| Measuring the magnetic field bias estimation | -| SENSOR_TYPE_HUMIDITY | Humidity sensor | Measures the ambient relative humidity, in a percentage (%). | Monitoring the dew point, absolute humidity, and relative humidity | -| SENSOR_TYPE_BAROMETER | Barometer sensor | Measures the barometric pressure, in the unit of hPa or mbar. | Measuring the barometric pressure | -| SENSOR_TYPE_ORIENTATION | Orientation sensor | Measures the rotation angles of a device on three physical axes (X, Y, and Z), in the unit of rad.| Providing the three orientation angles of the screen | -| SENSOR_TYPE_ROTATION_VECTOR | Rotation vector sensor | Measures the rotation vector of a device. It is a composite sensor that generates data from the acceleration sensor, magnetic field sensor, and gyroscope sensor.| Detecting the orientation of a device in the East, North, Up (ENU) Cartesian coordinate system | -| SENSOR_TYPE_PROXIMITY | Proximity sensor | Measures the distance between a visible object and the device screen. | Measuring the distance between a person and the device during a call | -| SENSOR_TYPE_AMBIENT_LIGHT | Ambient light sensor | Measures the ambient light intensity of a device, in the unit of lux. | Automatically adjusting the screen brightness and checking whether the screen is covered on the top| -| SENSOR_TYPE_HEART_RATE | Heart rate sensor | Measures the heart rate of a user. | Providing users' heart rate data | -| SENSOR_TYPE_WEAR_DETECTION | Wear detection sensor | Checks whether a user is wearing a wearable device. | Detecting wearables | -| SENSOR_TYPE_HALL | Hall effect sensor | Detects a magnetic field around a device. | Smart cover mode of the device | +| Sensor Type | Sensor Name | Description | Usage | +| --------------------------------------- | ---------------------------------- | ---------------------------------------- | ---------------------------------------- | +| SENSOR_TYPE_ACCELEROMETER | Acceleration sensor | Measures the acceleration (including the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s2. | Detecting the motion status | +| SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED | Uncalibrated acceleration sensor | Measures the uncalibrated acceleration (including the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s2. | Measuring the acceleration bias estimation | +| SENSOR_TYPE_LINEAR_ACCELERATION | Linear acceleration sensor | Measures the linear acceleration (excluding the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s2. | Detecting the linear acceleration in each axis | +| SENSOR_TYPE_GRAVITY | Gravity sensor | Measures the gravity acceleration applied to a device on three physical axes (X, Y, and Z), in the unit of m/s2. | Measuring the gravity | +| SENSOR_TYPE_GYROSCOPE | Gyroscope sensor | Measures the rotation angular velocity of a device on three physical axes (X, Y, and Z), in the unit of rad/s. | Measuring the rotation angular velocity | +| SENSOR_TYPE_GYROSCOPE_UNCALIBRATED | Uncalibrated gyroscope sensor | Measures the uncalibrated rotation angular velocity of a device on three physical axes (X, Y, and Z), in the unit of rad/s. | Measuring the bias estimation of the rotation angular velocity | +| SENSOR_TYPE_SIGNIFICANT_MOTION | Significant motion sensor | Checks whether a device has a significant motion on three physical axes (X, Y, and Z). The value **0** means that the device does not have a significant motion, and **1** means the opposite. | Detecting significant motions of a device | +| SENSOR_TYPE_PEDOMETER_DETECTION | Pedometer detection sensor | Detects whether a user takes a step. The value can be **0** (the user does not take a step) or **1** (the user takes a step). | Detecting whether a user takes a step | +| SENSOR_TYPE_PEDOMETER | Pedometer sensor | Records the number of steps a user has walked. | Providing the number of steps a user has walked | +| SENSOR_TYPE_AMBIENT_TEMPERATURE | Ambient temperature sensor | Measures the ambient temperature, in the unit of degree Celsius (°C). | Measuring the ambient temperature | +| SENSOR_TYPE_MAGNETIC_FIELD | Magnetic field sensor | Measures the magnetic field on three physical axes (X, Y, and Z), in the unit of μT. | Creating a compass | +| SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED | Uncalibrated magnetic field sensor | Measures the uncalibrated magnetic field on three physical axes (X, Y, and Z), in the unit of μT. | Measuring the magnetic field bias estimation | +| SENSOR_TYPE_HUMIDITY | Humidity sensor | Measures the ambient relative humidity, in a percentage (%). | Monitoring the dew point, absolute humidity, and relative humidity | +| SENSOR_TYPE_BAROMETER | Barometer sensor | Measures the barometric pressure, in the unit of hPa or mbar. | Measuring the barometric pressure | +| SENSOR_TYPE_ORIENTATION | Orientation sensor | Measures the rotation angles of a device on three physical axes (X, Y, and Z), in the unit of rad. | Providing the three orientation angles of the screen | +| SENSOR_TYPE_ROTATION_VECTOR | Rotation vector sensor | Measures the rotation vector of a device. It is a composite sensor that generates data from the acceleration sensor, magnetic field sensor, and gyroscope sensor. | Detecting the orientation of a device in the East, North, Up (ENU) Cartesian coordinate system | +| SENSOR_TYPE_PROXIMITY | Proximity sensor | Measures the distance between a visible object and the device screen. | Measuring the distance between a person and the device during a call | +| SENSOR_TYPE_AMBIENT_LIGHT | Ambient light sensor | Measures the ambient light intensity of a device, in the unit of lux. | Automatically adjusting the screen brightness and checking whether the screen is covered on the top | +| SENSOR_TYPE_HEART_RATE | Heart rate sensor | Measures the heart rate of a user. | Providing users' heart rate data | +| SENSOR_TYPE_WEAR_DETECTION | Wear detection sensor | Checks whether a user is wearing a wearable device. | Detecting wearables | +| SENSOR_TYPE_HALL | Hall effect sensor | Detects a magnetic field around a device. | Smart cover mode of the device | ## Working Principles @@ -37,7 +37,7 @@ The following modules work cooperatively to implement OpenHarmony sensors: Senso **Figure 1** How the sensor works -![fad1a124-a90e-460f-84fc-e87d6caebb21](figures/fad1a124-a90e-460f-84fc-e87d6caebb21.png) +![en-us_image_0000001226521897.png](figures/en-us_image_0000001226521897.png) - Sensor API: provides APIs for performing basic operations on sensors, including querying the sensor list, subscribing to or unsubscribing from sensor data, and executing control commands. This module makes application development simpler. @@ -54,12 +54,12 @@ The following modules work cooperatively to implement OpenHarmony sensors: Senso Table 7 Sensor data permissions - | Sensor | Permission | Sensitivity | Permission Description | - | ------------------------- | -------------------------------- | ------------ | ----------------------- | - | Acceleration sensor, uncalibrated acceleration sensor, and linear acceleration sensor| ohos.permission.ACCELEROMETER | system_grant | Allows your application to subscribe to data of these acceleration-related sensors in the motion category.| - | Gyroscope sensor and uncalibrated gyroscope sensor | ohos.permission.GYROSCOPE | system_grant | Allows an application to subscribe to data of the gyroscope-related sensors in the motion category.| - | Pedometer sensor | ohos.permission.ACTIVITY_MOTION | user_grant | Allows an application to subscribe to the motion status. | - | Heart rate sensor | ohos.permission.READ_HEALTH_DATA | user_grant | Allows an application to read health data. | +| Sensor | Permission | Sensitivity | Permission Description | +| ---------------------------------------- | -------------------------------- | ------------ | ---------------------------------------- | +| Acceleration sensor, uncalibrated acceleration sensor, and linear acceleration sensor | ohos.permission.ACCELEROMETER | system_grant | Allows your application to subscribe to data of these acceleration-related sensors in the motion category. | +| Gyroscope sensor and uncalibrated gyroscope sensor | ohos.permission.GYROSCOPE | system_grant | Allows an application to subscribe to data of the gyroscope-related sensors in the motion category. | +| Pedometer sensor | ohos.permission.ACTIVITY_MOTION | user_grant | Allows an application to subscribe to the motion status. | +| Heart rate sensor | ohos.permission.READ_HEALTH_DATA | user_grant | Allows an application to read health data. | diff --git a/en/application-dev/device/vibrator-overview.md b/en/application-dev/device/vibrator-overview.md index 88460b4fe415d836a687363c10ceda68c1e98390..40bcea0c77b14609d39a433c7b8389e017036c3b 100644 --- a/en/application-dev/device/vibrator-overview.md +++ b/en/application-dev/device/vibrator-overview.md @@ -10,7 +10,7 @@ The vibrator is a Misc device that consists of four modules: Vibrator API, Vibra **Figure 1** Vibrator in Misc devices -![0752d302-aeb9-481a-bb8f-e5524eb61eeb](figures/0752d302-aeb9-481a-bb8f-e5524eb61eeb.png) +![en-us_image_0000001180249428.png](figures/en-us_image_0000001180249428.png) - Vibrator API: provides basic vibrator APIs, including the APIs for querying the vibrator list, querying the vibrator by effect, and triggering and stopping vibration. diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001251292933.gif b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001251292933.gif new file mode 100644 index 0000000000000000000000000000000000000000..587325d41b6320ff8e25afd9d2b19e3d1b5a11d5 Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001251292933.gif differ diff --git a/en/application-dev/reference/arkui-ts/figures/en_image_0000001174582862.gif b/en/application-dev/reference/arkui-ts/figures/en_image_0000001174582862.gif new file mode 100644 index 0000000000000000000000000000000000000000..f30a8d85e898213691abd5369c9c1008d399274b Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/en_image_0000001174582862.gif differ diff --git a/en/application-dev/reference/arkui-ts/figures/en_image_0000001186807708.gif b/en/application-dev/reference/arkui-ts/figures/en_image_0000001186807708.gif new file mode 100644 index 0000000000000000000000000000000000000000..8eceb3bf5313485a1fedda5768e70cdb5febc464 Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/en_image_0000001186807708.gif differ diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md b/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md index 88927b3b6cbca8ebbb8eb13bc86c38d0380499b1..8716d4769e9c42dcc04bf777569fcc74c135b401 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md @@ -23,50 +23,50 @@ None Slider(value:{value?: number, min?: number, max?: number, step?: number, style?: SliderStyle, direction?: Axis}) - Parameters - | Name | Type | Mandatory | Default Value | Description | - | -------- | -------- | -------- | -------- | -------- | - | value | number | No | 0 | Current progress. | - | min | number | No | 0 | Minimum value. | - | max | number | No | 100 | Maximum value. | - | step | number | No | 1 | Step of the slider. When the corresponding step is set, the slider slides intermittently. | - | style | SliderStyle | No | SliderStyle.OutSet | Style of the slider. | - | direction8+ | [Axis](../reference/arkui-ts/ts-appendix-enums.md#axis-enums) | No | Axis.Horizontal | Whether the slider moves horizontally or vertically. | - | reverse8+ | boolean | No | false | Whether the slider values are reversed. | + | Name | Type | Mandatory | Default Value | Description | + | ---------------------- | --------------------------------------- | --------- | ------------------ | ---------------------------------------- | + | value | number | No | 0 | Current progress. | + | min | number | No | 0 | Minimum value. | + | max | number | No | 100 | Maximum value. | + | step | number | No | 1 | Step of the slider. When the corresponding step is set, the slider slides intermittently. | + | style | SliderStyle | No | SliderStyle.OutSet | Style of the slider. | + | direction8+ | [Axis](ts-appendix-enums.md#axis-enums) | No | Axis.Horizontal | Whether the slider moves horizontally or vertically. | + | reverse8+ | boolean | No | false | Whether the slider values are reversed. | - SliderStyle enums - | Name | Description | - | -------- | -------- | - | OutSet | The slider is on the slider rail. | - | InSet | The slider is in the slider rail. | + | Name | Description | + | ------ | --------------------------------- | + | OutSet | The slider is on the slider rail. | + | InSet | The slider is in the slider rail. | ## Attributes Touch target configuration is not supported. - | Name | Type | Default Value | Description | -| -------- | -------- | -------- | -------- | -| blockColor | Color | - | Color of the slider. | -| trackColor | Color | - | Background color of the slider. | -| selectedColor | Color | - | Color of the slider rail that has been slid. | -| showSteps | boolean | false | Whether to display the current step. | -| showTips | boolean | false | Whether to display a bubble to indicate the percentage when sliding. | +| Name | Type | Default Value | Description | +| ------------- | ------- | ------------- | ---------------------------------------- | +| blockColor | Color | - | Color of the slider. | +| trackColor | Color | - | Background color of the slider. | +| selectedColor | Color | - | Color of the slider rail that has been slid. | +| showSteps | boolean | false | Whether to display the current step. | +| showTips | boolean | false | Whether to display a bubble to indicate the percentage when sliding. | ## Events Among all the universal events, only **OnAppear** and **OnDisAppear** are supported. -| Name | Description | -| -------- | -------- | +| Name | Description | +| ---------------------------------------- | ---------------------------------------- | | onChange(callback: (value: number, mode: SliderChangeMode) => void) | Callback invoked when the slider slides.
**value**: current progress.
**mode**: dragging state. | - SliderChangeMode enums - | Name | Description | - | -------- | -------- | - | Begin | The user starts to drag the slider. | - | Moving | The user is dragging the slider. | - | End | The user stops dragging the slider. | + | Name | Description | + | ------ | ----------------------------------- | + | Begin | The user starts to drag the slider. | + | Moving | The user is dragging the slider. | + | End | The user stops dragging the slider. | ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-textarea.md b/en/application-dev/reference/arkui-ts/ts-basic-components-textarea.md index 9acf78b9759c113a654d03940f299b5df1adc290..f686f9a01011f7afb704d3f10d5fadc7bd521ee3 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-textarea.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-textarea.md @@ -23,37 +23,37 @@ None TextArea(value?:{placeholder?: string controller?: TextAreaController}) - Parameters - | Name | Type | Mandatory | Default Value | Description | - | -------- | -------- | -------- | -------- | -------- | - | placeholder | string | No | - | Text displayed when there is no input. | - | controller8+ | [TextAreaController](#textareacontroller8) | No | - | Text area controller. | + | Name | Type | Mandatory | Default Value | Description | + | ----------------------- | ---------------------------------------- | --------- | ------------- | -------------------------------------- | + | placeholder | string | No | - | Text displayed when there is no input. | + | controller8+ | [TextAreaController](#textareacontroller8) | No | - | Text area controller. | ## Attributes -In addition to [universal attributes](ts-universal-attributes-index.md), the following attributes are supported. +In addition to universal attributes, the following attributes are supported. -| Name | Type | Default Value | Description | -| -------- | -------- | -------- | -------- | -| placeholderColor | Color | - | Placeholder text color. | -| placeholderFont | {
size?: number,
weight?:number \| [FontWeight](ts-universal-attributes-text-style.md),
family?: string,
style?: [FontStyle](ts-universal-attributes-text-style.md)
} | - | Placeholder text style.
- **size**: font size. If the value is of the number type, the unit fp is used.
- **weight**: font weight. For the number type, the value ranges from 100 to 900, at an interval of 100. The default value is **400**. A larger value indicates a larger font weight.
- **family**: font family. Use commas (,) to separate multiple fonts, for example, **'Arial, sans-serif'**. The priority of the fonts is the sequence in which they are placed.
- **style**: font style. | -| textAlign | TextAlign | Start | Sets the text horizontal alignment mode. | -| caretColor | Color | - | Sets the color of the cursor in the text box. | -| inputFilter8+ | {
value: [ResourceStr](../../ui/ts-types.md),
error?: (value: string)
} | - | Regular expression for input filtering. Only inputs that comply with the regular expression can be displayed. Other inputs are ignored. The specified regular expression can match single characters, but not strings. Example: ^(? =.\*\d)(? =.\*[a-z])(? =.\*[A-Z]).{8,10}$. Strong passwords containing 8 to 10 characters cannot be filtered.
- **value**: indicates the regular expression to set.
- **error**: returns the ignored content when regular expression matching fails. | +| Name | Type | Default Value | Description | +| ------------------------ | ---------------------------------------- | ------------- | ---------------------------------------- | +| placeholderColor | Color | - | Placeholder text color. | +| placeholderFont | {
size?: number,
weight?:number \| [FontWeight](ts-universal-attributes-text-style.md),
family?: string,
style?: [FontStyle](ts-universal-attributes-text-style.md)
} | - | Placeholder text style.
- **size**: font size. If the value is of the number type, the unit fp is used.
- **weight**: font weight. For the number type, the value ranges from 100 to 900, at an interval of 100. The default value is **400**. A larger value indicates a larger font weight.
- **family**: font family. Use commas (,) to separate multiple fonts, for example, **'Arial, sans-serif'**. The priority of the fonts is the sequence in which they are placed.
- **style**: font style. | +| textAlign | TextAlign | Start | Sets the text horizontal alignment mode. | +| caretColor | Color | - | Sets the color of the cursor in the text box. | +| inputFilter8+ | {
value: [ResourceStr](../../ui/ts-types.md),
error?: (value: string)
} | - | Regular expression for input filtering. Only inputs that comply with the regular expression can be displayed. Other inputs are ignored. The specified regular expression can match single characters, but not strings. Example: ^(? =.\*\d)(? =.\*[a-z])(? =.\*[A-Z]).{8,10}$. Strong passwords containing 8 to 10 characters cannot be filtered.
- **value**: indicates the regular expression to set.
- **error**: returns the ignored content when regular expression matching fails. | - TextAlign enums - | Name | Description | - | -------- | -------- | - | Start | Aligns the header horizontally. | - | Center | Horizontal center alignment. | - | End | Align the tail horizontally. | + | Name | Description | + | ------ | ------------------------------- | + | Start | Aligns the header horizontally. | + | Center | Horizontal center alignment. | + | End | Align the tail horizontally. | ## Events -| Name | Description | -| -------- | -------- | -| onChange(callback: (value: string) => void) | Triggered when the input changes. | +| Name | Description | +| ---------------------------------------- | ---------------------------------------- | +| onChange(callback: (value: string) => void) | Triggered when the input changes. | | onCopy8+(callback:(value: string) => void) | Triggered when the copy button on the pasteboard, which displays when the text box is long pressed, is clicked.
**value**: text to be copied. | | onCut8+(callback:(value: string) => void) | Triggered when the cut button on the pasteboard, which displays when the text box is long pressed, is clicked.
**value**: text to be cut. | | onPaste8+(callback:(value: string) => void) | Triggered when the paste button on the pasteboard, which displays when the text box is long pressed, is clicked.
**value**: text to be pasted. | @@ -76,9 +76,9 @@ caretPosition(value: number): void Sets the position of the caret. - Parameters - | Name | Type | Mandatory | Default Value | Description | - | ----- | ------ | ---- | ---- | ------------------- | - | value | number | Yes | - | Length from the start of the string to the position where the input cursor is located. | + | Name | Type | Mandatory | Default Value | Description | + | ----- | ------ | --------- | ------------- | ---------------------------------------- | + | value | number | Yes | - | Length from the start of the string to the position where the input cursor is located. | ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md b/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md index b24dec295a1264222075a3c4cc51216bc8373715..f91e78172298ab17e0cb2b4be62304eff49901ff 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md @@ -23,50 +23,50 @@ None TextInput(value?:{placeholder?: string controller?: TextInputController}) - Parameters - | Name | Type | Mandatory | Default Value | Description | - | -------- | -------- | -------- | -------- | -------- | - | placeholder | string | No | - | Text displayed when there is no input. | - | controller8+ | [TextInputController](#textinputcontroller8) | No | - | Text input controller. | + | Name | Type | Mandatory | Default Value | Description | + | ----------------------- | ---------------------------------------- | --------- | ------------- | -------------------------------------- | + | placeholder | string | No | - | Text displayed when there is no input. | + | controller8+ | [TextInputController](#textinputcontroller8) | No | - | Text input controller. | ## Attributes -In addition to [universal attributes](ts-universal-attributes-index.md), the following attributes are supported. +In addition to universal attributes, the following attributes are supported. -| Name | Type | Default Value | Description | -| -------- | -------- | -------- | -------- | -| type | InputType | InputType.Normal | Input box type. | -| placeholderColor | Color | - | Placeholder color. | -| placeholderFont | {
size?: Length,
weight?: number\|[FontWeight](ts-universal-attributes-text-style.md),
family?: string,
style?: [FontStyle](ts-universal-attributes-text-style.md)
} | - | Placeholder text style.
- **size**: font size. If the value is of the number type, the unit fp is used.
- **weight**: font weight. For the number type, the value ranges from 100 to 900, at an interval of 100. The default value is **400**. A larger value indicates a larger font weight.
- **family**: font family. Use commas (,) to separate multiple fonts, for example, **'Arial, sans-serif'**. The priority of the fonts is the sequence in which they are placed.
- **style**: font style. | -| enterKeyType | EnterKeyType | EnterKeyType.Done | How the Enter key is labeled. | -| caretColor | Color | - | Color of the caret (also known as the text insertion cursor). | -| maxLength8+ | number | - | Maximum number of characters in the text input. | -| inputFilter8+ | {
value: [ResourceStr](../../ui/ts-types.md)8+,
error?: (value: string)
} | - | Regular expression for input filtering. Only inputs that comply with the regular expression can be displayed. Other inputs are ignored. The specified regular expression can match single characters, but not strings. Example: ^(? =.\*\d)(? =.\*[a-z])(? =.\*[A-Z]).{8,10}$. Strong passwords containing 8 to 10 characters cannot be filtered.
- **value**: indicates the regular expression to set.
- **error**: returns the ignored content when regular expression matching fails. | +| Name | Type | Default Value | Description | +| ------------------------ | ---------------------------------------- | ----------------- | ---------------------------------------- | +| type | InputType | InputType.Normal | Input box type. | +| placeholderColor | Color | - | Placeholder color. | +| placeholderFont | {
size?: Length,
weight?: number\|[FontWeight](ts-universal-attributes-text-style.md),
family?: string,
style?: [FontStyle](ts-universal-attributes-text-style.md)
} | - | Placeholder text style.
- **size**: font size. If the value is of the number type, the unit fp is used.
- **weight**: font weight. For the number type, the value ranges from 100 to 900, at an interval of 100. The default value is **400**. A larger value indicates a larger font weight.
- **family**: font family. Use commas (,) to separate multiple fonts, for example, **'Arial, sans-serif'**. The priority of the fonts is the sequence in which they are placed.
- **style**: font style. | +| enterKeyType | EnterKeyType | EnterKeyType.Done | How the Enter key is labeled. | +| caretColor | Color | - | Color of the caret (also known as the text insertion cursor). | +| maxLength8+ | number | - | Maximum number of characters in the text input. | +| inputFilter8+ | {
value: [ResourceStr](../../ui/ts-types.md)8+,
error?: (value: string)
} | - | Regular expression for input filtering. Only inputs that comply with the regular expression can be displayed. Other inputs are ignored. The specified regular expression can match single characters, but not strings. Example: ^(? =.\*\d)(? =.\*[a-z])(? =.\*[A-Z]).{8,10}$. Strong passwords containing 8 to 10 characters cannot be filtered.
- **value**: indicates the regular expression to set.
- **error**: returns the ignored content when regular expression matching fails. | - EnterKeyType enums - | Name | Description | - | -------- | -------- | - | EnterKeyType.Go | The Enter key is labeled "Go." | - | EnterKeyType.Search | The Enter key is labeled "Search." | - | EnterKeyType.Send | The Enter key is labeled "Send." | - | EnterKeyType.Next | The Enter key is labeled "Next." | - | EnterKeyType.Done | The Enter key is labeled "Done." | + | Name | Description | + | ------------------- | ---------------------------------- | + | EnterKeyType.Go | The Enter key is labeled "Go." | + | EnterKeyType.Search | The Enter key is labeled "Search." | + | EnterKeyType.Send | The Enter key is labeled "Send." | + | EnterKeyType.Next | The Enter key is labeled "Next." | + | EnterKeyType.Done | The Enter key is labeled "Done." | - InputType enums - | Name | Description | - | -------- | -------- | - | InputType.Normal | Normal input mode. | - | InputType.Password | Password input mode. | - | InputType.Email | Email address input mode. | - | InputType.Number | Digit input mode. | + | Name | Description | + | ------------------ | ------------------------- | + | InputType.Normal | Normal input mode. | + | InputType.Password | Password input mode. | + | InputType.Email | Email address input mode. | + | InputType.Number | Digit input mode. | ### TextInputController8+ Implements the controller of the **<TextInput>** component. -| Name | Description | -| -------- | -------- | +| Name | Description | +| --------------------------------- | ---------------------------------------- | | caretPosition(value: number):void | Position of the input cursor.
**value**: indicates the length from the start of the string to the position where the input cursor is located. | @@ -85,16 +85,16 @@ caretPosition(value: number): void Sets the cursor in a specified position. - Parameters - | Name | Type | Mandatory | Default Value | Description | - | -------- | -------- | -------- | -------- | -------- | - | value | number | Yes | - | Position of the input cursor.
**value**: indicates the length from the start of the string to the position where the input cursor is located. | + | Name | Type | Mandatory | Default Value | Description | + | ----- | ------ | --------- | ------------- | ---------------------------------------- | + | value | number | Yes | - | Position of the input cursor.
**value**: indicates the length from the start of the string to the position where the input cursor is located. | ## Events -| Name | Description | -| -------- | -------- | -| onChange(value: string) => void | Triggered when the input changes. | +| Name | Description | +| ---------------------------------------- | ---------------------------------------- | +| onChange(value: string) => void | Triggered when the input changes. | | onSubmit(callback: (enterKey: EnterKeyType) => void) | Triggered when the Enter key on the physical or soft keyboard is pressed. | | onEditChanged(callback: (isEditing: boolean) => void)(deprecated) | Triggered when the input status changes. | | onEditChange(callback: (isEditing: boolean) => void) 8+ | Triggered when the input status changes. | diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-timepicker.md b/en/application-dev/reference/arkui-ts/ts-basic-components-timepicker.md index 24b1ac6d59eb51962ee98a000ea19fb0b22658c7..43f8b6eeb6ac8a18d219829390627c4fe20e4780 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-timepicker.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-timepicker.md @@ -24,29 +24,29 @@ TimePicker(options?: TimePickerOptions) Creates a time picker whose default time range is from 00:00 to 23:59. - options parameters - | Name| Type| Mandatory| Default Value| Description| - | -------- | -------- | -------- | -------- | -------- | - | selected | Date | No| Current system time| Time of the selected item.| + | Name | Type | Mandatory | Default Value | Description | + | -------- | ---- | --------- | ------------------- | -------------------------- | + | selected | Date | No | Current system time | Time of the selected item. | ## Attributes -| Name| Type| Default Value| Description| -| -------- | -------- | -------- | -------- | -| useMilitaryTime | boolean | false | Whether to display time in 24-hour format. The value cannot be modified dynamically.| +| Name | Type | Default Value | Description | +| --------------- | ------- | ------------- | ---------------------------------------- | +| useMilitaryTime | boolean | false | Whether to display time in 24-hour format. The value cannot be modified dynamically. | ## Events -| Name| Description| -| -------- | -------- | -| onChange(callback: (value: TimePickerResult ) => void) | Triggered when a time is selected.| +| Name | Description | +| ---------------------------------------- | ---------------------------------- | +| onChange(callback: (value: TimePickerResult ) => void) | Triggered when a time is selected. | ### TimePickerResult -| Name| Type| Description| -| -------- | -------- | -------- | -| hour | number | Hour portion of the selected time.| -| minute | number | Minute portion of the selected time.| +| Name | Type | Description | +| ------ | ------ | ------------------------------------ | +| hour | number | Hour portion of the selected time. | +| minute | number | Minute portion of the selected time. | ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md b/en/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md index be29bb3bdb125c821da0748c8163f7a09e2920fa..60e9edaf38398f66715489b6e232058ce679bc76 100644 --- a/en/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md +++ b/en/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md @@ -23,23 +23,23 @@ None Canvas(context: CanvasRenderingContext2D) - Parameters - | Name | Type | Mandatory | Default Value | Description | - | -------- | -------- | -------- | -------- | -------- | - | context | [CanvasRenderingContext2D](ts-canvasrenderingcontext2d.md) | Yes | - | For details, see CanvasRenderingContext2D. | + | Name | Type | Mandatory | Default Value | Description | + | ------- | ---------------------------------------- | --------- | ------------- | ---------------------------------------- | + | context | [CanvasRenderingContext2D](ts-canvasrenderingcontext2d.md) | Yes | - | For details, see CanvasRenderingContext2D. | ## Attributes -[Universal attributes]( ts-universal-attributes-index.md) are supported. +Universal attributes are supported. ## Events -In addition to [universal events](ts-universal-events-index.md), the following events are supported. +In addition to universal events, the following events are supported. -| Name | Parameter | Description | -| -------- | -------- | -------- | -| onReady(callback: () => void) | None | Triggered when . | +| Name | Parameter | Description | +| -------------------------------- | --------- | ---------------- | +| onReady(callback: () => void) | None | Triggered when . | ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md b/en/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md index 6e31d4b8ac3cf4641876baa1797008e3cb6214da..aee479be4f35743e3f13d384f4293140ce08d63f 100644 --- a/en/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md +++ b/en/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md @@ -15,20 +15,20 @@ addColorStop(offset: number, color: string): void Adds a color stop for the **CanvasGradient** object based on the specified offset and gradient color. - Parameters - | Name | Type | Mandatory | Default Value | Description | - | -------- | -------- | -------- | -------- | -------- | - | offset | number | Yes | 0 | Proportion of the distance between the color stop and the start point to the total length. The value ranges from 0 to 1. | - | color | string | Yes | 'ffffff' | Gradient color to set. | + | Name | Type | Mandatory | Default Value | Description | + | ------ | ------ | --------- | ------------- | ---------------------------------------- | + | offset | number | Yes | 0 | Proportion of the distance between the color stop and the start point to the total length. The value ranges from 0 to 1. | + | color | string | Yes | 'ffffff' | Gradient color to set. | - Example - + ``` @Entry @Component struct Page45 { private settings: RenderingContextSettings = new RenderingContextSettings(true) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) - + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Canvas(this.context) diff --git a/en/application-dev/ui/ui-js-animate-dynamic-effects.md b/en/application-dev/ui/ui-js-animate-dynamic-effects.md index bbd5aae520e9c5e767b132b929f11cb006670f5b..48bfadad8aabbb15b845149e450b6b4348a0a671 100644 --- a/en/application-dev/ui/ui-js-animate-dynamic-effects.md +++ b/en/application-dev/ui/ui-js-animate-dynamic-effects.md @@ -1,7 +1,7 @@ # Animation Effect -You can set the interpolator to implement the animation effect. For details, see [Animation](../reference/apis/js-apis-basic-features-animator.md). +You can set the interpolator to implement the animation effect. For details, see [Animation](../reference/apis/js-apis-animator.md). > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**: @@ -82,15 +82,15 @@ export default { > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**: > - When you use createAnimator to create an animation object, you must pass the options parameter. -> +> > - begin indicates the start point of the animation interpolation. If it is not set, the default value 0 is used. -> +> > - end indicates the end point of the animation interpolation. If it is not set, the default value 1 is used. ## Adding Animation Events and Calling Methods -The animator supports events and methods, which you can use to customize the animation effect. Events include frame, cancel, repeat, and finish. Methods include update, play, pause, cancel, reverse, and finish. For details about the supported events and methods, see [animator supported events and animator supported APIs](../reference/apis/js-apis-basic-features-animator.md). +The animator supports events and methods, which you can use to customize the animation effect. Events include frame, cancel, repeat, and finish. Methods include update, play, pause, cancel, reverse, and finish. For details about the supported events and methods, see [animator supported events and animator supported APIs](../reference/apis/js-apis-animator.md). ```