README.md
1# Simple Clock
2
3### Introduction
4
5This sample exemplifies how to implement a simple clock application using the eTS UI capability.
6
7### Usage
8
9The UI uses **setInterval** to update the time at regular intervals and uses **Canvas** to draw the clock, where the rotation angles of the clock hands are obtained through calculation.
10
11For example, **2 * Math.PI / 60 * second** indicates the rotation angle of the second hand.
12
13### Constraints
14
151. This sample can only be run on standard-system devices.
16
172. This sample demonstrates the stage model, which supports only API version 9.
18
193. The DevEco Studio version used in this sample must be 3.0.0.900 or later.
20
README_zh.md
1# 简单时钟
2
3### 简介
4
5本示例使用eTS UI能力实现一个简单的时钟应用。实现效果如下:
6
7
8
9### 相关概念
10
11CanvasRenderingContext2D:使用RenderingContext在Canvas组件上进行绘制,绘制对象可以是矩形、文本、图片等。
12
13### 相关权限
14
15不涉及。
16
17### 使用说明
18
191.界面通过setInterval实现周期性实时刷新时间,使用Canvas绘制时钟,指针旋转角度通过计算得出。
20
21例如:"2 * Math.PI / 60 * second"是秒针旋转的角度。
22
23### 约束与限制
24
251.本示例仅支持标准系统上运行。
26
272.本示例为Stage模型,从API version 9开始支持。
28
293.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行。