mirror of
https://gitee.com/openharmony/applications_launcher
synced 2024-11-27 09:00:31 +00:00
commit
ec3ce8af2d
@ -78,6 +78,8 @@ class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnim
|
||||
finishCallback.onAnimationFinish();
|
||||
}
|
||||
|
||||
onWindowAnimationTargetsUpdate(fullScreenWindowTarget: windowAnimationManager.WindowAnimationTarget, floatingWindowTargets: Array<windowAnimationManager.WindowAnimationTarget>): void {}
|
||||
|
||||
printfTarget(target: windowAnimationManager.WindowAnimationTarget): void {
|
||||
if (CheckEmptyUtils.isEmpty(target) || CheckEmptyUtils.isEmpty(target.windowBounds)) {
|
||||
Log.showInfo(TAG, `remote window animaion with invalid target`);
|
||||
|
@ -13,8 +13,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Log } from '@ohos/common';
|
||||
import { StyleConstants } from '@ohos/common';
|
||||
import {
|
||||
Log,
|
||||
Trace,
|
||||
StyleConstants,
|
||||
CommonConstants,
|
||||
AppMenu,
|
||||
MenuInfo} from '@ohos/common';
|
||||
import SwiperPage from './SwiperPage';
|
||||
|
||||
const TAG = "GridSwiper";
|
||||
@ -27,6 +32,7 @@ export default struct GridSwiper {
|
||||
private mPageDesktopViewModel;
|
||||
@State mAppGridInfo: [[]] = [[]];
|
||||
private swiperController: SwiperController = new SwiperController();
|
||||
private dialogController: CustomDialogController;
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.mPageDesktopViewModel.setSwiperController(this.swiperController);
|
||||
@ -42,16 +48,68 @@ export default struct GridSwiper {
|
||||
return isDesktopLoadFinished == true;
|
||||
}
|
||||
|
||||
@Builder MenuBuilder() {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
AppMenu({
|
||||
getMenuInfoList: this.getMenu.bind(this),
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.CONTEXT_MENU_WIDTH)
|
||||
.borderRadius(StyleConstants.DEFAULT_12)
|
||||
}
|
||||
|
||||
private getMenu(): MenuInfo[] {
|
||||
let menuInfoList = new Array<MenuInfo>();
|
||||
let setting = new MenuInfo();
|
||||
setting.menuType = CommonConstants.MENU_TYPE_FIXED
|
||||
setting.menuImgSrc = "/common/pics/ic_public_settings.svg"
|
||||
setting.menuText = $r('app.string.into_settings')
|
||||
setting.onMenuClick = () => {
|
||||
Trace.start(Trace.CORE_METHOD_START_SETTINGS);
|
||||
this.mPageDesktopViewModel.intoSetting();
|
||||
}
|
||||
menuInfoList.push(setting);
|
||||
|
||||
let addOrDeleteBlankPage = new MenuInfo();
|
||||
addOrDeleteBlankPage.menuType = CommonConstants.MENU_TYPE_FIXED
|
||||
addOrDeleteBlankPage.menuImgSrc = this.mPageDesktopViewModel.getBlankPageBtnIcon()
|
||||
addOrDeleteBlankPage.menuText = this.mPageDesktopViewModel.getBlankPageBtnStr()
|
||||
addOrDeleteBlankPage.onMenuClick = () => {
|
||||
this.mPageDesktopViewModel.addOrDeleteBlankPage();
|
||||
}
|
||||
menuInfoList.push(addOrDeleteBlankPage);
|
||||
return menuInfoList;
|
||||
}
|
||||
|
||||
build() {
|
||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||
if (this.buildLog()) {
|
||||
Swiper(this.swiperController) {
|
||||
ForEach(this.mAppGridInfo, (item) => {
|
||||
SwiperPage({
|
||||
mAppListInfo: item,
|
||||
gridConfig: this.gridConfig,
|
||||
mPageDesktopViewModel: this.mPageDesktopViewModel
|
||||
})
|
||||
if (AppStorage.Get('deviceType') == CommonConstants.DEFAULT_DEVICE_TYPE) {
|
||||
Column() {
|
||||
SwiperPage({
|
||||
mAppListInfo: item,
|
||||
gridConfig: this.gridConfig,
|
||||
mPageDesktopViewModel: this.mPageDesktopViewModel
|
||||
})
|
||||
}
|
||||
.gesture(
|
||||
LongPressGesture({ repeat: true })
|
||||
.onAction((event: GestureEvent) => {
|
||||
this.dialogController.open()
|
||||
})
|
||||
)
|
||||
.bindContextMenu(this.MenuBuilder, ResponseType.RightClick)
|
||||
} else {
|
||||
SwiperPage({
|
||||
mAppListInfo: item,
|
||||
gridConfig: this.gridConfig,
|
||||
mPageDesktopViewModel: this.mPageDesktopViewModel
|
||||
})
|
||||
.bindContextMenu(this.MenuBuilder, ResponseType.LongPress)
|
||||
.bindContextMenu(this.MenuBuilder, ResponseType.RightClick)
|
||||
}
|
||||
})
|
||||
}
|
||||
.padding({
|
||||
|
@ -13,12 +13,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Log , CloseAppManager } from '@ohos/common';
|
||||
import { Trace } from '@ohos/common';
|
||||
import { AppMenu } from '@ohos/common';
|
||||
import { MenuInfo } from '@ohos/common';
|
||||
import { StyleConstants } from '@ohos/common';
|
||||
import { CommonConstants } from '@ohos/common';
|
||||
import {
|
||||
Log,
|
||||
Trace,
|
||||
StyleConstants,
|
||||
CommonConstants,
|
||||
CloseAppManager } from '@ohos/common';
|
||||
import GridSwiper from '../common/components/GridSwiper';
|
||||
import { PageDesktopDragHandler } from '../common/PageDesktopDragHandler';
|
||||
import PageDesktopViewModel from '../viewmodel/PageDesktopViewModel';
|
||||
@ -103,89 +103,15 @@ export struct PageDesktopLayout {
|
||||
return true;
|
||||
}
|
||||
|
||||
private getMenu(): MenuInfo[] {
|
||||
let menuInfoList = new Array<MenuInfo>();
|
||||
let setting = new MenuInfo();
|
||||
setting.menuType = CommonConstants.MENU_TYPE_FIXED
|
||||
setting.menuImgSrc = "/common/pics/ic_public_settings.svg"
|
||||
setting.menuText = $r('app.string.into_settings')
|
||||
setting.onMenuClick = () => {
|
||||
Trace.start(Trace.CORE_METHOD_START_SETTINGS);
|
||||
mPageDesktopViewModel.intoSetting();
|
||||
}
|
||||
menuInfoList.push(setting);
|
||||
|
||||
let addOrDeleteBlankPage = new MenuInfo();
|
||||
addOrDeleteBlankPage.menuType = CommonConstants.MENU_TYPE_FIXED
|
||||
addOrDeleteBlankPage.menuImgSrc = mPageDesktopViewModel.getBlankPageBtnIcon()
|
||||
addOrDeleteBlankPage.menuText = mPageDesktopViewModel.getBlankPageBtnStr()
|
||||
addOrDeleteBlankPage.onMenuClick = () => {
|
||||
mPageDesktopViewModel.addOrDeleteBlankPage();
|
||||
}
|
||||
menuInfoList.push(addOrDeleteBlankPage);
|
||||
return menuInfoList;
|
||||
}
|
||||
|
||||
private logId() {
|
||||
Log.showInfo(TAG, `MenuBuilder build start ${this.menuId}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Builder MenuBuilder() {
|
||||
if (this.logId()) {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
AppMenu({
|
||||
getMenuInfoList: this.getMenu,
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.CONTEXT_MENU_WIDTH)
|
||||
.borderRadius(StyleConstants.DEFAULT_12)
|
||||
}
|
||||
}
|
||||
|
||||
build() {
|
||||
if (this.deviceType == CommonConstants.DEFAULT_DEVICE_TYPE) {
|
||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||
if (this.buildLog()) {
|
||||
}
|
||||
Column() {
|
||||
GridSwiper({
|
||||
mAppGridInfo: this.AppListInfo.appGridInfo,
|
||||
gridConfig: this.gridConfig,
|
||||
mPageDesktopViewModel: mPageDesktopViewModel
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.PERCENTAGE_100)
|
||||
.height(StyleConstants.PERCENTAGE_100)
|
||||
}
|
||||
.gesture(
|
||||
LongPressGesture({ repeat: true })
|
||||
.onAction((event: GestureEvent) => {
|
||||
this.dialogController.open()
|
||||
})
|
||||
)
|
||||
.bindContextMenu(this.MenuBuilder, ResponseType.RightClick)
|
||||
GridSwiper({
|
||||
mAppGridInfo: this.AppListInfo.appGridInfo,
|
||||
gridConfig: this.gridConfig,
|
||||
mPageDesktopViewModel: mPageDesktopViewModel,
|
||||
dialogController: this.deviceType == CommonConstants.PAD_DEVICE_TYPE ? null : this.dialogController
|
||||
})
|
||||
.width(StyleConstants.PERCENTAGE_100)
|
||||
.height(StyleConstants.PERCENTAGE_100)
|
||||
} else {
|
||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||
if (this.buildLog()) {
|
||||
}
|
||||
Column() {
|
||||
GridSwiper({
|
||||
mAppGridInfo: this.AppListInfo.appGridInfo,
|
||||
gridConfig: this.gridConfig,
|
||||
mPageDesktopViewModel: mPageDesktopViewModel
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.PERCENTAGE_100)
|
||||
.height(StyleConstants.PERCENTAGE_100)
|
||||
}
|
||||
.bindContextMenu(this.MenuBuilder, ResponseType.LongPress)
|
||||
.bindContextMenu(this.MenuBuilder, ResponseType.RightClick)
|
||||
.width(StyleConstants.PERCENTAGE_100)
|
||||
.height(StyleConstants.PERCENTAGE_100)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user