11import { back } from '@zos/router'
22import { createWidget , deleteWidget , prop , widget } from '@zos/ui'
3- import { Time , Vibrator , VIBRATOR_SCENE_TIMER } from '@zos/sensor'
3+ import { Time , Vibrator , VIBRATOR_SCENE_DURATION_LONG , VIBRATOR_SCENE_SHORT_LIGHT , VIBRATOR_SCENE_TIMER } from '@zos/sensor'
44import { pausePalmScreenOff , resetPalmScreenOff } from '@zos/display'
55
66import { CONSTANTS , getText , zeroPad } from '../common'
5959 this . startBlinkInterval ( )
6060 this . createStopButton ( )
6161 this . deleteAdditionalButtons ( )
62- this . doVibro ( )
62+ this . doVibro ( VIBRATOR_SCENE_TIMER )
6363 } else {
6464 this . notifyOnInterval ( remainingSeconds )
6565 }
8282 if ( this . lastReminder ) {
8383 const now = this . time . getTime ( )
8484 if ( now - this . lastReminder >= this . interval . valueSeconds * CONSTANTS . seconds . mili ) {
85- this . doVibro ( )
85+ this . doVibro ( VIBRATOR_SCENE_DURATION_LONG )
8686 this . switchTimerDisplayColor ( true )
8787 this . lastReminder = now
8888 } else {
@@ -124,32 +124,30 @@ Page({
124124 }
125125 } ,
126126
127- doVibro ( ) {
127+ doVibro ( scene = VIBRATOR_SCENE_SHORT_LIGHT ) {
128128 this . vibro . stop ( )
129- this . vibro . setMode ( VIBRATOR_SCENE_TIMER )
129+ this . vibro . setMode ( scene )
130130 this . vibro . start ( )
131131 } ,
132132
133133 createStopButton ( ) {
134134 return createWidget ( widget . BUTTON ,
135135 COMMON . STANDARD_BOTTOM_BUTTON_STYLE_ACTION ( CONSTANTS . img . STOP , CONSTANTS . img . STOP_PRESSED , ( arg ) => {
136- getApp ( ) . _options . globalData . openMain = true
137136 back ( )
138137 } ) )
139138 } ,
140139
141140 createCancelButton ( ) {
142141 return createWidget ( widget . BUTTON , TIMER_PROGRESS . CANCEL_BUTTON ( ( arg ) => {
143- this . doVibro ( )
144- getApp ( ) . _options . globalData . openMain = true
142+ this . doVibro ( VIBRATOR_SCENE_SHORT_LIGHT )
145143 back ( )
146144 } ) )
147145 } ,
148146
149147 createPauseButton ( ) {
150148 return createWidget ( widget . BUTTON ,
151149 TIMER_PROGRESS . PAUSE_RESUME_BUTTON ( CONSTANTS . img . PAUSE , CONSTANTS . img . PAUSE_PRESSED , ( button ) => {
152- this . doVibro ( )
150+ this . doVibro ( VIBRATOR_SCENE_SHORT_LIGHT )
153151 this . stopProcesses ( )
154152 this . pause = this . time . getTime ( )
155153 this . resumeButton = this . createResumeButton ( )
@@ -160,7 +158,7 @@ Page({
160158 createResumeButton ( ) {
161159 return createWidget ( widget . BUTTON ,
162160 TIMER_PROGRESS . PAUSE_RESUME_BUTTON ( CONSTANTS . img . RESUME , CONSTANTS . img . RESUME_PRESSED , ( button ) => {
163- this . doVibro ( )
161+ this . doVibro ( VIBRATOR_SCENE_SHORT_LIGHT )
164162 const pauseTime = this . time . getTime ( ) - this . pause
165163 this . end += pauseTime
166164 this . lastReminder += pauseTime
0 commit comments