Merge branch 'xts_origin' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230...
author罗正yun <1732036298@qq.com>
Tue, 23 Jan 2024 10:02:57 +0000 (18:02 +0800)
committer罗正yun <1732036298@qq.com>
Tue, 23 Jan 2024 10:02:57 +0000 (18:02 +0800)
1  2 
code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h
code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h
code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp

@@@ -47,10 -48,8 +48,12 @@@ typedef enum : uint16_
      VIEW_SYSTEM,                 // 系统
      VIEW_SYSTEM_SYSTEM_LANGUAGE, // 系统:系统语言
      VIEW_SYSTEM_FACTORY_RESET,   // 系统:恢复出厂设置
 +    VIEW_SOUND_VIBRATION,        // 声音与震动
 +    VIEW_SYSTEM_VOLUME,          // 系统音量
 +    VIEW_CALL_VOLUME,            // 通话音量
 +    VIEW_MEDIA_VOLUME,           // 媒体音量
+     /* ---------------------------------- 测试界面 ---------------------------------- */
+     VIEW_MESSAGE, // 信息通知
      /* -------------------------------------------------------------------------- */
      VIEW_MAIN_TEMP,     // 体温界面(暂时不用)
      VIEW_OFFLINEVOICE,  // 语音助手界面(暂时不用)
@@@ -5,8 -6,8 +6,10 @@@
   * @LastEditTime: 2024-01-22 16:32:42
   * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h
   * @Description:
++ * @Description:
   * @
   * @Copyright (c) 2024 by Caisking , All Rights Reserved.
++ * @Copyright (c) 2024 by Caisking , All Rights Reserved.
   */
  
  #ifndef NATIVE_LAUNCHER_H
@@@ -46,14 -47,12 +49,15 @@@ namespace OHO
          void InitFutureWeatherSlice(void);
          void InitGetWeatherDataErrorSlice(void);
          /* -------------------------------------------------------------------------- */
 -        void InitSystemSlice(void);                          
 -        void InitSystemLanguageSlice(void);            
 -        void InitSystemFactoryResetSlice(void);   
 -        
 +        void InitSystemSlice(void);
 +        void InitSystemLanguageSlice(void);
 +        void InitSystemFactoryResetSlice(void);
          /* -------------------------------------------------------------------------- */
 -        void InitMessageSlice(void);   
 +        void InitSoundAndVibrationSlice(void);
 +        void InitSystemVolumeSlice(void);
 +        void InitCallVolumeSlice(void);
 +        void InitMediaVolumeSlice(void);
++        void InitMessageSlice(void); 
      private:
          void InitAllNativeSlices(void);
  
  #include "system/include/SystemFactoryResetPresenter.h"
  #include "system/include/SystemFactoryResetView.h"
  
 +#include "soundandvibration/include/SoundAndVibrationPresenter.h"
 +#include "soundandvibration/include/SoundAndVibrationView.h"
 +#include "soundandvibration/include/SystemVolumePresenter.h"
 +#include "soundandvibration/include/SystemVolumeView.h"
 +
+ #include "message/include/MessageAdapter.h"
+ #include "message/include/MessageView.h"
+ #include "message/include/MessageItemView.h"
+ #include "message/include/MessageModel.h"
+ #include "message/include/MessagePresenter.h"
+ 
  #include "BluetoothHeadsetEvent.h"
  #include "graphic_hardware_config.h"
  #include "graphic_service.h"
@@@ -122,12 -123,15 +128,17 @@@ namespace OHO
          {VIEW_SYSTEM, &NativeLauncher::InitSystemSlice},                              // 系统实例化地址
          {VIEW_SYSTEM_SYSTEM_LANGUAGE, &NativeLauncher::InitSystemLanguageSlice},      // 系统:系统语言实例化地址
          {VIEW_SYSTEM_FACTORY_RESET, &NativeLauncher::InitSystemFactoryResetSlice},    // 系统:恢复出厂设置实例化地址
-         //{VIEW_MAIN_ACTIVITY, &NativeLauncher::InitActivitySlice},
-         //{VIEW_OFFLINEVOICE, &NativeLauncher::InitOfflineVoice},
-         //{VIEW_MAIN_TEMP, &NativeLauncher::InitMainTempSlice},
-         //{VIEW_UISAMPLE, &NativeLauncher::InitUISampleSlice}
 +        {VIEW_SOUND_VIBRATION, &NativeLauncher::InitSoundAndVibrationSlice},          // 声音与震动实例化地址
 +        {VIEW_SYSTEM_VOLUME, &NativeLauncher::InitSystemVolumeSlice},                 // 系统音量
+ 
+         {VIEW_MESSAGE, &NativeLauncher::InitMessageSlice},
+ 
+ #if 0
+         {VIEW_MAIN_ACTIVITY, &NativeLauncher::InitActivitySlice},
+         {VIEW_OFFLINEVOICE, &NativeLauncher::InitOfflineVoice},
+         {VIEW_MAIN_TEMP, &NativeLauncher::InitMainTempSlice},
+         {VIEW_UISAMPLE, &NativeLauncher::InitUISampleSlice}
+ #endif
      };
  
      static const ViewIdToString VIEW_MAPPER[] = {
          NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_FACTORY_RESET, systemfactoryreset);
      }
  
 -    /* -------------------------------------------------------------------------- */
 -    void NativeLauncher::InitMessageSlice(void) // 系统:恢复出厂设置
++    void NativeLauncher::InitMessageSlice(void) // 消息中心
+     {
+         SliceProxy *messageview = new AbilitySliceProxy<MessageView, MessagePresenter>;
+         if (messageview == nullptr)
+         {
 -            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MessageView is nullptr");
 -            return;
++        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MessageView is nullptr");
++        return;
+         }
+         NativeAbility::GetInstance().AddSliceProxy(VIEW_MESSAGE, messageview);
+     }
 -    /* -------------------------------------------------------------------------- */
++
 +    void NativeLauncher::InitSoundAndVibrationSlice(void) // 声音与震动
 +    {
 +        SliceProxy *SoundAndVibration = new AbilitySliceProxy<SoundAndVibrationView, SoundAndVibrationPresenter>;
 +        if (SoundAndVibration == nullptr)
 +        {
 +            return;
 +        }
 +        NativeAbility::GetInstance().AddSliceProxy(VIEW_SOUND_VIBRATION, SoundAndVibration);
 +    }
 +
 +    void NativeLauncher::InitSystemVolumeSlice(void) // 系统音量
 +    {
 +        SliceProxy *systemvolume = new AbilitySliceProxy<SystemVolumeView, SystemVolumePresenter>;
 +        if (systemvolume == nullptr)
 +        {
 +            return;
 +        }
 +        NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_VOLUME, systemvolume);
 +    }
 +    
  }