* @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
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"
{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);
+ }
+
}