1/** 2 * Copyright (c) 2022-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { BaseStartAppHandler , Log } from '@ohos/common'; 17 18 19const TAG = 'RecentMissionStartAppHandler'; 20 21/** 22 * Desktop workspace start app processing class 23 */ 24export class RecentMissionStartAppHandler extends BaseStartAppHandler { 25 private constructor() { 26 super(); 27 } 28 29 static getInstance(): RecentMissionStartAppHandler { 30 if (globalThis.RecentMissionStartAppHandler == null) { 31 globalThis.RecentMissionStartAppHandler = new RecentMissionStartAppHandler(); 32 } 33 return globalThis.RecentMissionStartAppHandler; 34 } 35 36 protected calculateAppIconPosition(): void { 37 const RecentMissionInfo = AppStorage.get('startAppItemInfo'); 38 Log.showInfo(TAG, `recentMission_CalculateAppIconPosition:${JSON.stringify(RecentMissionInfo)} `); 39 const position = RecentMissionInfo['position']; 40 this.mAppIconPositionX = position.x; 41 this.mAppIconPositionY = position.y; 42 } 43 44} 45