蓝区^Cster代码更新

Signed-off-by: tangzhigang1 <tangzhigang7@huawei.com>
This commit is contained in:
tangzhigang1 2022-12-03 12:11:55 +08:00
parent 8ef22cbb83
commit 8e8db26155
20 changed files with 171 additions and 142 deletions

View File

@ -1,12 +1,12 @@
{
"totalTime": 2116161500,
"totalTime": 65683707500,
"moduleNum": 12,
"taskTime": {
"sdkDirInit": 21573800,
"compileETS": 0,
"compileJS": 0,
"compileResource": 0,
"packageHap": 0,
"signHap": 0
"sdkDirInit": 13986400,
"compileETS": 23271501000,
"compileJS": 376000,
"compileResource": 408618700,
"packageHap": 316348500,
"signHap": 2653352100
}
}

View File

@ -1,12 +1,13 @@
{
"name": "@ohos/common",
"version": "1.0.0",
"description": "a npm package which contains common function",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"main": "index.ets",
"dependencies": {}
"devDependencies": {},
"name": "@ohos/common",
"description": "a npm package which contains common function",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"main": "index.ets",
"version": "1.0.0",
"dependencies": {}
}

View File

@ -39,6 +39,7 @@ export struct AppBubble {
nameLines: number = PresetStyleConstants.DEFAULT_APP_NAME_LINES;
mIconNameMargin: number = PresetStyleConstants.DEFAULT_ICON_NAME_GAP;
private menuInfo;
private getMenuInfoList: Function;
isSelect?: boolean;
appName: string = '';
useCache: boolean = true;
@ -49,6 +50,7 @@ export struct AppBubble {
Column() {
AppMenu({
menuInfoList: this.menuInfo,
getMenuInfoList: this.getMenuInfoList,
closeMenu: () => {
AppStorage.SetOrCreate('contextMenuState', false);
}

View File

@ -1,14 +1,15 @@
{
"name": "@ohos/appcenter",
"version": "1.0.0",
"description": "a npm package which contains appcenter feature",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"main": "index.ets",
"dependencies": {
"@ohos/common": "../../common"
}
"devDependencies": {},
"name": "@ohos/appcenter",
"description": "a npm package which contains appcenter feature",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"main": "index.ets",
"version": "1.0.0",
"dependencies": {
"@ohos/common": "../../common"
}
}

View File

@ -83,9 +83,10 @@ export struct AppGridLayout {
this.dialogName = resName;
});
}
public buildMenuInfoList(appInfo) {
let menuInfoList = new Array<MenuInfo>();
let shortcutInfo = this.mAppGridViewModel.getShortcutInfo(appInfo.bundleName);
let shortcutInfo: any = this.mAppGridViewModel.getShortcutInfo(appInfo.bundleName);
if (shortcutInfo) {
let menu = null;
shortcutInfo.forEach((value) => {

View File

@ -1,14 +1,15 @@
{
"name": "@ohos/bigfolder",
"version": "1.0.0",
"description": "a npm package which contains bigfolder feature",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"main": "index.ets",
"dependencies": {
"@ohos/common": "../../common"
}
"devDependencies": {},
"name": "@ohos/bigfolder",
"description": "a npm package which contains bigfolder feature",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"main": "index.ets",
"version": "1.0.0",
"dependencies": {
"@ohos/common": "../../common"
}
}

View File

@ -1,14 +1,15 @@
{
"name": "@ohos/form",
"version": "1.0.0",
"description": "a npm package which contains form feature",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"main": "index.ets",
"dependencies": {
"@ohos/common": "../../common"
}
"devDependencies": {},
"name": "@ohos/form",
"description": "a npm package which contains form feature",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"main": "index.ets",
"version": "1.0.0",
"dependencies": {
"@ohos/common": "../../common"
}
}

View File

@ -1,14 +1,15 @@
{
"name": "@ohos/gesturenavigation",
"version": "1.0.0",
"description": "a npm package which contains gesturenavigation feature",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"main": "index.ets",
"dependencies": {
"@ohos/common": "../../common"
}
"devDependencies": {},
"name": "@ohos/gesturenavigation",
"description": "a npm package which contains gesturenavigation feature",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"main": "index.ets",
"version": "1.0.0",
"dependencies": {
"@ohos/common": "../../common"
}
}

View File

@ -1,16 +1,17 @@
{
"name": "@ohos/pagedesktop",
"version": "1.0.0",
"description": "a npm package which contains pagedesktop feature",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"main": "index.ets",
"dependencies": {
"@ohos/common": "../../common",
"@ohos/bigfolder": "../bigfolder",
"@ohos/form": "../form"
}
"devDependencies": {},
"name": "@ohos/pagedesktop",
"description": "a npm package which contains pagedesktop feature",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"main": "index.ets",
"version": "1.0.0",
"dependencies": {
"@ohos/bigfolder": "../bigfolder",
"@ohos/form": "../form",
"@ohos/common": "../../common"
}
}

View File

@ -146,6 +146,11 @@ export default struct AppItem {
});
}
getMenuInfoList() {
const menuInfo = this.mPageDesktopViewModel.buildMenuInfoList(this.item, this.dialogController, this.formManagerDialogController)
return menuInfo;
}
/**
* When click cancel dialog, this function will be called.
*/
@ -168,8 +173,7 @@ export default struct AppItem {
appLabelId: this.item.appLabelId,
badgeNumber: this.item.badgeNumber,
isSelect: this.selectDesktopAppItem == this.item.keyName,
menuInfo:this.mPageDesktopViewModel.buildMenuInfoList(this.item,
this.dialogController, this.formManagerDialogController),
getMenuInfoList: this.getMenuInfoList.bind(this),
mPaddingTop: this.mMarginVertical,
nameLines: this.mNameLines,
mIconNameMargin: this.mIconNameMargin,
@ -244,6 +248,7 @@ export default struct AppItem {
*/
private setStartAppInfo() {
Log.showInfo(TAG, `app setStartAppInfo ${this.mIconSize}`);
Trace.start("setStartAppInfo");
const appInfo = {
bundleName: this.item.bundleName,
abilityName: this.item.abilityName,
@ -259,5 +264,6 @@ export default struct AppItem {
AppStorage.SetOrCreate('startAppTypeFromPageDesktop', CommonConstants.OVERLAY_TYPE_APP_ICON);
this.mPageDesktopStartAppHandler.setAppIconSize(this.mIconSize);
this.mPageDesktopStartAppHandler.setAppIconInfo();
Trace.start("setStartAppInfo");
}
}

View File

@ -880,7 +880,7 @@ export default class PageDesktopViewModel extends BaseViewModel {
buildMenuInfoList(appInfo, dialog, formDialog?, folderCallback?, openClickCallback?): MenuInfo[] {
let menuInfoList = new Array<MenuInfo>();
const shortcutInfo = this.mAppModel.getShortcutInfo(appInfo.bundleName);
const shortcutInfo: any = this.mAppModel.getShortcutInfo(appInfo.bundleName);
if (shortcutInfo) {
let menu = null;
shortcutInfo.forEach((value) => {

View File

@ -1,14 +1,15 @@
{
"name": "@ohos/recents",
"version": "1.0.0",
"description": "a npm package which contains recents feature",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"main": "index.ets",
"dependencies": {
"@ohos/common": "../../common"
}
"devDependencies": {},
"name": "@ohos/recents",
"description": "a npm package which contains recents feature",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"main": "index.ets",
"version": "1.0.0",
"dependencies": {
"@ohos/common": "../../common"
}
}

View File

@ -153,7 +153,7 @@ export default struct RecentMissionCard {
Image(this.recentImage)
.alt(RecentsStyleConstants.DEFAULT_APP_IMAGE)
.objectFit(ImageFit.Contain)
.objectFit(ImageFit.Fill)
.borderRadius(RecentsStyleConstants.RECENT_IMAGE_RADIUS)
.width(this.mIsSingleLayout ?
RecentsStyleConstants.SINGLE_LIST_APP_IMAGE_WIDTH :

View File

@ -1,14 +1,15 @@
{
"name": "@ohos/smartdock",
"version": "1.0.0",
"description": "a npm package which contains smartdock feature",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"main": "index.ets",
"dependencies": {
"@ohos/common": "../../common"
}
"devDependencies": {},
"name": "@ohos/smartdock",
"description": "a npm package which contains smartdock feature",
"ohos": {
"org": "huawei",
"directoryLevel": "module",
"buildTool": "hvigor"
},
"main": "index.ets",
"version": "1.0.0",
"dependencies": {
"@ohos/common": "../../common"
}
}

View File

@ -36,6 +36,7 @@ import SmartDockCloseAppHandler from '../common/SmartDockCloseAppHandler';
import { SmartDockStyleConfig } from '../config/SmartDockStyleConfig';
import { SmartDockLayoutConfig } from '../config/SmartDockLayoutConfig';
import SmartDockConstants from '../common/constants/SmartDockConstants';
import { RecentMissionInfo } from '@ohos/common'
const TAG = 'SmartDockModel';
const KEY_NAME = 'name';
@ -430,7 +431,7 @@ export default class SmartDockModel {
private registerMissionListener(): void {
Log.showDebug(TAG, 'registerMissionListener');
const listener: MissionListener = {
onMissionCreated: this.onMissionCreatedCallback.bind(this),
onMissionCreated: () => {},
onMissionDestroyed: this.onMissionDestroyedCallback.bind(this),
onMissionSnapshotChanged: this.onMissionSnapshotChangedCallback.bind(this),
onMissionMovedToFront: this.onMissionMovedToFrontCallback.bind(this),
@ -443,12 +444,6 @@ export default class SmartDockModel {
missionManager.registerMissionListener(listener);
}
onMissionCreatedCallback(missionId: number): void {
Log.showInfo(TAG, 'onMissionCreatedCallback, missionId=' + missionId);
this.getRecentDataList().then(() => {}, () => {});
this.getRecentViewDataList(missionId).then(() => {}, () => {});
}
/**
* get recent view list
*/
@ -456,9 +451,24 @@ export default class SmartDockModel {
let mRecentMissionsList = await amsMissionManager.getRecentMissionsList();
Log.showDebug(TAG, `getRecentMissionsList length: ${mRecentMissionsList.length}`);
const snapShotTime = new Date().toString();
mRecentMissionsList.find(item => {
return item.missionId === missionId;
}).snapShotTime = snapShotTime;
let recentMissionInfoIndex = mRecentMissionsList.findIndex(item => {
return item.missionId = missionId;
})
if (recentMissionInfoIndex != -1) {
let recentMissionInfo: RecentMissionInfo = {
missionId: mRecentMissionsList[recentMissionInfoIndex].missionId,
appIconId: mRecentMissionsList[recentMissionInfoIndex].appIconId,
appLabelId: mRecentMissionsList[recentMissionInfoIndex].appLabelId,
appName: mRecentMissionsList[recentMissionInfoIndex].appName,
bundleName: mRecentMissionsList[recentMissionInfoIndex].bundleName,
moduleName: mRecentMissionsList[recentMissionInfoIndex].moduleName,
abilityName: mRecentMissionsList[recentMissionInfoIndex].abilityName,
lockedState: mRecentMissionsList[recentMissionInfoIndex].lockedState,
snapShotTime: snapShotTime
}
mRecentMissionsList[recentMissionInfoIndex] = recentMissionInfo;
}
AppStorage.SetOrCreate('recentMissionsList', mRecentMissionsList);
}

View File

@ -1,16 +1,16 @@
{
"devDependencies": {},
"name": "launcher",
"ohos": {
"org": "huawei",
"directoryLevel": "project",
"buildTool": "hvigor"
"devDependencies":{},
"name":"launcher",
"ohos":{
"org":"huawei",
"directoryLevel":"project",
"buildTool":"hvigor"
},
"version": "1.0.0",
"dependencies": {
"@ohos/hvigor-ohos-plugin": "1.1.6",
"hypium": "^1.0.0",
"@ohos/hvigor": "1.1.6",
"@ohos/hypium": "1.0.1"
"version":"1.0.0",
"dependencies":{
"@ohos/hypium":"1.0.1",
"@ohos/hvigor-ohos-plugin":"1.1.6",
"hypium":"^1.0.0",
"@ohos/hvigor":"1.1.6"
}
}
}

View File

@ -8,14 +8,14 @@
},
"version": "1.0.0",
"dependencies": {
"@ohos/common": "../../common",
"@ohos/appcenter": "../../feature/appcenter",
"@ohos/bigfolder": "../../feature/bigfolder",
"@ohos/form": "../../feature/form",
"@ohos/gesturenavigation": "../../feature/gesturenavigation",
"@ohos/pagedesktop": "../../feature/pagedesktop",
"@ohos/recents": "../../feature/recents",
"@ohos/bigfolder": "../../feature/bigfolder",
"@ohos/appcenter": "../../feature/appcenter",
"@ohos/smartdock": "../../feature/smartdock",
"@ohos/form": "../../feature/form",
"@ohos/gesturenavigation": "../../feature/gesturenavigation",
"@ohos/common": "../../common",
"@ohos/numbadge": "../../feature/numbadge"
}
}

View File

@ -29,7 +29,8 @@ const TAG = 'LauncherMainAbility';
export default class MainAbility extends ServiceExtension {
onCreate(want: Want): void {
Log.showInfo(TAG,'onCreate start');
Log.showInfo(TAG, 'onCreate start');
this.context.area = 0;
this.initLauncher();
}

View File

@ -8,13 +8,13 @@
},
"version": "1.0.0",
"dependencies": {
"@ohos/common": "../../common",
"@ohos/bigfolder": "../../feature/bigfolder",
"@ohos/form": "../../feature/form",
"@ohos/gesturenavigation": "../../feature/gesturenavigation",
"@ohos/pagedesktop": "../../feature/pagedesktop",
"@ohos/recents": "../../feature/recents",
"@ohos/bigfolder": "../../feature/bigfolder",
"@ohos/smartdock": "../../feature/smartdock",
"@ohos/form": "../../feature/form",
"@ohos/gesturenavigation": "../../feature/gesturenavigation",
"@ohos/common": "../../common",
"@ohos/numbadge": "../../feature/numbadge"
}
}

View File

@ -29,7 +29,8 @@ const TAG = 'LauncherMainAbility';
export default class MainAbility extends ServiceExtension {
onCreate(want: Want): void {
Log.showInfo(TAG,'onCreate start');
Log.showInfo(TAG, 'onCreate start');
this.context.area = 0;
this.initLauncher();
}