void ApplistModel::Init()
{
- if (!initFlag)
- {
+ if (!initFlag) {
ResolvingJSAppItems();
initFlag = true;
}
void ApplistModel::ResolvingJSAppItems(void)
{
- uint8 i, ret, nativeAppNum;
- int32 len = 0;
#ifdef JS_ENABLE
- if (bundleInfos != nullptr)
- {
- for (i = 0; i < bundleLen; i++)
- {
+ if (bundleInfos != nullptr) {
+ for (uint8_t i = 0; i < bundleLen; i++) {
ClearBundleInfo(bundleInfos + i);
}
- if (bundleInfos != nullptr)
- {
+ if (bundleInfos != nullptr) {
AdapterFree(bundleInfos);
bundleInfos = nullptr;
}
#endif
bundleLen = 0;
appLen = 0;
- nativeAppNum = sizeof(g_nativeAppList) / sizeof(AppItem);
- if (nativeAppNum >= APP_MAX_NUM)
- {
+
+ uint8_t nativeAppNum = sizeof(g_nativeAppList) / sizeof(AppItem);
+ if (nativeAppNum >= APP_MAX_NUM) {
nativeAppNum = APP_MAX_NUM;
}
- ret = memcpy_s(applist, sizeof(AppItem) * APP_MAX_NUM, g_nativeAppList, sizeof(AppItem) * nativeAppNum);
- if (ret != EOK)
- {
+
+ uint8_t ret = memcpy_s(applist, sizeof(AppItem) * APP_MAX_NUM, g_nativeAppList, sizeof(AppItem) * nativeAppNum);
+ if (ret != EOK) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%s] ret = %d, nativeAppNum = %d", __FUNCTION__, ret, nativeAppNum);
nativeAppNum = 0;
}
appLen = nativeAppNum;
#ifdef JS_ENABLE
+ int32_t len = 0;
ret = BundleMsClient::GetInstance().GetBundleInfos(0, &bundleInfos, &len);
- if ((ret == 0) && (len > 0) && (bundleInfos != nullptr))
- {
+ if ((ret == 0) && (len > 0) && (bundleInfos != nullptr)) {
bundleLen = len;
- if (len > APP_MAX_NUM - nativeAppNum)
- {
+ if (len > APP_MAX_NUM - nativeAppNum) {
len = APP_MAX_NUM - nativeAppNum;
}
- while (len--)
- {
+ while (len--) {
applist[appLen].id = VIEW_EXTERN_APP;
applist[appLen].iconLarge = bundleInfos[len].smallIconPath;
applist[appLen].iconSmall = bundleInfos[len].smallIconPath;
appLen++;
bundleInfos[len].abilityInfo = nullptr;
}
- }
- else
- {
+ } else {
WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "ResolvingJSAppItems GetBundleInfos ret = %d \r", ret);
}
#endif
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnDrag ChangeSlice");
// uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId();
// NativeAbility::GetInstance().ChangeSlice(preSlice);
- NativeAbility::GetInstance().Back();
+ NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
}
return false;
}
SetDesktopModel::GetInstance().SetDesktopStyle(APPLIST_STYLE);
}
// uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId();
- NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST);
+ //NativeAbility::GetInstance().ChangeSlice(preSlice);
+ NativeAbility::GetInstance().EnterSlice(VIEW_APPLIST);
return true;
}
bool SetDesktopPresenter::GetHexagonsStyleState(void)
// 如果是power键就返回上一级
if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0)
{
- NativeAbility::GetInstance().Back();
+ NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS);
}
return true;
}