From: Caisking <3449750381@qq.com> Date: Tue, 12 Dec 2023 08:57:52 +0000 (+0800) Subject: 同步代码4 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=6a821ce6f9a0ce5a33ce80f2a0e07f37a3c5c2f0;p=mirrors%2FFD230.git 同步代码4 --- diff --git a/Resource/res/Bluetooth.bin b/Resource/res/Bluetooth.bin new file mode 100644 index 000000000..358e24be0 Binary files /dev/null and b/Resource/res/Bluetooth.bin differ diff --git a/Resource/res/weather/WEATHER_CLEAR-CLOUDY.bin b/Resource/res/weather/WEATHER_CLEAR-CLOUDY.bin new file mode 100644 index 000000000..f253a7ea1 Binary files /dev/null and b/Resource/res/weather/WEATHER_CLEAR-CLOUDY.bin differ diff --git a/Resource/res/weather/WEATHER_THUNDERSHOWER.bin b/Resource/res/weather/WEATHER_THUNDERSHOWER.bin new file mode 100644 index 000000000..4954d5ee1 Binary files /dev/null and b/Resource/res/weather/WEATHER_THUNDERSHOWER.bin differ diff --git a/Resource/res/weather/WEATHER_UNKNOWN.bin b/Resource/res/weather/WEATHER_UNKNOWN.bin new file mode 100644 index 000000000..604d809cf Binary files /dev/null and b/Resource/res/weather/WEATHER_UNKNOWN.bin differ diff --git a/Resource/res/weather/weather_clear-sunny.bin b/Resource/res/weather/weather_clear-sunny.bin new file mode 100644 index 000000000..bda9c3e0c Binary files /dev/null and b/Resource/res/weather/weather_clear-sunny.bin differ diff --git a/Resource/res/weather/weather_duststorm.bin b/Resource/res/weather/weather_duststorm.bin new file mode 100644 index 000000000..c6710e714 Binary files /dev/null and b/Resource/res/weather/weather_duststorm.bin differ diff --git a/Resource/res/weather/weather_foggy.bin b/Resource/res/weather/weather_foggy.bin new file mode 100644 index 000000000..d38ac2e77 Binary files /dev/null and b/Resource/res/weather/weather_foggy.bin differ diff --git a/Resource/res/weather/weather_haze.bin b/Resource/res/weather/weather_haze.bin new file mode 100644 index 000000000..6f795a16e Binary files /dev/null and b/Resource/res/weather/weather_haze.bin differ diff --git a/Resource/res/weather/weather_overcast.bin b/Resource/res/weather/weather_overcast.bin new file mode 100644 index 000000000..272962347 Binary files /dev/null and b/Resource/res/weather/weather_overcast.bin differ diff --git a/Resource/res/weather/weather_rain.bin b/Resource/res/weather/weather_rain.bin new file mode 100644 index 000000000..b3874bd26 Binary files /dev/null and b/Resource/res/weather/weather_rain.bin differ diff --git a/Resource/res/weather/weather_snow.bin b/Resource/res/weather/weather_snow.bin new file mode 100644 index 000000000..f92e6feed Binary files /dev/null and b/Resource/res/weather/weather_snow.bin differ diff --git a/Resource/res/weather/weather_sunny.bin b/Resource/res/weather/weather_sunny.bin new file mode 100644 index 000000000..548273d1e Binary files /dev/null and b/Resource/res/weather/weather_sunny.bin differ diff --git a/code/sdk/application/wearable/nativeapp/CMakeLists.txt b/code/sdk/application/wearable/nativeapp/CMakeLists.txt index 85082dd13..cf7b6947c 100755 --- a/code/sdk/application/wearable/nativeapp/CMakeLists.txt +++ b/code/sdk/application/wearable/nativeapp/CMakeLists.txt @@ -1,403 +1,450 @@ -set(COMPONENT_NAME "nativelauncher") -set(MODULE_NAME "app") -set(AUTO_DEF_FILE_ID TRUE) -set(UI_SAMPLE_ROOT ${ROOT_DIR}/middleware/services/gui/uikit/sample/uitest) - -set(PUBLIC_HEADER - ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/include/slices/main -) - -set(PRIVATE_HEADER - ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rtcservice/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarmclockmanage/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarmclocktimerconfig/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/key/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phoneservice/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/screensetting/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uiservice/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/ - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/InitComponent/include - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/uitest/framework/include - ${UI_SAMPLE_ROOT}/components - ${CMAKE_CURRENT_SOURCE_DIR}/../service/smart_voice/smart_voice_service/interfaces/innerkits/native_c/include - ${CMAKE_CURRENT_SOURCE_DIR}/../service/smart_voice/voice_engine_hal/interfaces/innerkits/native_c/include - ${CMAKE_CURRENT_SOURCE_DIR}/../ohos_deps - - ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits - ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include - ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/ui/frameworks - ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/service - ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits - - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/interfaces/kits/events - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/interfaces/kits - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/utils/interfaces/kits - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/utils/interfaces/kits/gfx_utils - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/utils/interfaces/innerkits - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/interfaces/innerkits - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/frameworks - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/surface/interfaces/kits - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/interfaces/kits/components - ${ROOT_DIR}/open_source/openharmony/foundation/graphic/service/include - ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audio_player/interfaces/kits - ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiomanager - ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiocommon - ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits/ - ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/utils/include - - ${ROOT_DIR}/include/middleware/services/bts/common - ${ROOT_DIR}/include/middleware/services/bts/ble - ${ROOT_DIR}/include/middleware/services/bts/br - - ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include - ${ROOT_DIR}/open_source/openharmony/foundation/distributedschedule/samgr_lite/interfaces/kits/samgr -) - -set(SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/src/NativeLauncher.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uiservice/src/ui_service.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/src/slices/main/MainPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/src/slices/main/MainView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainViewSample.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainPresenterSample.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainSwipeViewGroup.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/ModelListenerSample.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/PresenterTask.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/HealthModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/PullUpDownView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/AppItemView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistAdapter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/MainClockView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/DialUserView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/DialMalioView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodBandoffView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothDeviceListView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/MainBluetoothView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/TipsConnFailMessageView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/TipsFailMessageView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/TipsSuccMessageView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothEarListView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothOptionsView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothReconnectView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothItemView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkMotionView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageFirst.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageSecond.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageThird.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageFourth.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageFifth.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/CustomizationView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkEndView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/src/ConnectPhoneView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/src/ConnectSelectView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/src/ConnectOpenView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/src/ConnectPhonePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/RebootView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/RebootPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/RebootModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/RebootDeviceView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/ShutdownDeviceView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/src/CallerLogView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/src/CallerLogPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/src/CallerLogModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/src/CallerItemView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/CallerDisplayView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/WaitingHintsView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/CallingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/MainCallingPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/DialingScreenView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/MainCallingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/VolumeSettingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/VolumeSettingPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/BluetoothView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/PlayersView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/PlayersPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/PlayersModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/PlayersCaseListAdapter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/src/MainActivityView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/src/ActivityWeekView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/src/ActivityPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/src/ActivityModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/src/HeartRateView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/src/HeartModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmClockModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/MainAlarmView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmConfigView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmSetTimeView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmSetWeekView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmJudgeView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmPopUpView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmRingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmCloseRingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmNewTimeView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmPopUpPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmMaxClock.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempJoinStudy.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempMainView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempMeasure.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempExitInter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempPromptWear.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempClickMea.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempRemindWear.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempMeaProcess.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempInitInter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempWarn.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempLittleTip.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempExitPrompt.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempStudyAbout.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempContinueWarn.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempReport.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingAdapter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingItemView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/key/src/KeyInputListener.cpp - #ʡ�� - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveEleModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveElePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveEleView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveBatPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveBatView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepPresenter.cpp - #˯�� - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepTimePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepTimeView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepActPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepActView.cpp - #�绰 - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhonePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneDirView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneDirPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallingPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallupView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallupPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneRingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneRingPresenter.cpp - #�������� - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/getpic/src/GetPicPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/getpic/src/GetPicView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/getpic/src/TakePicPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/getpic/src/TakePicView.cpp - #Ѫ�� - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodShowView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodShowPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodCheckView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodCheckPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodErrorView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodErrorPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodNoteView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodNotePresenter.cpp - #���� - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/dial/src/DialView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/dial/src/DialPresenter.cpp - - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/src/HeartRemindView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/src/HeartRemindPresenter.cpp - - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingMoreView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingMorePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingLimitView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingLimitPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingNomalView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingNomalPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetTimeView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetTimePresenter.cpp - #ָ���� - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassControlView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassCalibrationView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/MainCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/MainCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PlaceMakerCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PlaceMakerCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/MakerPointCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/MakerPointCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/StartPathRecordCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/StartPathRecordCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndPathRecordCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndPathRecordCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PathBackTrackingCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PathBackTrackingCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/ResetPlaceMakerCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/ResetPlaceMakerCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PathRetracingCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PathRetracingCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndBackTrackingEarlyCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndBackTrackingEarlyCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndBackTrackingCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndBackTrackingCompassView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/GPSLossCompassPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/GPSLossCompassView.cpp - #辅助功能 - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/SecondaryFunctionPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/SecondaryFunctionView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/FastTrainingAttentionPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/FastTrainingPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/FastTrainingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phoneservice/src/PhoneService.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phoneservice/src/PhoneAudio.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/src/VocassistModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/src/VocassistPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/src/VocassistView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/src/MainVocassistView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/screensetting/src/ScreenModels.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarmclockmanage/src/AlarmClockManage.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rtcservice/src/RtcService.cpp - - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/DisplayBrightnessModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/DisplayBrightnessView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/BrightnessControlPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/BrightnessControlView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/ScreenDurationPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/ScreenDurationView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetoothofsetting/src/BlueToothOfSettingModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetoothofsetting/src/BlueToothOfSettingPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetoothofsetting/src/BlueToothOfSettingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SoundAndVibrationView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SystemVolumePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SystemVolumeView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/CallVolumePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/CallVolumeView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/MediaVolumePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/MediaVolumeView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/QuickAccessPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/QuickAccessView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemAboutPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemAboutView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemSupervisePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemSuperviseView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemLanguagePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemLanguageView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordListPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordListView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordPlayPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordPlayView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordDeletePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordDeleteView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordGoingPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordGoingView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemRebootPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemRebootView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemShoutDownPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemShoutDownView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemFactoryResetPresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemFactoryResetView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/InitComponent/src/InitComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/src/UISampleView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/src/UISamplePresenter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/src/UISampleModel.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/uitest/framework/src/ui_test_group.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_tiger/tiger_view.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_tiger/ui_test_tiger.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_running_ball/ui_test_running_ball.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_breath/ui_test_breath.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_card_switch/ui_test_card_switch.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_countdown/ui_test_countdown.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_list_fps/image_text_adapter.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_list_fps/ui_test_list_fps.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_message/ui_test_message.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_cube_rotate/cube_rotate_view.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_cube_rotate/ui_test_cube_rotate.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_video_play/ui_test_video_play.cpp - ${UI_SAMPLE_ROOT}/components/ui_test_video_play/media_video_play.cpp -) - -set(COMPONENT_PUBLIC_CCFLAGS -) - -set(COMPONENT_CCFLAGS - -std=c++11 - -Wno-error - -Wno-unused-parameter - -fno-exceptions - -fno-unwind-tables - -fno-asynchronous-unwind-tables - -Wno-undef - -Wno-bitwise-op-parentheses - -Wno-shift-op-parentheses - -nostdlibinc - -nostdinc - -nostdlib - -Wno-c++11-narrowing - -Wno-error=unused-function -) - -set(WHOLE_LINK - true -) - -set(MAIN_COMPONENT - false -) - -set(PUBLIC_DEFINES - SUPPORT_NATIVE_UI -) - -set(PRIVATE_DEFINES -) - -build_component() +set(COMPONENT_NAME "nativelauncher") +set(MODULE_NAME "app") +set(AUTO_DEF_FILE_ID TRUE) +set(UI_SAMPLE_ROOT ${ROOT_DIR}/middleware/services/gui/uikit/sample/uitest) + +set(PUBLIC_HEADER + ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/include/slices/main +) + +set(PRIVATE_HEADER + ${ROOT_DIR}/open_source/openharmony/foundation/ace/ace_engine_lite/interfaces/base + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rtcservice/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarmclockmanage/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarmclocktimerconfig/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/key/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phoneservice/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/screensetting/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uiservice/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/ + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/InitComponent/include + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/uitest/framework/include + ${UI_SAMPLE_ROOT}/components + ${CMAKE_CURRENT_SOURCE_DIR}/../service/smart_voice/smart_voice_service/interfaces/innerkits/native_c/include + ${CMAKE_CURRENT_SOURCE_DIR}/../service/smart_voice/voice_engine_hal/interfaces/innerkits/native_c/include + ${CMAKE_CURRENT_SOURCE_DIR}/../ohos_deps + + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/ui/frameworks + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/service + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits + + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/interfaces/kits/events + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/interfaces/kits + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/utils/interfaces/kits + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/utils/interfaces/kits/gfx_utils + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/utils/interfaces/innerkits + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/interfaces/innerkits + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/frameworks + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/surface/interfaces/kits + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/ui/interfaces/kits/components + ${ROOT_DIR}/open_source/openharmony/foundation/graphic/service/include + ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audio_player/interfaces/kits + ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiomanager + ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiocommon + ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits/ + ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/utils/include + + ${ROOT_DIR}/include/middleware/services/bts/common + ${ROOT_DIR}/include/middleware/services/bts/ble + ${ROOT_DIR}/include/middleware/services/bts/br + + ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include + ${ROOT_DIR}/open_source/openharmony/foundation/distributedschedule/samgr_lite/interfaces/kits/samgr +) + +set(SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/src/NativeLauncher.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uiservice/src/ui_service.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/src/slices/main/MainPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativelauncher/src/slices/main/MainView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainViewSample.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainPresenterSample.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/MainSwipeViewGroup.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/ModelListenerSample.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/PresenterTask.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/HealthModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/PullUpDownView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/AppItemView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistAdapter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/MainClockView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/DialUserView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/DialMalioView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodBandoffView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothDeviceListView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothHeadsetEvent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/MainBluetoothView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/TipsConnFailMessageView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/TipsFailMessageView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/TipsSuccMessageView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothEarListView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothOptionsView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothReconnectView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothItemView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetooth/src/BluetoothCaseListAdapter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkMotionView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageFirst.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageSecond.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageThird.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageFourth.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/MotionPageFifth.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/CustomizationView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/indoorwalk/src/IndoorWalkEndView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/src/ConnectPhoneView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/src/ConnectSelectView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/src/ConnectOpenView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/connectnewphone/src/ConnectPhonePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/RebootView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/RebootPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/RebootModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/RebootDeviceView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rebootdevice/src/ShutdownDeviceView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/src/CallerLogView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/src/CallerLogPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/src/CallerLogModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/callerlog/src/CallerItemView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/CallerDisplayView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/WaitingHintsView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/CallingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/MainCallingPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/DialingScreenView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/makephone/src/MainCallingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/VolumeSettingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/main/src/VolumeSettingPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/BluetoothView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/PlayersView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/PlayersPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/PlayersModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/player/src/PlayersCaseListAdapter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/src/MainActivityView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/src/ActivityWeekView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/src/ActivityPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/activity/src/ActivityModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/src/HeartRateView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/src/HeartModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmClockModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/MainAlarmView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmConfigView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmSetTimeView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmSetWeekView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmJudgeView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmPopUpView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmRingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmCloseRingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmNewTimeView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmPopUpPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarm/src/AlarmMaxClock.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempJoinStudy.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempMainView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempMeasure.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempExitInter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempPromptWear.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempClickMea.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempRemindWear.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempMeaProcess.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempInitInter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempWarn.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempLittleTip.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempExitPrompt.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempStudyAbout.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempContinueWarn.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/temperature/src/TempReport.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingAdapter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/settings/src/SettingItemView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/key/src/KeyInputListener.cpp + #ʡ�� + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveEleModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveElePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveEleView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveBatPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/saveele/src/SaveBatView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepPresenter.cpp + #˯�� + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepTimePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepTimeView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepActPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/sleep/src/SleepActView.cpp + #�绰 + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhonePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneDirView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneDirPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallingPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallupView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneCallupPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneRingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phone/src/PhoneRingPresenter.cpp + #�������� + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/getpic/src/GetPicPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/getpic/src/GetPicView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/getpic/src/TakePicPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/getpic/src/TakePicView.cpp + #Ѫ�� + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodShowView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodShowPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodCheckView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodCheckPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodErrorView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodErrorPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodNoteView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/blood/src/BloodNotePresenter.cpp + #���� + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/dial/src/DialView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/dial/src/DialPresenter.cpp + + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/src/HeartRemindView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heartrate/src/HeartRemindPresenter.cpp + + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingMoreView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingMorePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingLimitView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingLimitPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingNomalView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingNomalPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetTimeView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetTimePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetCaluliView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingSetCaluliPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingControlView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingControlPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingCardView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingCardPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingDataView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingDataPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingDetailView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingDetailPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingEndnoteView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingEndnotePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingEnddataView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingEnddataPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingGPSView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingGPSPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingGPSlackView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingGPSlackPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingGPSnoteView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingGPSnotePresenter.cpp + #ָ���� + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassControlView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassCalibrationView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/MainCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/MainCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PlaceMakerCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PlaceMakerCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/MakerPointCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/MakerPointCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/StartPathRecordCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/StartPathRecordCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndPathRecordCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndPathRecordCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PathBackTrackingCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PathBackTrackingCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/ResetPlaceMakerCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/ResetPlaceMakerCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PathRetracingCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/PathRetracingCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndBackTrackingEarlyCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndBackTrackingEarlyCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndBackTrackingCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/EndBackTrackingCompassView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/GPSLossCompassPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/GPSLossCompassView.cpp + #辅助功能 + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/SecondaryFunctionPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/SecondaryFunctionView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/FastTrainingAttentionPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/FastTrainingPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/FastTrainingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phoneservice/src/PhoneService.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phoneservice/src/PhoneAudio.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/src/VocassistModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/src/VocassistPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/src/VocassistView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/src/MainVocassistView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/screensetting/src/ScreenModels.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarmclockmanage/src/AlarmClockManage.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rtcservice/src/RtcService.cpp + #天气 + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/MainWeatherPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/MainWeatherView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/WeatherReportPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/WeatherReportView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/FutureWeatherPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/FutureWeatherView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/GetWeatherDataErrorPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/GetWeatherDataErrorView.cpp + #倒计时 + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/countdown/src/MainCountDownPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/countdown/src/MainCountDownView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/countdown/src/CountDownTimeConfigPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/countdown/src/CountDownTimeConfigView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/countdown/src/StartCountDownPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/countdown/src/StartCountDownView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/countdown/src/CountDownModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/countdown/src/CountDownTimeNotNullPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/countdown/src/CountDownTimeNotNullView.cpp + #秒表 + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/stopwatch/src/MainStopWatchPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/stopwatch/src/MainStopWatchView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/stopwatch/src/StopWatchModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/stopwatch/src/StopWatchRecordCycleToLimitPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/stopwatch/src/StopWatchRecordCycleToLimitView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/stopwatch/src/StopWatchRecordTimeToLimitPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/stopwatch/src/StopWatchRecordTimeToLimitView.cpp + + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/DisplayBrightnessModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/DisplayBrightnessView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/BrightnessControlPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/BrightnessControlView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/ScreenDurationPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/displaybrightness/src/ScreenDurationView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetoothofsetting/src/BlueToothOfSettingModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetoothofsetting/src/BlueToothOfSettingPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bluetoothofsetting/src/BlueToothOfSettingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SoundAndVibrationView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SystemVolumePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SystemVolumeView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/CallVolumePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/CallVolumeView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/MediaVolumePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/MediaVolumeView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/QuickAccessPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/secondaryfunction/src/QuickAccessView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemAboutPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemAboutView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemSupervisePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemSuperviseView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemLanguagePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemLanguageView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordListPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordListView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordPlayPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordPlayView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordDeletePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordDeleteView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordGoingPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/record/src/RecordGoingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemRebootPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemRebootView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemShoutDownPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemShoutDownView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemFactoryResetPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemFactoryResetView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/InitComponent/src/InitComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/src/UISampleView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/src/UISamplePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/src/UISampleModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/uitest/framework/src/test_case_list_adapter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/uisample/uitest/framework/src/ui_test_group.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_tiger/tiger_view.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_tiger/ui_test_tiger.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_running_ball/ui_test_running_ball.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_breath/ui_test_breath.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_card_switch/ui_test_card_switch.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_countdown/ui_test_countdown.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_list_fps/image_text_adapter.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_list_fps/ui_test_list_fps.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_message/ui_test_message.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_cube_rotate/cube_rotate_view.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_cube_rotate/ui_test_cube_rotate.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_video_play/ui_test_video_play.cpp + ${UI_SAMPLE_ROOT}/components/ui_test_video_play/media_video_play.cpp +) + +set(COMPONENT_PUBLIC_CCFLAGS +) + +set(COMPONENT_CCFLAGS + -std=c++11 + -Wno-error + -Wno-unused-parameter + -fno-exceptions + -fno-unwind-tables + -fno-asynchronous-unwind-tables + -Wno-undef + -Wno-bitwise-op-parentheses + -Wno-shift-op-parentheses + -nostdlibinc + -nostdinc + -nostdlib + -Wno-c++11-narrowing + -Wno-error=unused-function +) + +set(WHOLE_LINK + true +) + +set(MAIN_COMPONENT + false +) + +set(PUBLIC_DEFINES + SUPPORT_NATIVE_UI +) + +set(PRIVATE_DEFINES +) + +build_component() diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h index 0b17e98bd..c1b85fd6e 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h @@ -1,147 +1,166 @@ -/* - * Copyright (c) 2020-2021 CompanyNameMagicTag. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef APP_VIEW_IDS_H -#define APP_VIEW_IDS_H - -#include - -/* - * 基础应用的view id,与MVP的V一一对应 - * 枚举命名要求:参考View名字,名字尽量简短 - */ -typedef enum : uint16_t -{ - VIEW_INVALID = 0, - VIEW_MAIN = 1, - VIEW_SETTING = 2, - VIEW_APPLIST = 3, - VIEW_SETTING_FIRST = 4, - VIEW_MAIN_SAMPLE = 5, - VIEW_MAIN_ALARM = 6, - VIEW_MAIN_ACTIVITY = 7, - VIEW_ALARM_POP_UP, - VIEW_CALLER_SAMPLE, - VIEW_MAEKPHONE_SAMPLE, - VIEW_BLOODOXY_SAMPLE, - VIEW_BLUETOOTH_EARPHONE, - VIEW_OFFLINEVOICE, - VIEW_WIFI, - VIEW_VOLUME, - VIEW_CONNECT_PHONE, - VIEW_MAIN_TEMP, - VIEW_INDOORWALK, - VIEW_REBOOT, - VIEW_UISAMPLE, // 实例 - VIEW_GETPIC, // 手势拍照 - VIEW_TAKEPIC, // 拍照 - - VIEW_BLOOD, // 血氧 - VIEW_BLOODSHOW, // 血氧说明 - VIEW_BLOODCHECK, // 血氧检查 - VIEW_BLOODERROR, // 血氧监测错误 - VIEW_BLOODNOTE, // 血氧过低提醒 - - VIEW_DIAL, // 表盘 - VIEW_DIALSETUP, // 表盘安装 - VIEW_DIALSUCCES, // 表盘安装成功 - - VIEW_SAVEELE, // 省电模式 - VIEW_SAVEBAT, // 省电模式界面 - - VIEW_COMPASS, // 指南针 - VIEW_COMPASS_PLACE_MAKER, // 指南针:放置标记点 - VIEW_COMPASS_MAKER_POINT, // 指南针:标记点介绍 - VIEW_COMPASS_START_PATH_RECORD, // 指南针:开始路径记录 - VIEW_COMPASS_END_PATH_RECORD, // 指南针:结束路径记录 - VIEW_COMPASS_PATH_BACKTRACKING, // 指南针:路径回溯 - VIEW_COMPASS_RESET_PLACE_MAKER, // 指南针:重置标记点 - VIEW_COMPASS_PATH_RETRACING, // 指南针:路径回溯中 - VIEW_COMPASS_GPS_LOSS, // 指南针:GPS丢失 - VIEW_COMPASS_END_BACK_TRACKING, // 指南针:结束路径回溯 - VIEW_COMPASS_END_BACK_TRACKING_EARLY, // 指南针:提前结束路径回溯 - VIEW_SPORT, // 活动 - - VIEW_HEARTRATEREMIND, // 心率提醒 - - VIEW_TRAINING, // 训练 - VIEW_TRAININGMORE, // 更多训练 - VIEW_TRAININGLIMIT, // 极限运动子列表 - VIEW_TRAININGNOMAL, // 正常训练开始界面(除骑行,健走,跑步外) - VIEW_TRAININGSET, // 训练目标(时长,卡路里) - VIEW_TRAININGSETTIME, // 设置训练时长 - VIEW_TRAINING_RECORD, // 训练记录 - - VIEW_BLOODPRESSURE, // 昨日睡眠时间 - VIEW_SLEEPTIME, // 睡眠详细数据 - VIEW_SLEEPACT, // 睡眠事项说明 - VIEW_MUSIC, // 音乐 - VIEW_WEATHER, // 天气 - VIEW_RECORD, // 录音 - // 录音 - VIEW_RECORD_LIST, - VIEW_RECORD_PLAY, - VIEW_RECORD_DELETE, - VIEW_RECORD_GOING, - // 电话 - VIEW_PHONE, // 电话 - VIEW_PHONECALL, // 拨号 - VIEW_PHONERING, // 拨号界面 - VIEW_PHONECALLING, // 来电 - VIEW_PHONECALLUP, // 通话界面 - VIEW_PHONEDIR, // 电话簿 - VIEW_CHRONOMETER, // 秒表 - VIEW_COUNTDOWN, // 计时器 - VIEW_BLUETOOTH, // 蓝牙 - // 设置 - VIEW_DISPLAY_BRIGHTNESS, // 屏幕与亮度 - VIEW_CONNECT_BLUETOOTH, // 蓝牙 - VIEW_SOUND_VIBRATION, // 声音与震动 - VIEW_SYSTEM_VOLUME, // 系统音量 - VIEW_CALL_VOLUME, // 通话音量 -VIEW_MEDIA_VOLUME, // 媒体音量 - VIEW_SECONDARY_FUNCTION, //辅助功能 - VIEW_SYSTEM, // 系统 - // 系统 - VIEW_SYSTEM_ABOUT_WATCH, // 系统:关于手表 - VIEW_SYSTEM_SUPERVISE, // 系统:监管 - VIEW_SYSTEM_SYSTEM_LANGUAGE, // 系统:系统语言 - VIEW_SYSTEM_REBOOT, // 系统:重新启动 - VIEW_SYSTEM_SHOUTDOWN, // 系统:关机 - VIEW_SYSTEM_FACTORY_RESET, // 系统:恢复出厂设置 - VIEW_BRIGHTNESS_CONTROL, // 亮度调节 - VIEW_SCREEN_DURATION, // 亮屏时长 - //按键按下进入的视图 - VIEW_QUICK_ACCESS, // 快速访问 - VIEW_FAST_TRAINING, //快速训练 - VIEW_FAST_TRAINING_ATTENTION,//快速训练项目选择超出提示 - VIEW_MAX_INTER_APP, // 在此之前添加native应用ID - VIEW_EXTERN_APP = 0xFFFE, // 三方应用 - VIEW_INVALIDE_APP = 0xFFFF, -} AppViewId; - -/* - * Slice页面优先级,越小优先级越高 - */ -typedef enum : uint16_t -{ - PRIO_0 = 0, - PRIO_1, - PRIO_2, - PRIO_3, - PRIO_4 -} AppPriority; - -#endif +/* + * Copyright (c) 2020-2021 CompanyNameMagicTag. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APP_VIEW_IDS_H +#define APP_VIEW_IDS_H + +#include + +/* + * 基础应用的view id,与MVP的V一一对应 + * 枚举命名要求:参考View名字,名字尽量简短 + */ +typedef enum : uint16_t +{ + VIEW_INVALID = 0, + VIEW_MAIN = 1, + VIEW_SETTING = 2, + VIEW_APPLIST = 3, + VIEW_SETTING_FIRST = 4, + VIEW_MAIN_SAMPLE = 5, + VIEW_MAIN_ALARM = 6, + VIEW_MAIN_ACTIVITY = 7, + VIEW_ALARM_POP_UP, + VIEW_CALLER_SAMPLE, + VIEW_MAEKPHONE_SAMPLE, + VIEW_BLOODOXY_SAMPLE, + VIEW_BLUETOOTH_EARPHONE, + VIEW_OFFLINEVOICE, + VIEW_WIFI, + VIEW_VOLUME, + VIEW_CONNECT_PHONE, + VIEW_MAIN_TEMP, + VIEW_INDOORWALK, + VIEW_REBOOT, + VIEW_UISAMPLE, // 实例 + VIEW_GETPIC, // 手势拍照 + VIEW_TAKEPIC, // 拍照 + + VIEW_BLOOD, // 血氧 + VIEW_BLOODSHOW, // 血氧说明 + VIEW_BLOODCHECK, // 血氧检查 + VIEW_BLOODERROR, // 血氧监测错误 + VIEW_BLOODNOTE, // 血氧过低提醒 + + VIEW_DIAL, // 表盘 + VIEW_DIALSETUP, // 表盘安装 + VIEW_DIALSUCCES, // 表盘安装成功 + + VIEW_SAVEELE, // 省电模式 + VIEW_SAVEBAT, // 省电模式界面 + + VIEW_COMPASS, // 指南针 + VIEW_COMPASS_PLACE_MAKER, // 指南针:放置标记点 + VIEW_COMPASS_MAKER_POINT, // 指南针:标记点介绍 + VIEW_COMPASS_START_PATH_RECORD, // 指南针:开始路径记录 + VIEW_COMPASS_END_PATH_RECORD, // 指南针:结束路径记录 + VIEW_COMPASS_PATH_BACKTRACKING, // 指南针:路径回溯 + VIEW_COMPASS_RESET_PLACE_MAKER, // 指南针:重置标记点 + VIEW_COMPASS_PATH_RETRACING, // 指南针:路径回溯中 + VIEW_COMPASS_GPS_LOSS, // 指南针:GPS丢失 + VIEW_COMPASS_END_BACK_TRACKING, // 指南针:结束路径回溯 + VIEW_COMPASS_END_BACK_TRACKING_EARLY, // 指南针:提前结束路径回溯 + VIEW_SPORT, // 活动 + + VIEW_HEARTRATEREMIND, // 心率提醒 + + VIEW_TRAINING, // 训练 + VIEW_TRAININGMORE, // 更多训练 + VIEW_TRAININGLIMIT, // 极限运动子列表 + VIEW_TRAININGNOMAL, // 正常训练开始界面(除骑行,健走,跑步外) + VIEW_TRAININGSET, // 训练目标(时长,卡路里) + VIEW_TRAININGSETTIME, // 设置训练时长 + VIEW_TRAININGSETCALULI, // 设置训练卡路里 + VIEW_TRAININGCRAD, // 训练卡片 + VIEW_TRAININGCONTROL, // 训练控制(包括结束,暂停,继续训练) + VIEW_TRAININGDATA, // 训练数据 + VIEW_TRAININGDETAIL, // 详细训练数据 + VIEW_TRAININGENDNOTE, // 结束训练提醒 + VIEW_TRAININGENDDATA, // 训练结束详细数据 + VIEW_TRAININGGPS, // GPS训练 + VIEW_TRAININGGPSLACK, // 缺少GPS + VIEW_TRAININGGPSNOTE, // 连接GPS提醒 + + VIEW_TRAINING_RECORD, // 训练记录 + + VIEW_BLOODPRESSURE, // 昨日睡眠时间 + VIEW_SLEEPTIME, // 睡眠详细数据 + VIEW_SLEEPACT, // 睡眠事项说明 + VIEW_MUSIC, // 音乐 + VIEW_WEATHER, // 天气 + VIEW_WEATHER_REPORT, // 气象报告 + VIEW_FUTURE_WEATHER, // 未来天气 + VIEW_GET_WEATHER_DATA_ERROR, // 获取天气数据失败 + VIEW_RECORD, // 录音 + // 录音 + VIEW_RECORD_LIST, + VIEW_RECORD_PLAY, + VIEW_RECORD_DELETE, + VIEW_RECORD_GOING, + // 电话 + VIEW_PHONE, // 电话 + VIEW_PHONECALL, // 拨号 + VIEW_PHONERING, // 拨号界面 + VIEW_PHONECALLING, // 来电 + VIEW_PHONECALLUP, // 通话界面 + VIEW_PHONEDIR, // 电话簿 + VIEW_MAIN_STOPWATCH,// 秒表主视图 + VIEW_STOPWATCH_RECORD_CYCLE_TO_LIMIT, //秒表记录圈速到达上限 + VIEW_STOPWATCH_RECORD_TIME_TO_LIMIT, //秒表记录时间到达上限 + VIEW_MAIN_COUNTDOWN,// 倒计时主视图 + VIEW_COUNTDOWN_TIME_CONFIG,//倒计时时间配置 + VIEW_START_COUNTDOWN,//开始倒计时 + VIEW_COUNTDOWN_TIME_NOT_NULL,//倒计时时间不能为0 + VIEW_BLUETOOTH, // 蓝牙 + // 设置 + VIEW_DISPLAY_BRIGHTNESS, // 屏幕与亮度 + VIEW_CONNECT_BLUETOOTH, // 蓝牙 + VIEW_SOUND_VIBRATION, // 声音与震动 + VIEW_SYSTEM_VOLUME, // 系统音量 + VIEW_CALL_VOLUME, // 通话音量 + VIEW_MEDIA_VOLUME, // 媒体音量 + VIEW_SECONDARY_FUNCTION, //辅助功能 + VIEW_SYSTEM, // 系统 + // 系统 + VIEW_SYSTEM_ABOUT_WATCH, // 系统:关于手表 + VIEW_SYSTEM_SUPERVISE, // 系统:监管 + VIEW_SYSTEM_SYSTEM_LANGUAGE, // 系统:系统语言 + VIEW_SYSTEM_REBOOT, // 系统:重新启动 + VIEW_SYSTEM_SHOUTDOWN, // 系统:关机 + VIEW_SYSTEM_FACTORY_RESET, // 系统:恢复出厂设置 + VIEW_BRIGHTNESS_CONTROL, // 亮度调节 + VIEW_SCREEN_DURATION, // 亮屏时长 + //按键按下进入的视图 + VIEW_QUICK_ACCESS, // 快速访问 + VIEW_FAST_TRAINING, //快速训练 + VIEW_FAST_TRAINING_ATTENTION,//快速训练项目选择超出提示 + VIEW_MAX_INTER_APP, // 在此之前添加native应用ID + VIEW_EXTERN_APP = 0xFFFE, // 三方应用 + VIEW_INVALIDE_APP = 0xFFFF, +} AppViewId; + +/* + * Slice页面优先级,越小优先级越高 + */ +typedef enum : uint16_t +{ + PRIO_0 = 0, + PRIO_1, + PRIO_2, + PRIO_3, + PRIO_4 +} AppPriority; + +#endif diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h index 1f6fec7e4..3684c83d9 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h @@ -1,114 +1,135 @@ -/* - * Copyright (c) 2020-2021 CompanyNameMagicTag. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef NATIVE_LAUNCHER_H -#define NATIVE_LAUNCHER_H -#include "AppViewIDs.h" - -namespace OHOS { -class NativeLauncher { -public: - static NativeLauncher &GetInstance(void); - void InitNativeLauncher(void); - void InitMainSlice(void); - void InitMainSampleSlice(void); - void InitSettingSlice(void); - void InitApplistSlice(void); - void InitMainAlarmSlice(void); - void InitAlarmPopUpSlice(void); - void InitActivitySlice(void); - void InitWeekStepSlice(void); - void InitBluetoothSlice(void); - void InitWifiView(void); - void InitMainBloodOxyView(void); - void InitMainCallerLogView(void); - void InitMainMakePhoneView(void); - void InitCompassSlice(void); - void InitOfflineVoice(void); - void InitConnectPhoneSlice(void); - void InitMainTempSlice(void); - void InitIndoorWalkSlice(void); - void InitRebootSlice(void); - void InitUISampleSlice(void); - void InitSaveEleSlice(void); - void InitSaveBatSlice(void); - void InitSleepSlice(void); - void InitSleepTimeSlice(void); - void InitSleepActSlice(void); - void InitGetPicSlice(void); - void InitTakePicSlice(void); - void InitBloodSlice(void); - void InitBloodShowSlice(void); - void InitBloodCheckSlice(void); - void InitBloodErrorSlice(void); - void InitBloodNoteSlice(void); - void InitDialSlice(void); - void InitHeartRemindSlice(void); - void InitPhoneSlice(void); - void InitPhoneCallSlice(void); - void InitPhoneDirSlice(void); - void InitPhoneCallingSlice(void); - void InitPhoneCallupSlice(void); - void InitPhoneRingSlice(void); - void InitTraingSlice(void); - void InitTraingMoreSlice(void); - void InitTraingLimitSlice(void); - void InitTraingNomalSlice(void); - void InitTraingSetSlice(void); - void InitTraingSetTimeSlice(void); - void InitUIDisplayBrightnessSlice(void); - void InitBlueToothSettingSlice(void); - void InitBrightnessControlSlice(void); - void InitScreenDurationSlice(void); - void InitSoundAndVibrationSlice(void); - void InitSystemVolumeSlice(void); - void InitCallVolumeSlice(void); - void InitMediaVolumeSlice(void); - void InitQuickAccessSlice(void); - void InitSystemSlice(void); - void InitSystemAboutWatchSlice(void); - void InitSystemSuperviseSlice(void); - void InitSystemLanguageSlice(void); - void InitSystemRebootSlice(void); - void InitSystemShoutDownSlice(void); - void InitSystemFactoryResetSlice(void); - void InitRecordingSlice(void); - void InitRecordingListSlice(void); - void InitRecordingPlaySlice(void); - void InitRecordingDeleteSlice(void); - void InitRecordingGoingSlice(void); - void InitCompassPlaceMakerSlice(void); - void InitCompassMakerPointSlice(void); - void InitCompassStartPathRecordSlice(void); - void InitCompassEndPathRecordSlice(void); - void InitCompassPathBackTrackingSlice(void); - void InitCompassResetPlaceMakerSlice(void); - void InitCompassPathRetracingSlice(void); - void InitCompassEndBackTrackingEarlySlice(); - void InitCompassEndBackTrackingSlice(void); - void InitCompassGPSLossSlice(void); - void InitSecondaryFunction(void); - void InitFastTrainingSlice(void); - void InitFastTrainingAttentionSlice(void); -private: - void InitAllNativeSlices(void); - - NativeLauncher(); - NativeLauncher(const NativeLauncher &); - NativeLauncher &operator=(const NativeLauncher &); - ~NativeLauncher(); -}; -} -#endif // NATIVE_LAUNCHER_H +/* + * Copyright (c) 2020-2021 CompanyNameMagicTag. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NATIVE_LAUNCHER_H +#define NATIVE_LAUNCHER_H +#include "AppViewIDs.h" + +namespace OHOS { +class NativeLauncher { +public: + static NativeLauncher &GetInstance(void); + void InitNativeLauncher(void); + void InitMainSlice(void); + void InitMainSampleSlice(void); + void InitSettingSlice(void); + void InitApplistSlice(void); + void InitMainAlarmSlice(void); + void InitAlarmPopUpSlice(void); + void InitActivitySlice(void); + void InitWeekStepSlice(void); + void InitBluetoothSlice(void); + void InitWifiView(void); + void InitMainBloodOxyView(void); + void InitMainCallerLogView(void); + void InitMainMakePhoneView(void); + void InitCompassSlice(void); + void InitOfflineVoice(void); + void InitConnectPhoneSlice(void); + void InitMainTempSlice(void); + void InitIndoorWalkSlice(void); + void InitRebootSlice(void); + void InitUISampleSlice(void); + void InitSaveEleSlice(void); + void InitSaveBatSlice(void); + void InitSleepSlice(void); + void InitSleepTimeSlice(void); + void InitSleepActSlice(void); + void InitGetPicSlice(void); + void InitTakePicSlice(void); + void InitBloodSlice(void); + void InitBloodShowSlice(void); + void InitBloodCheckSlice(void); + void InitBloodErrorSlice(void); + void InitBloodNoteSlice(void); + void InitDialSlice(void); + void InitHeartRemindSlice(void); + void InitPhoneSlice(void); + void InitPhoneCallSlice(void); + void InitPhoneDirSlice(void); + void InitPhoneCallingSlice(void); + void InitPhoneCallupSlice(void); + void InitPhoneRingSlice(void); + void InitTraingSlice(void); + void InitTraingMoreSlice(void); + void InitTraingLimitSlice(void); + void InitTraingNomalSlice(void); + void InitTraingSetSlice(void); + void InitTraingSetTimeSlice(void); + void InitTraingSetCaluliSlice(void); + void InitTraingControlSlice(void); + void InitTraingCardSlice(void); + void InitTraingDataSlice(void); + void InitTraingDetailSlice(void); + void InitTraingEndnoteSlice(void); + void InitTraingEnddataSlice(void); + void InitTraingGPSSlice(void); + void InitTraingGPSlackSlice(void); + void InitTraingGPSnoteSlice(void); + void InitUIDisplayBrightnessSlice(void); + void InitBlueToothSettingSlice(void); + void InitBrightnessControlSlice(void); + void InitScreenDurationSlice(void); + void InitSoundAndVibrationSlice(void); + void InitSystemVolumeSlice(void); + void InitCallVolumeSlice(void); + void InitMediaVolumeSlice(void); + void InitQuickAccessSlice(void); + void InitSystemSlice(void); + void InitSystemAboutWatchSlice(void); + void InitSystemSuperviseSlice(void); + void InitSystemLanguageSlice(void); + void InitSystemRebootSlice(void); + void InitSystemShoutDownSlice(void); + void InitSystemFactoryResetSlice(void); + void InitRecordingSlice(void); + void InitRecordingListSlice(void); + void InitRecordingPlaySlice(void); + void InitRecordingDeleteSlice(void); + void InitRecordingGoingSlice(void); + void InitCompassPlaceMakerSlice(void); + void InitCompassMakerPointSlice(void); + void InitCompassStartPathRecordSlice(void); + void InitCompassEndPathRecordSlice(void); + void InitCompassPathBackTrackingSlice(void); + void InitCompassResetPlaceMakerSlice(void); + void InitCompassPathRetracingSlice(void); + void InitCompassEndBackTrackingEarlySlice(); + void InitCompassEndBackTrackingSlice(void); + void InitCompassGPSLossSlice(void); + void InitSecondaryFunction(void); + void InitFastTrainingSlice(void); + void InitFastTrainingAttentionSlice(void); + void InitWeatherSlice(void); + void InitWeatherReportSlice(void); + void InitFutureWeatherSlice(void); + void InitGetWeatherDataErrorSlice(void); + void InitMainCountDownSlice(void); + void InitCountDownTimeConfigSlice(void); + void InitStartCountDownSlice(void); + void InitCountDownTimeNotNullSlice(void); + void InitMainStopWatchSlice(void); + void InitStopWatchRecordCycleToLimitSlice(void); + void InitStopWatchRecordTimeToLimitSlice(void); +private: + void InitAllNativeSlices(void); + + NativeLauncher(); + NativeLauncher(const NativeLauncher &); + NativeLauncher &operator=(const NativeLauncher &); + ~NativeLauncher(); +}; +} +#endif // NATIVE_LAUNCHER_H diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp index 0b9b54d6d..d211d9967 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp @@ -1,1117 +1,1340 @@ -/* - * Copyright (c) 2020-2021 CompanyNameMagicTag. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "NativeLauncher.h" -#include "MainView.h" -#include "MainPresenter.h" -#include "SliceProxy.h" -#include "AbilitySliceProxy.h" -#include "wearable_log.h" -#include "MainViewSample.h" -#include "MainPresenterSample.h" -#include "SettingView.h" -#include "SettingPresenter.h" -#include "ApplistView.h" -#include "ApplistPresenter.h" -#include "BloodOxygenView.h" -#include "BloodOxygenPresenter.h" -#include "CallerLogView.h" -#include "CallerLogPresenter.h" -#include "MainCallingView.h" -#include "MainCallingPresenter.h" -#include "ActivityPresenter.h" -#include "MainAlarmView.h" -#include "AlarmPresenter.h" -#include "AlarmPopUpPresenter.h" -#include "AlarmPopUpView.h" -#include "MainBluetoothView.h" -#include "BluetoothPresenter.h" -#include "PlayersModel.h" -#include "HealthModel.h" -#include "PresenterTask.h" -#include "MainCompassPresenter.h" -#include "MainCompassView.h" -#include "CallerLogModel.h" -#include "VocassistPresenter.h" -#include "MainVocassistView.h" -#include "VocassistModel.h" -#include "ConnectPhonePresenter.h" -#include "ConnectPhoneView.h" -#include "ScreenModels.h" -#include "TempMainView.h" -#include "TempPresenter.h" -#include "IndoorWalkPresenter.h" -#include "IndoorWalkView.h" -#include "RebootView.h" -#include "RebootPresenter.h" -#include "UISampleView.h" -#include "UISamplePresenter.h" -#include "BluetoothHeadsetEvent.h" -#include "graphic_hardware_config.h" -#include "graphic_service.h" -#include "common/graphic_startup.h" -#include "saveele/include/SaveEleView.h" -#include "saveele/include/SaveElePresenter.h" -#include "saveele/include/SaveBatView.h" -#include "saveele/include/SaveBatPresenter.h" -#include "sleep/include/SleepView.h" -#include "sleep/include/SleepPresenter.h" -#include "sleep/include/SleepTimeView.h" -#include "sleep/include/SleepTimePresenter.h" -#include "sleep/include/SleepActView.h" -#include "sleep/include/SleepActPresenter.h" -#include "getpic/include/GetPicView.h" -#include "getpic/include/GetPicPresenter.h" -#include "getpic/include/TakePicView.h" -#include "getpic/include/TakePicPresenter.h" -#include "phone/include/PhoneView.h" -#include "phone/include/PhonePresenter.h" -#include "phone/include/PhoneCallView.h" -#include "phone/include/PhoneCallPresenter.h" -#include "phone/include/PhoneDirView.h" -#include "phone/include/PhoneDirPresenter.h" -#include "phone/include/PhoneCallingView.h" -#include "phone/include/PhoneCallingPresenter.h" -#include "phone/include/PhoneCallupView.h" -#include "phone/include/PhoneCallupPresenter.h" -#include "phone/include/PhoneRingView.h" -#include "phone/include/PhoneRingPresenter.h" -#include "blood/include/BloodView.h" -#include "blood/include/BloodPresenter.h" -#include "blood/include/BloodCheckPresenter.h" -#include "blood/include/BloodCheckView.h" -#include "blood/include/BloodShowPresenter.h" -#include "blood/include/BloodShowView.h" -#include "blood/include/BloodErrorPresenter.h" -#include "blood/include/BloodNoteView.h" -#include "blood/include/BloodNotePresenter.h" -#include "dial/include/DialPresenter.h" -#include "dial/include/DialView.h" -#include "heartrate/include/HeartRemindPresenter.h" -#include "heartrate/include/HeartRemindView.h" -#include "traing/include/TraingPresenter.h" -#include "traing/include/TraingView.h" -#include "traing/include/TraingMorePresenter.h" -#include "traing/include/TraingMoreView.h" -#include "traing/include/TraingLimitPresenter.h" -#include "traing/include/TraingLimitView.h" -#include "traing/include/TraingNomalPresenter.h" -#include "traing/include/TraingNomalView.h" -#include "traing/include/TraingSetPresenter.h" -#include "traing/include/TraingSetView.h" -#include "traing/include/TraingSetTimePresenter.h" -#include "traing/include/TraingSetTimeView.h" -#include "displaybrightness/include/DisplayBrightnessPresenter.h" -#include "displaybrightness/include/DisplayBrightnessView.h" -#include "bluetoothofsetting/include/BlueToothOfSettingPresenter.h" -#include "bluetoothofsetting/include/BlueToothOfSettingView.h" -#include "displaybrightness/include/BrightnessControlPresenter.h" -#include "displaybrightness/include/BrightnessControlView.h" -#include "displaybrightness/include/ScreenDurationPresenter.h" -#include "displaybrightness/include/ScreenDurationView.h" -#include "soundandvibration/include/SoundAndVibrationPresenter.h" -#include "soundandvibration/include/SoundAndVibrationView.h" -#include "soundandvibration/include/SystemVolumePresenter.h" -#include "soundandvibration/include/SystemVolumeView.h" -#include "soundandvibration/include/CallVolumePresenter.h" -#include "soundandvibration/include/CallVolumeView.h" -#include "soundandvibration/include/MediaVolumePresenter.h" -#include "soundandvibration/include/MediaVolumeView.h" -#include "secondaryfunction/include/QuickAccessPresenter.h" -#include "secondaryfunction/include/QuickAccessView.h" -#include "system/include/SystemPresenter.h" -#include "system/include/SystemView.h" -#include "system/include/SystemAboutPresenter.h" -#include "system/include/SystemAboutView.h" -#include "system/include/SystemSupervisePresenter.h" -#include "system/include/SystemSuperviseView.h" -#include "system/include/SystemLanguagePresenter.h" -#include "system/include/SystemLanguageView.h" -#include "system/include/SystemRebootPresenter.h" -#include "system/include/SystemRebootView.h" -#include "system/include/SystemShoutDownPresenter.h" -#include "system/include/SystemShoutDownView.h" -#include "system/include/SystemFactoryResetPresenter.h" -#include "system/include/SystemFactoryResetView.h" -#include "record/include/RecordPresenter.h" -#include "record/include/RecordView.h" -#include "record/include/RecordListPresenter.h" -#include "record/include/RecordListView.h" -#include "record/include/RecordPlayPresenter.h" -#include "record/include/RecordPlayView.h" -#include "record/include/RecordDeletePresenter.h" -#include "record/include/RecordDeleteView.h" -#include "record/include/RecordGoingPresenter.h" -#include "record/include/RecordGoingView.h" -#include "PlaceMakerCompassPresenter.h" -#include "PlaceMakerCompassView.h" -#include "MakerPointCompassPresenter.h" -#include "MakerPointCompassView.h" -#include "StartPathRecordCompassPresenter.h" -#include "StartPathRecordCompassView.h" -#include "EndPathRecordCompassPresenter.h" -#include "EndPathRecordCompassView.h" -#include "PathBackTrackingCompassPresenter.h" -#include "PathBackTrackingCompassView.h" -#include "ResetPlaceMakerCompassPresenter.h" -#include "ResetPlaceMakerCompassView.h" -#include "PathRetracingCompassPresenter.h" -#include "PathRetracingCompassView.h" -#include "EndBackTrackingEarlyCompassPresenter.h" -#include "EndBackTrackingEarlyCompassView.h" -#include "EndBackTrackingCompassPresenter.h" -#include "EndBackTrackingCompassView.h" -#include "GPSLossCompassPresenter.h" -#include "GPSLossCompassView.h" -#include "secondaryfunction/include/SecondaryFunctionPresenter.h" -#include "secondaryfunction/include/SecondaryFunctionView.h" -#include "secondaryfunction/include/FastTrainingPresenter.h" -#include "secondaryfunction/include/FastTrainingView.h" -#include "secondaryfunction/include/FastTrainingAttentionPresenter.h" -#include "secondaryfunction/include/FastTrainingAttentionView.h" -namespace OHOS { -struct AppViewMapper -{ - AppViewId id; - void (NativeLauncher::*func)(void); -}; - -struct ViewIdToString -{ - AppViewId id; - char idForUikit[256]; -}; - -static const AppViewMapper SLICE_MAPPER[] = { - {VIEW_MAIN, &NativeLauncher::InitMainSlice}, - {VIEW_SETTING, &NativeLauncher::InitSettingSlice}, - {VIEW_APPLIST, &NativeLauncher::InitApplistSlice}, - {VIEW_MAIN_SAMPLE, &NativeLauncher::InitMainSampleSlice}, - {VIEW_MAIN_ALARM, &NativeLauncher::InitMainAlarmSlice}, - {VIEW_ALARM_POP_UP, &NativeLauncher::InitAlarmPopUpSlice}, - {VIEW_BLOODOXY_SAMPLE, &NativeLauncher::InitMainBloodOxyView}, - {VIEW_MAIN_ACTIVITY, &NativeLauncher::InitActivitySlice}, - {VIEW_CALLER_SAMPLE,&NativeLauncher::InitMainCallerLogView}, - {VIEW_MAEKPHONE_SAMPLE,&NativeLauncher::InitMainMakePhoneView}, - {VIEW_BLUETOOTH_EARPHONE, &NativeLauncher::InitBluetoothSlice}, - {VIEW_COMPASS, &NativeLauncher::InitCompassSlice}, - {VIEW_OFFLINEVOICE, &NativeLauncher::InitOfflineVoice}, - {VIEW_CONNECT_PHONE, &NativeLauncher::InitConnectPhoneSlice}, - {VIEW_MAIN_TEMP, &NativeLauncher::InitMainTempSlice}, - {VIEW_INDOORWALK, &NativeLauncher::InitIndoorWalkSlice}, - {VIEW_REBOOT, &NativeLauncher::InitRebootSlice}, - {VIEW_SAVEELE, &NativeLauncher::InitSaveEleSlice}, - {VIEW_SAVEBAT, &NativeLauncher::InitSaveBatSlice}, - {VIEW_BLOODPRESSURE, &NativeLauncher::InitSleepSlice}, - {VIEW_SLEEPTIME, &NativeLauncher::InitSleepTimeSlice}, - {VIEW_SLEEPACT, &NativeLauncher::InitSleepActSlice}, - {VIEW_GETPIC, &NativeLauncher::InitGetPicSlice}, //拍照 - {VIEW_TAKEPIC, &NativeLauncher::InitTakePicSlice}, - {VIEW_PHONE, &NativeLauncher::InitPhoneSlice}, //电话 - {VIEW_PHONECALL, &NativeLauncher::InitPhoneCallSlice}, - {VIEW_PHONEDIR, &NativeLauncher::InitPhoneDirSlice}, - {VIEW_PHONECALLING, &NativeLauncher::InitPhoneCallingSlice}, - {VIEW_PHONECALLUP, &NativeLauncher::InitPhoneCallupSlice}, - {VIEW_PHONERING, &NativeLauncher::InitPhoneRingSlice}, - {VIEW_BLOOD, &NativeLauncher::InitBloodSlice}, //血氧 - {VIEW_BLOODSHOW, &NativeLauncher::InitBloodShowSlice}, - {VIEW_BLOODCHECK, &NativeLauncher::InitBloodCheckSlice}, - {VIEW_BLOODERROR, &NativeLauncher::InitBloodErrorSlice}, - {VIEW_BLOODNOTE, &NativeLauncher::InitBloodNoteSlice}, - {VIEW_DIAL, &NativeLauncher::InitDialSlice}, //表盘 - {VIEW_HEARTRATEREMIND, &NativeLauncher::InitHeartRemindSlice}, - - {VIEW_TRAINING, &NativeLauncher::InitTraingSlice}, //训练 - {VIEW_TRAININGMORE, &NativeLauncher::InitTraingMoreSlice}, //更多训练 - {VIEW_TRAININGLIMIT, &NativeLauncher::InitTraingLimitSlice}, //极限训练 - {VIEW_TRAININGNOMAL, &NativeLauncher::InitTraingNomalSlice}, //正常训练初始界面 - {VIEW_TRAININGSET, &NativeLauncher::InitTraingSetSlice}, //训练目标设置界面 - {VIEW_TRAININGSETTIME, &NativeLauncher::InitTraingSetTimeSlice}, //设置目标时长 - - {VIEW_DISPLAY_BRIGHTNESS,&NativeLauncher::InitUIDisplayBrightnessSlice}, //显示与亮度的实例化地址 - {VIEW_CONNECT_BLUETOOTH,&NativeLauncher::InitBlueToothSettingSlice}, //蓝牙设置的实例化地址 - {VIEW_BRIGHTNESS_CONTROL,&NativeLauncher::InitBrightnessControlSlice}, //调节亮度的实例化地址 - {VIEW_SCREEN_DURATION,&NativeLauncher::InitScreenDurationSlice}, //亮屏时长实例化地址 - {VIEW_SOUND_VIBRATION,&NativeLauncher::InitSoundAndVibrationSlice}, //声音与震动实例化地址 - {VIEW_SYSTEM_VOLUME,&NativeLauncher::InitSystemVolumeSlice}, //系统音量 - {VIEW_QUICK_ACCESS,&NativeLauncher::InitQuickAccessSlice}, //快速访问实例化地址 - {VIEW_SYSTEM,&NativeLauncher::InitSystemSlice}, //系统实例化地址 - {VIEW_SYSTEM_ABOUT_WATCH,&NativeLauncher::InitSystemAboutWatchSlice}, //系统:关于手表实例化地址 - {VIEW_SYSTEM_SUPERVISE,&NativeLauncher::InitSystemSuperviseSlice}, //系统:监管实例化地址 - {VIEW_SYSTEM_SYSTEM_LANGUAGE,&NativeLauncher::InitSystemLanguageSlice}, //系统:系统语言实例化地址 - {VIEW_SYSTEM_REBOOT,&NativeLauncher::InitSystemRebootSlice}, //系统:重启实例化地址 - {VIEW_SYSTEM_SHOUTDOWN,&NativeLauncher::InitSystemShoutDownSlice}, //系统:关机实例化地址 - {VIEW_SYSTEM_FACTORY_RESET,&NativeLauncher::InitSystemFactoryResetSlice}, //系统:恢复出厂设置实例化地址 - {VIEW_RECORD,&NativeLauncher::InitRecordingSlice}, //录音实例化地址 - {VIEW_RECORD_LIST,&NativeLauncher::InitRecordingListSlice}, - {VIEW_RECORD_PLAY,&NativeLauncher::InitRecordingPlaySlice}, - {VIEW_RECORD_DELETE,&NativeLauncher::InitRecordingDeleteSlice}, - {VIEW_RECORD_DELETE,&NativeLauncher::InitRecordingDeleteSlice}, - {VIEW_RECORD_GOING,&NativeLauncher::InitRecordingGoingSlice}, - {VIEW_COMPASS_PLACE_MAKER,&NativeLauncher::InitCompassPlaceMakerSlice}, //指南针放置标记点实例化地址 - {VIEW_COMPASS_MAKER_POINT,&NativeLauncher::InitCompassMakerPointSlice}, //指南针标记点介绍实例化地址 - {VIEW_COMPASS_START_PATH_RECORD,&NativeLauncher::InitCompassStartPathRecordSlice}, //指南针开始路径记录实例化地址 - {VIEW_COMPASS_END_PATH_RECORD,&NativeLauncher::InitCompassEndPathRecordSlice}, //指南针结束路径记录实例化地址 - {VIEW_COMPASS_PATH_BACKTRACKING,&NativeLauncher::InitCompassPathBackTrackingSlice}, //指南针路径回溯实例化地址 - {VIEW_COMPASS_RESET_PLACE_MAKER,&NativeLauncher::InitCompassResetPlaceMakerSlice}, //指南针重置标记点实例化地址 - {VIEW_COMPASS_PATH_RETRACING,&NativeLauncher::InitCompassPathRetracingSlice}, //指南针路径回溯实例化地址 - {VIEW_COMPASS_END_BACK_TRACKING,&NativeLauncher::InitCompassEndBackTrackingSlice}, //指南针结束路径回溯 - {VIEW_COMPASS_END_BACK_TRACKING_EARLY,&NativeLauncher::InitCompassEndBackTrackingEarlySlice},//指南针提前结束路径回溯 - {VIEW_COMPASS_GPS_LOSS,&NativeLauncher::InitCompassGPSLossSlice}, //指南针GPS丢失实例化地址 - {VIEW_SECONDARY_FUNCTION,&NativeLauncher::InitSecondaryFunction}, //按键按下进入辅助功能 - {VIEW_FAST_TRAINING,&NativeLauncher::InitFastTrainingSlice}, //快速训练 - {VIEW_FAST_TRAINING_ATTENTION,&NativeLauncher::InitFastTrainingAttentionSlice}, //快速训练 - {VIEW_UISAMPLE, &NativeLauncher::InitUISampleSlice} -}; - -static const ViewIdToString VIEW_MAPPER[] = { - {VIEW_MAIN, "main"}, - {VIEW_SETTING, "setting"}, - {VIEW_APPLIST, "applist"}, - {VIEW_MAIN_SAMPLE, "mainViewSample"}, - {VIEW_MAIN_ALARM, "mainAlarmView"}, - {VIEW_ALARM_POP_UP, "alarmPopUpView"}, - {VIEW_BLOODOXY_SAMPLE, "bloodOxygenView"}, - {VIEW_MAIN_ACTIVITY, "mainActivityView"}, - {VIEW_CALLER_SAMPLE, "callerLogView"}, - {VIEW_MAEKPHONE_SAMPLE, "makePhoneView"}, - {VIEW_BLUETOOTH_EARPHONE, "mainBluetoothView"}, - {VIEW_COMPASS, "mainCompassView"}, - {VIEW_OFFLINEVOICE, "offlineVoiceView"}, - {VIEW_CONNECT_PHONE, "ConnectPhoneView"}, - {VIEW_MAIN_TEMP, "mianTempView"}, - {VIEW_INDOORWALK, "IndoorWalkView"}, - {VIEW_REBOOT, "RebootView"}, - {VIEW_DISPLAY_BRIGHTNESS,"DisplayBrightness"}, //显示与亮度 - {VIEW_CONNECT_BLUETOOTH,"BlueToothSetting"}, //蓝牙 - {VIEW_BRIGHTNESS_CONTROL,"BrightnessControl"}, //亮度调节 - {VIEW_SCREEN_DURATION,"ScreenDuration"}, //亮屏时长 - {VIEW_SOUND_VIBRATION,"SoundAndVibration"}, //声音与震动 - {VIEW_SYSTEM_VOLUME,"SystemVolume"}, //系统音量 - {VIEW_QUICK_ACCESS,"QuickAccess"}, //快速访问 - {VIEW_SYSTEM,"System"}, //系统 - {VIEW_SYSTEM_ABOUT_WATCH,"SystemAboutWatch"}, //系统:关于手表 - {VIEW_SYSTEM_SUPERVISE,"SystemSupervise"}, //系统:监管 - {VIEW_SYSTEM_SYSTEM_LANGUAGE,"SystemLanguage"}, //系统:系统语言 - {VIEW_SYSTEM_REBOOT,"SystemReboot"}, //系统:重新启动 - {VIEW_SYSTEM_SHOUTDOWN,"SystemShoutDown"}, //系统:关机 - {VIEW_SYSTEM_FACTORY_RESET,"SystemFactoryReset"},//系统:恢复出厂设置 - {VIEW_RECORD,"Recording"}, //录音 - {VIEW_RECORD_LIST,"RecordingList"}, - {VIEW_RECORD_PLAY,"RecordingPlay"}, - {VIEW_RECORD_DELETE,"RecordingDelete"}, - {VIEW_RECORD_GOING,"RecordingGoing"}, - {VIEW_COMPASS_PLACE_MAKER,"PlaceMakerCompass"}, //指南针放置标记点 - {VIEW_COMPASS_MAKER_POINT,"MakerPointCompass"}, //指南针标记点介绍 - {VIEW_COMPASS_START_PATH_RECORD,"StartPathRecordCompass"}, //指南针开始路径记录 - {VIEW_COMPASS_END_PATH_RECORD,"StartPathRecordCompass"}, //指南针结束路径记录 - {VIEW_COMPASS_PATH_BACKTRACKING,"PathBackTrackingCompass"}, //指南针路径回溯 - {VIEW_COMPASS_RESET_PLACE_MAKER,"ResetPlaceMakerCompass"}, //指南针重置路径标记点 - {VIEW_COMPASS_PATH_RETRACING,"PathRetracingCompass"}, //指南针路径回溯中 - {VIEW_COMPASS_END_BACK_TRACKING_EARLY,"EndBackTrackingEarlyCompass"},//指南针提前结束路径回溯 - {VIEW_COMPASS_END_BACK_TRACKING,"EndBackTrackingCompass"}, //指南针提前结束路径回溯 - {VIEW_COMPASS_GPS_LOSS,"GPSLossCompass"}, //指南针GPS丢失 - {VIEW_SECONDARY_FUNCTION,"SecondaryFunction"}, //辅助功能 - {VIEW_FAST_TRAINING,"FastTraining"}, //快速训练 - {VIEW_FAST_TRAINING_ATTENTION,"FastTrainingAttention"}, - {VIEW_UISAMPLE, "UISample"} -}; - -NativeLauncher::NativeLauncher() {} -NativeLauncher::~NativeLauncher() {} - -NativeLauncher &NativeLauncher::GetInstance(void) -{ - static NativeLauncher instance; - return instance; -} - -void NativeLauncher::InitNativeLauncher() { - GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "NativeLauncher::InitNativeLauncher"); - // 初始化所有预加载slice - InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化 - InitAllNativeSlices(); - CallerLogModel::GetInstance()->InitPhoneService(); - PresenterTask::GetInstance()->Init(); - PlayersModel::GetInstance()->AudioInit(); - ActivityModel::GetInstance()->Init(); - ScreenModels::GetInstance()->InitCardConfig(); - VocassistModel::GetInstance()->Init(); - HeartModel::GetInstance()->Init(); - BluetoothModel::GetInstance()->Init(); - // 初始化默认首页 - ScreenModels::GetInstance()->PreLoadAppimages(); - NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN_SAMPLE); -} - -void NativeLauncher::InitAllNativeSlices(void) -{ - uint16_t size = sizeof(SLICE_MAPPER) / sizeof(SLICE_MAPPER[0]); - for (int index = 0; index < size; index++) { - if ((SLICE_MAPPER[index].id >= VIEW_MAX_INTER_APP)) { - continue; - } - (this->*(SLICE_MAPPER[index].func))(); - } - return; -} - -void NativeLauncher::InitMainSlice(void) -{ - SliceProxy *mainSlice = new AbilitySliceProxy; - if (mainSlice != nullptr) { - NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN, mainSlice); - } -} - - -void NativeLauncher::InitMainSampleSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainSampleSlice"); - SliceProxy *mainViewSample = new AbilitySliceProxy; - if (mainViewSample == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainViewSample is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_SAMPLE, mainViewSample); -} - -void NativeLauncher::InitMainAlarmSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainAlarmSlice"); - SliceProxy *mainAlarmView = new AbilitySliceProxy; - if (mainAlarmView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainAlarmView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_ALARM, mainAlarmView); -} - -void NativeLauncher::InitMainTempSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainTempSlice"); - SliceProxy *mainTempView = new AbilitySliceProxy; - if (mainTempView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainTempView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_TEMP, mainTempView); -} - -void NativeLauncher::InitCompassSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::MainCompassView"); - SliceProxy *mainCompassView = new AbilitySliceProxy; - if (mainCompassView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainCompassView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS, mainCompassView); -} - -void NativeLauncher::InitIndoorWalkSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::IndoorWalkView"); - SliceProxy *indoorWalkView = new AbilitySliceProxy; - if (indoorWalkView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "indoorWalkView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_INDOORWALK, indoorWalkView); -} - -void NativeLauncher::InitRebootSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::RebootView"); - SliceProxy *rebootView = new AbilitySliceProxy; - if (rebootView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "rebootView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_REBOOT, rebootView); -} - -void NativeLauncher::InitConnectPhoneSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::ConnectPhoneView"); - SliceProxy *connectPhoneView = new AbilitySliceProxy; - if (connectPhoneView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "connectPhoneView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_CONNECT_PHONE, connectPhoneView); -} - -void NativeLauncher::InitAlarmPopUpSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitAlarmPopUpSlice"); - SliceProxy *alarmPopUpView = new AbilitySliceProxy; - if (alarmPopUpView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainAlarmView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_ALARM_POP_UP, alarmPopUpView); -} - -void NativeLauncher::InitMainBloodOxyView(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainBloodOxyView"); - SliceProxy *bloodOxygenView = new AbilitySliceProxy; - if (bloodOxygenView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodOxygenView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODOXY_SAMPLE, bloodOxygenView); -} - -void NativeLauncher::InitMainMakePhoneView(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainMakePhoneView"); - SliceProxy *makePhoneView = new AbilitySliceProxy; - if (makePhoneView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makePhoneView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_MAEKPHONE_SAMPLE, makePhoneView); -} - -void NativeLauncher::InitMainCallerLogView(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainCallerLogView"); - SliceProxy *callerLogView = new AbilitySliceProxy; - if (callerLogView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "callerLogView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_CALLER_SAMPLE, callerLogView); -} - -void NativeLauncher::InitActivitySlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitWeekStepSlice"); - SliceProxy *mainActivityView = new AbilitySliceProxy; - if (mainActivityView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainActivityView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_ACTIVITY, mainActivityView); -} - -void NativeLauncher::InitBluetoothSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeAbility::InitBluetoothSlice"); - SliceProxy *mainBluetoothView = new AbilitySliceProxy; - if (mainBluetoothView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainBluetoothView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_BLUETOOTH_EARPHONE, mainBluetoothView); -} - -void NativeLauncher::InitSettingSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSettingSlice"); - SliceProxy *settingView = new AbilitySliceProxy; - if (settingView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "settingView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SETTING, settingView); -} - -void NativeLauncher::InitApplistSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitApplistSlice"); - SliceProxy *applistView = new AbilitySliceProxy; - if (applistView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "applistView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_APPLIST, applistView); -} - -void NativeLauncher::InitOfflineVoice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitOfflineVoice"); - SliceProxy *offlineVoiceView = new AbilitySliceProxy; - if (offlineVoiceView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "offlineVoiceView is nullptr"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_OFFLINEVOICE, offlineVoiceView); -} - -void NativeLauncher::InitUISampleSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitUISampleSlice"); - SliceProxy *uisampleView = new AbilitySliceProxy; - if (uisampleView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uisampleView"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_UISAMPLE, uisampleView); -} -// 省电模式 -void NativeLauncher::InitSaveEleSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSaveEleSlice"); - SliceProxy *saveeleview = new AbilitySliceProxy; - if (saveeleview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "saveeleview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SAVEELE, saveeleview); -} - -void NativeLauncher::InitSaveBatSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSaveBatSlice"); - SliceProxy *savebatview = new AbilitySliceProxy; - if (savebatview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "savebatview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SAVEBAT, savebatview); -} -// 睡眠记录 -void NativeLauncher::InitSleepSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSleepSlice"); - SliceProxy *sleepview = new AbilitySliceProxy; - if (sleepview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sleepview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODPRESSURE, sleepview); -} -void NativeLauncher::InitSleepTimeSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSleepTimeSlice"); - SliceProxy *sleeptimeview = new AbilitySliceProxy; - if (sleeptimeview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sleeptimeview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SLEEPTIME, sleeptimeview); -} -void NativeLauncher::InitSleepActSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSleepActSlice"); - SliceProxy *sleepactview = new AbilitySliceProxy; - if (sleepactview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sleepactview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SLEEPACT, sleepactview); -} - -void NativeLauncher::InitGetPicSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitGetPicSlice"); - SliceProxy *getpicview = new AbilitySliceProxy; - if (getpicview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "getpicview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_GETPIC, getpicview); -} - -void NativeLauncher::InitTakePicSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitTakePicSlice"); - SliceProxy *takepicview = new AbilitySliceProxy; - if (takepicview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "takepicview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_TAKEPIC, takepicview); -} - -void NativeLauncher::InitPhoneSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneSlice"); - SliceProxy *phoneview = new AbilitySliceProxy; - if (phoneview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phoneview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONE, phoneview); -} - -void NativeLauncher::InitPhoneCallSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneCallSlice"); - SliceProxy *phonecallview = new AbilitySliceProxy; - if (phonecallview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phonecallview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONECALL, phonecallview); -} - -void NativeLauncher::InitPhoneDirSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneCallSlice"); - SliceProxy *phonedirview = new AbilitySliceProxy; - if (phonedirview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phonedirview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONEDIR, phonedirview); -} - -void NativeLauncher::InitPhoneCallingSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneCallingSlice"); - SliceProxy *phonecallingview = new AbilitySliceProxy; - if (phonecallingview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phonecallingview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONECALLING, phonecallingview); -} - -void NativeLauncher::InitPhoneCallupSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneCallupSlice"); - SliceProxy *phonecallupview = new AbilitySliceProxy; - if (phonecallupview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phonecallview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONECALLUP, phonecallupview); -} - -void NativeLauncher::InitPhoneRingSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneRingSlice"); - SliceProxy *phoneringview = new AbilitySliceProxy; - if (phoneringview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phoneringview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONERING, phoneringview); -} - -void NativeLauncher::InitBloodSlice(void) //血氧 -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); - SliceProxy *bloodview = new AbilitySliceProxy; - if (bloodview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOOD, bloodview); -} - -void NativeLauncher::InitBloodShowSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); - SliceProxy *bloodshowview = new AbilitySliceProxy; - if (bloodshowview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODSHOW, bloodshowview); -} - -void NativeLauncher::InitBloodErrorSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); - SliceProxy *blooderrorview = new AbilitySliceProxy; - if (blooderrorview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODERROR, blooderrorview); -} - -void NativeLauncher::InitBloodCheckSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); - SliceProxy *bloodcheckview = new AbilitySliceProxy; - if (bloodcheckview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODCHECK, bloodcheckview); -} - -void NativeLauncher::InitBloodNoteSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); - SliceProxy *bloodnoteview = new AbilitySliceProxy; - if (bloodnoteview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodnoteview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODNOTE, bloodnoteview); -} - -void NativeLauncher::InitDialSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); - SliceProxy *dialview = new AbilitySliceProxy; - if (dialview == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "dialview"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_DIAL, dialview); -} - -void NativeLauncher::InitHeartRemindSlice(void) -{ - SliceProxy *heartremindview = new AbilitySliceProxy; - NativeAbility::GetInstance().AddSliceProxy(VIEW_HEARTRATEREMIND, heartremindview); -} - -//体能训练 -void NativeLauncher::InitTraingSlice(void) -{ - SliceProxy *traingview = new AbilitySliceProxy; - NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAINING, traingview); -} -void NativeLauncher::InitTraingMoreSlice(void) -{ - SliceProxy *traingmoreview = new AbilitySliceProxy; - NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGMORE, traingmoreview); -} -void NativeLauncher::InitTraingLimitSlice(void) -{ - SliceProxy *trainglimitview = new AbilitySliceProxy; - NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGLIMIT, trainglimitview); -} -void NativeLauncher::InitTraingNomalSlice(void) -{ - SliceProxy *traingnomalview = new AbilitySliceProxy; - NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGNOMAL, traingnomalview); -} -void NativeLauncher::InitTraingSetSlice(void) -{ - SliceProxy *traingsetview = new AbilitySliceProxy; - NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGSET, traingsetview); -} -void NativeLauncher::InitTraingSetTimeSlice(void) -{ - SliceProxy *traingsettimeview = new AbilitySliceProxy; - NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGSETTIME, traingsettimeview); -} - -//DisplayBrightness的实例化 -void NativeLauncher::InitUIDisplayBrightnessSlice(void) -{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitUISampleSlice"); - SliceProxy *uidisplaybrightnessView = new AbilitySliceProxy; - if (uidisplaybrightnessView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uidisplaybrightnessView"); - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_DISPLAY_BRIGHTNESS, uidisplaybrightnessView); -} - -void NativeLauncher::InitBlueToothSettingSlice(void) -{ - SliceProxy *bluetoothsetting = new AbilitySliceProxy; - if (bluetoothsetting == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_CONNECT_BLUETOOTH, bluetoothsetting); -} - -void NativeLauncher::InitBrightnessControlSlice(void) -{ - SliceProxy *brightnesscontrol = new AbilitySliceProxy; - if (brightnesscontrol == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_BRIGHTNESS_CONTROL, brightnesscontrol); -} - -void NativeLauncher::InitScreenDurationSlice(void) -{ - SliceProxy *ScreenDuration = new AbilitySliceProxy; - if (ScreenDuration == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SCREEN_DURATION, ScreenDuration); -} - -void NativeLauncher::InitSoundAndVibrationSlice(void) //声音与震动 -{ - SliceProxy *SoundAndVibration = new AbilitySliceProxy; - if (SoundAndVibration == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SOUND_VIBRATION, SoundAndVibration); -} - -void NativeLauncher::InitQuickAccessSlice(void) //快速访问 -{ - SliceProxy *QuickAccess = new AbilitySliceProxy; - if (QuickAccess == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_QUICK_ACCESS, QuickAccess); -} - -void NativeLauncher::InitSystemSlice(void) //系统 -{ - SliceProxy *system = new AbilitySliceProxy; - if (system == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM, system); -} -void NativeLauncher::InitSystemAboutWatchSlice(void) //系统:关于手表 -{ - SliceProxy *systemaboutwatch = new AbilitySliceProxy; - if (systemaboutwatch == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_ABOUT_WATCH, systemaboutwatch); -} - -void NativeLauncher::InitSystemSuperviseSlice(void) //系统:监管 -{ - SliceProxy *systemsupervise = new AbilitySliceProxy; - if (systemsupervise == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_SUPERVISE, systemsupervise); -} - -void NativeLauncher::InitSystemLanguageSlice(void) //系统:系统语言 -{ - SliceProxy *systemlanguage = new AbilitySliceProxy; - if (systemlanguage == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_SYSTEM_LANGUAGE, systemlanguage); -} -void NativeLauncher::InitSystemRebootSlice(void) //系统:重新启动 -{ - SliceProxy *systemreboot = new AbilitySliceProxy; - if (systemreboot == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_REBOOT, systemreboot); -} -void NativeLauncher::InitSystemShoutDownSlice(void) //系统:关机 -{ - SliceProxy *systemshoutdown = new AbilitySliceProxy; - if (systemshoutdown == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_SHOUTDOWN, systemshoutdown); -} -void NativeLauncher::InitSystemFactoryResetSlice(void) //系统:恢复出厂设置 -{ - SliceProxy *systemfactoryreset = new AbilitySliceProxy; - if (systemfactoryreset == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_FACTORY_RESET, systemfactoryreset); -} - -void NativeLauncher::InitSystemVolumeSlice(void) //系统音量 -{ - SliceProxy *systemvolume = new AbilitySliceProxy; - if (systemvolume == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_VOLUME, systemvolume); -} - -void NativeLauncher::InitRecordingSlice(void) //录音 -{ - SliceProxy *record = new AbilitySliceProxy; - if (record == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD, record); -} - -void NativeLauncher::InitRecordingListSlice(void) -{ - SliceProxy *recordlist = new AbilitySliceProxy; - if (recordlist == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD_LIST, recordlist); -} - -void NativeLauncher::InitRecordingPlaySlice(void) -{ - SliceProxy *recordplay = new AbilitySliceProxy; - if (recordplay == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD_PLAY, recordplay); -} -void NativeLauncher::InitRecordingDeleteSlice(void) -{ - SliceProxy *recorddelete = new AbilitySliceProxy; - if (recorddelete == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD_DELETE, recorddelete); -} - -void NativeLauncher::InitRecordingGoingSlice(void) //正在录音 -{ - SliceProxy *recordgoing = new AbilitySliceProxy; - if (recordgoing == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD_GOING, recordgoing); -} - -void NativeLauncher::InitCompassPlaceMakerSlice(void) //指南针:放置标记点 -{ - - SliceProxy *placemakercompass = new AbilitySliceProxy; - if (placemakercompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_PLACE_MAKER, placemakercompass); -} - -void NativeLauncher::InitCompassMakerPointSlice(void) //指南针:标记点介绍 -{ - SliceProxy *makerpointcompass = new AbilitySliceProxy; - if (makerpointcompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_MAKER_POINT, makerpointcompass); -} - -void NativeLauncher::InitCompassStartPathRecordSlice(void) //指南针:开始路径记录 -{ - SliceProxy *startpathrecordcompass = new AbilitySliceProxy; - if (startpathrecordcompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_START_PATH_RECORD, startpathrecordcompass); -} - -void NativeLauncher::InitCompassEndPathRecordSlice(void) //指南针:结束路径记录 -{ - SliceProxy *endtpathrecordcompass = new AbilitySliceProxy; - if (endtpathrecordcompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_END_PATH_RECORD, endtpathrecordcompass); -} - -void NativeLauncher::InitCompassPathBackTrackingSlice(void) //指南针:路径回溯 -{ - SliceProxy *pathbacktrackingcompass = new AbilitySliceProxy; - if (pathbacktrackingcompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_PATH_BACKTRACKING, pathbacktrackingcompass); -} - -void NativeLauncher::InitCompassResetPlaceMakerSlice(void) //指南针:重置标记点 -{ - SliceProxy *resetplacemakercompass = new AbilitySliceProxy; - if (resetplacemakercompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_RESET_PLACE_MAKER, resetplacemakercompass); -} - -void NativeLauncher::InitCompassPathRetracingSlice(void) //指南针:路径回溯中 -{ - SliceProxy *pathretracingcompass = new AbilitySliceProxy; - if (pathretracingcompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_PATH_RETRACING, pathretracingcompass); -} -void NativeLauncher::InitCompassEndBackTrackingEarlySlice() //指南针:提前结束路径回溯 -{ - SliceProxy *endbacktrackingearlycompass = new AbilitySliceProxy; - if (endbacktrackingearlycompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_END_BACK_TRACKING_EARLY, endbacktrackingearlycompass); -} - -void NativeLauncher::InitCompassEndBackTrackingSlice(void) //指南针:结束路径回溯 -{ - SliceProxy *endbacktrackingecompass = new AbilitySliceProxy; - if (endbacktrackingecompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_END_BACK_TRACKING, endbacktrackingecompass); -} - -void NativeLauncher::InitCompassGPSLossSlice(void) //指南针:GPS丢失 -{ - SliceProxy *GPSlosscompass = new AbilitySliceProxy; - if (GPSlosscompass == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_GPS_LOSS, GPSlosscompass); -} - -void NativeLauncher::InitSecondaryFunction(void) //辅助功能 -{ - SliceProxy *secondaryfunction = new AbilitySliceProxy; - if (secondaryfunction == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_SECONDARY_FUNCTION, secondaryfunction); -} - -void NativeLauncher::InitFastTrainingSlice(void) -{ - SliceProxy *fasttraining = new AbilitySliceProxy; - if (fasttraining == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_FAST_TRAINING, fasttraining); -} - -void NativeLauncher::InitFastTrainingAttentionSlice(void) -{ - SliceProxy *fasttrainingattention = new AbilitySliceProxy; - if (fasttrainingattention == nullptr) { - return; - } - NativeAbility::GetInstance().AddSliceProxy(VIEW_FAST_TRAINING_ATTENTION, fasttrainingattention); -} -} +/* + * Copyright (c) 2020-2021 CompanyNameMagicTag. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "NativeLauncher.h" +#include "MainView.h" +#include "MainPresenter.h" +#include "SliceProxy.h" +#include "AbilitySliceProxy.h" +#include "wearable_log.h" +#include "MainViewSample.h" +#include "MainPresenterSample.h" +#include "SettingView.h" +#include "SettingPresenter.h" +#include "ApplistView.h" +#include "ApplistPresenter.h" +#include "BloodOxygenView.h" +#include "BloodOxygenPresenter.h" +#include "CallerLogView.h" +#include "CallerLogPresenter.h" +#include "MainCallingView.h" +#include "MainCallingPresenter.h" +#include "ActivityPresenter.h" +#include "MainAlarmView.h" +#include "AlarmPresenter.h" +#include "AlarmPopUpPresenter.h" +#include "AlarmPopUpView.h" +#include "MainBluetoothView.h" +#include "BluetoothPresenter.h" +#include "PlayersModel.h" +#include "HealthModel.h" +#include "PresenterTask.h" +#include "MainCompassPresenter.h" +#include "MainCompassView.h" +#include "CallerLogModel.h" +#include "VocassistPresenter.h" +#include "MainVocassistView.h" +#include "VocassistModel.h" +#include "ConnectPhonePresenter.h" +#include "ConnectPhoneView.h" +#include "ScreenModels.h" +#include "TempMainView.h" +#include "TempPresenter.h" +#include "IndoorWalkPresenter.h" +#include "IndoorWalkView.h" +#include "RebootView.h" +#include "RebootPresenter.h" +#include "UISampleView.h" +#include "UISamplePresenter.h" +#include "BluetoothHeadsetEvent.h" +#include "graphic_hardware_config.h" +#include "graphic_service.h" +#include "common/graphic_startup.h" +#include "saveele/include/SaveEleView.h" +#include "saveele/include/SaveElePresenter.h" +#include "saveele/include/SaveBatView.h" +#include "saveele/include/SaveBatPresenter.h" +#include "sleep/include/SleepView.h" +#include "sleep/include/SleepPresenter.h" +#include "sleep/include/SleepTimeView.h" +#include "sleep/include/SleepTimePresenter.h" +#include "sleep/include/SleepActView.h" +#include "sleep/include/SleepActPresenter.h" +#include "getpic/include/GetPicView.h" +#include "getpic/include/GetPicPresenter.h" +#include "getpic/include/TakePicView.h" +#include "getpic/include/TakePicPresenter.h" +#include "phone/include/PhoneView.h" +#include "phone/include/PhonePresenter.h" +#include "phone/include/PhoneCallView.h" +#include "phone/include/PhoneCallPresenter.h" +#include "phone/include/PhoneDirView.h" +#include "phone/include/PhoneDirPresenter.h" +#include "phone/include/PhoneCallingView.h" +#include "phone/include/PhoneCallingPresenter.h" +#include "phone/include/PhoneCallupView.h" +#include "phone/include/PhoneCallupPresenter.h" +#include "phone/include/PhoneRingView.h" +#include "phone/include/PhoneRingPresenter.h" +#include "blood/include/BloodView.h" +#include "blood/include/BloodPresenter.h" +#include "blood/include/BloodCheckPresenter.h" +#include "blood/include/BloodCheckView.h" +#include "blood/include/BloodShowPresenter.h" +#include "blood/include/BloodShowView.h" +#include "blood/include/BloodErrorPresenter.h" +#include "blood/include/BloodNoteView.h" +#include "blood/include/BloodNotePresenter.h" +#include "dial/include/DialPresenter.h" +#include "dial/include/DialView.h" +#include "heartrate/include/HeartRemindPresenter.h" +#include "heartrate/include/HeartRemindView.h" +#include "traing/include/TraingPresenter.h" +#include "traing/include/TraingView.h" +#include "traing/include/TraingMorePresenter.h" +#include "traing/include/TraingMoreView.h" +#include "traing/include/TraingLimitPresenter.h" +#include "traing/include/TraingLimitView.h" +#include "traing/include/TraingNomalPresenter.h" +#include "traing/include/TraingNomalView.h" +#include "traing/include/TraingSetPresenter.h" +#include "traing/include/TraingSetView.h" +#include "traing/include/TraingSetTimePresenter.h" +#include "traing/include/TraingSetTimeView.h" +#include "traing/include/TraingSetCaluliPresenter.h" +#include "traing/include/TraingSetCaluliView.h" +#include "traing/include/TraingControlPresenter.h" +#include "traing/include/TraingControlView.h" +#include "traing/include/TraingCardPresenter.h" +#include "traing/include/TraingCardView.h" +#include "traing/include/TraingDataPresenter.h" +#include "traing/include/TraingDataView.h" +#include "traing/include/TraingDetailPresenter.h" +#include "traing/include/TraingDetailView.h" +#include "traing/include/TraingEndnotePresenter.h" +#include "traing/include/TraingEndnoteView.h" +#include "traing/include/TraingEnddataPresenter.h" +#include "traing/include/TraingEnddataView.h" +#include "traing/include/TraingGPSPresenter.h" +#include "traing/include/TraingGPSView.h" +#include "traing/include/TraingGPSlackPresenter.h" +#include "traing/include/TraingGPSlackView.h" +#include "traing/include/TraingGPSnotePresenter.h" +#include "traing/include/TraingGPSnoteView.h" +#include "displaybrightness/include/DisplayBrightnessPresenter.h" +#include "displaybrightness/include/DisplayBrightnessView.h" +#include "bluetoothofsetting/include/BlueToothOfSettingPresenter.h" +#include "bluetoothofsetting/include/BlueToothOfSettingView.h" +#include "displaybrightness/include/BrightnessControlPresenter.h" +#include "displaybrightness/include/BrightnessControlView.h" +#include "displaybrightness/include/ScreenDurationPresenter.h" +#include "displaybrightness/include/ScreenDurationView.h" +#include "soundandvibration/include/SoundAndVibrationPresenter.h" +#include "soundandvibration/include/SoundAndVibrationView.h" +#include "soundandvibration/include/SystemVolumePresenter.h" +#include "soundandvibration/include/SystemVolumeView.h" +#include "soundandvibration/include/CallVolumePresenter.h" +#include "soundandvibration/include/CallVolumeView.h" +#include "soundandvibration/include/MediaVolumePresenter.h" +#include "soundandvibration/include/MediaVolumeView.h" +#include "secondaryfunction/include/QuickAccessPresenter.h" +#include "secondaryfunction/include/QuickAccessView.h" +#include "system/include/SystemPresenter.h" +#include "system/include/SystemView.h" +#include "system/include/SystemAboutPresenter.h" +#include "system/include/SystemAboutView.h" +#include "system/include/SystemSupervisePresenter.h" +#include "system/include/SystemSuperviseView.h" +#include "system/include/SystemLanguagePresenter.h" +#include "system/include/SystemLanguageView.h" +#include "system/include/SystemRebootPresenter.h" +#include "system/include/SystemRebootView.h" +#include "system/include/SystemShoutDownPresenter.h" +#include "system/include/SystemShoutDownView.h" +#include "system/include/SystemFactoryResetPresenter.h" +#include "system/include/SystemFactoryResetView.h" +#include "record/include/RecordPresenter.h" +#include "record/include/RecordView.h" +#include "record/include/RecordListPresenter.h" +#include "record/include/RecordListView.h" +#include "record/include/RecordPlayPresenter.h" +#include "record/include/RecordPlayView.h" +#include "record/include/RecordDeletePresenter.h" +#include "record/include/RecordDeleteView.h" +#include "record/include/RecordGoingPresenter.h" +#include "record/include/RecordGoingView.h" +#include "PlaceMakerCompassPresenter.h" +#include "PlaceMakerCompassView.h" +#include "MakerPointCompassPresenter.h" +#include "MakerPointCompassView.h" +#include "StartPathRecordCompassPresenter.h" +#include "StartPathRecordCompassView.h" +#include "EndPathRecordCompassPresenter.h" +#include "EndPathRecordCompassView.h" +#include "PathBackTrackingCompassPresenter.h" +#include "PathBackTrackingCompassView.h" +#include "ResetPlaceMakerCompassPresenter.h" +#include "ResetPlaceMakerCompassView.h" +#include "PathRetracingCompassPresenter.h" +#include "PathRetracingCompassView.h" +#include "EndBackTrackingEarlyCompassPresenter.h" +#include "EndBackTrackingEarlyCompassView.h" +#include "EndBackTrackingCompassPresenter.h" +#include "EndBackTrackingCompassView.h" +#include "GPSLossCompassPresenter.h" +#include "GPSLossCompassView.h" +#include "secondaryfunction/include/SecondaryFunctionPresenter.h" +#include "secondaryfunction/include/SecondaryFunctionView.h" +#include "secondaryfunction/include/FastTrainingPresenter.h" +#include "secondaryfunction/include/FastTrainingView.h" +#include "secondaryfunction/include/FastTrainingAttentionPresenter.h" +#include "secondaryfunction/include/FastTrainingAttentionView.h" +#include "weather/include/MainWeatherPresenter.h" +#include "weather/include/MainWeatherView.h" +#include "weather/include/WeatherReportPresenter.h" +#include "weather/include/WeatherReportView.h" +#include "weather/include/FutureWeatherPresenter.h" +#include "weather/include/FutureWeatherView.h" +#include "weather/include/GetWeatherDataErrorPresenter.h" +#include "weather/include/GetWeatherDataErrorView.h" +#include "countdown/include/MainCountDownPresenter.h" +#include "countdown/include/MainCountDownView.h" +#include "countdown/include/CountDownTimeConfigPresenter.h" +#include "countdown/include/CountDownTimeConfigView.h" +#include "countdown/include/StartCountDownPresenter.h" +#include "countdown/include/StartCountDownView.h" +#include "countdown/include/CountDownTimeNotNullPresenter.h" +#include "countdown/include/CountDownTimeNotNullView.h" +#include "stopwatch/include/MainStopWatchPresenter.h" +#include "stopwatch/include/MainStopWatchView.h" +#include "stopwatch/include/StopWatchRecordCycleToLimitPresenter.h" +#include "stopwatch/include/StopWatchRecordCycleToLimitView.h" +#include "stopwatch/include/StopWatchRecordTimeToLimitPresenter.h" +#include "stopwatch/include/StopWatchRecordTimeToLimitView.h" + +namespace OHOS { +struct AppViewMapper +{ + AppViewId id; + void (NativeLauncher::*func)(void); +}; + +struct ViewIdToString +{ + AppViewId id; + char idForUikit[256]; +}; + +static const AppViewMapper SLICE_MAPPER[] = { + {VIEW_MAIN, &NativeLauncher::InitMainSlice}, + {VIEW_SETTING, &NativeLauncher::InitSettingSlice}, + {VIEW_APPLIST, &NativeLauncher::InitApplistSlice}, + {VIEW_MAIN_SAMPLE, &NativeLauncher::InitMainSampleSlice}, + {VIEW_MAIN_ALARM, &NativeLauncher::InitMainAlarmSlice}, + {VIEW_ALARM_POP_UP, &NativeLauncher::InitAlarmPopUpSlice}, + {VIEW_BLOODOXY_SAMPLE, &NativeLauncher::InitMainBloodOxyView}, + {VIEW_MAIN_ACTIVITY, &NativeLauncher::InitActivitySlice}, + {VIEW_CALLER_SAMPLE,&NativeLauncher::InitMainCallerLogView}, + {VIEW_MAEKPHONE_SAMPLE,&NativeLauncher::InitMainMakePhoneView}, + {VIEW_BLUETOOTH_EARPHONE, &NativeLauncher::InitBluetoothSlice}, + {VIEW_COMPASS, &NativeLauncher::InitCompassSlice}, + {VIEW_OFFLINEVOICE, &NativeLauncher::InitOfflineVoice}, + {VIEW_CONNECT_PHONE, &NativeLauncher::InitConnectPhoneSlice}, + {VIEW_MAIN_TEMP, &NativeLauncher::InitMainTempSlice}, + {VIEW_INDOORWALK, &NativeLauncher::InitIndoorWalkSlice}, + {VIEW_REBOOT, &NativeLauncher::InitRebootSlice}, + {VIEW_SAVEELE, &NativeLauncher::InitSaveEleSlice}, + {VIEW_SAVEBAT, &NativeLauncher::InitSaveBatSlice}, + {VIEW_BLOODPRESSURE, &NativeLauncher::InitSleepSlice}, + {VIEW_SLEEPTIME, &NativeLauncher::InitSleepTimeSlice}, + {VIEW_SLEEPACT, &NativeLauncher::InitSleepActSlice}, + {VIEW_GETPIC, &NativeLauncher::InitGetPicSlice}, //拍照 + {VIEW_TAKEPIC, &NativeLauncher::InitTakePicSlice}, + {VIEW_PHONE, &NativeLauncher::InitPhoneSlice}, //电话 + {VIEW_PHONECALL, &NativeLauncher::InitPhoneCallSlice}, + {VIEW_PHONEDIR, &NativeLauncher::InitPhoneDirSlice}, + {VIEW_PHONECALLING, &NativeLauncher::InitPhoneCallingSlice}, + {VIEW_PHONECALLUP, &NativeLauncher::InitPhoneCallupSlice}, + {VIEW_PHONERING, &NativeLauncher::InitPhoneRingSlice}, + {VIEW_BLOOD, &NativeLauncher::InitBloodSlice}, //血氧 + {VIEW_BLOODSHOW, &NativeLauncher::InitBloodShowSlice}, + {VIEW_BLOODCHECK, &NativeLauncher::InitBloodCheckSlice}, + {VIEW_BLOODERROR, &NativeLauncher::InitBloodErrorSlice}, + {VIEW_BLOODNOTE, &NativeLauncher::InitBloodNoteSlice}, + {VIEW_DIAL, &NativeLauncher::InitDialSlice}, //表盘 + {VIEW_HEARTRATEREMIND, &NativeLauncher::InitHeartRemindSlice}, + + {VIEW_TRAINING, &NativeLauncher::InitTraingSlice}, //训练 + {VIEW_TRAININGMORE, &NativeLauncher::InitTraingMoreSlice}, //更多训练 + {VIEW_TRAININGLIMIT, &NativeLauncher::InitTraingLimitSlice}, //极限训练 + {VIEW_TRAININGNOMAL, &NativeLauncher::InitTraingNomalSlice}, //正常训练初始界面 + {VIEW_TRAININGSET, &NativeLauncher::InitTraingSetSlice}, //训练目标设置界面 + {VIEW_TRAININGSETTIME, &NativeLauncher::InitTraingSetTimeSlice}, //设置目标时长 + {VIEW_TRAININGSETCALULI, &NativeLauncher::InitTraingSetCaluliSlice}, //设置目标卡路里 + {VIEW_TRAININGCONTROL, &NativeLauncher::InitTraingControlSlice}, //训练控制 + {VIEW_TRAININGCRAD, &NativeLauncher::InitTraingCardSlice}, //训练卡片 + {VIEW_TRAININGDATA, &NativeLauncher::InitTraingDataSlice}, //训练数据 + {VIEW_TRAININGDETAIL, &NativeLauncher::InitTraingDetailSlice}, //详细训练数据 + {VIEW_TRAININGENDNOTE, &NativeLauncher::InitTraingEndnoteSlice}, //训练结束提醒 + {VIEW_TRAININGENDDATA, &NativeLauncher::InitTraingEnddataSlice}, //训练结束详细数据 + {VIEW_TRAININGGPS, &NativeLauncher::InitTraingGPSSlice}, //GPS训练 + {VIEW_TRAININGGPSLACK, &NativeLauncher::InitTraingGPSlackSlice}, //GPS训练 + {VIEW_TRAININGGPSNOTE, &NativeLauncher::InitTraingGPSnoteSlice}, //GPS训练 + + {VIEW_DISPLAY_BRIGHTNESS,&NativeLauncher::InitUIDisplayBrightnessSlice}, //显示与亮度的实例化地址 + {VIEW_CONNECT_BLUETOOTH,&NativeLauncher::InitBlueToothSettingSlice}, //蓝牙设置的实例化地址 + {VIEW_BRIGHTNESS_CONTROL,&NativeLauncher::InitBrightnessControlSlice}, //调节亮度的实例化地址 + {VIEW_SCREEN_DURATION,&NativeLauncher::InitScreenDurationSlice}, //亮屏时长实例化地址 + {VIEW_SOUND_VIBRATION,&NativeLauncher::InitSoundAndVibrationSlice}, //声音与震动实例化地址 + {VIEW_SYSTEM_VOLUME,&NativeLauncher::InitSystemVolumeSlice}, //系统音量 + {VIEW_QUICK_ACCESS,&NativeLauncher::InitQuickAccessSlice}, //快速访问实例化地址 + {VIEW_SYSTEM,&NativeLauncher::InitSystemSlice}, //系统实例化地址 + {VIEW_SYSTEM_ABOUT_WATCH,&NativeLauncher::InitSystemAboutWatchSlice}, //系统:关于手表实例化地址 + {VIEW_SYSTEM_SUPERVISE,&NativeLauncher::InitSystemSuperviseSlice}, //系统:监管实例化地址 + {VIEW_SYSTEM_SYSTEM_LANGUAGE,&NativeLauncher::InitSystemLanguageSlice}, //系统:系统语言实例化地址 + {VIEW_SYSTEM_REBOOT,&NativeLauncher::InitSystemRebootSlice}, //系统:重启实例化地址 + {VIEW_SYSTEM_SHOUTDOWN,&NativeLauncher::InitSystemShoutDownSlice}, //系统:关机实例化地址 + {VIEW_SYSTEM_FACTORY_RESET,&NativeLauncher::InitSystemFactoryResetSlice}, //系统:恢复出厂设置实例化地址 + {VIEW_RECORD,&NativeLauncher::InitRecordingSlice}, //录音实例化地址 + {VIEW_RECORD_LIST,&NativeLauncher::InitRecordingListSlice}, + {VIEW_RECORD_PLAY,&NativeLauncher::InitRecordingPlaySlice}, + {VIEW_RECORD_DELETE,&NativeLauncher::InitRecordingDeleteSlice}, + {VIEW_RECORD_DELETE,&NativeLauncher::InitRecordingDeleteSlice}, + {VIEW_RECORD_GOING,&NativeLauncher::InitRecordingGoingSlice}, + {VIEW_COMPASS_PLACE_MAKER,&NativeLauncher::InitCompassPlaceMakerSlice}, //指南针放置标记点实例化地址 + {VIEW_COMPASS_MAKER_POINT,&NativeLauncher::InitCompassMakerPointSlice}, //指南针标记点介绍实例化地址 + {VIEW_COMPASS_START_PATH_RECORD,&NativeLauncher::InitCompassStartPathRecordSlice}, //指南针开始路径记录实例化地址 + {VIEW_COMPASS_END_PATH_RECORD,&NativeLauncher::InitCompassEndPathRecordSlice}, //指南针结束路径记录实例化地址 + {VIEW_COMPASS_PATH_BACKTRACKING,&NativeLauncher::InitCompassPathBackTrackingSlice}, //指南针路径回溯实例化地址 + {VIEW_COMPASS_RESET_PLACE_MAKER,&NativeLauncher::InitCompassResetPlaceMakerSlice}, //指南针重置标记点实例化地址 + {VIEW_COMPASS_PATH_RETRACING,&NativeLauncher::InitCompassPathRetracingSlice}, //指南针路径回溯实例化地址 + {VIEW_COMPASS_END_BACK_TRACKING,&NativeLauncher::InitCompassEndBackTrackingSlice}, //指南针结束路径回溯 + {VIEW_COMPASS_END_BACK_TRACKING_EARLY,&NativeLauncher::InitCompassEndBackTrackingEarlySlice},//指南针提前结束路径回溯 + {VIEW_COMPASS_GPS_LOSS,&NativeLauncher::InitCompassGPSLossSlice}, //指南针GPS丢失实例化地址 + {VIEW_SECONDARY_FUNCTION,&NativeLauncher::InitSecondaryFunction}, //按键按下进入辅助功能 + {VIEW_FAST_TRAINING,&NativeLauncher::InitFastTrainingSlice}, //快速训练 + {VIEW_FAST_TRAINING_ATTENTION,&NativeLauncher::InitFastTrainingAttentionSlice}, //快速训练 + {VIEW_WEATHER,&NativeLauncher::InitWeatherSlice}, //天气 + {VIEW_WEATHER_REPORT,&NativeLauncher::InitWeatherReportSlice}, //气象报告 + {VIEW_FUTURE_WEATHER,&NativeLauncher::InitFutureWeatherSlice}, //未来天气 + {VIEW_GET_WEATHER_DATA_ERROR,&NativeLauncher::InitGetWeatherDataErrorSlice}, //获取天气数据失败 + {VIEW_MAIN_COUNTDOWN,&NativeLauncher::InitMainCountDownSlice}, //倒计时主视图 + {VIEW_COUNTDOWN_TIME_CONFIG,&NativeLauncher::InitCountDownTimeConfigSlice}, //倒计时时间配置 + {VIEW_START_COUNTDOWN,&NativeLauncher::InitStartCountDownSlice}, //开始倒计时 + {VIEW_COUNTDOWN_TIME_NOT_NULL,&NativeLauncher::InitCountDownTimeNotNullSlice}, //倒计时不能为0 + {VIEW_MAIN_STOPWATCH,&NativeLauncher::InitMainStopWatchSlice}, //秒表主视图 + {VIEW_STOPWATCH_RECORD_CYCLE_TO_LIMIT,&NativeLauncher::InitStopWatchRecordCycleToLimitSlice}, + {VIEW_STOPWATCH_RECORD_TIME_TO_LIMIT,&NativeLauncher::InitStopWatchRecordTimeToLimitSlice}, + {VIEW_UISAMPLE, &NativeLauncher::InitUISampleSlice} +}; + +static const ViewIdToString VIEW_MAPPER[] = { + {VIEW_MAIN, "main"}, + {VIEW_SETTING, "setting"}, + {VIEW_APPLIST, "applist"}, + {VIEW_MAIN_SAMPLE, "mainViewSample"}, + {VIEW_MAIN_ALARM, "mainAlarmView"}, + {VIEW_ALARM_POP_UP, "alarmPopUpView"}, + {VIEW_BLOODOXY_SAMPLE, "bloodOxygenView"}, + {VIEW_MAIN_ACTIVITY, "mainActivityView"}, + {VIEW_CALLER_SAMPLE, "callerLogView"}, + {VIEW_MAEKPHONE_SAMPLE, "makePhoneView"}, + {VIEW_BLUETOOTH_EARPHONE, "mainBluetoothView"}, + {VIEW_COMPASS, "mainCompassView"}, + {VIEW_OFFLINEVOICE, "offlineVoiceView"}, + {VIEW_CONNECT_PHONE, "ConnectPhoneView"}, + {VIEW_MAIN_TEMP, "mianTempView"}, + {VIEW_INDOORWALK, "IndoorWalkView"}, + {VIEW_REBOOT, "RebootView"}, + {VIEW_DISPLAY_BRIGHTNESS,"DisplayBrightness"}, //显示与亮度 + {VIEW_CONNECT_BLUETOOTH,"BlueToothSetting"}, //蓝牙 + {VIEW_BRIGHTNESS_CONTROL,"BrightnessControl"}, //亮度调节 + {VIEW_SCREEN_DURATION,"ScreenDuration"}, //亮屏时长 + {VIEW_SOUND_VIBRATION,"SoundAndVibration"}, //声音与震动 + {VIEW_SYSTEM_VOLUME,"SystemVolume"}, //系统音量 + {VIEW_QUICK_ACCESS,"QuickAccess"}, //快速访问 + {VIEW_SYSTEM,"System"}, //系统 + {VIEW_SYSTEM_ABOUT_WATCH,"SystemAboutWatch"}, //系统:关于手表 + {VIEW_SYSTEM_SUPERVISE,"SystemSupervise"}, //系统:监管 + {VIEW_SYSTEM_SYSTEM_LANGUAGE,"SystemLanguage"}, //系统:系统语言 + {VIEW_SYSTEM_REBOOT,"SystemReboot"}, //系统:重新启动 + {VIEW_SYSTEM_SHOUTDOWN,"SystemShoutDown"}, //系统:关机 + {VIEW_SYSTEM_FACTORY_RESET,"SystemFactoryReset"},//系统:恢复出厂设置 + {VIEW_RECORD,"Recording"}, //录音 + {VIEW_RECORD_LIST,"RecordingList"}, + {VIEW_RECORD_PLAY,"RecordingPlay"}, + {VIEW_RECORD_DELETE,"RecordingDelete"}, + {VIEW_RECORD_GOING,"RecordingGoing"}, + {VIEW_COMPASS_PLACE_MAKER,"PlaceMakerCompass"}, //指南针放置标记点 + {VIEW_COMPASS_MAKER_POINT,"MakerPointCompass"}, //指南针标记点介绍 + {VIEW_COMPASS_START_PATH_RECORD,"StartPathRecordCompass"}, //指南针开始路径记录 + {VIEW_COMPASS_END_PATH_RECORD,"StartPathRecordCompass"}, //指南针结束路径记录 + {VIEW_COMPASS_PATH_BACKTRACKING,"PathBackTrackingCompass"}, //指南针路径回溯 + {VIEW_COMPASS_RESET_PLACE_MAKER,"ResetPlaceMakerCompass"}, //指南针重置路径标记点 + {VIEW_COMPASS_PATH_RETRACING,"PathRetracingCompass"}, //指南针路径回溯中 + {VIEW_COMPASS_END_BACK_TRACKING_EARLY,"EndBackTrackingEarlyCompass"},//指南针提前结束路径回溯 + {VIEW_COMPASS_END_BACK_TRACKING,"EndBackTrackingCompass"}, //指南针提前结束路径回溯 + {VIEW_COMPASS_GPS_LOSS,"GPSLossCompass"}, //指南针GPS丢失 + {VIEW_SECONDARY_FUNCTION,"SecondaryFunction"}, //辅助功能 + {VIEW_FAST_TRAINING,"FastTraining"}, //快速训练 + {VIEW_FAST_TRAINING_ATTENTION,"FastTrainingAttention"}, + {VIEW_WEATHER,"Weather"}, //天气 + {VIEW_WEATHER_REPORT,"WeatherReport"}, //气象报告 + {VIEW_FUTURE_WEATHER,"FutureWeather"}, //未来天气 + {VIEW_GET_WEATHER_DATA_ERROR,"GetWeatherDataError"}, + {VIEW_MAIN_COUNTDOWN,"MainCountDown"}, + {VIEW_COUNTDOWN_TIME_CONFIG,"CountDownTimeConfig"}, + {VIEW_START_COUNTDOWN,"StartCountDown"}, + {VIEW_COUNTDOWN_TIME_NOT_NULL,"CountDownTimeNotNull"}, + {VIEW_MAIN_STOPWATCH,"MainStopWatch"}, + {VIEW_STOPWATCH_RECORD_CYCLE_TO_LIMIT,"StopWatchRecordCycleToLimit"}, + {VIEW_STOPWATCH_RECORD_TIME_TO_LIMIT,"StopWatchRecordTimeToLimit"}, + {VIEW_UISAMPLE, "UISample"} +}; + +NativeLauncher::NativeLauncher() {} +NativeLauncher::~NativeLauncher() {} + +NativeLauncher &NativeLauncher::GetInstance(void) +{ + static NativeLauncher instance; + return instance; +} + +void NativeLauncher::InitNativeLauncher() { + GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "NativeLauncher::InitNativeLauncher"); + // 初始化所有预加载slice + InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化 + InitAllNativeSlices(); + CallerLogModel::GetInstance()->InitPhoneService(); + PresenterTask::GetInstance()->Init(); + PlayersModel::GetInstance()->AudioInit(); + ActivityModel::GetInstance()->Init(); + ScreenModels::GetInstance()->InitCardConfig(); + VocassistModel::GetInstance()->Init(); + HeartModel::GetInstance()->Init(); + BluetoothModel::GetInstance()->Init(); + // 初始化默认首页 + ScreenModels::GetInstance()->PreLoadAppimages(); + NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN_SAMPLE); +} + +void NativeLauncher::InitAllNativeSlices(void) +{ + uint16_t size = sizeof(SLICE_MAPPER) / sizeof(SLICE_MAPPER[0]); + for (int index = 0; index < size; index++) { + if ((SLICE_MAPPER[index].id >= VIEW_MAX_INTER_APP)) { + continue; + } + (this->*(SLICE_MAPPER[index].func))(); + } + return; +} + +void NativeLauncher::InitMainSlice(void) +{ + SliceProxy *mainSlice = new AbilitySliceProxy; + if (mainSlice != nullptr) { + NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN, mainSlice); + } +} + + +void NativeLauncher::InitMainSampleSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainSampleSlice"); + SliceProxy *mainViewSample = new AbilitySliceProxy; + if (mainViewSample == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainViewSample is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_SAMPLE, mainViewSample); +} + +void NativeLauncher::InitMainAlarmSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainAlarmSlice"); + SliceProxy *mainAlarmView = new AbilitySliceProxy; + if (mainAlarmView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainAlarmView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_ALARM, mainAlarmView); +} + +void NativeLauncher::InitMainTempSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainTempSlice"); + SliceProxy *mainTempView = new AbilitySliceProxy; + if (mainTempView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainTempView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_TEMP, mainTempView); +} + +void NativeLauncher::InitCompassSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::MainCompassView"); + SliceProxy *mainCompassView = new AbilitySliceProxy; + if (mainCompassView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainCompassView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS, mainCompassView); +} + +void NativeLauncher::InitIndoorWalkSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::IndoorWalkView"); + SliceProxy *indoorWalkView = new AbilitySliceProxy; + if (indoorWalkView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "indoorWalkView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_INDOORWALK, indoorWalkView); +} + +void NativeLauncher::InitRebootSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::RebootView"); + SliceProxy *rebootView = new AbilitySliceProxy; + if (rebootView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "rebootView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_REBOOT, rebootView); +} + +void NativeLauncher::InitConnectPhoneSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::ConnectPhoneView"); + SliceProxy *connectPhoneView = new AbilitySliceProxy; + if (connectPhoneView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "connectPhoneView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_CONNECT_PHONE, connectPhoneView); +} + +void NativeLauncher::InitAlarmPopUpSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitAlarmPopUpSlice"); + SliceProxy *alarmPopUpView = new AbilitySliceProxy; + if (alarmPopUpView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainAlarmView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_ALARM_POP_UP, alarmPopUpView); +} + +void NativeLauncher::InitMainBloodOxyView(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainBloodOxyView"); + SliceProxy *bloodOxygenView = new AbilitySliceProxy; + if (bloodOxygenView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodOxygenView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODOXY_SAMPLE, bloodOxygenView); +} + +void NativeLauncher::InitMainMakePhoneView(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainMakePhoneView"); + SliceProxy *makePhoneView = new AbilitySliceProxy; + if (makePhoneView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makePhoneView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_MAEKPHONE_SAMPLE, makePhoneView); +} + +void NativeLauncher::InitMainCallerLogView(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitMainCallerLogView"); + SliceProxy *callerLogView = new AbilitySliceProxy; + if (callerLogView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "callerLogView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_CALLER_SAMPLE, callerLogView); +} + +void NativeLauncher::InitActivitySlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitWeekStepSlice"); + SliceProxy *mainActivityView = new AbilitySliceProxy; + if (mainActivityView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainActivityView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_ACTIVITY, mainActivityView); +} + +void NativeLauncher::InitBluetoothSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeAbility::InitBluetoothSlice"); + SliceProxy *mainBluetoothView = new AbilitySliceProxy; + if (mainBluetoothView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainBluetoothView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_BLUETOOTH_EARPHONE, mainBluetoothView); +} + +void NativeLauncher::InitSettingSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSettingSlice"); + SliceProxy *settingView = new AbilitySliceProxy; + if (settingView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "settingView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SETTING, settingView); +} + +void NativeLauncher::InitApplistSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitApplistSlice"); + SliceProxy *applistView = new AbilitySliceProxy; + if (applistView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "applistView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_APPLIST, applistView); +} + +void NativeLauncher::InitOfflineVoice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitOfflineVoice"); + SliceProxy *offlineVoiceView = new AbilitySliceProxy; + if (offlineVoiceView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "offlineVoiceView is nullptr"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_OFFLINEVOICE, offlineVoiceView); +} + +void NativeLauncher::InitUISampleSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitUISampleSlice"); + SliceProxy *uisampleView = new AbilitySliceProxy; + if (uisampleView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uisampleView"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_UISAMPLE, uisampleView); +} +// 省电模式 +void NativeLauncher::InitSaveEleSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSaveEleSlice"); + SliceProxy *saveeleview = new AbilitySliceProxy; + if (saveeleview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "saveeleview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SAVEELE, saveeleview); +} + +void NativeLauncher::InitSaveBatSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSaveBatSlice"); + SliceProxy *savebatview = new AbilitySliceProxy; + if (savebatview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "savebatview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SAVEBAT, savebatview); +} +// 睡眠记录 +void NativeLauncher::InitSleepSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSleepSlice"); + SliceProxy *sleepview = new AbilitySliceProxy; + if (sleepview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sleepview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODPRESSURE, sleepview); +} +void NativeLauncher::InitSleepTimeSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSleepTimeSlice"); + SliceProxy *sleeptimeview = new AbilitySliceProxy; + if (sleeptimeview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sleeptimeview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SLEEPTIME, sleeptimeview); +} +void NativeLauncher::InitSleepActSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitSleepActSlice"); + SliceProxy *sleepactview = new AbilitySliceProxy; + if (sleepactview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sleepactview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SLEEPACT, sleepactview); +} + +void NativeLauncher::InitGetPicSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitGetPicSlice"); + SliceProxy *getpicview = new AbilitySliceProxy; + if (getpicview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "getpicview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_GETPIC, getpicview); +} + +void NativeLauncher::InitTakePicSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitTakePicSlice"); + SliceProxy *takepicview = new AbilitySliceProxy; + if (takepicview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "takepicview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_TAKEPIC, takepicview); +} + +void NativeLauncher::InitPhoneSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneSlice"); + SliceProxy *phoneview = new AbilitySliceProxy; + if (phoneview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phoneview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONE, phoneview); +} + +void NativeLauncher::InitPhoneCallSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneCallSlice"); + SliceProxy *phonecallview = new AbilitySliceProxy; + if (phonecallview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phonecallview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONECALL, phonecallview); +} + +void NativeLauncher::InitPhoneDirSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneCallSlice"); + SliceProxy *phonedirview = new AbilitySliceProxy; + if (phonedirview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phonedirview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONEDIR, phonedirview); +} + +void NativeLauncher::InitPhoneCallingSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneCallingSlice"); + SliceProxy *phonecallingview = new AbilitySliceProxy; + if (phonecallingview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phonecallingview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONECALLING, phonecallingview); +} + +void NativeLauncher::InitPhoneCallupSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneCallupSlice"); + SliceProxy *phonecallupview = new AbilitySliceProxy; + if (phonecallupview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phonecallview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONECALLUP, phonecallupview); +} + +void NativeLauncher::InitPhoneRingSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitPhoneRingSlice"); + SliceProxy *phoneringview = new AbilitySliceProxy; + if (phoneringview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "phoneringview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_PHONERING, phoneringview); +} + +void NativeLauncher::InitBloodSlice(void) //血氧 +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); + SliceProxy *bloodview = new AbilitySliceProxy; + if (bloodview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOOD, bloodview); +} + +void NativeLauncher::InitBloodShowSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); + SliceProxy *bloodshowview = new AbilitySliceProxy; + if (bloodshowview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODSHOW, bloodshowview); +} + +void NativeLauncher::InitBloodErrorSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); + SliceProxy *blooderrorview = new AbilitySliceProxy; + if (blooderrorview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODERROR, blooderrorview); +} + +void NativeLauncher::InitBloodCheckSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); + SliceProxy *bloodcheckview = new AbilitySliceProxy; + if (bloodcheckview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODCHECK, bloodcheckview); +} + +void NativeLauncher::InitBloodNoteSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); + SliceProxy *bloodnoteview = new AbilitySliceProxy; + if (bloodnoteview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodnoteview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODNOTE, bloodnoteview); +} + +void NativeLauncher::InitDialSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitBloodSlice"); + SliceProxy *dialview = new AbilitySliceProxy; + if (dialview == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "dialview"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_DIAL, dialview); +} + +void NativeLauncher::InitHeartRemindSlice(void) +{ + SliceProxy *heartremindview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_HEARTRATEREMIND, heartremindview); +} + +//体能训练 +void NativeLauncher::InitTraingSlice(void) +{ + SliceProxy *traingview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAINING, traingview); +} +void NativeLauncher::InitTraingMoreSlice(void) +{ + SliceProxy *traingmoreview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGMORE, traingmoreview); +} +void NativeLauncher::InitTraingLimitSlice(void) +{ + SliceProxy *trainglimitview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGLIMIT, trainglimitview); +} +void NativeLauncher::InitTraingNomalSlice(void) +{ + SliceProxy *traingnomalview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGNOMAL, traingnomalview); +} +void NativeLauncher::InitTraingSetSlice(void) +{ + SliceProxy *traingsetview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGSET, traingsetview); +} +void NativeLauncher::InitTraingSetTimeSlice(void) +{ + SliceProxy *traingsettimeview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGSETTIME, traingsettimeview); +} +void NativeLauncher::InitTraingSetCaluliSlice(void) +{ + SliceProxy *traingsetcaluliview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGSETCALULI, traingsetcaluliview); +} +void NativeLauncher::InitTraingControlSlice(void) +{ + SliceProxy *traingcontrolview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGCONTROL, traingcontrolview); +} +void NativeLauncher::InitTraingCardSlice(void) +{ + SliceProxy *traingcardview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGCRAD, traingcardview); +} +void NativeLauncher::InitTraingDataSlice(void) +{ + SliceProxy *traingdataview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGDATA, traingdataview); +} +void NativeLauncher::InitTraingDetailSlice(void) +{ + SliceProxy *traingdetailview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGDETAIL, traingdetailview); +} +void NativeLauncher::InitTraingEndnoteSlice(void) +{ + SliceProxy *traingendnoteview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGENDNOTE, traingendnoteview); +} +void NativeLauncher::InitTraingEnddataSlice(void) +{ + SliceProxy *traingenddataview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGENDDATA, traingenddataview); +} +void NativeLauncher::InitTraingGPSSlice(void) +{ + SliceProxy *traingGPSview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGGPS, traingGPSview); +} +void NativeLauncher::InitTraingGPSlackSlice(void) +{ + SliceProxy *traingGPSlackview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGGPSLACK, traingGPSlackview); +} +void NativeLauncher::InitTraingGPSnoteSlice(void) +{ + SliceProxy *traingGPSnoteview = new AbilitySliceProxy; + NativeAbility::GetInstance().AddSliceProxy(VIEW_TRAININGGPSNOTE, traingGPSnoteview); +} + +//DisplayBrightness的实例化 +void NativeLauncher::InitUIDisplayBrightnessSlice(void) +{ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitUISampleSlice"); + SliceProxy *uidisplaybrightnessView = new AbilitySliceProxy; + if (uidisplaybrightnessView == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uidisplaybrightnessView"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_DISPLAY_BRIGHTNESS, uidisplaybrightnessView); +} +void NativeLauncher::InitBlueToothSettingSlice(void) +{ + SliceProxy *bluetoothsetting = new AbilitySliceProxy; + if (bluetoothsetting == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_CONNECT_BLUETOOTH, bluetoothsetting); +} + +void NativeLauncher::InitBrightnessControlSlice(void) +{ + SliceProxy *brightnesscontrol = new AbilitySliceProxy; + if (brightnesscontrol == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_BRIGHTNESS_CONTROL, brightnesscontrol); +} + +void NativeLauncher::InitScreenDurationSlice(void) +{ + SliceProxy *ScreenDuration = new AbilitySliceProxy; + if (ScreenDuration == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SCREEN_DURATION, ScreenDuration); +} + +void NativeLauncher::InitSoundAndVibrationSlice(void) //声音与震动 +{ + SliceProxy *SoundAndVibration = new AbilitySliceProxy; + if (SoundAndVibration == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SOUND_VIBRATION, SoundAndVibration); +} + +void NativeLauncher::InitQuickAccessSlice(void) //快速访问 +{ + SliceProxy *QuickAccess = new AbilitySliceProxy; + if (QuickAccess == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_QUICK_ACCESS, QuickAccess); +} + +void NativeLauncher::InitSystemSlice(void) //系统 +{ + SliceProxy *system = new AbilitySliceProxy; + if (system == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM, system); +} +void NativeLauncher::InitSystemAboutWatchSlice(void) //系统:关于手表 +{ + SliceProxy *systemaboutwatch = new AbilitySliceProxy; + if (systemaboutwatch == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_ABOUT_WATCH, systemaboutwatch); +} + +void NativeLauncher::InitSystemSuperviseSlice(void) //系统:监管 +{ + SliceProxy *systemsupervise = new AbilitySliceProxy; + if (systemsupervise == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_SUPERVISE, systemsupervise); +} + +void NativeLauncher::InitSystemLanguageSlice(void) //系统:系统语言 +{ + SliceProxy *systemlanguage = new AbilitySliceProxy; + if (systemlanguage == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_SYSTEM_LANGUAGE, systemlanguage); +} +void NativeLauncher::InitSystemRebootSlice(void) //系统:重新启动 +{ + SliceProxy *systemreboot = new AbilitySliceProxy; + if (systemreboot == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_REBOOT, systemreboot); +} +void NativeLauncher::InitSystemShoutDownSlice(void) //系统:关机 +{ + SliceProxy *systemshoutdown = new AbilitySliceProxy; + if (systemshoutdown == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_SHOUTDOWN, systemshoutdown); +} +void NativeLauncher::InitSystemFactoryResetSlice(void) //系统:恢复出厂设置 +{ + SliceProxy *systemfactoryreset = new AbilitySliceProxy; + if (systemfactoryreset == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_FACTORY_RESET, systemfactoryreset); +} + +void NativeLauncher::InitSystemVolumeSlice(void) //系统音量 +{ + SliceProxy *systemvolume = new AbilitySliceProxy; + if (systemvolume == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_VOLUME, systemvolume); +} + +void NativeLauncher::InitRecordingSlice(void) //录音 +{ + SliceProxy *record = new AbilitySliceProxy; + if (record == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD, record); +} + +void NativeLauncher::InitRecordingListSlice(void) +{ + SliceProxy *recordlist = new AbilitySliceProxy; + if (recordlist == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD_LIST, recordlist); +} + +void NativeLauncher::InitRecordingPlaySlice(void) +{ + SliceProxy *recordplay = new AbilitySliceProxy; + if (recordplay == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD_PLAY, recordplay); +} +void NativeLauncher::InitRecordingDeleteSlice(void) +{ + SliceProxy *recorddelete = new AbilitySliceProxy; + if (recorddelete == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD_DELETE, recorddelete); +} + +void NativeLauncher::InitRecordingGoingSlice(void) //正在录音 +{ + SliceProxy *recordgoing = new AbilitySliceProxy; + if (recordgoing == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_RECORD_GOING, recordgoing); +} + +void NativeLauncher::InitCompassPlaceMakerSlice(void) //指南针:放置标记点 +{ + + SliceProxy *placemakercompass = new AbilitySliceProxy; + if (placemakercompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_PLACE_MAKER, placemakercompass); +} + +void NativeLauncher::InitCompassMakerPointSlice(void) //指南针:标记点介绍 +{ + SliceProxy *makerpointcompass = new AbilitySliceProxy; + if (makerpointcompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_MAKER_POINT, makerpointcompass); +} + +void NativeLauncher::InitCompassStartPathRecordSlice(void) //指南针:开始路径记录 +{ + SliceProxy *startpathrecordcompass = new AbilitySliceProxy; + if (startpathrecordcompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_START_PATH_RECORD, startpathrecordcompass); +} + +void NativeLauncher::InitCompassEndPathRecordSlice(void) //指南针:结束路径记录 +{ + SliceProxy *endtpathrecordcompass = new AbilitySliceProxy; + if (endtpathrecordcompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_END_PATH_RECORD, endtpathrecordcompass); +} + +void NativeLauncher::InitCompassPathBackTrackingSlice(void) //指南针:路径回溯 +{ + SliceProxy *pathbacktrackingcompass = new AbilitySliceProxy; + if (pathbacktrackingcompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_PATH_BACKTRACKING, pathbacktrackingcompass); +} + +void NativeLauncher::InitCompassResetPlaceMakerSlice(void) //指南针:重置标记点 +{ + SliceProxy *resetplacemakercompass = new AbilitySliceProxy; + if (resetplacemakercompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_RESET_PLACE_MAKER, resetplacemakercompass); +} + +void NativeLauncher::InitCompassPathRetracingSlice(void) //指南针:路径回溯中 +{ + SliceProxy *pathretracingcompass = new AbilitySliceProxy; + if (pathretracingcompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_PATH_RETRACING, pathretracingcompass); +} +void NativeLauncher::InitCompassEndBackTrackingEarlySlice() //指南针:提前结束路径回溯 +{ + SliceProxy *endbacktrackingearlycompass = new AbilitySliceProxy; + if (endbacktrackingearlycompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_END_BACK_TRACKING_EARLY, endbacktrackingearlycompass); +} + +void NativeLauncher::InitCompassEndBackTrackingSlice(void) //指南针:结束路径回溯 +{ + SliceProxy *endbacktrackingecompass = new AbilitySliceProxy; + if (endbacktrackingecompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_END_BACK_TRACKING, endbacktrackingecompass); +} + +void NativeLauncher::InitCompassGPSLossSlice(void) //指南针:GPS丢失 +{ + SliceProxy *GPSlosscompass = new AbilitySliceProxy; + if (GPSlosscompass == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COMPASS_GPS_LOSS, GPSlosscompass); +} + +void NativeLauncher::InitSecondaryFunction(void) //辅助功能 +{ + SliceProxy *secondaryfunction = new AbilitySliceProxy; + if (secondaryfunction == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SECONDARY_FUNCTION, secondaryfunction); +} + +void NativeLauncher::InitFastTrainingSlice(void) +{ + SliceProxy *fasttraining = new AbilitySliceProxy; + if (fasttraining == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_FAST_TRAINING, fasttraining); +} + +void NativeLauncher::InitFastTrainingAttentionSlice(void) +{ + SliceProxy *fasttrainingattention = new AbilitySliceProxy; + if (fasttrainingattention == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_FAST_TRAINING_ATTENTION, fasttrainingattention); +} + +void NativeLauncher::InitWeatherSlice(void) //天气 +{ + SliceProxy *mainweather = new AbilitySliceProxy; + if (mainweather == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_WEATHER, mainweather); +} + +void NativeLauncher::InitWeatherReportSlice(void) //气象报告 +{ + SliceProxy *weatherreport = new AbilitySliceProxy; + if (weatherreport == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_WEATHER_REPORT, weatherreport); +} + +void NativeLauncher::InitFutureWeatherSlice(void) //未来天气 +{ + SliceProxy *futureweather = new AbilitySliceProxy; + if (futureweather == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_FUTURE_WEATHER, futureweather); +} + +void NativeLauncher::InitGetWeatherDataErrorSlice(void) +{ + SliceProxy *getweatherdataerror = new AbilitySliceProxy; + if (getweatherdataerror == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_GET_WEATHER_DATA_ERROR, getweatherdataerror); +} + +void NativeLauncher::InitMainCountDownSlice(void) //倒计时主视图 +{ + SliceProxy *maincountdown = new AbilitySliceProxy; + if (maincountdown == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_COUNTDOWN, maincountdown); +} + +void NativeLauncher::InitCountDownTimeConfigSlice(void) //倒计时时间设置 +{ + SliceProxy *countdowntimeconfig = new AbilitySliceProxy; + if (countdowntimeconfig == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COUNTDOWN_TIME_CONFIG, countdowntimeconfig); +} + +void NativeLauncher::InitStartCountDownSlice(void) //开始倒计时 +{ + SliceProxy *startcountdownt = new AbilitySliceProxy; + if (startcountdownt == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_START_COUNTDOWN, startcountdownt); +} + +void NativeLauncher::InitCountDownTimeNotNullSlice(void) //倒计时时间不能为0 +{ + SliceProxy *countdowntnotnull = new AbilitySliceProxy; + if (countdowntnotnull == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_COUNTDOWN_TIME_NOT_NULL, countdowntnotnull); +} + +void NativeLauncher::InitMainStopWatchSlice(void) //倒计时时间不能为0 +{ + SliceProxy *mainstopwatch = new AbilitySliceProxy; + if (mainstopwatch == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_STOPWATCH, mainstopwatch); +} + +void NativeLauncher::InitStopWatchRecordCycleToLimitSlice(void) +{ + SliceProxy *stopwatchrecordcycletolimit = new AbilitySliceProxy; + if (stopwatchrecordcycletolimit == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_STOPWATCH_RECORD_CYCLE_TO_LIMIT, stopwatchrecordcycletolimit); +} + +void NativeLauncher::InitStopWatchRecordTimeToLimitSlice(void) +{ + SliceProxy *stopwatchrecordtimetolimit = new AbilitySliceProxy; + if (stopwatchrecordtimetolimit == nullptr) { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_STOPWATCH_RECORD_TIME_TO_LIMIT, stopwatchrecordtimetolimit); +} +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp index fe7727f7c..0f29af4f1 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp @@ -38,7 +38,7 @@ constexpr int16_t BUTTON_HEIGHT3 = 100; constexpr int16_t PICKER_FONT_SIZE = 25; constexpr int16_t LABEL_TIME_FONT = 40; constexpr uint8_t BACKGROUND_FONT = 40; -constexpr uint8_t HIGHTLIGHT_FONT = 50; +constexpr uint8_t HIGHTLIGHT_FONT = 60; AlarmSetTimeView::AlarmSetTimeView() { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp index 7deba17fb..8f34224b5 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp @@ -19,32 +19,31 @@ namespace OHOS { - const AppItem g_nativeAppList[] = { - {VIEW_MAIN_ALARM, PNG_APPLIST_ALARM_IMAGE, PNG_APPLIST_ALARM_IMAGE, "闹钟", nullptr}, - {VIEW_BLOODOXY_SAMPLE, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_SPO2_IMAGE, "血氧饱和度", nullptr}, - {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "系统设置", nullptr}, - {VIEW_DIAL, PNG_APPLIST_DIAL_IMAGE, PNG_APPLIST_DIAL_IMAGE, "表盘设置", nullptr}, - {VIEW_CALLER_SAMPLE, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_CALLER_IMAGE, "通话记录", nullptr}, - {VIEW_COMPASS, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_COMPASS_IMAGE, "指南针", nullptr}, - {VIEW_OFFLINEVOICE, PNG_APPLIST_VOCASSIST_IMAGE, PNG_APPLIST_VOCASSIST_IMAGE, "语音助手", nullptr}, - {VIEW_MAIN_TEMP, PNG_APPLIST_TEMP_IMAGE, PNG_APPLIST_TEMP_IMAGE, "体温", nullptr}, - {VIEW_INDOORWALK, PNG_APPLIST_WALK_IMAGE, PNG_APPLIST_WALK_IMAGE, "室内步行", nullptr}, - {VIEW_UISAMPLE, PNG_APPLIST_UI_SAMPLE_IMAGE, PNG_APPLIST_UI_SAMPLE_IMAGE, "示例", nullptr}, - {VIEW_SPORT, PNG_APPLIST_SPORT_IMAGE, PNG_APPLIST_SPORT_IMAGE, "活动", nullptr}, - {VIEW_GETPIC, PNG_APPLIST_GETPIC_IMAGE, PNG_APPLIST_GETPIC_IMAGE, "拍照", nullptr}, - {VIEW_BLOOD, PNG_APPLIST_BLOOD_IMAGE, PNG_APPLIST_BLOOD_IMAGE, "血氧监测", nullptr}, - {VIEW_HEARTRATEREMIND, PNG_APPLIST_HEARTRATE_IMAGE, PNG_APPLIST_HEARTRATE_IMAGE, "心率", nullptr}, - {VIEW_TRAINING, PNG_APPLIST_TRAINING_IMAGE, PNG_APPLIST_TRAINING_IMAGE, "训练", nullptr}, - {VIEW_TRAINING_RECORD, PNG_APPLIST_TRAINING_RECORD_IMAGE, PNG_APPLIST_TRAINING_RECORD_IMAGE, "训练记录", nullptr}, - {VIEW_BLOODPRESSURE, PNG_APPLIST_BLOODPRESSURE_IMAGE, PNG_APPLIST_BLOODPRESSURE_IMAGE, "睡眠", nullptr}, - {VIEW_MUSIC, PNG_APPLIST_MUSIC_IMAGE, PNG_APPLIST_MUSIC_IMAGE, "音乐", nullptr}, - {VIEW_WEATHER, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_WEATHER_IMAGE, "天气", nullptr}, - {VIEW_RECORD, PNG_APPLIST_RECORD_IMAGE, PNG_APPLIST_RECORD_IMAGE, "录音", nullptr}, - {VIEW_PHONE, PNG_APPLIST_PHONE_IMAGE, PNG_APPLIST_PHONE_IMAGE, "电话", nullptr}, - {VIEW_CHRONOMETER, PNG_APPLIST_CHRONOMETER_IMAGE, PNG_APPLIST_CHRONOMETER_IMAGE, "秒表", nullptr}, - {VIEW_COUNTDOWN, PNG_APPLIST_COUNTDOWN_IMAGE, PNG_APPLIST_COUNTDOWN_IMAGE, "计时器", nullptr}, - {VIEW_BLUETOOTH, PNG_APPLIST_BLUETOOTH_IMAGE, PNG_APPLIST_BLUETOOTH_IMAGE, "蓝牙", nullptr}, - }; + const AppItem g_nativeAppList[] = { + {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "系统设置", nullptr}, + {VIEW_DIAL, PNG_APPLIST_DIAL_IMAGE, PNG_APPLIST_DIAL_IMAGE, "表盘设置", nullptr}, + {VIEW_COMPASS, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_COMPASS_IMAGE, "指南针", nullptr}, + {VIEW_WEATHER, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_WEATHER_IMAGE, "天气", nullptr}, + {VIEW_MUSIC, PNG_APPLIST_MUSIC_IMAGE, PNG_APPLIST_MUSIC_IMAGE, "音乐", nullptr}, + {VIEW_RECORD, PNG_APPLIST_RECORD_IMAGE, PNG_APPLIST_RECORD_IMAGE, "录音", nullptr}, + {VIEW_PHONE, PNG_APPLIST_PHONE_IMAGE, PNG_APPLIST_PHONE_IMAGE, "电话", nullptr}, + {VIEW_GETPIC, PNG_APPLIST_GETPIC_IMAGE, PNG_APPLIST_GETPIC_IMAGE, "拍照", nullptr}, + {VIEW_CONNECT_BLUETOOTH, PNG_APPLIST_BLUETOOTH_IMAGE, PNG_APPLIST_BLUETOOTH_IMAGE, "蓝牙", nullptr}, + {VIEW_MAIN_ALARM, PNG_APPLIST_ALARM_IMAGE, PNG_APPLIST_ALARM_IMAGE, "闹钟", nullptr}, + {VIEW_MAIN_STOPWATCH, PNG_APPLIST_CHRONOMETER_IMAGE, PNG_APPLIST_CHRONOMETER_IMAGE, "秒表", nullptr}, + //{VIEW_SPORT, PNG_APPLIST_SPORT_IMAGE, PNG_APPLIST_SPORT_IMAGE, "活动", nullptr}, + {VIEW_MAIN_COUNTDOWN, PNG_APPLIST_COUNTDOWN_IMAGE, PNG_APPLIST_COUNTDOWN_IMAGE, "计时器", nullptr}, + {VIEW_BLOODOXY_SAMPLE, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_SPO2_IMAGE, "血氧饱和度", nullptr}, + {VIEW_INDOORWALK, PNG_APPLIST_WALK_IMAGE, PNG_APPLIST_WALK_IMAGE, "室内步行", nullptr}, + {VIEW_TRAINING, PNG_APPLIST_TRAINING_IMAGE, PNG_APPLIST_TRAINING_IMAGE, "体能训练", nullptr}, + //{VIEW_TRAINING_RECORD, PNG_APPLIST_TRAINING_RECORD_IMAGE, PNG_APPLIST_TRAINING_RECORD_IMAGE, "训练记录", nullptr}, + {VIEW_OFFLINEVOICE, PNG_APPLIST_VOCASSIST_IMAGE, PNG_APPLIST_VOCASSIST_IMAGE, "语音助手", nullptr}, + {VIEW_BLOODPRESSURE, PNG_APPLIST_BLOODPRESSURE_IMAGE, PNG_APPLIST_BLOODPRESSURE_IMAGE, "睡眠监测", nullptr}, + {VIEW_MAIN_TEMP, PNG_APPLIST_TEMP_IMAGE, PNG_APPLIST_TEMP_IMAGE, "体温检测", nullptr}, + {VIEW_BLOOD, PNG_APPLIST_BLOOD_IMAGE, PNG_APPLIST_BLOOD_IMAGE, "血氧监测", nullptr}, + {VIEW_HEARTRATEREMIND, PNG_APPLIST_HEARTRATE_IMAGE, PNG_APPLIST_HEARTRATE_IMAGE, "心率检测", nullptr}, + {VIEW_UISAMPLE, PNG_APPLIST_UI_SAMPLE_IMAGE, PNG_APPLIST_UI_SAMPLE_IMAGE, "示例", nullptr}, +}; ApplistModel &ApplistModel::GetInstance(void) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetoothofsetting/src/BlueToothOfSettingPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetoothofsetting/src/BlueToothOfSettingPresenter.cpp index 6e53d558a..546f7ad6e 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetoothofsetting/src/BlueToothOfSettingPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetoothofsetting/src/BlueToothOfSettingPresenter.cpp @@ -27,7 +27,7 @@ namespace OHOS { Presenter::OnStart(); } - + void BlueToothOfSettingPresenter::OnPause(void) { @@ -51,7 +51,9 @@ namespace OHOS if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) { - NativeAbility::GetInstance().ChangeSlice(VIEW_SETTING); + // NativeAbility::GetInstance().ChangeSlice(VIEW_SETTING); + uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + NativeAbility::GetInstance().ChangeSlice(preSlice); } return true; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersView.h b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersView.h index 6be9d5a5c..897c068f4 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersView.h @@ -83,20 +83,20 @@ private: bool LoadPlayerImage(UIButton *button, uint32_t resId, uint32_t hlResId); UIImageView *backGround{nullptr}; - UILabel *subTitleLabel{nullptr}; + UILabel *subTitleLabel{nullptr}; //副标题标签:在这里为音乐作者 PlayersCaseListAdapter *adapterText{nullptr}; - UILabel *titleLabel{nullptr}; - UILabelButton *backButton{nullptr}; - UIButton *pullButton{nullptr}; - UIButton *optionsButton{nullptr}; - UIButton *preButton{nullptr}; - UIButton *nextButton{nullptr}; - UIViewGroup *listGroup{nullptr}; - UIImageView *soundButton{nullptr}; - UIImageView *playerModelButton{nullptr}; - UICheckBox *playerButton{nullptr}; - UICircleProgress *playbackProgress{nullptr}; - int16_t volumeSet{0}; + UILabel *titleLabel{nullptr}; //主标题标签:在这里为音乐名 + UILabelButton *backButton{nullptr}; //返回按钮 + UIButton *pullButton{nullptr}; //上拉按钮 + UIButton *optionsButton{nullptr}; //选项按钮 + UIButton *preButton{nullptr}; //上一首按钮 + UIButton *nextButton{nullptr}; //下一首按钮 + UIViewGroup *listGroup{nullptr}; //列表组:可能是歌单~暂定 + UIImageView *soundButton{nullptr}; //声音按钮 + UIImageView *playerModelButton{nullptr}; //播放模式按钮 + UICheckBox *playerButton{nullptr}; //播放按钮 + UICircleProgress *playbackProgress{nullptr};//播放进度条 + int16_t volumeSet{0}; //声音值的大小设置 UIList *list{nullptr}; JumpView *jumpView{nullptr}; PlayersPresenter *playersPresenter{nullptr}; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp index 1522244ce..1e0215f44 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp @@ -212,7 +212,7 @@ PlayersView* PlayersView::GetInstance(void) return g_pPlayersView; } -// list +// 显示音乐列表 void PlayersView::ShowUpListView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShowUpListView"); @@ -254,7 +254,7 @@ void PlayersView::ShowUpListView() listGroup->SetVisible(false); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShowUpListView end"); } - +//设置按钮的位置和监听 void PlayersView::SetUpButton(UIButton *btn, const Point& point, int16_t width, int16_t height, UIView::OnClickListener *listener) { @@ -266,7 +266,7 @@ void PlayersView::SetUpButton(UIButton *btn, const Point& point, btn->SetPosition(point.x, point.y, width, height); btn->SetOnClickListener(listener); } - +//复选框:选中播放未选中暂停 int PlayersView::ShowUpCheckBoxButton() { ImageInfo *image; @@ -286,13 +286,10 @@ int PlayersView::ShowUpCheckBoxButton() WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "playerlistener new fail"); return OHOS_FAILURE; } - - playerButton->SetState(UICheckBox::UICheckBoxState::SELECTED); - playerButton->SetPosition(140, 139, 172, 172); // 140:x 139:y 172:width 172:height playerButton->SetOnClickListener(playerlistener); - image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_PLAYER, PLAYER_IAMGES); - hlImage = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_PLAYERHIGHLIGHT, PLAYER_IAMGES); + image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_PLAYER, PLAYER_IAMGES); //播放图片 + hlImage = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_PLAYERHIGHLIGHT, PLAYER_IAMGES);//暂停图片 playerButton->SetImages(hlImage, image); Add(playerButton); @@ -311,7 +308,7 @@ int PlayersView::ShowUpCheckBoxButton() Add(soundButton); return OHOS_SUCCESS; } - +//显示按钮:下一首,上一首,播放模式 int PlayersView::ShowUpButton() { struct Point pointBtn; @@ -355,7 +352,7 @@ int PlayersView::ShowUpButton() return OHOS_SUCCESS; } - +//显示音乐播放模式:LOOP 循环播放 SEQUENCE 循序播放 REPEATS 单曲循环 RANDOM 随机播放 bool PlayersView::ShowUpPlayerMode() { if (PlayersModel::GetInstance()->GetPlayerModel() == LOOP) { @@ -381,7 +378,7 @@ bool PlayersView::ShowUpPlayerMode() } return true; } - +//显示按钮视图 int PlayersView::ShowUpButtonView() { int ret; @@ -425,7 +422,10 @@ int PlayersView::ShowUpButtonView() } return OHOS_SUCCESS; } - +/* + 创建了两个按钮:optionslistener:显示选项按钮,点击后里面有三种模式:1手机音乐,2本地音乐,3蓝牙耳机 + pullButton:上拉按钮上拉后显示歌单 +*/ int PlayersView::ShowUpButtonOptions() { struct Point pointBtn; @@ -446,7 +446,7 @@ int PlayersView::ShowUpButtonOptions() pullButton->SetImageSrc(PNG_PULLBUTTON_FACE_IMAGE, PNG_PULLBUTTON_FACE_IMAGE); return OHOS_SUCCESS; } - +//显示播放进度条 int PlayersView::ShowUpCircleProgress() { if (playbackProgress == nullptr) { @@ -470,7 +470,7 @@ int PlayersView::ShowUpCircleProgress() Add(playbackProgress); return OHOS_SUCCESS; } - +//创建跳转视图 void PlayersView::CreateJumpView(void) { if (jumpView == nullptr) { @@ -481,7 +481,7 @@ void PlayersView::CreateJumpView(void) } } } - +//创建一个音乐播放器的逻辑层 void PlayersView::CreatePlayersPresenter(void) { if (playersPresenter == nullptr) { @@ -492,7 +492,7 @@ void PlayersView::CreatePlayersPresenter(void) } } } - +//创建一个音乐播放器的拖拽监听 void PlayersView::CreatePlayerOnDragListener(void) { if (playerOnDragListener == nullptr) { @@ -503,6 +503,7 @@ void PlayersView::CreatePlayerOnDragListener(void) } } } +//初始化背景图片 bool PlayersView::InitBackGround(void) { if (backGround == nullptr) { @@ -520,7 +521,7 @@ bool PlayersView::InitBackGround(void) Add(backGround); return true; } - +//创建音乐名,作者名 void PlayersView::CreatePlayerMusicName() { if (titleLabel == nullptr) { @@ -549,7 +550,7 @@ void PlayersView::CreatePlayerMusicName() Add(subTitleLabel); return; } - +//拖拽监听:从下到上拖拽后显示音乐列表 bool PlayersView::OnDragEvent(const DragEvent& event) { /* 300: y limit of drag start point */ @@ -588,7 +589,6 @@ bool PlayersView::InitView(void) ShowUpListView(); SetTouchable(true); SetDraggable(true); - return true; } @@ -605,7 +605,7 @@ void PlayersView::UnLoad(void) { // Players's usage scenes is complicated, so we do not release it's resources inner slice. } - +//加载音乐图片 bool PlayersView::LoadPlayerImage(UIImageView *view, uint32_t resId) { std::string file = PLAYER_IAMGES; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordDeleteView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordDeleteView.cpp index 6b4f2fe48..6f1a6ea58 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordDeleteView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordDeleteView.cpp @@ -33,7 +33,6 @@ namespace OHOS container_ = new UIViewGroup(); container_->SetPosition(0, 0, 466, 466); container_->SetStyle(STYLE_BACKGROUND_OPA, 0); - } // Add ImageView to App @@ -100,8 +99,6 @@ namespace OHOS if (container_ != nullptr) { container_->RemoveAll(); - delete container_; - container_ = nullptr; } if (RECORD_DELETE_BACKGROUND_IMAGE != nullptr) { @@ -118,6 +115,8 @@ namespace OHOS delete RECORD_DELETE_OFF_BUTTON; RECORD_DELETE_OFF_BUTTON = nullptr; } + delete container_; + container_ = nullptr; } void RecordDeleteView::OnStart() diff --git a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordGoingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordGoingView.cpp index d3203dd74..5f9f23df5 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordGoingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordGoingView.cpp @@ -144,7 +144,7 @@ namespace OHOS RECORD_GOING_LABEL2->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); RECORD_GOING_LABEL2->SetRollSpeed(0); RECORD_GOING_LABEL2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 65); - + callBack_ = new TimerAnimatorCallback(RECORD_GOING_LABEL2); animator_ = new Animator(callBack_, RECORD_GOING_LABEL2, 0, true); animator_->Start(); @@ -180,8 +180,6 @@ namespace OHOS if (container_ != nullptr) { container_->RemoveAll(); - delete container_; - container_ = nullptr; } if (scrollView != nullptr) { @@ -214,6 +212,8 @@ namespace OHOS delete RECORD_GOING_LABEL3; RECORD_GOING_LABEL3 = nullptr; } + delete container_; + container_ = nullptr; } void RecordGoingView::OnStart() diff --git a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordListView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordListView.cpp index 57d9254db..1eb2c5cdd 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordListView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordListView.cpp @@ -370,7 +370,7 @@ namespace OHOS } label9->SetPosition(280, 620); // widget's left position and top position label9->Resize(200, 60); // widget's width and height - label9->SetViewId("label9"); // Set style + label9->SetViewId("label9"); // Set style label9->SetStyle(STYLE_TEXT_FONT, 20); label9->SetStyle(STYLE_LINE_HEIGHT, 23); // Set additional property @@ -405,8 +405,6 @@ namespace OHOS if (container_ != nullptr) { container_->RemoveAll(); - delete container_; - container_ = nullptr; } if (RecordListScrollView != nullptr) { @@ -493,6 +491,8 @@ namespace OHOS delete label4; label4 = nullptr; } + delete container_; + container_ = nullptr; } void RecordListView::OnStart() diff --git a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordPlayView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordPlayView.cpp index 67e2d959f..8f086fbd6 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordPlayView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordPlayView.cpp @@ -214,8 +214,6 @@ namespace OHOS if (container_ != nullptr) { container_->RemoveAll(); - delete container_; - container_ = nullptr; } if (RECORD_PLAY_BACKGROUND_IMAGE != nullptr) { @@ -287,6 +285,8 @@ namespace OHOS delete RECORD_PLAY_VOLUME_BUTTON_CLICK; RECORD_PLAY_VOLUME_BUTTON_CLICK = nullptr; } + delete container_; + container_ = nullptr; } void RecordPlayView::OnStart() diff --git a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordView.cpp index 31e7c82a8..01c2b9c43 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/record/src/RecordView.cpp @@ -162,8 +162,6 @@ namespace OHOS if (container_ != nullptr) { container_->RemoveAll(); - delete container_; - container_ = nullptr; } if (scrollView != nullptr) { @@ -195,6 +193,8 @@ namespace OHOS delete imageAnimator1_; imageAnimator1_ = nullptr; } + delete container_; + container_ = nullptr; } void RecordView::OnStart() { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingItemView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingItemView.cpp index 207a6cfbc..b0ed32b68 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingItemView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingItemView.cpp @@ -52,6 +52,7 @@ namespace OHOS { void SettingItemView::SetUpChild() { + sBackgroundImage.SetPosition(0,0); sBackgroundImage.SetSrc(PNG_SETTING_BACKGROUND_IMAGE); sIcon.SetPosition(SETTING_ICON_X, SETTING_SICON_Y); sIcon.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingView.cpp index 009ca2fdc..322647180 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingView.cpp @@ -12,12 +12,12 @@ #include "SettingPresenter.h" namespace OHOS { -static constexpr uint8_t SETTINGS_ITEM_FONT_SIZE = 40; +static constexpr uint8_t SETTINGS_ITEM_FONT_SIZE = 30; static constexpr int16_t SETTINGS_RESIZE_SIZE_WIDTH = 100; static constexpr int16_t SETTINGS_RESIZE_SIZE_HEIGHT = 60; -static constexpr int16_t SETTING_TITLE_POSITION_X = 187; -static constexpr int16_t SETTING_LIST_POSITION_X = 32; -static constexpr int16_t SETTING_LIST_POSITION_Y = 90; +static constexpr int16_t SETTING_TITLE_POSITION_X = 203; +static constexpr int16_t SETTING_LIST_POSITION_X = 43; +static constexpr int16_t SETTING_LIST_POSITION_Y = 120; static constexpr int16_t SETTING_SCROLLBLANKSIZE = 50; static constexpr int16 MAX_SCR_DIS = 1000; static constexpr int16 LIST_POS = 20; @@ -67,10 +67,11 @@ void SettingView::OnStart() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingView::OnStart::title is nullptr"); return; } - title->SetPosition(SETTING_TITLE_POSITION_X, 0); + title->SetPosition(SETTING_TITLE_POSITION_X, 52); title->SetText("设置"); title->Resize(SETTINGS_RESIZE_SIZE_WIDTH, SETTINGS_RESIZE_SIZE_HEIGHT); title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, SETTINGS_ITEM_FONT_SIZE); + title->SetStyle(STYLE_LINE_HEIGHT, 35); title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); title->SetStyle(STYLE_TEXT_OPA, OPA_OPAQUE); title->SetStyle(STYLE_TEXT_COLOR, Color::White().full); @@ -83,7 +84,7 @@ void SettingView::OnStart() return; } contentList->SetPosition(SETTING_LIST_POSITION_X, SETTING_LIST_POSITION_Y); - contentList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + contentList->Resize(380, 700); contentList->SetScrollBlankSize(SETTING_SCROLLBLANKSIZE); contentList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position contentList->SetDraggable(true); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/include/TraingSetCaluliView.h b/code/sdk/application/wearable/nativeapp/nativeui/traing/include/TraingSetCaluliView.h index e69de29bb..2b9f128b3 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/include/TraingSetCaluliView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/include/TraingSetCaluliView.h @@ -0,0 +1,62 @@ +#ifndef _TraingSetCaluli_VIEW_H +#define _TraingSetCaluli_VIEW_H + +#include "BaseView.h" +#include "View.h" +#include +#include "components/ui_view_group.h" +#include "components/ui_label.h" +#include "components/ui_image_view.h" +#include "components/ui_button.h" +#include "components/ui_image_animator.h" +#include "components/ui_label_button_ext.h" +#include "components/ui_chart.h" +#include "components/ui_list.h" +#include "components/icon_adapter.h" +#include "wearable_log.h" +#include "ohos_types.h" +#include "components/ui_card_page.h" +#include "components/ui_picker.h" + +#include "TraingSetCaluliPresenter.h" +namespace OHOS +{ +#define BUTTONOK "button1" + + + class TraingSetCaluliPresenter; + class TraingSetCaluliView : public View + { + + public: + TraingSetCaluliView(); + virtual ~TraingSetCaluliView(); + static TraingSetCaluliView *GetInstance(void); + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + void InitView(); + void DeInit(); + void InitLabel(UILabel *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize); + void InitButton(UIButton *&button, int left, int top, int width, int height, const char *viewId); + void InitImageView(UIImageView *&imageView, int left, int top, int width, int height, const char *viewId, const char *imagePath); + void InitUIPicker(UIPicker *&picker, int x, int y, int width, int height, const char *viewId); + void InitList(); + void PreLoad(void); + + private: + UIView::OnDragListener *draglistener{nullptr}; + TraingSetCaluliView(TraingSetCaluliView &&) = delete; + TraingSetCaluliView &operator=(TraingSetCaluliView &&) = delete; + + UIViewGroup *container_ = nullptr; + UILabel *label1_ = nullptr; + UIButton *button1_ = nullptr; + UIPicker *uiPicker1_ = nullptr; + + bool viewiInitStatus{false}; + }; +} // namespace OHOS +#endif // TraingSetCaluli_PRESENTER_H diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingLimitPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingLimitPresenter.cpp index 4369a5e5c..745fc09ae 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingLimitPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingLimitPresenter.cpp @@ -1,85 +1,107 @@ -#include "AppViewIDs.h" -#include "NativeAbility.h" - -#include -#include -#include -#include "traing/include/TraingLimitPresenter.h" -// #include "TraingLimitView.h" - -namespace OHOS -{ - - // 当前Presenter属性实例化的内存指针 - static TraingLimitPresenter *g_pTraingLimitPresenter = nullptr; - - TraingLimitPresenter::TraingLimitPresenter() - { - - g_pTraingLimitPresenter = this; - } - - TraingLimitPresenter::~TraingLimitPresenter() - { - - g_pTraingLimitPresenter = nullptr; - } - - TraingLimitPresenter *TraingLimitPresenter::GetInstance() - { - - return g_pTraingLimitPresenter; - } - - void TraingLimitPresenter::OnStart() - { - - Presenter::OnStart(); - } - - void TraingLimitPresenter::OnPause(void) - { - - Presenter::OnPause(); - } - - void TraingLimitPresenter::OnResume(void) - { - - Presenter::OnResume(); - } - - void TraingLimitPresenter::OnStop(void) - { - - Presenter::OnStop(); - } - - bool TraingLimitPresenter::OnDrag(UIView &view, const DragEvent &event) - { - - if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && - (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGMORE); - } - UNUSED(view); - return true; - } - - bool TraingLimitPresenter::OnClick(UIView &view, const ClickEvent &event) - { - // 根据控件id查找是哪个控件触发了点击回调 - if (strcmp(view.GetViewId(), BUTTON1) == 0) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); - } - if (strcmp(view.GetViewId(), "Remind") == 0) - { - // 模拟心率监测,等待20秒 - // std::this_thread::sleep_for(std::chrono::seconds(20)); - // NativeAbility::GetInstance().ChangeSlice(VIEW_TraingLimitREMIND); - } - return true; - } -} +#include "AppViewIDs.h" +#include "NativeAbility.h" + +#include +#include +#include +#include "traing/include/TraingLimitPresenter.h" +// #include "TraingLimitView.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static TraingLimitPresenter *g_pTraingLimitPresenter = nullptr; + + TraingLimitPresenter::TraingLimitPresenter() + { + + g_pTraingLimitPresenter = this; + } + + TraingLimitPresenter::~TraingLimitPresenter() + { + + g_pTraingLimitPresenter = nullptr; + } + + TraingLimitPresenter *TraingLimitPresenter::GetInstance() + { + + return g_pTraingLimitPresenter; + } + + void TraingLimitPresenter::OnStart() + { + + Presenter::OnStart(); + } + + void TraingLimitPresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void TraingLimitPresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void TraingLimitPresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool TraingLimitPresenter::OnDrag(UIView &view, const DragEvent &event) + { + + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && + (event.GetDeltaX() > 30) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGMORE); + } + UNUSED(view); + return true; + } + + bool TraingLimitPresenter::OnClick(UIView &view, const ClickEvent &event) + { + // 根据控件id查找是哪个控件触发了点击回调 + if (strcmp(view.GetViewId(), BUTTON1) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); + } + if (strcmp(view.GetViewId(), BUTTON2) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); + } + if (strcmp(view.GetViewId(), BUTTON3) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); + } + if (strcmp(view.GetViewId(), BUTTON4) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); + } + if (strcmp(view.GetViewId(), BUTTON5) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); + } + if (strcmp(view.GetViewId(), BUTTON6) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); + } + if (strcmp(view.GetViewId(), BUTTON7) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); + } + if (strcmp(view.GetViewId(), BUTTON8) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); + } + return true; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingLimitView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingLimitView.cpp index 6d5bbda37..5ebde5cf3 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingLimitView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingLimitView.cpp @@ -1,402 +1,400 @@ - -#include "traing/include/TraingLimitView.h" - -#include "common/image_cache_manager.h" -#include "UiConfig.h" -#include "ui_resource_image.h" -#include -#include "components/ui_button.h" -namespace OHOS -{ - - static char *text[] = {"一般极限运动", "滑板", "高空弹跳/蹦极", "跑酷", "BMX", "定向越野", "跳伞", "铁人三项运动"}; - static const char *imagePath_iocn = "/user/res/Training/icon.bin"; - - static TraingLimitView *g_pTraingLimitView{nullptr}; - - TraingLimitView::TraingLimitView() - { - g_pTraingLimitView = this; - } - - TraingLimitView::~TraingLimitView() - { - DeInit(); - g_pTraingLimitView = nullptr; - } - - TraingLimitView *TraingLimitView::GetInstance() - { - - return g_pTraingLimitView; - } - /* - InitLabel:初始化标签 - @param label 标签指针 - @param left 标签左边位置 - @param top 标签顶部位置 - @param width 标签宽度 - @param height 标签高度 - @param viewId 标签的视图 ID - @param text 标签显示的文本 - @param fontName 字体名称 - @param fontSize 字体大小 - */ - void TraingLimitView::InitLabel(UILabel *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize) - { - // 检查标签指针是否为空 - if (label == nullptr) - { - label = new UILabel(); - } - // 设置标签的位置和大小 - label->SetPosition(left, top); - label->Resize(width, height); - // 设置标签的视图 ID - label->SetViewId(viewId); - // 设置标签的样式 - label->SetStyle(STYLE_TEXT_FONT, fontSize); - label->SetFont(fontName, fontSize); - // 设置标签的文本和其他属性 - label->SetText(text); - label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label->SetRollSpeed(0); - // 设置标签可见 - label->SetVisible(true); - } - /* - InitButton:初始化按钮 - @param button 按钮指针 - @param left 按钮左边位置 - @param top 按钮顶部位置 - @param width 按钮宽度 - @param height 按钮高度 - @param viewId 按钮的视图 ID - */ - void TraingLimitView::InitButton(UIButton *&button, int left, int top, int width, int height, const char *viewId) - { - // 设置按钮的背景颜色 - uint32_t backgroundColor = 0xff191919; // 默认背景颜色 - uint32_t pressedBackgroundColor = 0xff249115; // 按下时的背景颜色 - uint32_t pressedBorderColor = 0xff0b1928; // 按下时的边框颜色 - // 创建新按钮(如果当前按钮为空) - if (button == nullptr) - { - button = new UIButton(); - } - button->SetPosition(left, top); - button->Resize(width, height); - button->SetViewId(viewId); - button->SetStyle(STYLE_BACKGROUND_COLOR, backgroundColor); - button->SetStyleForState(STYLE_BACKGROUND_COLOR, pressedBackgroundColor, UIButton::PRESSED); - button->SetStyleForState(STYLE_BORDER_COLOR, pressedBorderColor, UIButton::PRESSED); - // 设置按钮的点击事件监听器为 TraingLimitPresenter 的实例 - button->SetOnClickListener(static_cast(TraingLimitPresenter::GetInstance())); - // 设置按钮可见 - button->SetVisible(true); - } - - /* - InitImageView:初始化图片 - @param imageView 图片指针 - @param left 图片左边位置 - @param top 图片顶部位置 - @param width 图片宽度 - @param height 图片高度 - @param viewId 图片的视图 ID - @param imagePath 图片路径 - */ - void TraingLimitView::InitImageView(UIImageView *&imageView, int left, int top, int width, int height, const char *viewId, const char *imagePath) - { - if (imageView == nullptr) - { - imageView = new UIImageView(); - } - imageView->SetPosition(left, top); - imageView->Resize(width, height); - imageView->SetViewId(viewId); - imageView->SetSrc(imagePath); - imageView->SetVisible(true); - } - - /* Traing:初始化list */ - void TraingLimitView::InitList() - { - // Add List to App - if (list1_ == nullptr) - { - list1_ = new UIList(); - } - list1_->SetPosition(35, 110); // widget's left position and top position - list1_->Resize(300, 1100); // widget's width and height - list1_->SetViewId("list1"); // Set style - list1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - list1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property - if (list1data_ == nullptr) - { - list1data_ = new List(); - } - - // 使用全局变量来初始化列表项 - for (int i = 0; i < 8; ++i) - { - IconItemNode *listData = new IconItemNode(); - //listData->imagePath = imagePaths[i]; - listData->txt = text[i]; - list1data_->PushBack(listData); - } - - if (list1adapter_ == nullptr) - { - list1adapter_ = new IconAdapter(); - } - list1adapter_->SetItemSize(250, 120); - list1adapter_->SetImageSize(130, 120); - list1adapter_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - list1adapter_->SetData(list1data_); - list1_->SetAdapter(list1adapter_); - - // Add to scrollView1 - // scrollView1_->Add(list1_); - list1_->SetVisible(true); - } - /* InitView:初始化界面*/ - void TraingLimitView ::InitView() - { - if (container_ == nullptr) - { - container_ = new UIViewGroup(); - container_->SetPosition(0, 0, 466, 466); - container_->SetStyle(STYLE_BACKGROUND_OPA, 0); - } - // Add ScrollView to App - if (scrollView1_ == nullptr) - { - scrollView1_ = new UIScrollView(); - } - scrollView1_->SetPosition(0, 0); // widget's left position and top position - scrollView1_->Resize(466, 466); // widget's width and height - scrollView1_->SetViewId("scrollView1"); // Set style - scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - // Add to rootView - container_->Add(scrollView1_); - scrollView1_->SetVisible(true); - - // 初始化Lable - InitLabel(label1_, 203, 52, 200, 60, "label1", "训练", DEFAULT_VECTOR_FONT_FILENAME, 30); - scrollView1_->Add(label1_); - // 初始化Button - InitButton(button1_, 43, 120, 380, 100, BUTTON1); - InitButton(button2_, 43, 240, 380, 100, BUTTON1); - InitButton(button1_, 43, 120, 380, 100, BUTTON1); - InitButton(button2_, 43, 240, 380, 100, BUTTON1); - InitButton(button3_, 43, 360, 380, 100, BUTTON1); - InitButton(button4_, 43, 480, 380, 100, BUTTON1); - InitButton(button5_, 43, 600, 380, 100, BUTTON1); - InitButton(button6_, 43, 720, 380, 100, BUTTON1); - InitButton(button7_, 43, 840, 380, 100, BUTTON1); - InitButton(button8_, 43, 960, 380, 100, BUTTON1); - scrollView1_->Add(button1_); - scrollView1_->Add(button2_); - scrollView1_->Add(button3_); - scrollView1_->Add(button4_); - scrollView1_->Add(button5_); - scrollView1_->Add(button6_); - scrollView1_->Add(button7_); - scrollView1_->Add(button8_); - // 初始化image - InitImageView(image1_, 360, 160, 100, 100, "image1", imagePath_iocn); - InitImageView(image2_, 360, 280, 100, 100, "image2", imagePath_iocn); - InitImageView(image3_, 360, 400, 100, 100, "image3", imagePath_iocn); - InitImageView(image4_, 360, 520, 100, 100, "image4", imagePath_iocn); - InitImageView(image5_, 360, 640, 100, 100, "image5", imagePath_iocn); - InitImageView(image6_, 360, 760, 100, 100, "image6", imagePath_iocn); - InitImageView(image7_, 360, 880, 100, 100, "image7", imagePath_iocn); - InitImageView(image8_, 360, 1000, 100, 100, "image8", imagePath_iocn); - scrollView1_->Add(image1_); - scrollView1_->Add(image2_); - scrollView1_->Add(image3_); - scrollView1_->Add(image4_); - scrollView1_->Add(image5_); - scrollView1_->Add(image6_); - scrollView1_->Add(image7_); - scrollView1_->Add(image8_); - // 初始化list - InitList(); - scrollView1_->Add(list1_); - } - /* DeInit:删除组件*/ - void TraingLimitView::DeInit() - { - if (label1_ != nullptr) - { - delete label1_; - label1_ = nullptr; - } - if (button1_ != nullptr) - { - delete button1_; - button1_ = nullptr; - } - if (button8_ != nullptr) - { - delete button8_; - button8_ = nullptr; - } - if (button7_ != nullptr) - { - delete button7_; - button7_ = nullptr; - } - if (button6_ != nullptr) - { - delete button6_; - button6_ = nullptr; - } - if (button5_ != nullptr) - { - delete button5_; - button5_ = nullptr; - } - if (button4_ != nullptr) - { - delete button4_; - button4_ = nullptr; - } - if (button3_ != nullptr) - { - delete button3_; - button3_ = nullptr; - } - if (button2_ != nullptr) - { - delete button2_; - button2_ = nullptr; - } - if (image1_ != nullptr) - { - delete image1_; - image1_ = nullptr; - } - if (image2_ != nullptr) - { - delete image2_; - image2_ = nullptr; - } - if (image3_ != nullptr) - { - delete image3_; - image3_ = nullptr; - } - if (image4_ != nullptr) - { - delete image4_; - image4_ = nullptr; - } - if (image5_ != nullptr) - { - delete image5_; - image5_ = nullptr; - } - if (image6_ != nullptr) - { - delete image6_; - image6_ = nullptr; - } - if (image7_ != nullptr) - { - delete image7_; - image7_ = nullptr; - } - if (image8_ != nullptr) - { - delete image8_; - image8_ = nullptr; - } - if (list1_ != nullptr) - { - delete list1_; - list1_ = nullptr; - } - if (list1adapter_ != nullptr) - { - delete list1adapter_; - list1adapter_ = nullptr; - } - if (list1data_ != nullptr) - { - list1data_->Clear(); - delete list1data_; - list1data_ = nullptr; - } - if (scrollView1_ != nullptr) - { - delete scrollView1_; - scrollView1_ = nullptr; - } - if (container_ != nullptr) - { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } - } - - void TraingLimitView::PreLoad(void) - { - if (!viewiInitStatus) - { - InitView(); - viewiInitStatus = true; - } - } - void TraingLimitView::OnStart() - { - container_ = new UIViewGroup(); - if (container_ == nullptr) - { - return; - } - container_->SetPosition(0, 0); - container_->SetWidth(Screen::GetInstance().GetWidth()); - container_->SetHeight(Screen::GetInstance().GetHeight()); - - // 创建 draglistener 实例并设置为拖动监听器 - UIView::OnDragListener *draglistener = static_cast(TraingLimitPresenter::GetInstance()); - if (draglistener == nullptr) - { - return; - } - container_->SetOnDragListener(draglistener); - - container_->SetTouchable(true); - container_->SetDraggable(true); - - PreLoad(); - RootView::GetInstance()->Add(container_); - } - - void TraingLimitView::OnSetUpView() - { - - View::OnSetUpView(); - Draw(); - } - - void TraingLimitView::OnTearDownView() - { - - View::OnTearDownView(); - return; - } - - void TraingLimitView::OnStop() - { - View::OnStop(); - RootView::GetInstance()->RemoveAll(); - return; - } -} + +#include "traing/include/TraingLimitView.h" + +#include "common/image_cache_manager.h" +#include "UiConfig.h" +#include "ui_resource_image.h" +#include +#include "components/ui_button.h" +namespace OHOS +{ + + static char *text[] = {"一般极限运动", "滑板", "高空弹跳/蹦极", "跑酷", "BMX", "定向越野", "跳伞", "铁人三项运动"}; + static const char *imagePath_iocn = "/user/res/Training/icon.bin"; + + static TraingLimitView *g_pTraingLimitView{nullptr}; + + TraingLimitView::TraingLimitView() + { + g_pTraingLimitView = this; + } + + TraingLimitView::~TraingLimitView() + { + DeInit(); + g_pTraingLimitView = nullptr; + } + + TraingLimitView *TraingLimitView::GetInstance() + { + + return g_pTraingLimitView; + } + /* + InitLabel:初始化标签 + @param label 标签指针 + @param left 标签左边位置 + @param top 标签顶部位置 + @param width 标签宽度 + @param height 标签高度 + @param viewId 标签的视图 ID + @param text 标签显示的文本 + @param fontName 字体名称 + @param fontSize 字体大小 + */ + void TraingLimitView::InitLabel(UILabel *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize) + { + // 检查标签指针是否为空 + if (label == nullptr) + { + label = new UILabel(); + } + // 设置标签的位置和大小 + label->SetPosition(left, top); + label->Resize(width, height); + // 设置标签的视图 ID + label->SetViewId(viewId); + // 设置标签的样式 + label->SetStyle(STYLE_TEXT_FONT, fontSize); + label->SetFont(fontName, fontSize); + // 设置标签的文本和其他属性 + label->SetText(text); + label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label->SetRollSpeed(0); + // 设置标签可见 + label->SetVisible(true); + } + /* + InitButton:初始化按钮 + @param button 按钮指针 + @param left 按钮左边位置 + @param top 按钮顶部位置 + @param width 按钮宽度 + @param height 按钮高度 + @param viewId 按钮的视图 ID + */ + void TraingLimitView::InitButton(UIButton *&button, int left, int top, int width, int height, const char *viewId) + { + // 设置按钮的背景颜色 + uint32_t backgroundColor = 0xff191919; // 默认背景颜色 + uint32_t pressedBackgroundColor = 0xff249115; // 按下时的背景颜色 + uint32_t pressedBorderColor = 0xff0b1928; // 按下时的边框颜色 + // 创建新按钮(如果当前按钮为空) + if (button == nullptr) + { + button = new UIButton(); + } + button->SetPosition(left, top); + button->Resize(width, height); + button->SetViewId(viewId); + button->SetStyle(STYLE_BACKGROUND_COLOR, backgroundColor); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, pressedBackgroundColor, UIButton::PRESSED); + button->SetStyleForState(STYLE_BORDER_COLOR, pressedBorderColor, UIButton::PRESSED); + // 设置按钮的点击事件监听器为 TraingLimitPresenter 的实例 + button->SetOnClickListener(static_cast(TraingLimitPresenter::GetInstance())); + // 设置按钮可见 + button->SetVisible(true); + } + + /* + InitImageView:初始化图片 + @param imageView 图片指针 + @param left 图片左边位置 + @param top 图片顶部位置 + @param width 图片宽度 + @param height 图片高度 + @param viewId 图片的视图 ID + @param imagePath 图片路径 + */ + void TraingLimitView::InitImageView(UIImageView *&imageView, int left, int top, int width, int height, const char *viewId, const char *imagePath) + { + if (imageView == nullptr) + { + imageView = new UIImageView(); + } + imageView->SetPosition(left, top); + imageView->Resize(width, height); + imageView->SetViewId(viewId); + imageView->SetSrc(imagePath); + imageView->SetVisible(true); + } + + /* Traing:初始化list */ + void TraingLimitView::InitList() + { + // Add List to App + if (list1_ == nullptr) + { + list1_ = new UIList(); + } + list1_->SetPosition(35, 110); // widget's left position and top position + list1_->Resize(300, 1100); // widget's width and height + list1_->SetViewId("list1"); // Set style + list1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + list1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + // Set additional property + if (list1data_ == nullptr) + { + list1data_ = new List(); + } + + // 使用全局变量来初始化列表项 + for (int i = 0; i < 8; ++i) + { + IconItemNode *listData = new IconItemNode(); + //listData->imagePath = imagePaths[i]; + listData->txt = text[i]; + list1data_->PushBack(listData); + } + + if (list1adapter_ == nullptr) + { + list1adapter_ = new IconAdapter(); + } + list1adapter_->SetItemSize(250, 120); + list1adapter_->SetImageSize(130, 120); + list1adapter_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + list1adapter_->SetData(list1data_); + list1_->SetAdapter(list1adapter_); + + // Add to scrollView1 + // scrollView1_->Add(list1_); + list1_->SetVisible(true); + } + /* InitView:初始化界面*/ + void TraingLimitView ::InitView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + } + // Add ScrollView to App + if (scrollView1_ == nullptr) + { + scrollView1_ = new UIScrollView(); + } + scrollView1_->SetPosition(0, 0); // widget's left position and top position + scrollView1_->Resize(466, 466); // widget's width and height + scrollView1_->SetViewId("scrollView1"); // Set style + scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + // Add to rootView + container_->Add(scrollView1_); + scrollView1_->SetVisible(true); + + // 初始化Lable + InitLabel(label1_, 173, 52, 200, 60, "label1", "极限训练", DEFAULT_VECTOR_FONT_FILENAME, 30); + scrollView1_->Add(label1_); + // 初始化Button + InitButton(button1_, 43, 120, 380, 100, BUTTON1); + InitButton(button2_, 43, 240, 380, 100, BUTTON2); + InitButton(button3_, 43, 360, 380, 100, BUTTON3); + InitButton(button4_, 43, 480, 380, 100, BUTTON4); + InitButton(button5_, 43, 600, 380, 100, BUTTON5); + InitButton(button6_, 43, 720, 380, 100, BUTTON6); + InitButton(button7_, 43, 840, 380, 100, BUTTON7); + InitButton(button8_, 43, 960, 380, 100, BUTTON8); + scrollView1_->Add(button1_); + scrollView1_->Add(button2_); + scrollView1_->Add(button3_); + scrollView1_->Add(button4_); + scrollView1_->Add(button5_); + scrollView1_->Add(button6_); + scrollView1_->Add(button7_); + scrollView1_->Add(button8_); + // 初始化image + InitImageView(image1_, 360, 160, 100, 100, "image1", imagePath_iocn); + InitImageView(image2_, 360, 280, 100, 100, "image2", imagePath_iocn); + InitImageView(image3_, 360, 400, 100, 100, "image3", imagePath_iocn); + InitImageView(image4_, 360, 520, 100, 100, "image4", imagePath_iocn); + InitImageView(image5_, 360, 640, 100, 100, "image5", imagePath_iocn); + InitImageView(image6_, 360, 760, 100, 100, "image6", imagePath_iocn); + InitImageView(image7_, 360, 880, 100, 100, "image7", imagePath_iocn); + InitImageView(image8_, 360, 1000, 100, 100, "image8", imagePath_iocn); + scrollView1_->Add(image1_); + scrollView1_->Add(image2_); + scrollView1_->Add(image3_); + scrollView1_->Add(image4_); + scrollView1_->Add(image5_); + scrollView1_->Add(image6_); + scrollView1_->Add(image7_); + scrollView1_->Add(image8_); + // 初始化list + InitList(); + scrollView1_->Add(list1_); + } + /* DeInit:删除组件*/ + void TraingLimitView::DeInit() + { + if (label1_ != nullptr) + { + delete label1_; + label1_ = nullptr; + } + if (button1_ != nullptr) + { + delete button1_; + button1_ = nullptr; + } + if (button8_ != nullptr) + { + delete button8_; + button8_ = nullptr; + } + if (button7_ != nullptr) + { + delete button7_; + button7_ = nullptr; + } + if (button6_ != nullptr) + { + delete button6_; + button6_ = nullptr; + } + if (button5_ != nullptr) + { + delete button5_; + button5_ = nullptr; + } + if (button4_ != nullptr) + { + delete button4_; + button4_ = nullptr; + } + if (button3_ != nullptr) + { + delete button3_; + button3_ = nullptr; + } + if (button2_ != nullptr) + { + delete button2_; + button2_ = nullptr; + } + if (image1_ != nullptr) + { + delete image1_; + image1_ = nullptr; + } + if (image2_ != nullptr) + { + delete image2_; + image2_ = nullptr; + } + if (image3_ != nullptr) + { + delete image3_; + image3_ = nullptr; + } + if (image4_ != nullptr) + { + delete image4_; + image4_ = nullptr; + } + if (image5_ != nullptr) + { + delete image5_; + image5_ = nullptr; + } + if (image6_ != nullptr) + { + delete image6_; + image6_ = nullptr; + } + if (image7_ != nullptr) + { + delete image7_; + image7_ = nullptr; + } + if (image8_ != nullptr) + { + delete image8_; + image8_ = nullptr; + } + if (list1_ != nullptr) + { + delete list1_; + list1_ = nullptr; + } + if (list1adapter_ != nullptr) + { + delete list1adapter_; + list1adapter_ = nullptr; + } + if (list1data_ != nullptr) + { + list1data_->Clear(); + delete list1data_; + list1data_ = nullptr; + } + if (scrollView1_ != nullptr) + { + delete scrollView1_; + scrollView1_ = nullptr; + } + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + } + + void TraingLimitView::PreLoad(void) + { + if (!viewiInitStatus) + { + InitView(); + viewiInitStatus = true; + } + } + void TraingLimitView::OnStart() + { + container_ = new UIViewGroup(); + if (container_ == nullptr) + { + return; + } + container_->SetPosition(0, 0); + container_->SetWidth(Screen::GetInstance().GetWidth()); + container_->SetHeight(Screen::GetInstance().GetHeight()); + + // 创建 draglistener 实例并设置为拖动监听器 + UIView::OnDragListener *draglistener = static_cast(TraingLimitPresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + + container_->SetTouchable(true); + container_->SetDraggable(true); + + PreLoad(); + RootView::GetInstance()->Add(container_); + } + + void TraingLimitView::OnSetUpView() + { + + View::OnSetUpView(); + Draw(); + } + + void TraingLimitView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void TraingLimitView::OnStop() + { + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingMorePresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingMorePresenter.cpp index 44b698949..5b6f363ac 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingMorePresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingMorePresenter.cpp @@ -1,85 +1,107 @@ -#include "AppViewIDs.h" -#include "NativeAbility.h" - -#include -#include -#include -#include "traing/include/TraingMorePresenter.h" -// #include "TraingMoreView.h" - -namespace OHOS -{ - - // 当前Presenter属性实例化的内存指针 - static TraingMorePresenter *g_pTraingMorePresenter = nullptr; - - TraingMorePresenter::TraingMorePresenter() - { - - g_pTraingMorePresenter = this; - } - - TraingMorePresenter::~TraingMorePresenter() - { - - g_pTraingMorePresenter = nullptr; - } - - TraingMorePresenter *TraingMorePresenter::GetInstance() - { - - return g_pTraingMorePresenter; - } - - void TraingMorePresenter::OnStart() - { - - Presenter::OnStart(); - } - - void TraingMorePresenter::OnPause(void) - { - - Presenter::OnPause(); - } - - void TraingMorePresenter::OnResume(void) - { - - Presenter::OnResume(); - } - - void TraingMorePresenter::OnStop(void) - { - - Presenter::OnStop(); - } - - bool TraingMorePresenter::OnDrag(UIView &view, const DragEvent &event) - { - - if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && - (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING); - } - UNUSED(view); - return true; - } - - bool TraingMorePresenter::OnClick(UIView &view, const ClickEvent &event) - { - // 根据控件id查找是哪个控件触发了点击回调 - if (strcmp(view.GetViewId(), BUTTON_LIMIT) == 0) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGLIMIT); - } - if (strcmp(view.GetViewId(), "Remind") == 0) - { - // 模拟心率监测,等待20秒 - // std::this_thread::sleep_for(std::chrono::seconds(20)); - // NativeAbility::GetInstance().ChangeSlice(VIEW_TraingMoreREMIND); - } - return true; - } -} +#include "AppViewIDs.h" +#include "NativeAbility.h" + +#include +#include +#include +#include "traing/include/TraingMorePresenter.h" +// #include "TraingMoreView.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static TraingMorePresenter *g_pTraingMorePresenter = nullptr; + + TraingMorePresenter::TraingMorePresenter() + { + + g_pTraingMorePresenter = this; + } + + TraingMorePresenter::~TraingMorePresenter() + { + + g_pTraingMorePresenter = nullptr; + } + + TraingMorePresenter *TraingMorePresenter::GetInstance() + { + + return g_pTraingMorePresenter; + } + + void TraingMorePresenter::OnStart() + { + + Presenter::OnStart(); + } + + void TraingMorePresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void TraingMorePresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void TraingMorePresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool TraingMorePresenter::OnDrag(UIView &view, const DragEvent &event) + { + + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && + (event.GetDeltaX() > 40) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING); + } + UNUSED(view); + return true; + } + + bool TraingMorePresenter::OnClick(UIView &view, const ClickEvent &event) + { + // 根据控件id查找是哪个控件触发了点击回调 + if (strcmp(view.GetViewId(), BUTTON_BALL) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGLIMIT); + } + if (strcmp(view.GetViewId(), BUTTON_DANCE) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGLIMIT); + } + if (strcmp(view.GetViewId(), BUTTON_FITNESS) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGLIMIT); + } + if (strcmp(view.GetViewId(), BUTTON_ICE) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGLIMIT); + } + if (strcmp(view.GetViewId(), BUTTON_LIMIT) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGLIMIT); + } + if (strcmp(view.GetViewId(), BUTTON_OTHER) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGLIMIT); + } + if (strcmp(view.GetViewId(), BUTTON_REST) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGLIMIT); + } + if (strcmp(view.GetViewId(), BUTTON_SWIMMING) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGLIMIT); + } + return true; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingMoreView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingMoreView.cpp index 77a821f0f..f8210771a 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingMoreView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingMoreView.cpp @@ -1,411 +1,411 @@ - -#include "traing/include/TraingMoreView.h" - -#include "common/image_cache_manager.h" -#include "UiConfig.h" -#include "ui_resource_image.h" -#include -#include "components/ui_button.h" -namespace OHOS -{ - // 定义全局变量 - static char *imagePaths[] = {"/user/res/Training/Fitness.bin", - "/user/res/Training/Dance.bin", - "/user/res/Training/Rest.bin", - "/user/res/Training/Ball.bin", - "/user/res/Training/Swimming.bin", - "/user/res/Training/Ice.bin", - "/user/res/Training/Limit.bin", - "/user/res/Training/Other.bin"}; - - static char *text[] = {"健身类", "舞蹈类", "休闲运动", "球类", "水上运动", "冰上运动", "极限运动", "其他"}; - static const char *imagePath_iocn = "/user/res/Training/icon.bin"; - - static TraingMoreView *g_pTraingMoreView{nullptr}; - - TraingMoreView::TraingMoreView() - { - g_pTraingMoreView = this; - } - - TraingMoreView::~TraingMoreView() - { - DeInit(); - g_pTraingMoreView = nullptr; - } - - TraingMoreView *TraingMoreView::GetInstance() - { - - return g_pTraingMoreView; - } - /* - InitLabel:初始化标签 - @param label 标签指针 - @param left 标签左边位置 - @param top 标签顶部位置 - @param width 标签宽度 - @param height 标签高度 - @param viewId 标签的视图 ID - @param text 标签显示的文本 - @param fontName 字体名称 - @param fontSize 字体大小 - */ - void TraingMoreView::InitLabel(UILabel *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize) - { - // 检查标签指针是否为空 - if (label == nullptr) - { - label = new UILabel(); - } - // 设置标签的位置和大小 - label->SetPosition(left, top); - label->Resize(width, height); - // 设置标签的视图 ID - label->SetViewId(viewId); - // 设置标签的样式 - label->SetStyle(STYLE_TEXT_FONT, fontSize); - label->SetFont(fontName, fontSize); - // 设置标签的文本和其他属性 - label->SetText(text); - label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label->SetRollSpeed(0); - // 设置标签可见 - label->SetVisible(true); - } - /* - InitButton:初始化按钮 - @param button 按钮指针 - @param left 按钮左边位置 - @param top 按钮顶部位置 - @param width 按钮宽度 - @param height 按钮高度 - @param viewId 按钮的视图 ID - */ - void TraingMoreView::InitButton(UIButton *&button, int left, int top, int width, int height, const char *viewId) - { - // 设置按钮的背景颜色 - uint32_t backgroundColor = 0xff191919; // 默认背景颜色 - uint32_t pressedBackgroundColor = 0xff249115; // 按下时的背景颜色 - uint32_t pressedBorderColor = 0xff0b1928; // 按下时的边框颜色 - // 创建新按钮(如果当前按钮为空) - if (button == nullptr) - { - button = new UIButton(); - } - button->SetPosition(left, top); - button->Resize(width, height); - button->SetViewId(viewId); - button->SetStyle(STYLE_BACKGROUND_COLOR, backgroundColor); - button->SetStyleForState(STYLE_BACKGROUND_COLOR, pressedBackgroundColor, UIButton::PRESSED); - button->SetStyleForState(STYLE_BORDER_COLOR, pressedBorderColor, UIButton::PRESSED); - // 设置按钮的点击事件监听器为 TraingMorePresenter 的实例 - button->SetOnClickListener(static_cast(TraingMorePresenter::GetInstance())); - // 设置按钮可见 - button->SetVisible(true); - } - - /* - InitImageView:初始化图片 - @param imageView 图片指针 - @param left 图片左边位置 - @param top 图片顶部位置 - @param width 图片宽度 - @param height 图片高度 - @param viewId 图片的视图 ID - @param imagePath 图片路径 - */ - void TraingMoreView::InitImageView(UIImageView *&imageView, int left, int top, int width, int height, const char *viewId, const char *imagePath) - { - if (imageView == nullptr) - { - imageView = new UIImageView(); - } - imageView->SetPosition(left, top); - imageView->Resize(width, height); - imageView->SetViewId(viewId); - imageView->SetSrc(imagePath); - imageView->SetVisible(true); - } - - /* Traing:初始化list */ - void TraingMoreView::InitList() - { - // Add List to App - if (list1_ == nullptr) - { - list1_ = new UIList(); - } - list1_->SetPosition(35, 110); // widget's left position and top position - list1_->Resize(300, 1100); // widget's width and height - list1_->SetViewId("list1"); // Set style - list1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - list1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property - if (list1data_ == nullptr) - { - list1data_ = new List(); - } - - // 使用全局变量来初始化列表项 - for (int i = 0; i < 8; ++i) - { - IconItemNode *listData = new IconItemNode(); - listData->imagePath = imagePaths[i]; - listData->txt = text[i]; - list1data_->PushBack(listData); - } - - if (list1adapter_ == nullptr) - { - list1adapter_ = new IconAdapter(); - } - list1adapter_->SetItemSize(250, 120); - list1adapter_->SetImageSize(130, 120); - list1adapter_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - list1adapter_->SetData(list1data_); - list1_->SetAdapter(list1adapter_); - - // Add to scrollView1 - // scrollView1_->Add(list1_); - list1_->SetVisible(true); - } - /* InitView:初始化界面*/ - void TraingMoreView ::InitView() - { - if (container_ == nullptr) - { - container_ = new UIViewGroup(); - container_->SetPosition(0, 0, 466, 466); - container_->SetStyle(STYLE_BACKGROUND_OPA, 0); - } - // Add ScrollView to App - if (scrollView1_ == nullptr) - { - scrollView1_ = new UIScrollView(); - } - scrollView1_->SetPosition(0, 0); // widget's left position and top position - scrollView1_->Resize(466, 466); // widget's width and height - scrollView1_->SetViewId("scrollView1"); // Set style - scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - // Add to rootView - container_->Add(scrollView1_); - scrollView1_->SetVisible(true); - - // 初始化Lable - InitLabel(label1_, 203, 52, 200, 60, "label1", "训练", DEFAULT_VECTOR_FONT_FILENAME, 30); - scrollView1_->Add(label1_); - // 初始化Button - InitButton(button1_, 43, 120, 380, 100, BUTTON_FITNESS); - InitButton(button2_, 43, 240, 380, 100, BUTTON_DANCE); - InitButton(button1_, 43, 120, 380, 100, BUTTON_FITNESS); - InitButton(button2_, 43, 240, 380, 100, BUTTON_DANCE); - InitButton(button3_, 43, 360, 380, 100, BUTTON_REST); - InitButton(button4_, 43, 480, 380, 100, BUTTON_BALL); - InitButton(button5_, 43, 600, 380, 100, BUTTON_SWIMMING); - InitButton(button6_, 43, 720, 380, 100, BUTTON_ICE); - InitButton(button7_, 43, 840, 380, 100, BUTTON_LIMIT); - InitButton(button8_, 43, 960, 380, 100, BUTTON_OTHER); - scrollView1_->Add(button1_); - scrollView1_->Add(button2_); - scrollView1_->Add(button3_); - scrollView1_->Add(button4_); - scrollView1_->Add(button5_); - scrollView1_->Add(button6_); - scrollView1_->Add(button7_); - scrollView1_->Add(button8_); - // 初始化image - InitImageView(image1_, 360, 160, 100, 100, "image1", imagePath_iocn); - InitImageView(image2_, 360, 280, 100, 100, "image2", imagePath_iocn); - InitImageView(image3_, 360, 400, 100, 100, "image3", imagePath_iocn); - InitImageView(image4_, 360, 520, 100, 100, "image4", imagePath_iocn); - InitImageView(image5_, 360, 640, 100, 100, "image5", imagePath_iocn); - InitImageView(image6_, 360, 760, 100, 100, "image6", imagePath_iocn); - InitImageView(image7_, 360, 880, 100, 100, "image7", imagePath_iocn); - InitImageView(image8_, 360, 1000, 100, 100, "image8", imagePath_iocn); - scrollView1_->Add(image1_); - scrollView1_->Add(image2_); - scrollView1_->Add(image3_); - scrollView1_->Add(image4_); - scrollView1_->Add(image5_); - scrollView1_->Add(image6_); - scrollView1_->Add(image7_); - scrollView1_->Add(image8_); - // 初始化list - InitList(); - scrollView1_->Add(list1_); - } - /* DeInit:删除组件*/ - void TraingMoreView::DeInit() - { - if (label1_ != nullptr) - { - delete label1_; - label1_ = nullptr; - } - if (button1_ != nullptr) - { - delete button1_; - button1_ = nullptr; - } - if (button8_ != nullptr) - { - delete button8_; - button8_ = nullptr; - } - if (button7_ != nullptr) - { - delete button7_; - button7_ = nullptr; - } - if (button6_ != nullptr) - { - delete button6_; - button6_ = nullptr; - } - if (button5_ != nullptr) - { - delete button5_; - button5_ = nullptr; - } - if (button4_ != nullptr) - { - delete button4_; - button4_ = nullptr; - } - if (button3_ != nullptr) - { - delete button3_; - button3_ = nullptr; - } - if (button2_ != nullptr) - { - delete button2_; - button2_ = nullptr; - } - if (image1_ != nullptr) - { - delete image1_; - image1_ = nullptr; - } - if (image2_ != nullptr) - { - delete image2_; - image2_ = nullptr; - } - if (image3_ != nullptr) - { - delete image3_; - image3_ = nullptr; - } - if (image4_ != nullptr) - { - delete image4_; - image4_ = nullptr; - } - if (image5_ != nullptr) - { - delete image5_; - image5_ = nullptr; - } - if (image6_ != nullptr) - { - delete image6_; - image6_ = nullptr; - } - if (image7_ != nullptr) - { - delete image7_; - image7_ = nullptr; - } - if (image8_ != nullptr) - { - delete image8_; - image8_ = nullptr; - } - if (list1_ != nullptr) - { - delete list1_; - list1_ = nullptr; - } - if (list1adapter_ != nullptr) - { - delete list1adapter_; - list1adapter_ = nullptr; - } - if (list1data_ != nullptr) - { - list1data_->Clear(); - delete list1data_; - list1data_ = nullptr; - } - if (scrollView1_ != nullptr) - { - delete scrollView1_; - scrollView1_ = nullptr; - } - if (container_ != nullptr) - { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } - } - - void TraingMoreView::PreLoad(void) - { - if (!viewiInitStatus) - { - InitView(); - viewiInitStatus = true; - } - } - void TraingMoreView::OnStart() - { - container_ = new UIViewGroup(); - if (container_ == nullptr) - { - return; - } - container_->SetPosition(0, 0); - container_->SetWidth(Screen::GetInstance().GetWidth()); - container_->SetHeight(Screen::GetInstance().GetHeight()); - - // 创建 draglistener 实例并设置为拖动监听器 - UIView::OnDragListener *draglistener = static_cast(TraingMorePresenter::GetInstance()); - if (draglistener == nullptr) - { - return; - } - container_->SetOnDragListener(draglistener); - - container_->SetTouchable(true); - container_->SetDraggable(true); - - PreLoad(); - RootView::GetInstance()->Add(container_); - } - - void TraingMoreView::OnSetUpView() - { - - View::OnSetUpView(); - Draw(); - } - - void TraingMoreView::OnTearDownView() - { - - View::OnTearDownView(); - return; - } - - void TraingMoreView::OnStop() - { - View::OnStop(); - RootView::GetInstance()->RemoveAll(); - return; - } -} + +#include "traing/include/TraingMoreView.h" + +#include "common/image_cache_manager.h" +#include "UiConfig.h" +#include "ui_resource_image.h" +#include +#include "components/ui_button.h" +namespace OHOS +{ + // 定义全局变量 + static char *imagePaths[] = {"/user/res/Training/Fitness.bin", + "/user/res/Training/Dance.bin", + "/user/res/Training/Rest.bin", + "/user/res/Training/Ball.bin", + "/user/res/Training/Swimming.bin", + "/user/res/Training/Ice.bin", + "/user/res/Training/Limit.bin", + "/user/res/Training/Other.bin"}; + + static char *text[] = {"健身类", "舞蹈类", "休闲运动", "球类", "水上运动", "冰上运动", "极限运动", "其他"}; + static const char *imagePath_iocn = "/user/res/Training/icon.bin"; + + static TraingMoreView *g_pTraingMoreView{nullptr}; + + TraingMoreView::TraingMoreView() + { + g_pTraingMoreView = this; + } + + TraingMoreView::~TraingMoreView() + { + DeInit(); + g_pTraingMoreView = nullptr; + } + + TraingMoreView *TraingMoreView::GetInstance() + { + + return g_pTraingMoreView; + } + /* + InitLabel:初始化标签 + @param label 标签指针 + @param left 标签左边位置 + @param top 标签顶部位置 + @param width 标签宽度 + @param height 标签高度 + @param viewId 标签的视图 ID + @param text 标签显示的文本 + @param fontName 字体名称 + @param fontSize 字体大小 + */ + void TraingMoreView::InitLabel(UILabel *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize) + { + // 检查标签指针是否为空 + if (label == nullptr) + { + label = new UILabel(); + } + // 设置标签的位置和大小 + label->SetPosition(left, top); + label->Resize(width, height); + // 设置标签的视图 ID + label->SetViewId(viewId); + // 设置标签的样式 + label->SetStyle(STYLE_TEXT_FONT, fontSize); + label->SetFont(fontName, fontSize); + // 设置标签的文本和其他属性 + label->SetText(text); + label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label->SetRollSpeed(0); + // 设置标签可见 + label->SetVisible(true); + } + /* + InitButton:初始化按钮 + @param button 按钮指针 + @param left 按钮左边位置 + @param top 按钮顶部位置 + @param width 按钮宽度 + @param height 按钮高度 + @param viewId 按钮的视图 ID + */ + void TraingMoreView::InitButton(UIButton *&button, int left, int top, int width, int height, const char *viewId) + { + // 设置按钮的背景颜色 + uint32_t backgroundColor = 0xff191919; // 默认背景颜色 + uint32_t pressedBackgroundColor = 0xff249115; // 按下时的背景颜色 + uint32_t pressedBorderColor = 0xff0b1928; // 按下时的边框颜色 + // 创建新按钮(如果当前按钮为空) + if (button == nullptr) + { + button = new UIButton(); + } + button->SetPosition(left, top); + button->Resize(width, height); + button->SetViewId(viewId); + button->SetStyle(STYLE_BACKGROUND_COLOR, backgroundColor); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, pressedBackgroundColor, UIButton::PRESSED); + button->SetStyleForState(STYLE_BORDER_COLOR, pressedBorderColor, UIButton::PRESSED); + // 设置按钮的点击事件监听器为 TraingMorePresenter 的实例 + button->SetOnClickListener(static_cast(TraingMorePresenter::GetInstance())); + // 设置按钮可见 + button->SetVisible(true); + } + + /* + InitImageView:初始化图片 + @param imageView 图片指针 + @param left 图片左边位置 + @param top 图片顶部位置 + @param width 图片宽度 + @param height 图片高度 + @param viewId 图片的视图 ID + @param imagePath 图片路径 + */ + void TraingMoreView::InitImageView(UIImageView *&imageView, int left, int top, int width, int height, const char *viewId, const char *imagePath) + { + if (imageView == nullptr) + { + imageView = new UIImageView(); + } + imageView->SetPosition(left, top); + imageView->Resize(width, height); + imageView->SetViewId(viewId); + imageView->SetSrc(imagePath); + imageView->SetVisible(true); + } + + /* Traing:初始化list */ + void TraingMoreView::InitList() + { + // Add List to App + if (list1_ == nullptr) + { + list1_ = new UIList(); + } + list1_->SetPosition(35, 110); // widget's left position and top position + list1_->Resize(300, 1100); // widget's width and height + list1_->SetViewId("list1"); // Set style + list1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + list1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + // Set additional property + if (list1data_ == nullptr) + { + list1data_ = new List(); + } + + // 使用全局变量来初始化列表项 + for (int i = 0; i < 8; ++i) + { + IconItemNode *listData = new IconItemNode(); + listData->imagePath = imagePaths[i]; + listData->txt = text[i]; + list1data_->PushBack(listData); + } + + if (list1adapter_ == nullptr) + { + list1adapter_ = new IconAdapter(); + } + list1adapter_->SetItemSize(250, 120); + list1adapter_->SetImageSize(130, 120); + list1adapter_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + list1adapter_->SetData(list1data_); + list1_->SetAdapter(list1adapter_); + + // Add to scrollView1 + // scrollView1_->Add(list1_); + list1_->SetVisible(true); + } + /* InitView:初始化界面*/ + void TraingMoreView ::InitView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + } + // Add ScrollView to App + if (scrollView1_ == nullptr) + { + scrollView1_ = new UIScrollView(); + } + scrollView1_->SetPosition(0, 0); // widget's left position and top position + scrollView1_->Resize(466, 466); // widget's width and height + scrollView1_->SetViewId("scrollView1"); // Set style + scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + // Add to rootView + container_->Add(scrollView1_); + scrollView1_->SetVisible(true); + + // 初始化Lable + InitLabel(label1_, 203, 52, 200, 60, "label1", "训练", DEFAULT_VECTOR_FONT_FILENAME, 30); + scrollView1_->Add(label1_); + // 初始化Button + InitButton(button1_, 43, 120, 380, 100, BUTTON_FITNESS); + InitButton(button2_, 43, 240, 380, 100, BUTTON_DANCE); + InitButton(button1_, 43, 120, 380, 100, BUTTON_FITNESS); + InitButton(button2_, 43, 240, 380, 100, BUTTON_DANCE); + InitButton(button3_, 43, 360, 380, 100, BUTTON_REST); + InitButton(button4_, 43, 480, 380, 100, BUTTON_BALL); + InitButton(button5_, 43, 600, 380, 100, BUTTON_SWIMMING); + InitButton(button6_, 43, 720, 380, 100, BUTTON_ICE); + InitButton(button7_, 43, 840, 380, 100, BUTTON_LIMIT); + InitButton(button8_, 43, 960, 380, 100, BUTTON_OTHER); + scrollView1_->Add(button1_); + scrollView1_->Add(button2_); + scrollView1_->Add(button3_); + scrollView1_->Add(button4_); + scrollView1_->Add(button5_); + scrollView1_->Add(button6_); + scrollView1_->Add(button7_); + scrollView1_->Add(button8_); + // 初始化image + InitImageView(image1_, 360, 160, 100, 100, "image1", imagePath_iocn); + InitImageView(image2_, 360, 280, 100, 100, "image2", imagePath_iocn); + InitImageView(image3_, 360, 400, 100, 100, "image3", imagePath_iocn); + InitImageView(image4_, 360, 520, 100, 100, "image4", imagePath_iocn); + InitImageView(image5_, 360, 640, 100, 100, "image5", imagePath_iocn); + InitImageView(image6_, 360, 760, 100, 100, "image6", imagePath_iocn); + InitImageView(image7_, 360, 880, 100, 100, "image7", imagePath_iocn); + InitImageView(image8_, 360, 1000, 100, 100, "image8", imagePath_iocn); + scrollView1_->Add(image1_); + scrollView1_->Add(image2_); + scrollView1_->Add(image3_); + scrollView1_->Add(image4_); + scrollView1_->Add(image5_); + scrollView1_->Add(image6_); + scrollView1_->Add(image7_); + scrollView1_->Add(image8_); + // 初始化list + InitList(); + scrollView1_->Add(list1_); + } + /* DeInit:删除组件*/ + void TraingMoreView::DeInit() + { + if (label1_ != nullptr) + { + delete label1_; + label1_ = nullptr; + } + if (button1_ != nullptr) + { + delete button1_; + button1_ = nullptr; + } + if (button8_ != nullptr) + { + delete button8_; + button8_ = nullptr; + } + if (button7_ != nullptr) + { + delete button7_; + button7_ = nullptr; + } + if (button6_ != nullptr) + { + delete button6_; + button6_ = nullptr; + } + if (button5_ != nullptr) + { + delete button5_; + button5_ = nullptr; + } + if (button4_ != nullptr) + { + delete button4_; + button4_ = nullptr; + } + if (button3_ != nullptr) + { + delete button3_; + button3_ = nullptr; + } + if (button2_ != nullptr) + { + delete button2_; + button2_ = nullptr; + } + if (image1_ != nullptr) + { + delete image1_; + image1_ = nullptr; + } + if (image2_ != nullptr) + { + delete image2_; + image2_ = nullptr; + } + if (image3_ != nullptr) + { + delete image3_; + image3_ = nullptr; + } + if (image4_ != nullptr) + { + delete image4_; + image4_ = nullptr; + } + if (image5_ != nullptr) + { + delete image5_; + image5_ = nullptr; + } + if (image6_ != nullptr) + { + delete image6_; + image6_ = nullptr; + } + if (image7_ != nullptr) + { + delete image7_; + image7_ = nullptr; + } + if (image8_ != nullptr) + { + delete image8_; + image8_ = nullptr; + } + if (list1_ != nullptr) + { + delete list1_; + list1_ = nullptr; + } + if (list1adapter_ != nullptr) + { + delete list1adapter_; + list1adapter_ = nullptr; + } + if (list1data_ != nullptr) + { + list1data_->Clear(); + delete list1data_; + list1data_ = nullptr; + } + if (scrollView1_ != nullptr) + { + delete scrollView1_; + scrollView1_ = nullptr; + } + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + } + + void TraingMoreView::PreLoad(void) + { + if (!viewiInitStatus) + { + InitView(); + viewiInitStatus = true; + } + } + void TraingMoreView::OnStart() + { + container_ = new UIViewGroup(); + if (container_ == nullptr) + { + return; + } + container_->SetPosition(0, 0); + container_->SetWidth(Screen::GetInstance().GetWidth()); + container_->SetHeight(Screen::GetInstance().GetHeight()); + + // 创建 draglistener 实例并设置为拖动监听器 + UIView::OnDragListener *draglistener = static_cast(TraingMorePresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + + container_->SetTouchable(true); + container_->SetDraggable(true); + + PreLoad(); + RootView::GetInstance()->Add(container_); + } + + void TraingMoreView::OnSetUpView() + { + + View::OnSetUpView(); + Draw(); + } + + void TraingMoreView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void TraingMoreView::OnStop() + { + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp index f546f94a7..49c769326 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp @@ -1,85 +1,83 @@ -#include "AppViewIDs.h" -#include "NativeAbility.h" - -#include -#include -#include -#include "traing/include/TraingNomalPresenter.h" -// #include "TraingNomalView.h" - -namespace OHOS -{ - - // 当前Presenter属性实例化的内存指针 - static TraingNomalPresenter *g_pTraingNomalPresenter = nullptr; - - TraingNomalPresenter::TraingNomalPresenter() - { - - g_pTraingNomalPresenter = this; - } - - TraingNomalPresenter::~TraingNomalPresenter() - { - - g_pTraingNomalPresenter = nullptr; - } - - TraingNomalPresenter *TraingNomalPresenter::GetInstance() - { - - return g_pTraingNomalPresenter; - } - - void TraingNomalPresenter::OnStart() - { - - Presenter::OnStart(); - } - - void TraingNomalPresenter::OnPause(void) - { - - Presenter::OnPause(); - } - - void TraingNomalPresenter::OnResume(void) - { - - Presenter::OnResume(); - } - - void TraingNomalPresenter::OnStop(void) - { - - Presenter::OnStop(); - } - - bool TraingNomalPresenter::OnDrag(UIView &view, const DragEvent &event) - { - - if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && - (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGMORE); - } - UNUSED(view); - return true; - } - - bool TraingNomalPresenter::OnClick(UIView &view, const ClickEvent &event) - { - // 根据控件id查找是哪个控件触发了点击回调 - if (strcmp(view.GetViewId(), BUTTONSET) == 0) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSET); - } - if (strcmp(view.GetViewId(), "Remind") == 0) - { - // 模拟心率监测,等待20秒 - // std::this_thread::sleep_for(std::chrono::seconds(20)); - // NativeAbility::GetInstance().ChangeSlice(VIEW_TraingNomalREMIND); - } - return true; - } -} +#include "AppViewIDs.h" +#include "NativeAbility.h" + +#include +#include +#include +#include "traing/include/TraingNomalPresenter.h" +// #include "TraingNomalView.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static TraingNomalPresenter *g_pTraingNomalPresenter = nullptr; + + TraingNomalPresenter::TraingNomalPresenter() + { + + g_pTraingNomalPresenter = this; + } + + TraingNomalPresenter::~TraingNomalPresenter() + { + + g_pTraingNomalPresenter = nullptr; + } + + TraingNomalPresenter *TraingNomalPresenter::GetInstance() + { + + return g_pTraingNomalPresenter; + } + + void TraingNomalPresenter::OnStart() + { + + Presenter::OnStart(); + } + + void TraingNomalPresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void TraingNomalPresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void TraingNomalPresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool TraingNomalPresenter::OnDrag(UIView &view, const DragEvent &event) + { + + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && + (event.GetDeltaX() > 40) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGMORE); + } + UNUSED(view); + return true; + } + + bool TraingNomalPresenter::OnClick(UIView &view, const ClickEvent &event) + { + // 根据控件id查找是哪个控件触发了点击回调 + if (strcmp(view.GetViewId(), BUTTONSET) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSET); + } + if (strcmp(view.GetViewId(), BUTTONGO) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGCONTROL); + } + return true; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingPresenter.cpp index fb84c41bf..f090fc82d 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingPresenter.cpp @@ -74,11 +74,17 @@ namespace OHOS { NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGMORE); } - if (strcmp(view.GetViewId(), "Remind") == 0) + if (strcmp(view.GetViewId(), BUTTON1) == 0) { - // 模拟心率监测,等待20秒 - // std::this_thread::sleep_for(std::chrono::seconds(20)); - // NativeAbility::GetInstance().ChangeSlice(VIEW_TraingREMIND); + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGGPS); + } + if (strcmp(view.GetViewId(), BUTTON2) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGGPSLACK); + } + if (strcmp(view.GetViewId(), BUTTON3) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGGPS); } return true; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetPresenter.cpp index 59eb9e1c3..fcb3da54d 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetPresenter.cpp @@ -1,85 +1,84 @@ -#include "AppViewIDs.h" -#include "NativeAbility.h" - -#include -#include -#include -#include "traing/include/TraingSetPresenter.h" -// #include "TraingSetView.h" - -namespace OHOS -{ - - // 当前Presenter属性实例化的内存指针 - static TraingSetPresenter *g_pTraingSetPresenter = nullptr; - - TraingSetPresenter::TraingSetPresenter() - { - - g_pTraingSetPresenter = this; - } - - TraingSetPresenter::~TraingSetPresenter() - { - - g_pTraingSetPresenter = nullptr; - } - - TraingSetPresenter *TraingSetPresenter::GetInstance() - { - - return g_pTraingSetPresenter; - } - - void TraingSetPresenter::OnStart() - { - - Presenter::OnStart(); - } - - void TraingSetPresenter::OnPause(void) - { - - Presenter::OnPause(); - } - - void TraingSetPresenter::OnResume(void) - { - - Presenter::OnResume(); - } - - void TraingSetPresenter::OnStop(void) - { - - Presenter::OnStop(); - } - - bool TraingSetPresenter::OnDrag(UIView &view, const DragEvent &event) - { - - if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && - (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); - } - UNUSED(view); - return true; - } - - bool TraingSetPresenter::OnClick(UIView &view, const ClickEvent &event) - { - // 根据控件id查找是哪个控件触发了点击回调 - if (strcmp(view.GetViewId(), BUTTONTIME) == 0) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSETTIME); - } - if (strcmp(view.GetViewId(), "Remind") == 0) - { - // 模拟心率监测,等待20秒 - // std::this_thread::sleep_for(std::chrono::seconds(20)); - // NativeAbility::GetInstance().ChangeSlice(VIEW_TraingSetREMIND); - } - return true; - } -} +#include "AppViewIDs.h" +#include "NativeAbility.h" + +#include +#include +#include +#include "traing/include/TraingSetPresenter.h" +// #include "TraingSetView.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static TraingSetPresenter *g_pTraingSetPresenter = nullptr; + + TraingSetPresenter::TraingSetPresenter() + { + + g_pTraingSetPresenter = this; + } + + TraingSetPresenter::~TraingSetPresenter() + { + + g_pTraingSetPresenter = nullptr; + } + + TraingSetPresenter *TraingSetPresenter::GetInstance() + { + + return g_pTraingSetPresenter; + } + + void TraingSetPresenter::OnStart() + { + + Presenter::OnStart(); + } + + void TraingSetPresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void TraingSetPresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void TraingSetPresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool TraingSetPresenter::OnDrag(UIView &view, const DragEvent &event) + { + + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && + (event.GetDeltaX() > 40) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) + { + uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); + } + UNUSED(view); + return true; + } + + bool TraingSetPresenter::OnClick(UIView &view, const ClickEvent &event) + { + // 根据控件id查找是哪个控件触发了点击回调 + if (strcmp(view.GetViewId(), BUTTONTIME) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSETTIME); + } + if (strcmp(view.GetViewId(), BUTTONCALULI) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSETCALULI); + } + return true; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetTimePresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetTimePresenter.cpp index 041d1d66c..f28506d5d 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetTimePresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetTimePresenter.cpp @@ -1,85 +1,85 @@ -#include "AppViewIDs.h" -#include "NativeAbility.h" - -#include -#include -#include -#include "traing/include/TraingSetTimePresenter.h" -// #include "TraingSetTimeView.h" - -namespace OHOS -{ - - // 当前Presenter属性实例化的内存指针 - static TraingSetTimePresenter *g_pTraingSetTimePresenter = nullptr; - - TraingSetTimePresenter::TraingSetTimePresenter() - { - - g_pTraingSetTimePresenter = this; - } - - TraingSetTimePresenter::~TraingSetTimePresenter() - { - - g_pTraingSetTimePresenter = nullptr; - } - - TraingSetTimePresenter *TraingSetTimePresenter::GetInstance() - { - - return g_pTraingSetTimePresenter; - } - - void TraingSetTimePresenter::OnStart() - { - - Presenter::OnStart(); - } - - void TraingSetTimePresenter::OnPause(void) - { - - Presenter::OnPause(); - } - - void TraingSetTimePresenter::OnResume(void) - { - - Presenter::OnResume(); - } - - void TraingSetTimePresenter::OnStop(void) - { - - Presenter::OnStop(); - } - - bool TraingSetTimePresenter::OnDrag(UIView &view, const DragEvent &event) - { - - if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && - (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSET); - } - UNUSED(view); - return true; - } - - bool TraingSetTimePresenter::OnClick(UIView &view, const ClickEvent &event) - { - // 根据控件id查找是哪个控件触发了点击回调 - if (strcmp(view.GetViewId(), " ") == 0) - { - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGNOMAL); - } - if (strcmp(view.GetViewId(), "Remind") == 0) - { - // 模拟心率监测,等待20秒 - // std::this_thread::sleep_for(std::chrono::seconds(20)); - // NativeAbility::GetInstance().ChangeSlice(VIEW_TraingSetTimeREMIND); - } - return true; - } -} +#include "AppViewIDs.h" +#include "NativeAbility.h" + +#include +#include +#include +#include "traing/include/TraingSetTimePresenter.h" +// #include "TraingSetTimeView.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static TraingSetTimePresenter *g_pTraingSetTimePresenter = nullptr; + + TraingSetTimePresenter::TraingSetTimePresenter() + { + + g_pTraingSetTimePresenter = this; + } + + TraingSetTimePresenter::~TraingSetTimePresenter() + { + + g_pTraingSetTimePresenter = nullptr; + } + + TraingSetTimePresenter *TraingSetTimePresenter::GetInstance() + { + + return g_pTraingSetTimePresenter; + } + + void TraingSetTimePresenter::OnStart() + { + + Presenter::OnStart(); + } + + void TraingSetTimePresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void TraingSetTimePresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void TraingSetTimePresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool TraingSetTimePresenter::OnDrag(UIView &view, const DragEvent &event) + { + + // if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && + // (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) + // { + // NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSET); + // } + UNUSED(view); + return true; + } + + bool TraingSetTimePresenter::OnClick(UIView &view, const ClickEvent &event) + { + // 根据控件id查找是哪个控件触发了点击回调 + if (strcmp(view.GetViewId(), BUTTONOK) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAININGSET); + } + if (strcmp(view.GetViewId(), "Remind") == 0) + { + // 模拟心率监测,等待20秒 + // std::this_thread::sleep_for(std::chrono::seconds(20)); + // NativeAbility::GetInstance().ChangeSlice(VIEW_TraingSetTimeREMIND); + } + return true; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetTimeView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetTimeView.cpp index 8edafa473..e123b4e5a 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetTimeView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetTimeView.cpp @@ -1,279 +1,279 @@ - -#include "traing/include/TraingSetTimeView.h" - -#include "common/image_cache_manager.h" -#include "UiConfig.h" -#include "ui_resource_image.h" -#include -#include "components/ui_button.h" -#include "common/screen.h" -#include -#include -#include - -namespace OHOS -{ - - /***************************************************************************************/ - // 动态生成包含指定时间区间内所有分钟数的字符串数组 - std::vector GenerateTimeValues(int minTime, int maxTime, int interval) - { - std::vector values; - for (int i = minTime; i <= maxTime; i += interval) - { - values.push_back(std::to_string(i) + "分钟"); - } - return values; - } - /***************************************************************************************/ - static TraingSetTimeView *g_pTraingSetTimeView{nullptr}; - - TraingSetTimeView::TraingSetTimeView() - { - g_pTraingSetTimeView = this; - } - - TraingSetTimeView::~TraingSetTimeView() - { - DeInit(); - g_pTraingSetTimeView = nullptr; - } - - TraingSetTimeView *TraingSetTimeView::GetInstance() - { - - return g_pTraingSetTimeView; - } - /* - InitLabel:初始化标签 - @param label 标签指针 - @param left 标签左边位置 - @param top 标签顶部位置 - @param width 标签宽度 - @param height 标签高度 - @param viewId 标签的视图 ID - @param text 标签显示的文本 - @param fontName 字体名称 - @param fontSize 字体大小 - */ - void TraingSetTimeView::InitLabel(UILabel *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize) - { - // 检查标签指针是否为空 - if (label == nullptr) - { - label = new UILabel(); - } - // 设置标签的位置和大小 - label->SetPosition(left, top); - label->Resize(width, height); - // 设置标签的视图 ID - label->SetViewId(viewId); - // 设置标签的样式 - label->SetStyle(STYLE_TEXT_FONT, fontSize); - label->SetFont(fontName, fontSize); - // 设置标签的文本和其他属性 - label->SetText(text); - label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label->SetRollSpeed(0); - // 设置标签可见 - label->SetVisible(true); - } - /* - InitButton:初始化按钮 - @param button 按钮指针 - @param left 按钮左边位置 - @param top 按钮顶部位置 - @param width 按钮宽度 - @param height 按钮高度 - @param viewId 按钮的视图 ID - */ - void TraingSetTimeView::InitButton(UIButton *&button, int left, int top, int width, int height, const char *viewId) - { - // 设置按钮的背景颜色 - uint32_t backgroundColor = 0xff191919; // 默认背景颜色 - uint32_t pressedBackgroundColor = 0xff249115; // 按下时的背景颜色 - uint32_t pressedBorderColor = 0xff0b1928; // 按下时的边框颜色 - // 创建新按钮(如果当前按钮为空) - if (button == nullptr) - { - button = new UIButton(); - } - button->SetPosition(left, top); - button->Resize(width, height); - button->SetViewId(viewId); - button->SetStyle(STYLE_BACKGROUND_COLOR, backgroundColor); - button->SetStyleForState(STYLE_BACKGROUND_COLOR, pressedBackgroundColor, UIButton::PRESSED); - button->SetStyleForState(STYLE_BORDER_COLOR, pressedBorderColor, UIButton::PRESSED); - // 设置按钮的点击事件监听器为 TraingSetTimePresenter 的实例 - button->SetOnClickListener(static_cast(TraingSetTimePresenter::GetInstance())); - // 设置按钮可见 - button->SetVisible(true); - } - /* - InitUIPicker: 初始化UIPicker组件 - @param picker: 指向UIPicker的指针 - @param x: UIPicker的左边位置 - @param y: UIPicker的顶部位置 - @param width: UIPicker的宽度 - @param height: UIPicker的高度 - @param viewId: UIPicker的视图 ID - @param values: 选项数组 - @param count: 选项数量 - @param backgroundFontSize: 普通文本大小 - @highlightFontSize: 高光文本大小 - */ - void TraingSetTimeView::InitUIPicker(UIPicker *&picker, int x, int y, int width, int height, const char *viewId) - { - // 文本大小 - constexpr uint8_t BACKGROUND_FONT = 40; - constexpr uint8_t HIGHTLIGHT_FONT = 60; - // 获取value数组 - int minTime = 10; - int maxTime = 600; - int interval = 10; - std::vector timeValues = GenerateTimeValues(minTime, maxTime, interval); - - const char **values = new const char *[timeValues.size()]; - for (size_t i = 0; i < timeValues.size(); i++) - { - values[i] = timeValues[i].c_str(); - } - // 创建 UIPicker - if (picker == nullptr) - { - picker = new UIPicker(); - } - - // 设置 UIPicker 的位置和大小 - picker->SetPosition(x, y); - picker->Resize(width, height); - // 设置 UIPicker 的 ViewId - picker->SetViewId(viewId); - // 设置 UIPicker 的属性 - picker->SetItemHeight(70); - picker->SetLoopState(true); - picker->SetTextColor(Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff), Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff)); - picker->SetBackgroundFont(DEFAULT_VECTOR_FONT_FILENAME, BACKGROUND_FONT); // 设置普通文本大小 - picker->SetHighlightFont(DEFAULT_VECTOR_FONT_FILENAME, HIGHTLIGHT_FONT); // 设置高光文本大小 - picker->SetValues(values, timeValues.size()); - // 将 UIPicker 设置为显示 - picker->SetVisible(true); - } - - /* InitView:初始化界面*/ - void TraingSetTimeView ::InitView() - { - if (container_ == nullptr) - { - container_ = new UIViewGroup(); - container_->SetPosition(0, 0, 466, 466); - container_->SetStyle(STYLE_BACKGROUND_OPA, 0); - } - // 初始化Lable - InitLabel(label1_, 173, 52, 120, 35, "label1", "时长设定", DEFAULT_VECTOR_FONT_FILENAME, 30); - container_->Add(label1_); - - // 初始化UIPicker - InitUIPicker(uiPicker1_, 43, 106, 380, 240, "uiPicker1"); - container_->Add(uiPicker1_); - // 初始化Button - InitButton(button1_, 0, 366, 466, 100, BUTTONOK); - // Set additional property - char *button1defaultImgSrc = "/user/res/Training/buttonok.bin"; - char *button1triggeredImgSrc = nullptr; - button1_->SetImageSrc(button1defaultImgSrc, button1triggeredImgSrc); - container_->Add(button1_); - } - /* DeInit:删除组件 */ - void TraingSetTimeView::DeInit() - { - // 删除Label - if (label1_ != nullptr) - { - container_->Remove(label1_); - delete label1_; - label1_ = nullptr; - } - // 删除Button - if (button1_ != nullptr) - { - container_->Remove(button1_); - delete button1_; - button1_ = nullptr; - } - - // 删除Image - - // 删除滚动选择器 - if (uiPicker1_ != nullptr) - { - container_->Remove(uiPicker1_); - delete uiPicker1_; - uiPicker1_ = nullptr; - } - - // 删除容器 - if (container_ != nullptr) - { - container_->RemoveAll(); // 移除容器中的所有组件 - delete container_; - container_ = nullptr; - } - } - - void TraingSetTimeView::PreLoad(void) - { - if (!viewiInitStatus) - { - InitView(); - viewiInitStatus = true; - } - } - void TraingSetTimeView::OnStart() - { - container_ = new UIViewGroup(); - if (container_ == nullptr) - { - return; - } - container_->SetPosition(0, 0); - container_->SetWidth(Screen::GetInstance().GetWidth()); - container_->SetHeight(Screen::GetInstance().GetHeight()); - - // 创建 draglistener 实例并设置为拖动监听器 - UIView::OnDragListener *draglistener = static_cast(TraingSetTimePresenter::GetInstance()); - if (draglistener == nullptr) - { - return; - } - container_->SetOnDragListener(draglistener); - - container_->SetTouchable(true); - container_->SetDraggable(true); - - PreLoad(); - RootView::GetInstance()->Add(container_); - } - - void TraingSetTimeView::OnSetUpView() - { - - View::OnSetUpView(); - Draw(); - } - - void TraingSetTimeView::OnTearDownView() - { - - View::OnTearDownView(); - return; - } - - void TraingSetTimeView::OnStop() - { - View::OnStop(); - RootView::GetInstance()->RemoveAll(); - return; - } -} + +#include "traing/include/TraingSetTimeView.h" + +#include "common/image_cache_manager.h" +#include "UiConfig.h" +#include "ui_resource_image.h" +#include +#include "components/ui_button.h" +#include "common/screen.h" +#include +#include +#include + +namespace OHOS +{ + + /***************************************************************************************/ + // 动态生成包含指定时间区间内所有分钟数的字符串数组 + std::vector GenerateTimeValues(int minTime, int maxTime, int interval) + { + std::vector values; + for (int i = minTime; i <= maxTime; i += interval) + { + values.push_back(std::to_string(i) + " 分钟"); + } + return values; + } + /***************************************************************************************/ + static TraingSetTimeView *g_pTraingSetTimeView{nullptr}; + + TraingSetTimeView::TraingSetTimeView() + { + g_pTraingSetTimeView = this; + } + + TraingSetTimeView::~TraingSetTimeView() + { + DeInit(); + g_pTraingSetTimeView = nullptr; + } + + TraingSetTimeView *TraingSetTimeView::GetInstance() + { + + return g_pTraingSetTimeView; + } + /* + InitLabel:初始化标签 + @param label 标签指针 + @param left 标签左边位置 + @param top 标签顶部位置 + @param width 标签宽度 + @param height 标签高度 + @param viewId 标签的视图 ID + @param text 标签显示的文本 + @param fontName 字体名称 + @param fontSize 字体大小 + */ + void TraingSetTimeView::InitLabel(UILabel *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize) + { + // 检查标签指针是否为空 + if (label == nullptr) + { + label = new UILabel(); + } + // 设置标签的位置和大小 + label->SetPosition(left, top); + label->Resize(width, height); + // 设置标签的视图 ID + label->SetViewId(viewId); + // 设置标签的样式 + label->SetStyle(STYLE_TEXT_FONT, fontSize); + label->SetFont(fontName, fontSize); + // 设置标签的文本和其他属性 + label->SetText(text); + label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label->SetRollSpeed(0); + // 设置标签可见 + label->SetVisible(true); + } + /* + InitButton:初始化按钮 + @param button 按钮指针 + @param left 按钮左边位置 + @param top 按钮顶部位置 + @param width 按钮宽度 + @param height 按钮高度 + @param viewId 按钮的视图 ID + */ + void TraingSetTimeView::InitButton(UIButton *&button, int left, int top, int width, int height, const char *viewId) + { + // 设置按钮的背景颜色 + uint32_t backgroundColor = 0xff191919; // 默认背景颜色 + uint32_t pressedBackgroundColor = 0xff249115; // 按下时的背景颜色 + uint32_t pressedBorderColor = 0xff0b1928; // 按下时的边框颜色 + // 创建新按钮(如果当前按钮为空) + if (button == nullptr) + { + button = new UIButton(); + } + button->SetPosition(left, top); + button->Resize(width, height); + button->SetViewId(viewId); + button->SetStyle(STYLE_BACKGROUND_COLOR, backgroundColor); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, pressedBackgroundColor, UIButton::PRESSED); + button->SetStyleForState(STYLE_BORDER_COLOR, pressedBorderColor, UIButton::PRESSED); + // 设置按钮的点击事件监听器为 TraingSetTimePresenter 的实例 + button->SetOnClickListener(static_cast(TraingSetTimePresenter::GetInstance())); + // 设置按钮可见 + button->SetVisible(true); + } + /* + InitUIPicker: 初始化UIPicker组件 + @param picker: 指向UIPicker的指针 + @param x: UIPicker的左边位置 + @param y: UIPicker的顶部位置 + @param width: UIPicker的宽度 + @param height: UIPicker的高度 + @param viewId: UIPicker的视图 ID + @param values: 选项数组 + @param count: 选项数量 + @param backgroundFontSize: 普通文本大小 + @highlightFontSize: 高光文本大小 + */ + void TraingSetTimeView::InitUIPicker(UIPicker *&picker, int x, int y, int width, int height, const char *viewId) + { + // 文本大小 + constexpr uint8_t BACKGROUND_FONT = 40; + constexpr uint8_t HIGHTLIGHT_FONT = 60; + // 获取value数组 + int minTime = 10; + int maxTime = 600; + int interval = 10; + std::vector timeValues = GenerateTimeValues(minTime, maxTime, interval); + + const char **values = new const char *[timeValues.size()]; + for (size_t i = 0; i < timeValues.size(); i++) + { + values[i] = timeValues[i].c_str(); + } + // 创建 UIPicker + if (picker == nullptr) + { + picker = new UIPicker(); + } + + // 设置 UIPicker 的位置和大小 + picker->SetPosition(x, y); + picker->Resize(width, height); + // 设置 UIPicker 的 ViewId + picker->SetViewId(viewId); + // 设置 UIPicker 的属性 + picker->SetItemHeight(70); + picker->SetLoopState(true); + picker->SetTextColor(Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff), Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff)); + picker->SetBackgroundFont(DEFAULT_VECTOR_FONT_FILENAME, BACKGROUND_FONT); // 设置普通文本大小 + picker->SetHighlightFont(DEFAULT_VECTOR_FONT_FILENAME, HIGHTLIGHT_FONT); // 设置高光文本大小 + picker->SetValues(values, timeValues.size()); + // 将 UIPicker 设置为显示 + picker->SetVisible(true); + } + + /* InitView:初始化界面*/ + void TraingSetTimeView ::InitView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + } + // 初始化Lable + InitLabel(label1_, 173, 52, 120, 35, "label1", "时长设定", DEFAULT_VECTOR_FONT_FILENAME, 30); + container_->Add(label1_); + + // 初始化UIPicker + InitUIPicker(uiPicker1_, 43, 106, 380, 240, "uiPicker1"); + container_->Add(uiPicker1_); + // 初始化Button + InitButton(button1_, 0, 366, 466, 100, BUTTONOK); + // Set additional property + char *button1defaultImgSrc = "/user/res/Training/buttonok.bin"; + char *button1triggeredImgSrc = nullptr; + button1_->SetImageSrc(button1defaultImgSrc, button1triggeredImgSrc); + container_->Add(button1_); + } + /* DeInit:删除组件 */ + void TraingSetTimeView::DeInit() + { + // 删除Label + if (label1_ != nullptr) + { + container_->Remove(label1_); + delete label1_; + label1_ = nullptr; + } + // 删除Button + if (button1_ != nullptr) + { + container_->Remove(button1_); + delete button1_; + button1_ = nullptr; + } + + // 删除Image + + // 删除滚动选择器 + if (uiPicker1_ != nullptr) + { + container_->Remove(uiPicker1_); + delete uiPicker1_; + uiPicker1_ = nullptr; + } + + // 删除容器 + if (container_ != nullptr) + { + container_->RemoveAll(); // 移除容器中的所有组件 + delete container_; + container_ = nullptr; + } + } + + void TraingSetTimeView::PreLoad(void) + { + if (!viewiInitStatus) + { + InitView(); + viewiInitStatus = true; + } + } + void TraingSetTimeView::OnStart() + { + container_ = new UIViewGroup(); + if (container_ == nullptr) + { + return; + } + container_->SetPosition(0, 0); + container_->SetWidth(Screen::GetInstance().GetWidth()); + container_->SetHeight(Screen::GetInstance().GetHeight()); + + // 创建 draglistener 实例并设置为拖动监听器 + UIView::OnDragListener *draglistener = static_cast(TraingSetTimePresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + + container_->SetTouchable(true); + container_->SetDraggable(true); + + PreLoad(); + RootView::GetInstance()->Add(container_); + } + + void TraingSetTimeView::OnSetUpView() + { + + View::OnSetUpView(); + Draw(); + } + + void TraingSetTimeView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void TraingSetTimeView::OnStop() + { + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetView.cpp index 483fa1e8e..02a111438 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingSetView.cpp @@ -1,297 +1,297 @@ - -#include "traing/include/TraingSetView.h" - -#include "common/image_cache_manager.h" -#include "UiConfig.h" -#include "ui_resource_image.h" -#include -#include "components/ui_button.h" -namespace OHOS -{ - static const char *imagePath_iocn = "/user/res/Training/icon.bin"; - static const char *imagePath_time = "/user/res/Training/time.bin"; - static const char *imagePath_calories = "/user/res/Training/calories.bin"; - - static TraingSetView *g_pTraingSetView{nullptr}; - - TraingSetView::TraingSetView() - { - g_pTraingSetView = this; - } - - TraingSetView::~TraingSetView() - { - DeInit(); - g_pTraingSetView = nullptr; - } - - TraingSetView *TraingSetView::GetInstance() - { - - return g_pTraingSetView; - } - /* - InitLabel:初始化标签 - @param label 标签指针 - @param left 标签左边位置 - @param top 标签顶部位置 - @param width 标签宽度 - @param height 标签高度 - @param viewId 标签的视图 ID - @param text 标签显示的文本 - @param fontName 字体名称 - @param fontSize 字体大小 - */ - void TraingSetView::InitLabel(UILabel *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize) - { - // 检查标签指针是否为空 - if (label == nullptr) - { - label = new UILabel(); - } - // 设置标签的位置和大小 - label->SetPosition(left, top); - label->Resize(width, height); - // 设置标签的视图 ID - label->SetViewId(viewId); - // 设置标签的样式 - label->SetStyle(STYLE_TEXT_FONT, fontSize); - label->SetFont(fontName, fontSize); - // 设置标签的文本和其他属性 - label->SetText(text); - label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label->SetRollSpeed(0); - // 设置标签可见 - label->SetVisible(true); - } - /* - InitButton:初始化按钮 - @param button 按钮指针 - @param left 按钮左边位置 - @param top 按钮顶部位置 - @param width 按钮宽度 - @param height 按钮高度 - @param viewId 按钮的视图 ID - */ - void TraingSetView::InitButton(UIButton *&button, int left, int top, int width, int height, const char *viewId) - { - // 设置按钮的背景颜色 - uint32_t backgroundColor = 0xff191919; // 默认背景颜色 - uint32_t pressedBackgroundColor = 0xff249115; // 按下时的背景颜色 - uint32_t pressedBorderColor = 0xff0b1928; // 按下时的边框颜色 - // 创建新按钮(如果当前按钮为空) - if (button == nullptr) - { - button = new UIButton(); - } - button->SetPosition(left, top); - button->Resize(width, height); - button->SetViewId(viewId); - button->SetStyle(STYLE_BACKGROUND_COLOR, backgroundColor); - button->SetStyleForState(STYLE_BACKGROUND_COLOR, pressedBackgroundColor, UIButton::PRESSED); - button->SetStyleForState(STYLE_BORDER_COLOR, pressedBorderColor, UIButton::PRESSED); - // 设置按钮的点击事件监听器为 TraingSetPresenter 的实例 - button->SetOnClickListener(static_cast(TraingSetPresenter::GetInstance())); - // 设置按钮可见 - button->SetVisible(true); - } - /* - InitImageView:初始化图片 - @param imageView 图片指针 - @param left 图片左边位置 - @param top 图片顶部位置 - @param width 图片宽度 - @param height 图片高度 - @param viewId 图片的视图 ID - @param imagePath 图片路径 - */ - void TraingSetView::InitImageView(UIImageView *&imageView, int left, int top, int width, int height, const char *viewId, const char *imagePath) - { - if (imageView == nullptr) - { - imageView = new UIImageView(); - } - imageView->SetPosition(left, top); - imageView->Resize(width, height); - imageView->SetViewId(viewId); - imageView->SetSrc(imagePath); - imageView->SetVisible(true); - } - /* InitView:初始化界面*/ - void TraingSetView ::InitView() - { - if (container_ == nullptr) - { - container_ = new UIViewGroup(); - container_->SetPosition(0, 0, 466, 466); - container_->SetStyle(STYLE_BACKGROUND_OPA, 0); - } - - // 初始化Button - InitButton(button1_, 43, 120, 380, 100, BUTTONTIME); - InitButton(button2_, 43, 240, 380, 100, BUTTONTIME); - container_->Add(button1_); - container_->Add(button2_); - - // 初始化Lable - InitLabel(label1_, 173, 52, 120, 35, "label1", "极限运动", DEFAULT_VECTOR_FONT_FILENAME, 30); - InitLabel(label2_, 130, 150, 60, 35, "label2", "时长", DEFAULT_VECTOR_FONT_FILENAME, 30); - InitLabel(label3_, 270, 155, 69, 23, "label3", "30 分钟", DEFAULT_VECTOR_FONT_FILENAME, 20); - InitLabel(label4_, 130, 270, 60, 35, "label4", "卡路里", DEFAULT_VECTOR_FONT_FILENAME, 30); - InitLabel(label5_, 270, 275, 60, 35, "label5", "1000 千卡", DEFAULT_VECTOR_FONT_FILENAME, 20); - container_->Add(label1_); - container_->Add(label2_); - container_->Add(label3_); - container_->Add(label4_); - container_->Add(label5_); - - // 初始化Image - InitImageView(image1_, 70, 150, 100, 100, "image1", imagePath_time); - InitImageView(image2_, 70, 270, 100, 100, "image2", imagePath_calories); - InitImageView(image3_, 380, 160, 100, 100, "image3", imagePath_iocn); - InitImageView(image4_, 380, 280, 100, 100, "image4", imagePath_iocn); - container_->Add(image1_); - container_->Add(image2_); - container_->Add(image3_); - container_->Add(image4_); - } - /* DeInit:删除组件 */ - void TraingSetView::DeInit() - { - // 删除Label - if (label1_ != nullptr) - { - container_->Remove(label1_); - delete label1_; - label1_ = nullptr; - } - if (label2_ != nullptr) - { - container_->Remove(label2_); - delete label2_; - label2_ = nullptr; - } - if (label3_ != nullptr) - { - container_->Remove(label3_); - delete label3_; - label3_ = nullptr; - } - if (label4_ != nullptr) - { - container_->Remove(label4_); - delete label4_; - label4_ = nullptr; - } - if (label5_ != nullptr) - { - container_->Remove(label5_); - delete label5_; - label5_ = nullptr; - } - - // 删除Button - if (button1_ != nullptr) - { - container_->Remove(button1_); - delete button1_; - button1_ = nullptr; - } - if (button2_ != nullptr) - { - container_->Remove(button2_); - delete button2_; - button2_ = nullptr; - } - - // 删除Image - if (image1_ != nullptr) - { - container_->Remove(image1_); - delete image1_; - image1_ = nullptr; - } - if (image2_ != nullptr) - { - container_->Remove(image2_); - delete image2_; - image2_ = nullptr; - } - if (image3_ != nullptr) - { - container_->Remove(image3_); - delete image3_; - image3_ = nullptr; - } - if (image4_ != nullptr) - { - container_->Remove(image4_); - delete image4_; - image4_ = nullptr; - } - - // 删除容器 - if (container_ != nullptr) - { - container_->RemoveAll(); // 移除容器中的所有组件 - delete container_; - container_ = nullptr; - } - } - - void TraingSetView::PreLoad(void) - { - if (!viewiInitStatus) - { - InitView(); - viewiInitStatus = true; - } - } - void TraingSetView::OnStart() - { - container_ = new UIViewGroup(); - if (container_ == nullptr) - { - return; - } - container_->SetPosition(0, 0); - container_->SetWidth(Screen::GetInstance().GetWidth()); - container_->SetHeight(Screen::GetInstance().GetHeight()); - - // 创建 draglistener 实例并设置为拖动监听器 - UIView::OnDragListener *draglistener = static_cast(TraingSetPresenter::GetInstance()); - if (draglistener == nullptr) - { - return; - } - container_->SetOnDragListener(draglistener); - - container_->SetTouchable(true); - container_->SetDraggable(true); - - PreLoad(); - RootView::GetInstance()->Add(container_); - } - - void TraingSetView::OnSetUpView() - { - - View::OnSetUpView(); - Draw(); - } - - void TraingSetView::OnTearDownView() - { - - View::OnTearDownView(); - return; - } - - void TraingSetView::OnStop() - { - View::OnStop(); - RootView::GetInstance()->RemoveAll(); - return; - } -} + +#include "traing/include/TraingSetView.h" + +#include "common/image_cache_manager.h" +#include "UiConfig.h" +#include "ui_resource_image.h" +#include +#include "components/ui_button.h" +namespace OHOS +{ + static const char *imagePath_iocn = "/user/res/Training/icon.bin"; + static const char *imagePath_time = "/user/res/Training/time.bin"; + static const char *imagePath_calories = "/user/res/Training/calories.bin"; + + static TraingSetView *g_pTraingSetView{nullptr}; + + TraingSetView::TraingSetView() + { + g_pTraingSetView = this; + } + + TraingSetView::~TraingSetView() + { + DeInit(); + g_pTraingSetView = nullptr; + } + + TraingSetView *TraingSetView::GetInstance() + { + + return g_pTraingSetView; + } + /* + InitLabel:初始化标签 + @param label 标签指针 + @param left 标签左边位置 + @param top 标签顶部位置 + @param width 标签宽度 + @param height 标签高度 + @param viewId 标签的视图 ID + @param text 标签显示的文本 + @param fontName 字体名称 + @param fontSize 字体大小 + */ + void TraingSetView::InitLabel(UILabel *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize) + { + // 检查标签指针是否为空 + if (label == nullptr) + { + label = new UILabel(); + } + // 设置标签的位置和大小 + label->SetPosition(left, top); + label->Resize(width, height); + // 设置标签的视图 ID + label->SetViewId(viewId); + // 设置标签的样式 + label->SetStyle(STYLE_TEXT_FONT, fontSize); + label->SetFont(fontName, fontSize); + // 设置标签的文本和其他属性 + label->SetText(text); + label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label->SetRollSpeed(0); + // 设置标签可见 + label->SetVisible(true); + } + /* + InitButton:初始化按钮 + @param button 按钮指针 + @param left 按钮左边位置 + @param top 按钮顶部位置 + @param width 按钮宽度 + @param height 按钮高度 + @param viewId 按钮的视图 ID + */ + void TraingSetView::InitButton(UIButton *&button, int left, int top, int width, int height, const char *viewId) + { + // 设置按钮的背景颜色 + uint32_t backgroundColor = 0xff191919; // 默认背景颜色 + uint32_t pressedBackgroundColor = 0xff249115; // 按下时的背景颜色 + uint32_t pressedBorderColor = 0xff0b1928; // 按下时的边框颜色 + // 创建新按钮(如果当前按钮为空) + if (button == nullptr) + { + button = new UIButton(); + } + button->SetPosition(left, top); + button->Resize(width, height); + button->SetViewId(viewId); + button->SetStyle(STYLE_BACKGROUND_COLOR, backgroundColor); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, pressedBackgroundColor, UIButton::PRESSED); + button->SetStyleForState(STYLE_BORDER_COLOR, pressedBorderColor, UIButton::PRESSED); + // 设置按钮的点击事件监听器为 TraingSetPresenter 的实例 + button->SetOnClickListener(static_cast(TraingSetPresenter::GetInstance())); + // 设置按钮可见 + button->SetVisible(true); + } + /* + InitImageView:初始化图片 + @param imageView 图片指针 + @param left 图片左边位置 + @param top 图片顶部位置 + @param width 图片宽度 + @param height 图片高度 + @param viewId 图片的视图 ID + @param imagePath 图片路径 + */ + void TraingSetView::InitImageView(UIImageView *&imageView, int left, int top, int width, int height, const char *viewId, const char *imagePath) + { + if (imageView == nullptr) + { + imageView = new UIImageView(); + } + imageView->SetPosition(left, top); + imageView->Resize(width, height); + imageView->SetViewId(viewId); + imageView->SetSrc(imagePath); + imageView->SetVisible(true); + } + /* InitView:初始化界面*/ + void TraingSetView ::InitView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + } + + // 初始化Button + InitButton(button1_, 43, 120, 380, 100, BUTTONTIME); + InitButton(button2_, 43, 240, 380, 100, BUTTONCALULI); + container_->Add(button1_); + container_->Add(button2_); + + // 初始化Lable + InitLabel(label1_, 173, 52, 120, 35, "label1", "极限运动", DEFAULT_VECTOR_FONT_FILENAME, 30); + InitLabel(label2_, 130, 150, 60, 35, "label2", "时长", DEFAULT_VECTOR_FONT_FILENAME, 30); + InitLabel(label3_, 270, 155, 69, 23, "label3", "30 分钟", DEFAULT_VECTOR_FONT_FILENAME, 20); + InitLabel(label4_, 130, 270, 60, 35, "label4", "卡路里", DEFAULT_VECTOR_FONT_FILENAME, 30); + InitLabel(label5_, 270, 275, 60, 35, "label5", "1000 千卡", DEFAULT_VECTOR_FONT_FILENAME, 20); + container_->Add(label1_); + container_->Add(label2_); + container_->Add(label3_); + container_->Add(label4_); + container_->Add(label5_); + + // 初始化Image + InitImageView(image1_, 70, 150, 100, 100, "image1", imagePath_time); + InitImageView(image2_, 70, 270, 100, 100, "image2", imagePath_calories); + InitImageView(image3_, 380, 160, 100, 100, "image3", imagePath_iocn); + InitImageView(image4_, 380, 280, 100, 100, "image4", imagePath_iocn); + container_->Add(image1_); + container_->Add(image2_); + container_->Add(image3_); + container_->Add(image4_); + } + /* DeInit:删除组件 */ + void TraingSetView::DeInit() + { + // 删除Label + if (label1_ != nullptr) + { + container_->Remove(label1_); + delete label1_; + label1_ = nullptr; + } + if (label2_ != nullptr) + { + container_->Remove(label2_); + delete label2_; + label2_ = nullptr; + } + if (label3_ != nullptr) + { + container_->Remove(label3_); + delete label3_; + label3_ = nullptr; + } + if (label4_ != nullptr) + { + container_->Remove(label4_); + delete label4_; + label4_ = nullptr; + } + if (label5_ != nullptr) + { + container_->Remove(label5_); + delete label5_; + label5_ = nullptr; + } + + // 删除Button + if (button1_ != nullptr) + { + container_->Remove(button1_); + delete button1_; + button1_ = nullptr; + } + if (button2_ != nullptr) + { + container_->Remove(button2_); + delete button2_; + button2_ = nullptr; + } + + // 删除Image + if (image1_ != nullptr) + { + container_->Remove(image1_); + delete image1_; + image1_ = nullptr; + } + if (image2_ != nullptr) + { + container_->Remove(image2_); + delete image2_; + image2_ = nullptr; + } + if (image3_ != nullptr) + { + container_->Remove(image3_); + delete image3_; + image3_ = nullptr; + } + if (image4_ != nullptr) + { + container_->Remove(image4_); + delete image4_; + image4_ = nullptr; + } + + // 删除容器 + if (container_ != nullptr) + { + container_->RemoveAll(); // 移除容器中的所有组件 + delete container_; + container_ = nullptr; + } + } + + void TraingSetView::PreLoad(void) + { + if (!viewiInitStatus) + { + InitView(); + viewiInitStatus = true; + } + } + void TraingSetView::OnStart() + { + container_ = new UIViewGroup(); + if (container_ == nullptr) + { + return; + } + container_->SetPosition(0, 0); + container_->SetWidth(Screen::GetInstance().GetWidth()); + container_->SetHeight(Screen::GetInstance().GetHeight()); + + // 创建 draglistener 实例并设置为拖动监听器 + UIView::OnDragListener *draglistener = static_cast(TraingSetPresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + + container_->SetTouchable(true); + container_->SetDraggable(true); + + PreLoad(); + RootView::GetInstance()->Add(container_); + } + + void TraingSetView::OnSetUpView() + { + + View::OnSetUpView(); + Draw(); + } + + void TraingSetView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void TraingSetView::OnStop() + { + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp index 86c9f1f24..05fc04a81 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp @@ -1,425 +1,425 @@ - -#include "traing/include/TraingView.h" - -#include "common/image_cache_manager.h" -#include "UiConfig.h" -#include "ui_resource_image.h" -#include -#include "components/ui_button.h" -namespace OHOS -{ - static TraingView *g_pTraingView{nullptr}; - - TraingView::TraingView() - { - - g_pTraingView = this; - } - - TraingView::~TraingView() - { - DeInit(); - g_pTraingView = nullptr; - } - - TraingView *TraingView::GetInstance() - { - - return g_pTraingView; - } - - void TraingView::Init() - { - if (container_ == nullptr) - { - container_ = new UIViewGroup(); - container_->SetPosition(0, 0, 466, 466); - container_->SetStyle(STYLE_BACKGROUND_OPA, 0); - } - - // Add Label to App - if (label1_ == nullptr) - { - label1_ = new UILabel(); - } - label1_->SetPosition(173, 52); // widget's left position and top position - label1_->Resize(200, 60); // widget's width and height - label1_->SetViewId("label1"); // Set style - label1_->SetStyle(STYLE_TEXT_FONT, 30); - - // Set additional property - label1_->SetText("快速训练"); - label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label1_->SetRollSpeed(0); - label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - - // Add to rootView - container_->Add(label1_); - label1_->SetVisible(true); - - // Add Button to App - if (button3_ == nullptr) - { - button3_ = new UIButton(); - } - button3_->SetPosition(236, 268); // widget's left position and top position - button3_->Resize(140, 140); // widget's width and height - button3_->SetViewId(BUTTONMORE); // Set style - button3_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - button3_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property -#ifdef _WIN32 - char *button3defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Training/More.bin"; -#else - const char *button3defaultImgSrc = PNG_TRAING_BOUTTONMORE_IMAGE; -#endif - char *button3triggeredImgSrc = nullptr; - button3_->SetImageSrc(button3defaultImgSrc, button3triggeredImgSrc); - button3_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff33df1c, UIButton::PRESSED); - button3_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - button3_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - - // Add the CallBack about events - UIView::OnClickListener *button3Click = static_cast(TraingPresenter::GetInstance()); - button3_->SetOnClickListener(button3Click); - // Add to rootView - container_->Add(button3_); - button3_->SetVisible(true); - - // Add Button to App - if (button4_ == nullptr) - { - button4_ = new UIButton(); - } - button4_->SetPosition(86, 118); // widget's left position and top position - button4_->Resize(140, 140); // widget's width and height - button4_->SetViewId(BUTTON2); // Set style - button4_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - button4_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property -#ifdef _WIN32 - char *button4defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Training/Buttonground2.bin"; -#else - const char *button4defaultImgSrc = PNG_TRAING_BUTTONGRONG2_IMAGE; -#endif - char *button4triggeredImgSrc = nullptr; - button4_->SetImageSrc(button4defaultImgSrc, button4triggeredImgSrc); - button4_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff33df1c, UIButton::PRESSED); - button4_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - button4_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - - // Add the CallBack about events - UIView::OnClickListener *button4Click = static_cast(TraingPresenter::GetInstance()); - button4_->SetOnClickListener(button4Click); - // Add to rootView - container_->Add(button4_); - button4_->SetVisible(true); - - // Add Button to App - if (button1_ == nullptr) - { - button1_ = new UIButton(); - } - button1_->SetPosition(86, 268); // widget's left position and top position - button1_->Resize(140, 140); // widget's width and height - button1_->SetViewId(BUTTON3); // Set style - button1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - button1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property -#ifdef _WIN32 - char *button1defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Training/Bouttonground.bin"; -#else - const char *button1defaultImgSrc = PNG_TRAING_BUTTONGRONG_IMAGE; -#endif - char *button1triggeredImgSrc = nullptr; - button1_->SetImageSrc(button1defaultImgSrc, button1triggeredImgSrc); - button1_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff33df1c, UIButton::PRESSED); - button1_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - button1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - - // Add the CallBack about events - UIView::OnClickListener *button1Click = static_cast(TraingPresenter::GetInstance()); - button1_->SetOnClickListener(button1Click); - // Add to rootView - container_->Add(button1_); - button1_->SetVisible(true); - - // Add Button to App - if (button2_ == nullptr) - { - button2_ = new UIButton(); - } - button2_->SetPosition(236, 118); // widget's left position and top position - button2_->Resize(140, 140); // widget's width and height - button2_->SetViewId(BUTTON1); // Set style - button2_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - button2_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property -#ifdef _WIN32 - char *button2defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Training/Bouttonground.bin"; -#else - const char *button2defaultImgSrc = PNG_TRAING_BUTTONGRONG_IMAGE; -#endif - char *button2triggeredImgSrc = nullptr; - button2_->SetImageSrc(button2defaultImgSrc, button2triggeredImgSrc); - button2_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff33df1c, UIButton::PRESSED); - button2_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - button2_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - - // Add the CallBack about events - UIView::OnClickListener *button2Click = static_cast(TraingPresenter::GetInstance()); - button2_->SetOnClickListener(button2Click); - // Add to rootView - container_->Add(button2_); - button2_->SetVisible(true); - - // Add ImageView to App - if (image1_ == nullptr) - { - image1_ = new UIImageView(); - } - image1_->SetPosition(276, 148); // widget's left position and top position - image1_->Resize(100, 100); // widget's width and height - image1_->SetViewId("image2"); // Set style - - // Set additional property -#ifdef _WIN32 - char *image1imagesPath = "c:/Users/caiking/project/image_converter_tool/output/Training/riding-big2.bin"; -#else - const char *image1imagesPath = PNG_TRAING_RIDINGBIG_IMAGE; -#endif - image1_->SetSrc(image1imagesPath); - - // Add to rootView - container_->Add(image1_); - image1_->SetVisible(true); - - // Add Label to App - if (label2_ == nullptr) - { - label2_ = new UILabel(); - } - label2_->SetPosition(286, 210); // widget's left position and top position - label2_->Resize(200, 60); // widget's width and height - label2_->SetViewId("label2"); // Set style - label2_->SetStyle(STYLE_TEXT_FONT, 20); - - // Set additional property - label2_->SetText("骑行"); - label2_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label2_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label2_->SetRollSpeed(0); - label2_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); - - // Add to rootView - container_->Add(label2_); - label2_->SetVisible(true); - - // Add ImageView to App - if (image3_ == nullptr) - { - image3_ = new UIImageView(); - } - image3_->SetPosition(126, 298); // widget's left position and top position - image3_->Resize(100, 100); // widget's width and height - image3_->SetViewId("image3"); // Set style - - // Set additional property -#ifdef _WIN32 - char *image3imagesPath = "c:/Users/caiking/project/image_converter_tool/output/Training/running-big.bin"; -#else - const char *image3imagesPath = PNG_TRAING_RUNNINGBIG_IMAGE; -#endif - image3_->SetSrc(image3imagesPath); - - // Add to rootView - container_->Add(image3_); - image3_->SetVisible(true); - - // Add Label to App - if (label3_ == nullptr) - { - label3_ = new UILabel(); - } - label3_->SetPosition(135, 210); // widget's left position and top position - label3_->Resize(200, 60); // widget's width and height - label3_->SetViewId("label3"); // Set style - label3_->SetStyle(STYLE_TEXT_FONT, 20); - - // Set additional property - label3_->SetText("健走"); - label3_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label3_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label3_->SetRollSpeed(0); - label3_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); - - // Add to rootView - container_->Add(label3_); - label3_->SetVisible(true); - - // Add ImageView to App - if (image5_ == nullptr) - { - image5_ = new UIImageView(); - } - image5_->SetPosition(126, 148); // widget's left position and top position - image5_->Resize(100, 100); // widget's width and height - image5_->SetViewId("image1"); // Set style - - // Set additional property -#ifdef _WIN32 - char *image5imagesPath = "c:/Users/caiking/project/image_converter_tool/output/Training/walking-big.bin"; -#else - const char *image5imagesPath = PNG_TRAING_WALKINGBIG_IMAGE; -#endif - image5_->SetSrc(image5imagesPath); - - // Add to rootView - container_->Add(image5_); - image5_->SetVisible(true); - - // Add Label to App - if (label4_ == nullptr) - { - label4_ = new UILabel(); - } - label4_->SetPosition(131, 365); // widget's left position and top position - label4_->Resize(200, 60); // widget's width and height - label4_->SetViewId("label4"); // Set style - label4_->SetStyle(STYLE_TEXT_FONT, 20); - - // Set additional property - label4_->SetText("跑步"); - label4_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label4_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label4_->SetRollSpeed(0); - label4_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); - - // Add to rootView - container_->Add(label4_); - label4_->SetVisible(true); - } - - void TraingView::DeInit() - { - if (container_ != nullptr) - { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } - if (label1_ != nullptr) - { - delete label1_; - label1_ = nullptr; - } - if (button3_ != nullptr) - { - delete button3_; - button3_ = nullptr; - } - if (button4_ != nullptr) - { - delete button4_; - button4_ = nullptr; - } - if (button1_ != nullptr) - { - delete button1_; - button1_ = nullptr; - } - if (button2_ != nullptr) - { - delete button2_; - button2_ = nullptr; - } - if (image1_ != nullptr) - { - delete image1_; - image1_ = nullptr; - } - if (label2_ != nullptr) - { - delete label2_; - label2_ = nullptr; - } - if (image3_ != nullptr) - { - delete image3_; - image3_ = nullptr; - } - if (label3_ != nullptr) - { - delete label3_; - label3_ = nullptr; - } - if (image5_ != nullptr) - { - delete image5_; - image5_ = nullptr; - } - if (label4_ != nullptr) - { - delete label4_; - label4_ = nullptr; - } - } - - UIView *TraingView::GetView() - { - Init(); - return container_; - } - - void TraingView::OnStart() - { - container_ = new UIViewGroup(); - if (container_ == nullptr) - { - return; - } - container_->SetPosition(0, 0); - container_->SetWidth(Screen::GetInstance().GetWidth()); - container_->SetHeight(Screen::GetInstance().GetHeight()); - - // 创建 draglistener 实例并设置为拖动监听器 - UIView::OnDragListener *draglistener = static_cast(TraingPresenter::GetInstance()); - if (draglistener == nullptr) - { - return; - } - container_->SetOnDragListener(draglistener); - - container_->SetTouchable(true); - container_->SetDraggable(true); - - GetView(); - RootView::GetInstance()->Add(container_); - } - - void TraingView::OnSetUpView() - { - - View::OnSetUpView(); - Draw(); - } - - void TraingView::OnTearDownView() - { - - View::OnTearDownView(); - return; - } - - void TraingView::OnStop() - { - View::OnStop(); - RootView::GetInstance()->RemoveAll(); - return; - } -} + +#include "traing/include/TraingView.h" + +#include "common/image_cache_manager.h" +#include "UiConfig.h" +#include "ui_resource_image.h" +#include +#include "components/ui_button.h" +namespace OHOS +{ + static TraingView *g_pTraingView{nullptr}; + + TraingView::TraingView() + { + + g_pTraingView = this; + } + + TraingView::~TraingView() + { + DeInit(); + g_pTraingView = nullptr; + } + + TraingView *TraingView::GetInstance() + { + + return g_pTraingView; + } + + void TraingView::Init() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + } + + // Add Label to App + if (label1_ == nullptr) + { + label1_ = new UILabel(); + } + label1_->SetPosition(173, 52); // widget's left position and top position + label1_->Resize(200, 60); // widget's width and height + label1_->SetViewId("label1"); // Set style + label1_->SetStyle(STYLE_TEXT_FONT, 30); + + // Set additional property + label1_->SetText("快速训练"); + label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label1_->SetRollSpeed(0); + label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + + // Add to rootView + container_->Add(label1_); + label1_->SetVisible(true); + + // Add Button to App + if (button3_ == nullptr) + { + button3_ = new UIButton(); + } + button3_->SetPosition(236, 268); // widget's left position and top position + button3_->Resize(140, 140); // widget's width and height + button3_->SetViewId(BUTTONMORE); // Set style + button3_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + button3_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + // Set additional property +#ifdef _WIN32 + char *button3defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Training/More.bin"; +#else + const char *button3defaultImgSrc = PNG_TRAING_BOUTTONMORE_IMAGE; +#endif + char *button3triggeredImgSrc = nullptr; + button3_->SetImageSrc(button3defaultImgSrc, button3triggeredImgSrc); + button3_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff33df1c, UIButton::PRESSED); + button3_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); + button3_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + + // Add the CallBack about events + UIView::OnClickListener *button3Click = static_cast(TraingPresenter::GetInstance()); + button3_->SetOnClickListener(button3Click); + // Add to rootView + container_->Add(button3_); + button3_->SetVisible(true); + + // Add Button to App + if (button4_ == nullptr) + { + button4_ = new UIButton(); + } + button4_->SetPosition(86, 118); // widget's left position and top position + button4_->Resize(140, 140); // widget's width and height + button4_->SetViewId(BUTTON2); // Set style + button4_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + button4_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + // Set additional property +#ifdef _WIN32 + char *button4defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Training/Buttonground2.bin"; +#else + const char *button4defaultImgSrc = PNG_TRAING_BUTTONGRONG2_IMAGE; +#endif + char *button4triggeredImgSrc = nullptr; + button4_->SetImageSrc(button4defaultImgSrc, button4triggeredImgSrc); + button4_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff33df1c, UIButton::PRESSED); + button4_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); + button4_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + + // Add the CallBack about events + UIView::OnClickListener *button4Click = static_cast(TraingPresenter::GetInstance()); + button4_->SetOnClickListener(button4Click); + // Add to rootView + container_->Add(button4_); + button4_->SetVisible(true); + + // Add Button to App + if (button1_ == nullptr) + { + button1_ = new UIButton(); + } + button1_->SetPosition(86, 268); // widget's left position and top position + button1_->Resize(140, 140); // widget's width and height + button1_->SetViewId(BUTTON3); // Set style + button1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + button1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + // Set additional property +#ifdef _WIN32 + char *button1defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Training/Bouttonground.bin"; +#else + const char *button1defaultImgSrc = PNG_TRAING_BUTTONGRONG_IMAGE; +#endif + char *button1triggeredImgSrc = nullptr; + button1_->SetImageSrc(button1defaultImgSrc, button1triggeredImgSrc); + button1_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff33df1c, UIButton::PRESSED); + button1_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); + button1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + + // Add the CallBack about events + UIView::OnClickListener *button1Click = static_cast(TraingPresenter::GetInstance()); + button1_->SetOnClickListener(button1Click); + // Add to rootView + container_->Add(button1_); + button1_->SetVisible(true); + + // Add Button to App + if (button2_ == nullptr) + { + button2_ = new UIButton(); + } + button2_->SetPosition(236, 118); // widget's left position and top position + button2_->Resize(140, 140); // widget's width and height + button2_->SetViewId(BUTTON1); // Set style + button2_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + button2_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + // Set additional property +#ifdef _WIN32 + char *button2defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Training/Bouttonground.bin"; +#else + const char *button2defaultImgSrc = PNG_TRAING_BUTTONGRONG_IMAGE; +#endif + char *button2triggeredImgSrc = nullptr; + button2_->SetImageSrc(button2defaultImgSrc, button2triggeredImgSrc); + button2_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff33df1c, UIButton::PRESSED); + button2_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); + button2_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + + // Add the CallBack about events + UIView::OnClickListener *button2Click = static_cast(TraingPresenter::GetInstance()); + button2_->SetOnClickListener(button2Click); + // Add to rootView + container_->Add(button2_); + button2_->SetVisible(true); + + // Add ImageView to App + if (image1_ == nullptr) + { + image1_ = new UIImageView(); + } + image1_->SetPosition(276, 148); // widget's left position and top position + image1_->Resize(100, 100); // widget's width and height + image1_->SetViewId("image2"); // Set style + + // Set additional property +#ifdef _WIN32 + char *image1imagesPath = "c:/Users/caiking/project/image_converter_tool/output/Training/riding-big2.bin"; +#else + const char *image1imagesPath = PNG_TRAING_RIDINGBIG_IMAGE; +#endif + image1_->SetSrc(image1imagesPath); + + // Add to rootView + container_->Add(image1_); + image1_->SetVisible(true); + + // Add Label to App + if (label2_ == nullptr) + { + label2_ = new UILabel(); + } + label2_->SetPosition(286, 210); // widget's left position and top position + label2_->Resize(200, 60); // widget's width and height + label2_->SetViewId("label2"); // Set style + label2_->SetStyle(STYLE_TEXT_FONT, 20); + + // Set additional property + label2_->SetText("骑行"); + label2_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label2_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label2_->SetRollSpeed(0); + label2_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + + // Add to rootView + container_->Add(label2_); + label2_->SetVisible(true); + + // Add ImageView to App + if (image3_ == nullptr) + { + image3_ = new UIImageView(); + } + image3_->SetPosition(126, 298); // widget's left position and top position + image3_->Resize(100, 100); // widget's width and height + image3_->SetViewId("image3"); // Set style + + // Set additional property +#ifdef _WIN32 + char *image3imagesPath = "c:/Users/caiking/project/image_converter_tool/output/Training/running-big.bin"; +#else + const char *image3imagesPath = PNG_TRAING_RUNNINGBIG_IMAGE; +#endif + image3_->SetSrc(image3imagesPath); + + // Add to rootView + container_->Add(image3_); + image3_->SetVisible(true); + + // Add Label to App + if (label3_ == nullptr) + { + label3_ = new UILabel(); + } + label3_->SetPosition(135, 210); // widget's left position and top position + label3_->Resize(200, 60); // widget's width and height + label3_->SetViewId("label3"); // Set style + label3_->SetStyle(STYLE_TEXT_FONT, 20); + + // Set additional property + label3_->SetText("健走"); + label3_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label3_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label3_->SetRollSpeed(0); + label3_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + + // Add to rootView + container_->Add(label3_); + label3_->SetVisible(true); + + // Add ImageView to App + if (image5_ == nullptr) + { + image5_ = new UIImageView(); + } + image5_->SetPosition(126, 148); // widget's left position and top position + image5_->Resize(100, 100); // widget's width and height + image5_->SetViewId("image1"); // Set style + + // Set additional property +#ifdef _WIN32 + char *image5imagesPath = "c:/Users/caiking/project/image_converter_tool/output/Training/walking-big.bin"; +#else + const char *image5imagesPath = PNG_TRAING_WALKINGBIG_IMAGE; +#endif + image5_->SetSrc(image5imagesPath); + + // Add to rootView + container_->Add(image5_); + image5_->SetVisible(true); + + // Add Label to App + if (label4_ == nullptr) + { + label4_ = new UILabel(); + } + label4_->SetPosition(131, 365); // widget's left position and top position + label4_->Resize(200, 60); // widget's width and height + label4_->SetViewId("label4"); // Set style + label4_->SetStyle(STYLE_TEXT_FONT, 20); + + // Set additional property + label4_->SetText("跑步"); + label4_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label4_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label4_->SetRollSpeed(0); + label4_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + + // Add to rootView + container_->Add(label4_); + label4_->SetVisible(true); + } + + void TraingView::DeInit() + { + if (label1_ != nullptr) + { + delete label1_; + label1_ = nullptr; + } + if (button3_ != nullptr) + { + delete button3_; + button3_ = nullptr; + } + if (button4_ != nullptr) + { + delete button4_; + button4_ = nullptr; + } + if (button1_ != nullptr) + { + delete button1_; + button1_ = nullptr; + } + if (button2_ != nullptr) + { + delete button2_; + button2_ = nullptr; + } + if (image1_ != nullptr) + { + delete image1_; + image1_ = nullptr; + } + if (label2_ != nullptr) + { + delete label2_; + label2_ = nullptr; + } + if (image3_ != nullptr) + { + delete image3_; + image3_ = nullptr; + } + if (label3_ != nullptr) + { + delete label3_; + label3_ = nullptr; + } + if (image5_ != nullptr) + { + delete image5_; + image5_ = nullptr; + } + if (label4_ != nullptr) + { + delete label4_; + label4_ = nullptr; + } + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + } + + UIView *TraingView::GetView() + { + Init(); + return container_; + } + + void TraingView::OnStart() + { + container_ = new UIViewGroup(); + if (container_ == nullptr) + { + return; + } + container_->SetPosition(0, 0); + container_->SetWidth(Screen::GetInstance().GetWidth()); + container_->SetHeight(Screen::GetInstance().GetHeight()); + + // 创建 draglistener 实例并设置为拖动监听器 + UIView::OnDragListener *draglistener = static_cast(TraingPresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + + container_->SetTouchable(true); + container_->SetDraggable(true); + + GetView(); + RootView::GetInstance()->Add(container_); + } + + void TraingView::OnSetUpView() + { + + View::OnSetUpView(); + Draw(); + } + + void TraingView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void TraingView::OnStop() + { + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +}