if (longPressFlag == 0 && pressFlag == 1) { // 短按电源键
- if (currentViewId == VIEW_MAEKPHONE_SAMPLE || IsCallingNotify() == true) { // 音量卡片
+ if (currentViewId == VIEW_MAEKPHONE_SAMPLE || IsCallingNotify() == true) { // 音量卡片
// 音量+
CallVolumeDipSwitchControl(1);
- }else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘
- PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+ }else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘
+ if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
+ PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+ }
} else {
- PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
if (!MainViewSample::GetInstance()->IsMainView()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
+ PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ }
} else {
//power键要进入休眠
if(mcu_pms_is_screen_on()){
// 音量-
CallVolumeDipSwitchControl(0);
} else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘
- PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+ if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
+ PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+ }
} else {
- PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
- if (!MainViewSample::GetInstance()->IsMainView()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
- } else {
- NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TRANSITION_ZOOM);
+ if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
+ PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
+ if (!MainViewSample::GetInstance()->IsMainView()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ } else {
+ NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TRANSITION_ZOOM);
+ }
}
}
}