From 4c975e3c0b929c9fa22e6eb91f8b3c32bf05e0b1 Mon Sep 17 00:00:00 2001 From: 26thE <962961353@qq.com> Date: Thu, 20 Mar 2025 16:04:24 +0800 Subject: [PATCH] =?UTF-8?q?HMOS=E4=B8=96=E7=95=8C=E6=95=B4=E6=94=B9Sample?= =?UTF-8?q?=EF=BC=8C=E6=B5=81=E7=95=85=E5=88=B7=E6=96=87=E7=AB=A0=EF=BC=8C?= =?UTF-8?q?codeCheck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/Constants.ets | 28 ++++++++----------- entry/src/main/ets/pages/NewPlayPage.ets | 6 ++-- entry/src/main/ets/view/AVPlayerItem.ets | 2 +- entry/src/main/ets/view/ButtonItem.ets | 1 + .../main/ets/viewmodel/BasicDataSource.ets | 14 +++++----- .../main/resources/base/element/float.json | 24 ---------------- 6 files changed, 24 insertions(+), 51 deletions(-) delete mode 100644 entry/src/main/resources/base/element/float.json diff --git a/entry/src/main/ets/common/Constants.ets b/entry/src/main/ets/common/Constants.ets index a58d205..9c77d4f 100644 --- a/entry/src/main/ets/common/Constants.ets +++ b/entry/src/main/ets/common/Constants.ets @@ -15,25 +15,21 @@ export class Constants { // Breakpoint - static readonly BREAK_POINT_SM: string = 'sm'; - static readonly BREAK_POINT_MD: string = 'md'; - static readonly BREAK_POINT_LG: string = 'lg'; + public static readonly BREAK_POINT_SM: string = 'sm'; + public static readonly BREAK_POINT_MD: string = 'md'; + public static readonly BREAK_POINT_LG: string = 'lg'; // Picture_grid_margin - static readonly PICTURE_GRID_MARGIN: number[] = [16, 24, 32]; - // Common padding or margin - static COMMON_DISTANCE = 12; + public static readonly PICTURE_GRID_MARGIN: number[] = [16, 24, 32]; // Icon size - static STATIC_ICON_SIZE = 24; - static BIG_ICON_SIZE = 36; - // Static avatar size - static STATIC_AVATAR_SIZE = 40; + public static STATIC_ICON_SIZE = 24; + public static BIG_ICON_SIZE = 36; // Size - static FULL_SIZE = '100%'; - static FIFTY_SIZE = '50%'; - static EIGHTY_SIZE = '80%'; + public static FULL_SIZE = '100%'; + public static FIFTY_SIZE = '50%'; + public static EIGHTY_SIZE = '80%'; // Rotate 360 - static ROTATE = 360; + public static ROTATE = 360; // Add rotate num - static FONT_SIZE_TWELVE = 12; - static FONT_SIZE_FOURTEEN = 14; + public static FONT_SIZE_TWELVE = 12; + public static FONT_SIZE_FOURTEEN = 14; } \ No newline at end of file diff --git a/entry/src/main/ets/pages/NewPlayPage.ets b/entry/src/main/ets/pages/NewPlayPage.ets index b654da6..a6b7f77 100644 --- a/entry/src/main/ets/pages/NewPlayPage.ets +++ b/entry/src/main/ets/pages/NewPlayPage.ets @@ -13,12 +13,12 @@ * limitations under the License. */ -import { AVPlayerItem } from '../view/AVPlayerItem'; -import SampleUnitAVPlayView from '../view/SampleUnitAVPlayView'; import { displaySync } from '@kit.ArkGraphics2D'; import { router } from '@kit.ArkUI'; import { Constants } from '../common/Constants'; import { BreakpointType } from '../common/Utils'; +import { AVPlayerItem } from '../view/AVPlayerItem'; +import SampleUnitAVPlayView from '../view/SampleUnitAVPlayView'; @Entry @Component @@ -82,7 +82,7 @@ struct NewPlayPage { Text($r('app.string.nav_bar_return_text')) .margin({ left: $r('sys.float.padding_level4') }) .font({ size: 20, weight: 700 }) - .fontColor($r("sys.color.font_primary")) + .fontColor($r('sys.color.font_primary')) .onClick(() => { router.back(); }) diff --git a/entry/src/main/ets/view/AVPlayerItem.ets b/entry/src/main/ets/view/AVPlayerItem.ets index 5aa6909..2cca8a1 100644 --- a/entry/src/main/ets/view/AVPlayerItem.ets +++ b/entry/src/main/ets/view/AVPlayerItem.ets @@ -13,8 +13,8 @@ * limitations under the License. */ -import { media } from '@kit.MediaKit'; import { common } from '@kit.AbilityKit'; +import { media } from '@kit.MediaKit'; // Video name const VIDEO_NAME = 'videoTest.mp4'; diff --git a/entry/src/main/ets/view/ButtonItem.ets b/entry/src/main/ets/view/ButtonItem.ets index 3efbbef..647fe19 100644 --- a/entry/src/main/ets/view/ButtonItem.ets +++ b/entry/src/main/ets/view/ButtonItem.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { Constants } from '../common/Constants'; import ButtonUnitItem from '../viewmodel/ButtonUnitItem'; diff --git a/entry/src/main/ets/viewmodel/BasicDataSource.ets b/entry/src/main/ets/viewmodel/BasicDataSource.ets index 9bc10d6..17e6346 100644 --- a/entry/src/main/ets/viewmodel/BasicDataSource.ets +++ b/entry/src/main/ets/viewmodel/BasicDataSource.ets @@ -30,15 +30,15 @@ export class DataSource { } class BasicDataSource implements IDataSource { - imageArray1: Resource[] = [$r("app.media.b")]; - imageArray3: Resource[] = [$r("app.media.j"), $r("app.media.b"), $r("app.media.c")]; - imageArray4: Resource[] = [$r("app.media.a"), $r("app.media.b"), $r("app.media.c"), $r("app.media.d")]; + imageArray1: Resource[] = [$r('app.media.b')]; + imageArray3: Resource[] = [$r('app.media.j'), $r('app.media.b'), $r('app.media.c')]; + imageArray4: Resource[] = [$r('app.media.a'), $r('app.media.b'), $r('app.media.c'), $r('app.media.d')]; imageArray8: Resource[] = - [$r("app.media.a"), $r("app.media.b"), $r("app.media.c"), $r("app.media.d"), $r("app.media.e"), $r("app.media.f"), - $r("app.media.g"), $r("app.media.h")]; + [$r('app.media.a'), $r('app.media.b'), $r('app.media.c'), $r('app.media.d'), $r('app.media.e'), $r('app.media.f'), + $r('app.media.g'), $r('app.media.h')]; imageArray9: Resource[] = - [$r("app.media.a"), $r("app.media.b"), $r("app.media.c"), $r("app.media.d"), $r("app.media.e"), $r("app.media.f"), - $r("app.media.g"), $r("app.media.h"), $r("app.media.i")]; + [$r('app.media.a'), $r('app.media.b'), $r('app.media.c'), $r('app.media.d'), $r('app.media.e'), $r('app.media.f'), + $r('app.media.g'), $r('app.media.h'), $r('app.media.i')]; public data: SampleUnitItem[] = []; private listeners: DataChangeListener[] = []; diff --git a/entry/src/main/resources/base/element/float.json b/entry/src/main/resources/base/element/float.json deleted file mode 100644 index 33b11ea..0000000 --- a/entry/src/main/resources/base/element/float.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "float": [ - { - "name": "mask_opacity", - "value": "0.5" - }, - { - "name": "mask_font_size", - "value": "30" - }, - { - "name": "padding_20", - "value": "20" - }, - { - "name": "text_margin", - "value": "20" - }, - { - "name": "divider_margin", - "value": "20" - } - ] -} \ No newline at end of file -- Gitee