• Home
Name Date Size #Lines LOC

..--

entry/12-May-2024-1,013904

screenshots/device/12-May-2024-

.gitignoreD12-May-2024112 88

README.mdD12-May-20241 KiB3316

README_zh.mdD12-May-20241,018 3116

build-profile.json5D12-May-20241 KiB4241

hvigorfile.jsD12-May-2024174 21

package.jsonD12-May-2024395 1919

README.md

1# Vibrator
2
3### Introduction
4
5This sample simulates the countdown scenario to show the use of the vibrator APIs. Below shows the sample app.
6
7![](./screenshots/device/vibrator.png)
8
9### Functions
10
11You can trigger a vibrator to vibrate by duration or vibration effect.
12
13### Required Permissions
14
15ohos.permission.VIBRATE
16
17### Usage
18
191. Touch the countdown text. A time picker is displayed. Select any time and touch **OK**. The selected time is displayed as the countdown text.
20
212. Touch **start**. The countdown starts, and the round progress bar and countdown text start changing. When the countdown ends, the device vibrates, the progress bar returns to the initial state, and a vibration dialog box is displayed.
22
233. Touch **reset**. The countdown ends, and the round progress bar and countdown text are restored to the initial state.
24
25### Constraints
26
271. This sample can only be run on standard-system devices.
28
292. This sample requires a device with a vibrator.
30
313. This sample requires DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100) to compile and run.
32
33

README_zh.md

1# 振动
2
3### 简介
4
5本示例模拟倒计时场景,展示振动接口的使用方法。实现效果如下:
6
7![](./screenshots/device/vibrator.png)
8
9### 相关概念
10
11触发振动的两种方式:通过持续时间触发马达振动和通过振动效果触发马达振动。
12
13### 相关权限
14
15允许应用程序使用马达:ohos.permission.VIBRATE
16
17### 使用说明
18
191.点击倒计时文本,弹出时间选择框,选择任意时间,点击**确认**,倒计时文本显示选择的时间。
20
212.点击**start**,开始倒计时,圆形进度条和文本开始变化;倒计时结束,开始振动,进度条恢复初始状态并且弹出振动提示框,按照描述进行选择。
22
233.点击**reset**,可以结束倒计时并使文本和进度条恢复初始状态。
24
25### 约束与限制
26
271.本示例仅支持标准系统上运行。
28
292.本示例需要使用有振动器的设备测试。
30
313.本示例需要使用DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100)及以上才可编译运行。