mirror of
https://gitee.com/openharmony/applications_launcher
synced 2024-11-23 06:50:02 +00:00
ux适配
Signed-off-by: jiangtao92 <jiangtao57@huawei.com>
This commit is contained in:
parent
4258baeb1d
commit
5980352b1e
@ -48,7 +48,7 @@ export default class PresetStyleConstants {
|
||||
/**
|
||||
* desktop indicator height
|
||||
*/
|
||||
static readonly DEFAULT_PHONE_INDICATOR_HEIGHT = 48;
|
||||
static readonly DEFAULT_PHONE_INDICATOR_HEIGHT = 32;
|
||||
|
||||
/**
|
||||
* columns of screen with phone
|
||||
|
@ -82,8 +82,13 @@ export default class LayoutViewModel {
|
||||
this.mSysUITopHeight = this.mLauncherLayoutStyleConfig.mSysTopHeight;
|
||||
this.mNavigationBarStatus = navigationBarStatus === '0' ? true : false;
|
||||
Log.showInfo(TAG, `initScreen navigationBarStatus: ${this.mNavigationBarStatus}`);
|
||||
|
||||
if (!this.mNavigationBarStatus) {
|
||||
this.mSysUIBottomHeight = this.mLauncherLayoutStyleConfig.mSysBottomHeight;
|
||||
if (this.mScreenWidth > this.mScreenHeight) {
|
||||
this.mSysUIBottomHeight = this.mLauncherLayoutStyleConfig.mSysBottomHeight * this.mScreenWidth / 1280;
|
||||
} else {
|
||||
this.mSysUIBottomHeight = this.mLauncherLayoutStyleConfig.mSysBottomHeight * this.mScreenWidth / 360;
|
||||
}
|
||||
} else {
|
||||
this.mSysUIBottomHeight = 0;
|
||||
}
|
||||
@ -199,6 +204,20 @@ export default class LayoutViewModel {
|
||||
let row = ~~((realHeight + gutter) / (itemSize + gutter));
|
||||
let marginTop = ((realHeight + gutter - (itemSize + gutter) * row) / 2);
|
||||
Log.showInfo(TAG, `calculateDesktop gutter: ${gutter}, marginTop: ${marginTop}`);
|
||||
if (!this.mIsPad) {
|
||||
if (row > 6) {
|
||||
row = 6;
|
||||
}
|
||||
|
||||
if (this.mNavigationBarStatus) {
|
||||
realHeight = realHeight + this.mLauncherLayoutStyleConfig.mSysBottomHeight;
|
||||
}
|
||||
let remainHeight = (realHeight + gutter - (itemSize + gutter) * row)
|
||||
realHeight -= remainHeight
|
||||
marginTop = remainHeight / 2 + this.mSysUITopHeight
|
||||
Log.showInfo(TAG, `realHeight = ${realHeight} marginTop = ${marginTop}`)
|
||||
}
|
||||
Log.showInfo(TAG, `desktop marginTop ${marginTop}`);
|
||||
//set desktop icon
|
||||
let ratio = this.mLauncherLayoutStyleConfig.mIconRatio;
|
||||
let lines = this.mLauncherLayoutStyleConfig.mNameLines;
|
||||
|
@ -63,8 +63,8 @@ export default class PageDesktopDragHandler extends BaseDragHandler {
|
||||
}
|
||||
|
||||
private updateGridParam(effectArea) {
|
||||
const gridWidth = effectArea.right - effectArea.left;
|
||||
const gridHeight = effectArea.bottom - effectArea.top;
|
||||
const gridWidth = this.mPageDesktopViewModel.getPageDesktopStyleConfig().mGridWidth;
|
||||
const gridHeight = this.mPageDesktopViewModel.getPageDesktopStyleConfig().mGridHeight;
|
||||
Log.showInfo(TAG, `updateGridParam gridWidth: ${gridWidth}, gridHeight: ${gridHeight}`);
|
||||
this.mGridConfig = this.mPageDesktopViewModel.getGridConfig();
|
||||
const column = this.mGridConfig.column;
|
||||
|
@ -26,6 +26,7 @@ const TAG = "SwiperPage";
|
||||
@Component
|
||||
export default struct SwiperPage {
|
||||
@StorageLink('workSpaceWidth') workSpaceWidth: number = 0;
|
||||
@StorageLink('NavigationBarStatusValue') navigationBarStatusValue: boolean = false;
|
||||
@State ColumnsTemplate: string = '';
|
||||
@State RowsTemplate: string = ''
|
||||
@Prop @Watch('changeColumnAndRow') gridConfig: string;
|
||||
@ -117,6 +118,10 @@ export default struct SwiperPage {
|
||||
.rowsGap(this.mRowsGap)
|
||||
.width(this.mGridWidth)
|
||||
.height(this.mGridHeight)
|
||||
.margin({ right: this.mMargin, left: this.mMargin, top: this.mMarginTop})
|
||||
.margin({
|
||||
right: this.mMargin,
|
||||
left: this.mMargin,
|
||||
top: this.navigationBarStatusValue ? this.mPageDesktopStyleConfig.mDesktopMarginTop : this.mPageDesktopStyleConfig.mDesktopMarginTop + 0
|
||||
})
|
||||
}
|
||||
}
|
@ -24,12 +24,12 @@ export default class PhonePresetStyleConstants {
|
||||
/**
|
||||
* systemUI top height
|
||||
*/
|
||||
static readonly DEFAULT_SYS_TOP_HEIGHT = 48;
|
||||
static readonly DEFAULT_SYS_TOP_HEIGHT = 44;
|
||||
|
||||
/**
|
||||
* systemUI bottom height
|
||||
*/
|
||||
static readonly DEFAULT_SYS_BOTTOM_HEIGHT = 72;
|
||||
static readonly DEFAULT_SYS_BOTTOM_HEIGHT = 36;
|
||||
|
||||
/**
|
||||
* desktop item size
|
||||
|
@ -141,7 +141,7 @@ struct EntryView {
|
||||
|
||||
build() {
|
||||
Stack() {
|
||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) {
|
||||
if (this.mAppPageStartConfig === 'Grid') {
|
||||
Column() {
|
||||
PageDesktopLayout({
|
||||
|
Loading…
Reference in New Issue
Block a user