*/
typedef enum : uint16_t
{
- VIEW_INVALID = 0, // 无效视图
- VIEW_MAIN_SAMPLE = 1, // 主界面
- VIEW_SETTING, // 设置
- VIEW_APPLIST, // App应用
- VIEW_MAIN_ALARM, // 闹钟
- VIEW_SETTING_FIRST,
- VIEW_MAIN_ACTIVITY,
- VIEW_ALARM_POP_UP,
- VIEW_CALLER_SAMPLE,
- VIEW_MAEKPHONE_SAMPLE,
- VIEW_BLOODOXY_SAMPLE,
- VIEW_BLUETOOTH_EARPHONE,
- VIEW_OFFLINEVOICE,
- VIEW_WIFI,
- VIEW_VOLUME,
- VIEW_COMPASS,
- VIEW_CONNECT_PHONE,
- VIEW_MAIN_TEMP,
- VIEW_INDOORWALK,
- VIEW_REBOOT,
- VIEW_UISAMPLE,
+ VIEW_INVALID = 0, // 无效视图
+ /* ----------------------------- 每一个id对应一个slice ----------------------------- */
+ VIEW_MAIN = 1, // 主界面
+ VIEW_SETTING, // 设置
+ VIEW_APPLIST, // App应用
+ VIEW_MAIN_ALARM, // 闹钟
+ VIEW_ALARM_POP_UP, // 闹铃界面
+ VIEW_BLUETOOTH_EARPHONE, // 连接蓝牙耳机界面
+ VIEW_CALLER_LOG, // 通话记录界面
+ VIEW_INCOMING_CALL, // 来电界面
+ VIEW_BLOODOXY, // 血氧饱和度界面
+ VIEW_COMPASS, // 指南针界面
+ VIEW_CONNECT_PHONE, // 连接手机界面
+ VIEW_INDOORWALK, // 室内步行
+ VIEW_SHUTDOWN_OR_REBOOT, // 关机或重启界面
VIEW_DIAL, // 切换表盘
VIEW_WEATHER, // 天气
VIEW_WEATHER_REPORT, // 气象报告
VIEW_FUTURE_WEATHER, // 未来天气
VIEW_GET_WEATHER_DATA_ERROR, // 获取天气数据失败
/* -------------------------------------------------------------------------- */
- VIEW_MAX_INTER_APP, // 在此之前添加native应用ID.
- VIEW_EXTERN_APP = 0xFFFE, // 三方应用
+ VIEW_MAIN_TEMP, // 体温界面(暂时不用)
+ VIEW_OFFLINEVOICE, // 语音助手界面(暂时不用)
+ VIEW_MAIN_ACTIVITY, // 记录步数界面(暂时不用)
+ VIEW_UISAMPLE, // 示例(暂时不用)
+ /* -------------------------------------------------------------------------- */
+ VIEW_MAX_INTER_APP, // 在此之前添加native应用ID.
+ VIEW_EXTERN_APP = 0xFFFE, // 三方应用
VIEW_INVALIDE_APP = 0xFFFF,
} AppViewId;
};
static const AppViewMapper SLICE_MAPPER[] = {
+ {VIEW_MAIN, &NativeLauncher::InitMainSampleSlice},
{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_CALLER_LOG, &NativeLauncher::InitMainCallerLogView},
+ {VIEW_INCOMING_CALL, &NativeLauncher::InitMainMakePhoneView},
+ {VIEW_BLOODOXY, &NativeLauncher::InitMainBloodOxyView},
{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_SHUTDOWN_OR_REBOOT, &NativeLauncher::InitRebootSlice},
{VIEW_DIAL, &NativeLauncher::InitDialSlice},
{VIEW_WEATHER,&NativeLauncher::InitWeatherSlice}, //天气
{VIEW_WEATHER_REPORT,&NativeLauncher::InitWeatherReportSlice}, //气象报告
{VIEW_FUTURE_WEATHER,&NativeLauncher::InitFutureWeatherSlice}, //未来天气
{VIEW_GET_WEATHER_DATA_ERROR,&NativeLauncher::InitGetWeatherDataErrorSlice}, //获取天气数据失败
- {VIEW_UISAMPLE, &NativeLauncher::InitUISampleSlice}};
+ //{VIEW_MAIN_ACTIVITY, &NativeLauncher::InitActivitySlice},
+ //{VIEW_OFFLINEVOICE, &NativeLauncher::InitOfflineVoice},
+ //{VIEW_MAIN_TEMP, &NativeLauncher::InitMainTempSlice},
+ //{VIEW_UISAMPLE, &NativeLauncher::InitUISampleSlice}
+ };
static const ViewIdToString VIEW_MAPPER[] = {
+ {VIEW_MAIN, "mainView"},
{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_CALLER_LOG, "callerLogView"},
+ {VIEW_INCOMING_CALL, "makePhoneView"},
+ {VIEW_BLOODOXY, "bloodOxygenView"},
{VIEW_COMPASS, "mainCompassView"},
- {VIEW_OFFLINEVOICE, "offlineVoiceView"},
{VIEW_CONNECT_PHONE, "ConnectPhoneView"},
- {VIEW_MAIN_TEMP, "mianTempView"},
{VIEW_INDOORWALK, "IndoorWalkView"},
- {VIEW_REBOOT, "RebootView"},
- {VIEW_UISAMPLE, "UISample"}};
-
+ {VIEW_SHUTDOWN_OR_REBOOT, "RebootView"}};
+
NativeLauncher::NativeLauncher() {}
NativeLauncher::~NativeLauncher() {}
BluetoothModel::GetInstance()->Init();
// 初始化默认首页
ScreenModels::GetInstance()->PreLoadAppimages();
- NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN_SAMPLE);
+ NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN);
}
void NativeLauncher::InitAllNativeSlices(void)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainViewSample is nullptr");
return;
}
- NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN_SAMPLE, mainViewSample);
+ NativeAbility::GetInstance().AddSliceProxy(VIEW_MAIN, mainViewSample);
}
void NativeLauncher::InitMainAlarmSlice(void)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "rebootView is nullptr");
return;
}
- NativeAbility::GetInstance().AddSliceProxy(VIEW_REBOOT, rebootView);
+ NativeAbility::GetInstance().AddSliceProxy(VIEW_SHUTDOWN_OR_REBOOT, rebootView);
}
void NativeLauncher::InitConnectPhoneSlice(void)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bloodOxygenView is nullptr");
return;
}
- NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODOXY_SAMPLE, bloodOxygenView);
+ NativeAbility::GetInstance().AddSliceProxy(VIEW_BLOODOXY, bloodOxygenView);
}
void NativeLauncher::InitMainMakePhoneView(void)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "makePhoneView is nullptr");
return;
}
- NativeAbility::GetInstance().AddSliceProxy(VIEW_MAEKPHONE_SAMPLE, makePhoneView);
+ NativeAbility::GetInstance().AddSliceProxy(VIEW_INCOMING_CALL, makePhoneView);
}
void NativeLauncher::InitMainCallerLogView(void)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "callerLogView is nullptr");
return;
}
- NativeAbility::GetInstance().AddSliceProxy(VIEW_CALLER_SAMPLE, callerLogView);
+ NativeAbility::GetInstance().AddSliceProxy(VIEW_CALLER_LOG, callerLogView);
}
void NativeLauncher::InitActivitySlice(void)
uint16_t preSlice;
preSlice = NativeAbility::GetInstance().GetPreSliceId();
if (preSlice == VIEW_ALARM_POP_UP || preSlice < VIEW_SETTING) {
- preSlice = VIEW_MAIN_SAMPLE;
- } else if ((preSlice == VIEW_MAEKPHONE_SAMPLE) &&
+ preSlice = VIEW_MAIN;
+ } else if ((preSlice == VIEW_INCOMING_CALL) &&
(GetCurrCallNum() == 0 || GetScoConnectState() != HFP_SCO_STATE_CONNECTED)) {
int num;
PhoneCallInfo callList[MULTI_CALL_MAX_NUME]{};
if (GetCurrCallNum() == 1 && callList[0].lastStatus == HFP_HF_CALL_STATE_INCOMING) {
return preSlice;
}
- preSlice = VIEW_MAIN_SAMPLE;
+ preSlice = VIEW_MAIN;
}
return preSlice;
}
if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) &&
(event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) {
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Applist Ondrag!!");
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
}
return false;
{
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_BLOODOXY, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_SPO2_IMAGE, "血氧饱和度", nullptr},
{VIEW_COMPASS, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_COMPASS_IMAGE, "指南针", nullptr},
{VIEW_INDOORWALK, PNG_APPLIST_WALK_IMAGE, PNG_APPLIST_WALK_IMAGE, "室内步行", nullptr},
{VIEW_WEATHER, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_WEATHER_IMAGE, "天气", nullptr},
{VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "设置", nullptr},
#if 0
{VIEW_MAIN_TEMP, PNG_APPLIST_TEMP_IMAGE, PNG_APPLIST_TEMP_IMAGE, "体温", nullptr},
- {VIEW_CALLER_SAMPLE, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_CALLER_IMAGE, "通话记录", nullptr},
+ {VIEW_CALLER_LOG, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_CALLER_IMAGE, "通话记录", nullptr},
{VIEW_OFFLINEVOICE, PNG_APPLIST_VOCASSIST_IMAGE, PNG_APPLIST_VOCASSIST_IMAGE, "语音助手", nullptr},
{VIEW_UISAMPLE, PNG_APPLIST_UI_SAMPLE_IMAGE, PNG_APPLIST_UI_SAMPLE_IMAGE, "示例", nullptr},
#endif
DisableCallingTimer();
// If the call is handling in the notification, the slice is not switched
if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
}
return;
}
static void ExitMakePhoneSlice(void)
{
- if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE) {
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL) {
WEARABLE_LOGD(HILOG_MODULE_AAFWK, "ExitMakePhoneSlice");
if (GetCurrCallNum() == 0) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
CallModelPostGraphicEvent(CallModelResumePlayer);
} else {
NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST);
CallerLogModel::GetInstance()->SetWaitingStatus(true);
// If the call is handling in the notification, the slice is not switched
if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
}
}
static void WatchActiveHandle(const PhoneCallInfo *phoneCall)
{
- if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
NativeAbility::GetInstance().GetCurSliceId() == VIEW_OFFLINEVOICE ||
CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
time_t seconds;
static void PhoneActiveHandle(void)
{
- if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
if (GetCurrCallNum() > 1) {
g_phoneStatus = PHONE_MULTI_STATUS;
TransCallToMobilePhone();
// If the call is handling in the notification, the slice is not switched
if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE); // 退出通话界面,回到主表盘应用
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); // 退出通话界面,回到主表盘应用
}
CallModelPostGraphicEvent(CallModelResumePlayer);
}
static void OppoActiveHandle(const PhoneCallInfo *phoneCall)
{
- if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
if (GetCurrCallNum() > 1) {
g_phoneStatus = PHONE_MULTI_STATUS;
static bool MultiplePhonesViewDisplay()
{
if (g_phoneStatus == PHONE_MULTI_STATUS) {
- if (NativeAbility::GetInstance().GetCurSliceId() != VIEW_MAEKPHONE_SAMPLE) {
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay]GetCurSliceId no VIEW_MAEKPHONE_SAMPLE");
+ if (NativeAbility::GetInstance().GetCurSliceId() != VIEW_INCOMING_CALL) {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[MultiplePhonesViewDisplay]GetCurSliceId no VIEW_INCOMING_CALL");
DisableCallingTimer();
CallerLogModel::GetInstance()->SetMulitplePhoneStatus(true);
CallerLogModel::GetInstance()->SetCallStatus(true);
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
return true;
}
if (MulitplePhoneTextReplaces() == false) {
/* 非手表挂断 */
static void NonWatchFinishHandle(int laststatus)
{
- if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
if (GetCurrCallNum() == 0) {
StatusReset();
}
// If the call is handling in the notification, the slice is not switched
if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
}
}
CallerLogModel::GetInstance()->SetNotifyFlag(false);
static void WatchFinishHandle(void)
{
- if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||
CallerLogModel::GetInstance()->GetNotifyFlag() == true) {
if (GetCurrCallNum() == 0) {
StatusReset();
}
// If the call is handling in the notification, the slice is not switched
if (g_callOperate != OPERATE_PHONE_ACTIVE && CallerLogModel::GetInstance()->GetNotifyFlag() != true) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
}
}
}
// If the call is handling in the notification, the slice is not switched
if (CallerLogModel::GetInstance()->GetNotifyFlag() == false) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
}
}
if (event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP)\r
{\r
// printf("draglistene is ok!\n");\r
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
}\r
UNUSED(view);\r
return true;\r
// printf("join click\n");\r
const std::string jsonPath = "/user/res/clocks/KUMI.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
}\r
if (strcmp(view.GetViewId(), "flowerbudbutton") == 0)\r
{\r
// printf("join click\n");\r
const std::string jsonPath = "/user/res/clocks/flowerbud.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
}\r
if (strcmp(view.GetViewId(), "maomaobutton") == 0)\r
{\r
// printf("join click\n");\r
const std::string jsonPath = "/user/res/clocks/maomao.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
}\r
if (strcmp(view.GetViewId(), "momobutton") == 0)\r
{\r
// printf("join click\n");\r
const std::string jsonPath = "/user/res/clocks/momo.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
}\r
if (strcmp(view.GetViewId(), "maliaobutton") == 0)\r
{\r
// printf("join click\n");\r
const std::string jsonPath = "/user/res/clocks/maliao.json";\r
g_pDigital_clockView->setJsonFilePath(jsonPath);\r
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
}\r
#endif\r
return true;\r
rateData = GetAveHeartRate();
uint16_t currentViewId = NativeAbility::GetInstance().GetCurSliceId();
- if (currentViewId == VIEW_MAIN_SAMPLE && MainClockView::GetInstance() != nullptr) {
+ if (currentViewId == VIEW_MAIN && MainClockView::GetInstance() != nullptr) {
MainClockView::GetInstance()->RefreshHeartRate(perSec);
}
WEARABLE_LOGD("","into key! keyID %u\n",keyID);
if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER)) { // 电源按键
// 切换到关机/重启卡片
- NativeAbility::GetInstance().ChangeSlice(VIEW_REBOOT);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_SHUTDOWN_OR_REBOOT);
} else if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC)) { // 功能按键
// 切换到查看系统版本卡片
}
if (longPressFlag == 0 && pressFlag == 1) { // 短按电源键
- if (currentViewId == VIEW_MAEKPHONE_SAMPLE || IsCallingNotify() == true) { // 音量卡片
+ if (currentViewId == VIEW_INCOMING_CALL || IsCallingNotify() == true) { // 音量卡片
// 音量+
CallVolumeDipSwitchControl(1);
- }else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘
+ }else if (currentViewId != VIEW_MAIN) { // 主表盘
if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
}
} else {
if (!MainViewSample::GetInstance()->IsMainView()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面
if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
}
} else {
//power键要进入休眠
}
} else if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC)) { // 功能按键
if (longPressFlag == 0 && pressFlag == 1) { // 短按功能键
- if (currentViewId == VIEW_MAEKPHONE_SAMPLE || IsCallingNotify() == true) { // 音量卡片
+ if (currentViewId == VIEW_INCOMING_CALL || IsCallingNotify() == true) { // 音量卡片
// 音量-
CallVolumeDipSwitchControl(0);
- } else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘
+ } else if (currentViewId != VIEW_MAIN) { // 主表盘
if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TRANSITION_ZOOM);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
}
} else {
if(mcu_pms_is_screen_on()){ //只有亮屏的时候才做界面切换
PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面
if (!MainViewSample::GetInstance()->IsMainView()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
} else {
NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TRANSITION_ZOOM);
}
namespace OHOS
{
-map<string, AppViewId> g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN_SAMPLE }, // 天气界面
+map<string, AppViewId> g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN }, // 天气界面
{ MAIN_CLICK_ACTIVITY, VIEW_MAIN_ACTIVITY }, // 活动记录界面
- { MAIN_CLICK_MESSAGE, VIEW_MAIN_SAMPLE }, // 消息app
- { MAIN_CLICK_HEARTRATE, VIEW_MAIN_SAMPLE }, // 心率界面
+ { MAIN_CLICK_MESSAGE, VIEW_MAIN }, // 消息app
+ { MAIN_CLICK_HEARTRATE, VIEW_MAIN }, // 心率界面
{ DROPDOWN_CLICK_SETTING,VIEW_SETTING}, // 设置
{ DROPDOWN_CLICK_BLUETOOTH,VIEW_BLUETOOTH_EARPHONE}, // 蓝牙
};
}
CallerLogModel::GetInstance()->SetWaitingStatus(false);
CallerLogModel::GetInstance()->SetCallStatus(true);
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, PRIORITY_ONE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, PRIORITY_ONE);
return true;
}
strcmp(view.GetViewId(), VOC_ID) == 0) { // 语音助手右滑退出
int phoneStatus = VocassistModel::GetInstance()->GetPhoneDetailStatus(); // 扫描设置此时通话的状态和个数
if (phoneStatus == ONE_ROAD_AND_INCOMING) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL);
} else {
NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST);
}
if (quitStatus == CONTINUTE_EXIT_MODE1) {
int phoneStatus = VocassistModel::GetInstance()->GetPhoneDetailStatus(); // 扫描设置此时通话的状态和个数
if (phoneStatus == ONE_ROAD_AND_INCOMING) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAEKPHONE_SAMPLE, gSliceDefaultPriority); // 返回来电界面
+ NativeAbility::GetInstance().ChangeSlice(VIEW_INCOMING_CALL, gSliceDefaultPriority); // 返回来电界面
return;
}
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Too long no operate, now exit vocassist");
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
return;
} else if (quitStatus == CONTINUTE_EXIT_MODE2) {
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Too long no operate, now change model to vocassist label");
{\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] start");\r
usleep(50000); // 确保界面切换完成\r
- if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_MAEKPHONE_SAMPLE ||\r
+ if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL ||\r
(GetCurrCallState() != HFP_HF_CALL_STATE_FINISHED && GetScoConnectState() == HFP_SCO_STATE_CONNECTED)) {\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PlayerInterruptListener::ResumePlayer] this is in calling");\r
return; // 通话界面,禁止音乐恢复播放\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootPresenter::OnDrag");
if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) {
if (strcmp(view.GetViewId(), REBOOT_VIEW) == 0) {
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
} else if (strcmp(view.GetViewId(), REBOOTDEVICE_VIEW) == 0) {
if (RebootModel::GetInstance()->GetExitsView() == 0) {
RebootView::GetInstance()->ChangeView(REBOOTDEVICEVIEW, REBOOTVIEW);
settings[2] = {SETTING_ITEM_TWO, PNG_SETTINGS_SOUND_VIBRATION, "声音与震动", true};
settings[3] = {SETTING_ITEM_THREE, PNG_SETTINGS_SECONDARY_FUNCTION, "辅助功能", true};
settings[4] = {SETTING_ITEM_FOUR, PNG_SETTINGS_SYSTEM, "系统", true};
- settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_ZERO, VIEW_REBOOT));
+ settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_ZERO, VIEW_SHUTDOWN_OR_REBOOT));
settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_ONE, VIEW_BLUETOOTH_EARPHONE));
- settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_TWO, VIEW_REBOOT));
- settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_THREE, VIEW_REBOOT));
- settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_FOUR, VIEW_REBOOT));
+ settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_TWO, VIEW_SHUTDOWN_OR_REBOOT));
+ settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_THREE, VIEW_SHUTDOWN_OR_REBOOT));
+ settingIdToViewId.insert(std::pair<SettingIndex, AppViewId>(SETTING_ITEM_FOUR, VIEW_SHUTDOWN_OR_REBOOT));
}
const SettingItem *SettingModel::GetSettinglistItems() const
}
else
{
- NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
}
}