applist与主题样式修改 289/1 289/head
authorluozheng <1732036298@qq.com>
Fri, 14 Jun 2024 11:46:48 +0000 (19:46 +0800)
committerluozheng <1732036298@qq.com>
Fri, 14 Jun 2024 11:46:48 +0000 (19:46 +0800)
code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp
code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStylePresenter.cpp

index dfcff84..25105cb 100644 (file)
@@ -20,6 +20,7 @@
 #include "ApplistModel.h"
 #include "ApplistPresenter.h"
 #include "SetDesktopModel.h"
+#include "themestyle/include/ThemeStyleModel.h"
 
 namespace OHOS
 {
@@ -195,6 +196,6 @@ namespace OHOS
 
     bool ApplistModel::GetIsUseListStyle(void)
     {
-        return (SetDesktopModel::GetInstance().GetDesktopStyle() == APPLIST_STYLE);
+        return (ThemeStyleModel::GetInstance().GetAppListDisplayStyle() == APPLIST_STYLE);
     }
 }
index 956a9a7..3771bf5 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-04-08 16:43:48
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-06-14 19:14:53
+ * @LastEditTime: 2024-06-14 19:39:03
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/ThemeStylePresenter.cpp
  */
 
@@ -65,26 +65,28 @@ namespace OHOS
             NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
             return true;
         }
-        /* -------------------------------------------------------------------------- */
-        if (viewId == THEME_STYLE_LIST)
-        {
-            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::APPLIST_STYLE);
-        }
-        else if (viewId == THEME_STYLE_HEXAGONS)
-        {
-            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::HEXAGONS_STYLE);
-        }
-        LabelButtonExt->SetImageSrc(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_ON_IMAGE);
-        LabelButtonExt->Invalidate();
-        uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId();
-        if (preSlice == VIEW_APPLIST)
-        {
-            NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
-        }
         else
         {
-            NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST);
-            NativeAbility::GetInstance().ClearSliceIdStack();
+            if (viewId == THEME_STYLE_LIST)
+            {
+                ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::APPLIST_STYLE);
+            }
+            else if (viewId == THEME_STYLE_HEXAGONS)
+            {
+                ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::HEXAGONS_STYLE);
+            }
+            // LabelButtonExt->SetImageSrc(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_ON_IMAGE);
+            // LabelButtonExt->Invalidate();
+            uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId();
+            if (preSlice == VIEW_APPLIST)
+            {
+                NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
+            }
+            else
+            {
+                NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST);
+                NativeAbility::GetInstance().ClearSliceIdStack();
+            }
         }
 
         return true;