diff --git a/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_flex/entry/src/main/ets/MainAbility/common/Utils.ets b/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_flex/entry/src/main/ets/MainAbility/common/Utils.ets index 34ab0559781edcd28a3ab2906c55fef600c57c31..5233c33b5a1d816477162b29085d7f6a10a1b6f0 100644 --- a/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_flex/entry/src/main/ets/MainAbility/common/Utils.ets +++ b/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_flex/entry/src/main/ets/MainAbility/common/Utils.ets @@ -15,6 +15,7 @@ import router from '@ohos.router'; import { AttrsManager } from './AttrsManager'; +import display from '@ohos.display'; export default class Utils { public static instance; @@ -111,7 +112,19 @@ export default class Utils { console.info(JSON.stringify(rect_value)); return rect_value; } + + static getDensityDPI() { + let displayClass = null; + let densityDPI; + try { + displayClass = display.getDefaultDisplaySync(); + densityDPI = displayClass.densityDPI; + } catch (exception) { + console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception)); + } + return densityDPI; + } static getComponentByKey(componentKey) { let strJson = getInspectorByKey(componentKey); let obj = JSON.parse(strJson); diff --git a/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_flex/entry/src/main/ets/test/flex/FlexBasisTest.test.ets b/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_flex/entry/src/main/ets/test/flex/FlexBasisTest.test.ets index 332b555cc70849bf6437f58e730068478b53c16d..b34c5b62f7c61b349dae91a0f5a8497f5bd34a11 100644 --- a/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_flex/entry/src/main/ets/test/flex/FlexBasisTest.test.ets +++ b/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_flex/entry/src/main/ets/test/flex/FlexBasisTest.test.ets @@ -132,10 +132,24 @@ export default function flexBasisTest() { //Verify the flexBasis is or not be set success console.info('[' + data.caseTag + '] check the flexBasis is or not be set success'); - + let densityDPI = Utils.getDensityDPI(); + console.info('the densityDPI is' + densityDPI); if (data.testValue.describe == 'SetNumber' || data.testValue.describe == 'SetStringPx') { - expect(data.viewObj.$attrs.flexBasis).assertEqual(data.testValue.expectValue.expectFlexBasis); - console.info('[' + data.caseTag + '] data.viewObj.$attrs.flexBasis' + data.viewObj.$attrs.flexBasis); + if (densityDPI == 1.5) { + expect(data.viewObj.$attrs.flexBasis).assertEqual(data.testValue.expectValue.expectFlexBasis); + console.info('[' + data.caseTag + '] data.viewObj.$attrs.flexBasis' + data.viewObj.$attrs.flexBasis); + } + + if (densityDPI == 3.5 ) { + if (supportView[12] == 'Menu') { + expect(data.viewObj.$attrs.flexBasis).assertEqual(64*3.5); + } else if (supportView[28] == 'Select') { + expect(data.viewObj.$attrs.flexBasis).assertEqual(66*3.5); + } else { + expect(data.viewObj.$attrs.flexBasis).assertEqual(data.testValue.expectValue.expectFlexBasis); + } + console.info('[' + data.caseTag + '] data.viewObj.$attrs.flexBasis' + data.viewObj.$attrs.flexBasis); + } } //Get target component rect diff --git a/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_hitTestBehavior/entry/src/main/ets/MainAbility/pages/hitTestBehavior/HitTestBehaviorPage.ets b/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_hitTestBehavior/entry/src/main/ets/MainAbility/pages/hitTestBehavior/HitTestBehaviorPage.ets index 0fd5893e053cae50a3fa2d43ec5136c46743fdc5..046b4aba2038d4fc068fbd446bc3a6152a25554d 100644 --- a/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_hitTestBehavior/entry/src/main/ets/MainAbility/pages/hitTestBehavior/HitTestBehaviorPage.ets +++ b/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_hitTestBehavior/entry/src/main/ets/MainAbility/pages/hitTestBehavior/HitTestBehaviorPage.ets @@ -115,6 +115,7 @@ struct HitTestBehaviorPage { .colors([[0x317AF7, 1], [0x5BA854, 1], [0xE08C3A, 1], [0x9C554B, 1]]) } else if (this.targetView == 'Image') { Image($r('app.media.icon')) + .draggable(false) .commonStyle() } else if (this.targetView == 'Marquee') { Marquee({