source
stringlengths
14
113
code
stringlengths
10
21.3k
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.backgroundColor = 0xffff0000; renderNode.frame = { x: 10, y: 10, width: 100, height: 100 }; renderNode.transform = [ 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; const transform = renderNod...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.backgroundColor = 0xffff0000; renderNode.frame = { x: 10, y: 10, width: 100, height: 100 }; renderNode.shadowElevation = 10; renderNode.shadowColor = 0XFF00FF00; const shadowColor = renderNode.shadowCol...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.backgroundColor = 0xffff0000; renderNode.frame = { x: 10, y: 10, width: 100, height: 100 }; renderNode.shadowElevation = 10; renderNode.shadowColor = 0XFF00FF00; renderNode.shadowOffset = { x: 10, y: 10...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController, UIContext } from '@kit.ArkUI'; class MyNodeController extends NodeController { private rootNode: FrameNode | null = null; makeNode(uiContext: UIContext): FrameNode | null { this.rootNode = new FrameNode(uiContext); const renderNode: RenderNode | null = this...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.backgroundColor = 0xffff0000; renderNode.frame = { x: 10, y: 10, width: 100, height: 100 }; renderNode.shadowElevation = 10; renderNode.shadowColor = 0XFF00FF00; renderNode.shadowOffset = { x: 10, y: 10...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.backgroundColor = 0xffff0000; renderNode.frame = { x: 0, y: 0, width: 100, height: 100 }; renderNode.shadowOffset = { x: 10, y: 10 }; renderNode.shadowAlpha = 0.7 renderNode.shadowElevation = 30; const ...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.backgroundColor = 0xff0000ff; renderNode.frame = { x: 100, y: 100, width: 100, height: 100 }; renderNode.shadowOffset = { x: 10, y: 10 }; renderNode.shadowAlpha = 0.7 renderNode.shadowRadius = 30...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
// Index.ets import bridge from "libentry.so" // This .so file is compiled and generated by you using the Node-API. import { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; class MyRenderNode extends RenderNode { uiContext: UIContext; constructor(uiContext: UIContext) { super(); th...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { DrawContext } from '@kit.ArkUI'; export const nativeOnDraw: (id: number, context: DrawContext, width: number, height: number) => number;
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import bridge from "libentry.so" // This .so file is compiled and generated by you using the Node-API. import { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; class MyRenderNode extends RenderNode { uiContext: UIContext; constructor(uiContext: UIContext) { super(); this.uiContext ...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.frame = { x: 0, y: 0, width: 150, height: 150 }; renderNode.backgroundColor = 0XFF00FF00; renderNode.borderWidth = { left: 8, top: 8, right: 8, bottom: 8 }; renderNode.borderStyle = { left: BorderStyle...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.frame = { x: 0, y: 0, width: 150, height: 150 }; renderNode.backgroundColor = 0XFF00FF00; renderNode.borderWidth = { left: 8, top: 8, right: 8, bottom: 8 }; const borderWidth = renderNode.borderWidth; ...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.frame = { x: 0, y: 0, width: 150, height: 150 }; renderNode.backgroundColor = 0XFF00FF00; renderNode.borderWidth = { left: 8, top: 8, right: 8, bottom: 8 }; renderNode.borderColor = { left: 0xFF0000FF, t...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.frame = { x: 0, y: 0, width: 150, height: 150 }; renderNode.backgroundColor = 0XFF00FF00; renderNode.borderRadius = { topLeft: 32, topRight: 32, bottomLeft: 32, bottomRight: 32 }; const borderRadius = re...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController, ShapeMask } from '@kit.ArkUI'; const mask = new ShapeMask(); mask.setRectShape({ left: 0, right: 150, top: 0, bottom: 150 }); mask.fillColor = 0X55FF0000; mask.strokeColor = 0XFFFF0000; mask.strokeWidth = 24; const renderNode = new RenderNode(); renderNode.frame = { x: ...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController, ShapeMask, ShapeClip } from '@kit.ArkUI'; const clip = new ShapeClip(); clip.setCommandPath({ commands: "M100 0 L0 100 L50 200 L150 200 L200 100 Z" }); const renderNode = new RenderNode(); renderNode.frame = { x: 0, y: 0, width: 150, height: 150 }; renderNode.ba...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController } from '@kit.ArkUI'; const renderNode = new RenderNode(); renderNode.frame = { x: 0, y: 100, width: 100, height: 100 }; renderNode.backgroundColor = 0xffff0000; class MyNodeController extends NodeController { private rootNode: FrameNode | null = null; makeNode(uiCon...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; import { drawing } from '@kit.ArkGraphics2D'; class MyRenderNode extends RenderNode { draw(context: DrawContext) { const canvas = context.canvas; const brush = new drawing.Brush(); brush.setColor({ alpha: 255, red: 255, gree...
application-dev\reference\apis-arkui\js-apis-arkui-renderNode.md
import { RenderNode, FrameNode, NodeController, DrawContext } from '@kit.ArkUI'; import { drawing } from '@kit.ArkGraphics2D'; import { LengthMetricsUnit } from '@ohos.arkui.node'; class BaseRenderNode extends RenderNode { constructor() { super(); this.lengthMetricsUnit = LengthMetricsUnit.PX; } } class M...
application-dev\reference\apis-arkui\js-apis-arkui-shape.md
import { CircleShape, EllipseShape, PathShape, RectShape } from "@kit.ArkUI";
application-dev\reference\apis-arkui\js-apis-arkui-shape.md
import { CircleShape, EllipseShape, PathShape, RectShape } from "@kit.ArkUI"; @Entry @Component struct ShapeExample { build() { Column({ space: 15 }) { Text('CircleShape, position').fontSize(20).width('75%').fontColor('#DCDCDC') Image($r('app.media.startIcon')) .clipShape(new CircleShape({ wi...
application-dev\reference\apis-arkui\js-apis-arkui-theme.md
import { Theme, ThemeControl, CustomColors, Colors, CustomTheme } from '@kit.ArkUI';
application-dev\reference\apis-arkui\js-apis-arkui-theme.md
import { CustomTheme, CustomColors, ThemeControl } from '@kit.ArkUI'; // Custom theme color class BlueColors implements CustomColors { fontPrimary = Color.White; backgroundPrimary = Color.Blue; brand = Color.Blue; // Brand color } class PageCustomTheme implements CustomTheme { colors?: CustomColors; constru...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext-sys.md
@Entry @Component struct Index { @State myCount : number = 100 build() { Column(){ Image($r('app.media.testImage')).width(500).height(800).id("test") }.width("100%").height("100%").onClick(()=>{ this.getUIContext().setDynamicDimming("test",1) this.getUIContext()?.animateTo({duration:500...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext-sys.md
// xxx.ets @Entry @Component struct AnimateToImmediatelyExample { @State widthSize: number = 250 @State heightSize: number = 100 @State opacitySize: number = 0 private flag: boolean = true uiContext: UIContext | null | undefined = this.getUIContext(); build() { Column() { Column() .width(...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getFont();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getComponentUtils();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getUIInspector();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getUIObserver();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getMediaQuery();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getRouter();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getPromptAction();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getOverlayManager();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.setOverlayManagerOptions({ renderRootOverlay: true, enableBackPressedEvent: true });
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getOverlayManagerOptions();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// xxx.ets @Entry @Component struct AnimateToExample { @State widthSize: number = 250 @State heightSize: number = 100 @State rotateAngle: number = 0 private flag: boolean = true uiContext: UIContext | undefined = undefined; aboutToAppear() { this.uiContext = this.getUIContext(); if (!this.uiContext...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// EntryAbility.ets import { UIAbility } from '@kit.AbilityKit'; import { window } from '@kit.ArkUI'; export default class EntryAbility extends UIAbility { storage: LocalStorage = new LocalStorage(); onWindowStageCreate(windowStage: window.WindowStage) { windowStage.loadContent('pages/Index', this.storage); ...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// Index.ets @Entry @Component struct SharedLocalStorage { localStorage = this.getUIContext().getSharedLocalStorage(); build() { Row() { Column() { Button("Change Local Storage to 47") .onClick(() => { this.localStorage?.setOrCreate("propA", 47); }) Button...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
@Entry @Component struct Index { uiContext = this.getUIContext(); build() { Row() { Column() { Text("cacheDir='"+this.uiContext?.getHostContext()?.cacheDir+"'").fontSize(25) Text("bundleCodeDir='"+this.uiContext?.getHostContext()?.bundleCodeDir+"'").fontSize(25) } .width('100%...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getFrameNodeById("TestNode")
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getAttachedFrameNodeById("TestNode")
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { UIContext, FrameNode } from '@kit.ArkUI'; @Entry @Component struct MyComponent { aboutToAppear() { let uniqueId: number = this.getUniqueId(); let uiContext: UIContext = this.getUIContext(); if (uiContext) { let node: FrameNode | null = uiContext.getFrameNodeByUniqueId(uniqueId); } } ...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { UIContext, PageInfo } from '@kit.ArkUI'; @Entry @Component struct PageInfoExample { @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); build() { Column() { Navigation(this.pageInfos) { NavDestination() { MyComponent() } }.id('navigation') } ...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.showAlertDialog( { title: 'title', message: 'text', autoCancel: true, alignment: DialogAlignment.Bottom, offset: { dx: 0, dy: -20 }, gridCount: 3, confirm: { value: 'button', action: () => { console.info('Button-clicking callback') } }, cancel: (...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.showActionSheet({ title: 'ActionSheet title', message: 'message', autoCancel: true, confirm: { value: 'Confirm button', action: () => { console.info('Get Alert Dialog handled') } }, cancel: () => { console.info('actionSheet canceled') }, alignment: DialogAlignment.Bottom,...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
let selectedDate: Date = new Date("2010-1-1") uiContext.showDatePickerDialog({ start: new Date("2000-1-1"), end: new Date("2100-12-31"), selected: selectedDate, onAccept: (value: DatePickerResult) => { // Use the setFullYear method to set the date when the OK button is touched. In this way, when the date pi...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// xxx.ets class SelectTime{ selectTime: Date = new Date('2020-12-25T08:30:00') hours(h:number,m:number){ this.selectTime.setHours(h,m) } } @Entry @Component struct TimePickerDialogExample { @State selectTime: Date = new Date('2023-12-25T08:30:00'); build() { Column() { Button('showTimePicker...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// xxx.ets class SelectedValue{ select: number = 2 set(val:number){ this.select = val } } class SelectedArray{ select: number[] = [] set(val:number[]){ this.select = val } } @Entry @Component struct TextPickerDialogExample { @State selectTime: Date = new Date('2023-12-25T08:30:00'); private fru...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// EntryAbility.ets import { AnimatorOptions, window } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; // used in UIAbility onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability o...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { SimpleAnimatorOptions, window } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; // used in UIAbility onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCr...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.runScopedTask( () => { console.info('Succeeded in runScopedTask'); } );
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// EntryAbility.ets import { KeyboardAvoidMode, UIContext } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStage...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// EntryAbility.ets import { KeyboardAvoidMode, UIContext } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStage...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// EntryAbility.ets import { UIContext, AtomicServiceBar, window } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', 'Ability onWindowStageCreate'); ...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getDragController();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getFocusController();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getFilteredInspectorTree(['id', 'src', 'content']);
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getFilteredInspectorTreeById('testId', 0, ['id', 'src', 'content']);
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.CursorController();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getContextMenuController();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getMeasureUtils();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getComponentSnapshot();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.vp2px(200);
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.px2vp(200);
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.fp2px(200);
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.px2fp(200);
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.lpx2px(200);
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.px2lpx(200);
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { window } from '@kit.ArkUI'; @Entry @Component struct Index { @State message: string = 'Hello World' aboutToAppear() { const windowName = this.getUIContext().getWindowName(); console.info('WindowName ' + windowName); const currWindow = window.findWindow(windowName); const windowProperties ...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { UIContext } from '@kit.ArkUI'; @Entry @Component struct Index { @State message: string = 'Hello World'; build() { Row() { Column() { Text(this.message) .fontSize(30) .fontWeight(FontWeight.Bold) Button() { Text('test') .fontSize(30) ...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { UIContext } from '@kit.ArkUI'; @Entry @Component struct Index { @State message: string = 'Hello World'; build() { Row() { Column() { Text(this.message) .fontSize(30) .fontWeight(FontWeight.Bold) Button() { Text('test') .fontSize(30) ...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import {FrameCallback } from '@kit.ArkUI'; class MyFrameCallback extends FrameCallback { private tag: string; constructor(tag: string) { super() this.tag = tag; } onFrame(frameTimeNanos: number) { console.info('MyFrameCallback ' + this.tag + ' ' + frameTimeNanos.toString()); } } @Entry @Compon...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import {FrameCallback } from '@kit.ArkUI'; class MyFrameCallback extends FrameCallback { private tag: string; constructor(tag: string) { super() this.tag = tag; } onFrame(frameTimeNanos: number) { console.info('MyFrameCallback ' + this.tag + ' ' + frameTimeNanos.toString()); } } @Entry @Compon...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.DynamicSyncScene("dynamicSyncScene")
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { FrameNode, ComponentContent } from "@kit.ArkUI"; import { BusinessError } from '@kit.BasicServicesKit'; class Params { text: string = "" constructor(text: string) { this.text = text; } } let contentNode: ComponentContent<Params>; let gUIContext: UIContext; @Builder function buildText(params: Para...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { FrameNode, ComponentContent } from "@kit.ArkUI"; import { BusinessError } from '@kit.BasicServicesKit'; class Params { text: string = "" constructor(text: string) { this.text = text; } } let contentNode: ComponentContent<Params>; let gUIContext: UIContext; @Builder function buildText(params: Para...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { FrameNode, ComponentContent } from "@kit.ArkUI"; import { BusinessError } from '@kit.BasicServicesKit'; class Params { text: string = "" constructor(text: string) { this.text = text; } } let contentNode: ComponentContent<Params>; let gUIContext: UIContext; @Builder function buildText(params: Para...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.isFollowingSystemFontScale()
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
uiContext.getMaxFontScale()
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
@Entry @Component struct TabsExample { private arr: string[] = [] private parentTabsController: TabsController = new TabsController() private childTabsController: TabsController = new TabsController() private listScroller: Scroller = new Scroller() private parentScroller: Scroller = new Scroller() private c...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { UIContext } from '@kit.ArkUI'; export default class EntryAbility extends UIAbility { onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); let uiContext : UIContext | undefined = UIContext.createUIContextWithoutWindow(...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
UIContext.destroyUIContextWithoutWindow();
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
@Entry @Component struct Index { build() { Row() { Row() { Button('Button1').id('Button1').onKeyEvent((event) => { console.log("Button1"); return true }) Button('Button2').id('Button2').onKeyEvent((event) => { console.log("Button2"); return tru...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { Font } from '@kit.ArkUI'; let font:Font = uiContext.getFont(); font.registerFont({ familyName: 'medium', familySrc: '/font/medium.ttf' });
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { Font } from '@kit.ArkUI'; let font:Font|undefined = uiContext.getFont(); if(font){ font.getSystemFontList() }
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { Font } from '@kit.ArkUI'; let font:Font|undefined = uiContext.getFont(); if(font){ font.getFontByName('Sans Italic') }
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { ComponentUtils } from '@kit.ArkUI'; let componentUtils:ComponentUtils = uiContext.getComponentUtils(); let modePosition = componentUtils.getRectangleById("onClick"); let localOffsetWidth = modePosition.size.width; let localOffsetHeight = modePosition.size.height;
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { UIInspector } from '@kit.ArkUI'; let inspector: UIInspector = uiContext.getUIInspector(); let listener = inspector.createComponentObserver('COMPONENT_ID');
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// Index.ets // Example usage of uiObserver.on('navDestinationUpdate', callback) // uiObserver.off('navDestinationUpdate', callback) @Component struct PageOne { build() { NavDestination() { Text("pageOne") }.title("pageOne") } } @Entry @Component struct Index { private stack: NavPathStack = new Na...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
// Index.ets // Example usage of uiObserver.on('navDestinationUpdate', navigationId, callback) // uiObserver.off('navDestinationUpdate', navigationId, callback) @Component struct PageOne { build() { NavDestination() { Text("pageOne") }.title("pageOne") } } @Entry @Component struct Index { private s...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { UIObserver } from '@kit.ArkUI' @Entry @Component struct Index { scroller: Scroller = new Scroller() observer: UIObserver = new UIObserver() private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7] build() { Row() { Column() { Scroll(this.scroller) { Column() { ForEach(...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { UIContext, UIObserver } from '@kit.ArkUI'; let observer:UIObserver = this.getUIContext().getUIObserver(); observer.on('routerPageUpdate', (info) => { console.info('RouterPage state updated, called by ' + `${info.name}`); });
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { UIContext, UIObserver } from '@kit.ArkUI'; let observer:UIObserver = this.getUIContext().getUIObserver(); function callBackFunc(info:observer.RouterPageInfo) {}; // callBackFunc is defined and used before observer.off('routerPageUpdate', callBackFunc);
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { uiObserver } from '@kit.ArkUI'; @Entry @Component struct Index { @State density: number = 0; @State message: string = 'No listener registered' densityUpdateCallback = (info: uiObserver.DensityInfo) => { this.density = info.density; this.message = 'DPI after change:' + this.density.toString(); ...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { uiObserver } from '@kit.ArkUI'; @Entry @Component struct Index { @State density: number = 0; @State message: string = 'No listener registered' densityUpdateCallback = (info: uiObserver.DensityInfo) => { this.density = info.density; this.message = 'DPI after change:' + this.density.toString(); ...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { uiObserver } from '@kit.ArkUI'; @Entry @Component struct Index { willDrawCallback = () => { console.info("willDraw instruction dispatched.") } build() { Column() { Button('Subscribe to Drawing Instruction Dispatch') .onClick(() => { this.getUIContext().getUIObserver().on(...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { uiObserver } from '@kit.ArkUI'; @Entry @Component struct Index { willDrawCallback = () => { console.info("willDraw instruction dispatched.") } build() { Column() { Button('Subscribe to Drawing Instruction Dispatch') .margin({ bottom: 10 }) .onClick(() => { this.g...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { uiObserver } from '@kit.ArkUI'; @Entry @Component struct Index { didLayoutCallback = () => { console.info("Layout completed."); } build() { Column() { Button('Subscribe to Layout Completion') .onClick(() => { this.getUIContext().getUIObserver().on('didLayout', this.didLay...
application-dev\reference\apis-arkui\js-apis-arkui-UIContext.md
import { uiObserver } from '@kit.ArkUI'; @Entry @Component struct Index { didLayoutCallback = () => { console.info("Layout completed.") } build() { Column() { Button('Subscribe to Layout Completion') .margin({ bottom: 10 }) .onClick(() => { this.getUIContext().getUIObserv...