屏蔽app list和主界面的切换动效
authorluozheng <1732036298@qq.com>
Sat, 11 Oct 2025 03:13:45 +0000 (11:13 +0800)
committerluozheng <1732036298@qq.com>
Sat, 11 Oct 2025 03:13:45 +0000 (11:13 +0800)
code/sdk/application/wearable/n9/nativeapp/nativeui/key/src/KeyInputListener.cpp

index 8553851..c7e6ec7 100644 (file)
@@ -35,7 +35,7 @@ void KeyInputListener::OnKeyPress(const KeyEvent &event)
 {
     pressFlag = 1; // 短按标志
     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnKeyPress: pressFlag = %d", pressFlag);
-    #if 0
+    #if 1
     uint16_t currentViewId = NativeAbility::GetInstance().GetCurSliceId();
     uint16 keyID = event.GetKeyId();
     if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
@@ -67,7 +67,7 @@ void KeyInputListener::OnKeyRelease(const KeyEvent& event)
     {
         if (longPressFlag == 0 && pressFlag == 1)
         {
-            HandlePowerKeyPress(currentViewId);
+            // HandlePowerKeyPress(currentViewId);
         }
     }
     // 重置标志
@@ -85,7 +85,7 @@ void KeyInputListener::HandlePowerKeyPress(uint16_t currentViewId)
     {
         if (mcu_pms_is_screen_on())
         {
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN,TransitionType::TRANSITION_ZOOM);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN,TransitionType::TRANSITION_INVALID);
         }
     }
     else // 当前页面是主表盘
@@ -109,9 +109,9 @@ void KeyInputListener::HandlePowerKeyPress(uint16_t currentViewId)
                 else
                 {
                     if (ApplistModel::GetInstance().GetCurrentStyle() == AppListStyle::WATERFALL_STYLE) {
-                        NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TransitionType::TRANSITION_ENTER_WATERFALL);
+                        NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TransitionType::TRANSITION_INVALID);
                     } else {
-                        NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TransitionType::TRANSITION_ZOOM);
+                        NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TransitionType::TRANSITION_INVALID);
                     }
                 }
             }