source stringlengths 14 113 | code stringlengths 10 21.3k |
|---|---|
release-notes\changelogs\OpenHarmony_4.0.8.2\changelogs-datashare.md | let arrayBuffer = new ArrayBuffer(1);
let version = 1;
let data : Array<dataShare.PublishedItem> = [{key:"key2", subscriberId:"11", data:arrayBuffer}];
function publishCallback(err, result: Array<dataShare.OperationResult>) {
console.info("publishCallback " + JSON.stringify(result));
}
try {
console.info("data ... |
release-notes\changelogs\OpenHarmony_4.0.8.2\changelogs-distributeddatamgr.md | /**
* Indicates datashare extension ability context.
*
* @type ?{ ExtensionContext }
* @syscap SystemCapability.DistributedDataManager.DataShare.Provider
* @systemapi
* @StageModelOnly
* @since 9
*/
context?: ExtensionContext; |
release-notes\changelogs\OpenHarmony_4.0.8.2\changelogs-distributeddatamgr.md | /**
* Indicates datashare extension ability context.
*
* @type { ExtensionContext }
* @syscap SystemCapability.DistributedDataManager.DataShare.Provider
* @systemapi
* @StageModelOnly
* @since 10
*/
context: ExtensionContext; |
release-notes\changelogs\OpenHarmony_4.0.8.2\changelogs-distributeddatamgr.md | OH_Predicates (*equalTo)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
OH_Predicates (*notEqualTo)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
OH_Predicates (*beginWrap)(OH_Predicates *predicates);
OH_Predicates (*endWrap)(OH_Predicates *predicates);
... |
release-notes\changelogs\OpenHarmony_4.0.8.2\changelogs-distributeddatamgr.md | OH_Predicates *(*equalTo)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
OH_Predicates *(*notEqualTo)(OH_Predicates *predicates, const char *field, OH_VObject *valueObject);
OH_Predicates *(*beginWrap)(OH_Predicates *predicates);
OH_Predicates *(*endWrap)(OH_Predicates *predicates);
... |
release-notes\changelogs\OpenHarmony_4.0.8.2\changelogs-distributeddatamgr.md | RDB_ERR_INVALID_ARGS = -2,
RDB_ERR = -1,
RDB_ERR_OK = 0 |
release-notes\changelogs\OpenHarmony_4.0.8.2\changelogs-distributeddatamgr.md | RDB_ERR = -1,
RDB_OK = 0,
E_BASE = 14800000,
RDB_E_NOT_SUPPORTED = 801,
RDB_E_ERROR = E_BASE,
RDB_E_INVALID_ARGS = (E_BASE + 1),
RDB_E_CANNOT_UPDATE_READONLY = (E_BASE + 2),
RDB_E_REMOVE_FILE = (E_BASE + 3),
RDB_E_EMPTY_TABLE_NAME = (E_BASE + 5),
RDB_E_EMPTY_VALUES_BUCKET = (E_BASE +... |
release-notes\changelogs\OpenHarmony_4.0.8.2\changelogs-miscdevice.md | import vibrator from '@ohos.vibrator';
import resourceManager from '@ohos.resourceManager';
const FILE_NAME = "xxx.json";
async function openResource(fileName) {
let fileDescriptor = undefined;
let mgr = await resourceManager.getResourceManager();
await mgr.getRawFd(fileName).then(value => {
fileD... |
release-notes\changelogs\OpenHarmony_4.0.8.5\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct StackExample {
build() {
Stack({alignContent:Alignment.Start}){
Text("Stack's child").backgroundColor(Color.Brown).height("100").width(100)
}
.width(300).height(300)
.backgroundColor(Color.Pink)
.align(Alignment.Center)
.alignContent(Alignment.TopEnd)
... |
release-notes\changelogs\OpenHarmony_4.0.8.5\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct FillText {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent... |
release-notes\changelogs\OpenHarmony_4.0.9.1\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct Example {
build() {
Button("test")
.onClick(()=>{
console.log("click");
})
.onClick(undefined)
}
} |
release-notes\changelogs\OpenHarmony_4.0.9.1\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct Parent {
@State message: string = 'Parent'
build() {
Column() {
Child() // Compile time error.
}
}
}
@Component
struct Child {
@Prop message: string
build() {
Column() {
}
}
} |
release-notes\changelogs\OpenHarmony_4.0.9.1\changelogs-arkui.md | // xxx.ets
@Builder
function builderFunction() {
Text('Hello Builder')
}
function normal () {
}
@Component
struct Index {
@BuilderParam builderParam: ()=>void = builderFunction
@BuilderParam builderParam2: ()=>void = normal // Compile time error.
build() {
Column() {
}
}
} |
release-notes\changelogs\OpenHarmony_4.0.9.1\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct Index {
async onBackPress() {} // Compile-time error
build() {
Column() {
}
}
} |
release-notes\changelogs\OpenHarmony_4.0.9.1\changelogs-security.md | interface Key {
/**
* Encode the key object to binary data.
*
* @returns { DataBlob } the binary data of the key object.
* @syscap SystemCapability.Security.CryptoFramework
* @since 9
*/
getEncoded(): DataBlob;
}
interface AsyKeyGenerator {
/**
* Used to generate asymmetric key pair.
*
... |
release-notes\changelogs\OpenHarmony_4.0.9.1\changelogs-security.md | interface Key {
/**
* Encode the key object to binary data.
*
* @returns { DataBlob } the binary data of the key object.
* @throws { BusinessError } 801 - this operation is not supported.
* @throws { BusinessError } 17620001 - memory error.
* @throws { BusinessError } 17630001 - crypto operation err... |
release-notes\changelogs\OpenHarmony_4.0.9.2\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct ListExample {
private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
build() {
Column() {
List({ space: 20, initialIndex: 0 }) {
ForEach(this.arr, (item) => {
ListItem() {
Text('' + item)
.width('100%').height(100).fontSize(1... |
release-notes\changelogs\OpenHarmony_4.0.9.2\changelogs-geoLocationManager.md | import geoLocationManager from '@ohos.geoLocationManager';
let config = {'type': 1, 'needStartScan': true, 'scanInterval': 10000};
try {
geoLocationManager.getLocatingRequiredData(config).then((result) => {
console.log('getLocatingRequiredData return: ' + JSON.stringify(result));
})
.c... |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelog-@Prop.md | let nextId = 0;
@Observed
class ClassA {
id : number;
a : number;
constructor(a : number = 0) {
this.id = nextId++;
this.a = a;
}
}
@Component
struct ObjectLinkClassA {
@ObjectLink obj : ClassA;
build() {
Row() {
Text(`ObjectLink: obj: ${this.obj.a}`)
.height(100)
.onCl... |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-arkui.md | // xxx.ets
@Extend(Text, Button) // Compilation error: @Extend should have one and only one parameter.
function fancy() {
.width(100)
}
@AnimatableExtend(Text, Polyline) //Compilation error: @AnimatableExtend should have one and only one parameter.
function fancy2() {
.height(100)
}
@Entry
@Component
struct Ex... |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-arkui.md | // xxx.ets
@Extend(Text)
function fancy() {
.width(100)
}
@AnimatableExtend(Text)
function fancy2() {
.height(100)
}
@Entry
@Component
struct Example {
build() {
Column() {
Text('text')
.fancy()
.fancy2()
}
}
} |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-arkui.md | // xxx.ets
@Observed
class Count {
message: string = 'count'
}
@Entry
@Component
struct Parent {
@State state1: string = 'state1';
@State state2: Count = new Count();
build() {
Column() {
Child() // Compilation error: Property 'link' in the custom component 'Child' is missing (mandatory to specify)... |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-arkui.md | // xxx.ets
@Observed
class Count {
message: string = 'count'
}
@Entry
@Component
struct Parent {
@State state1: string = 'state1';
@State state2: Count = new Count();
build() {
Column() {
Child({link: $state1, objectLink: this.state2})
}
}
}
@Component
struct Child {
@Link link: string;
@... |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-arkui.md | @Entry
@Component
struct OnReadyDiff {
@State message: string = 'init '
@State isShow: boolean = false
@State myHeight: number = 300
private settings: RenderingContextSettings = new RenderingContextSettings(true);
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings);
buil... |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct TextInputExample {
@State text: string = ''
controller: TextInputController = new TextInputController()
build() {
Column(){
Row().margin({left:"50%"}).width(100).height(100)
}.width("100%").height("100%")
}
} |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct ListItemExample2 {
@State message: string = 'Hello World'
@State arr: number[] = [0, 1, 2, 3, 4]
@State enterEndDeleteAreaString: string = "not enterEndDeleteArea"
@State exitEndDeleteAreaString: string = "not exitEndDeleteArea"
@Builder itemEnd() {
Row() {
Butto... |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-distributeddatamgr.md | enum Action {
CLEAR_CLOUD_INFO,
CLEAR_CLOUD_DATA_AND_INFO
} |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-distributeddatamgr.md | enum ClearAction {
CLEAR_CLOUD_INFO,
CLEAR_CLOUD_DATA_AND_INFO
} |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-distributeddatamgr.md | static clean(
accountId: string,
appActions: { [bundleName: string]: Action },
callback: AsyncCallback<void>
): void;
static clean(accountId: string, appActions: { [bundleName: string]: Action }): Promise<void>; |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-distributeddatamgr.md | static clear(
accountId: string,
appActions: { [bundleName: string]: ClearAction },
callback: AsyncCallback<void>
): void;
static clear(accountId: string, appActions: { [bundleName: string]: ClearAction }): Promise<void>; |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-distributeddatamgr.md | interface Statistic {
total: number;
success: number;
failed: number;
remained: number;
} |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-distributeddatamgr.md | interface Statistic {
total: number;
successful: number;
failed: number;
remained: number;
} |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-distributeddatamgr.md | setDistributedTables(tables: Array<string>, type: number, config: DistributedConfig, callback: AsyncCallback<void>): void;
setDistributedTables(tables: Array<string>, type?: number, config?: DistributedConfig): Promise<void>; |
release-notes\changelogs\OpenHarmony_4.0.9.3\changelogs-distributeddatamgr.md | setDistributedTables(tables: Array<string>, type: DistributedType, config: DistributedConfig, callback: AsyncCallback<void>): void;
setDistributedTables(tables: Array<string>, type?: DistributedType, config?: DistributedConfig): Promise<void>; |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-arkui.md | @Entry
@Component
struct Index {
build() {
Column() {
Navigation() {
Text('Navigation')
}.title("Navigation Menu")
.menus([
{icon: 'common/image/icon.png', value: 'menu1'},
{icon: 'common/image/icon.png', value: 'menu2'},
{icon: 'common/image/icon.png', value: 'me... |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-arkui.md | @Entry
@Component
struct Index {
@Builder NavigationTile() {
Column() {
Text('title').fontColor('#182431').fontSize(30).lineHeight(41)
Text('subTitle').fontColor('#182431').fontSize(14).lineHeight(19).margin(top:2, bottom: 20)
}
}
build() {
Column() {
Navigation() {
Text('Na... |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-arkui.md | @Entry
@Component
struct GridRowExample {
@State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown]
@State currentBp: string = 'unknown'
build() {
Column() {
GridRow({
columns: 5,
gutter: { x: 5, y: 10 },
bre... |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-arkui.md | class MyDataSource implements IDataSource {
private list: number[] = []
private listener: DataChangeListener
constructor(list: number[]) {
this.list = list
}
totalCount(): number {
return this.list.length
}
getData(index: number): any {
return this.list[index]
}
registerDataChangeListe... |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-arkui.md | @Entry
@Component
struct Index {
build() {
Column() {
Row() {
Row() {
Row() {
Row() {
Row()
.width('100%')
.height('100%')
.border({width: '1', color: 'blue'})
}
.width('100%')
.he... |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int (*close)(OH_Cursor *cursor); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int (*destroy)(OH_Cursor *cursor); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int (*destroyPredicates)(OH_Predicates *predicates); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int (*destroy)(OH_Predicates *predicates); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int (*destroyValueObject)(OH_VObject *valueObject); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int (*destroy)(OH_VObject *valueObject); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int (*destroyValuesBucket)(OH_VBucket *bucket); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int (*destroy)(OH_VBucket *bucket); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | typedef struct {
const char *path;
bool isEncrypt;
enum OH_Rdb_SecurityLevel securityLevel;
} OH_Rdb_Config; |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | typedef struct {
int selfSize;
const char *dataBaseDir;
const char *storeName;
const char *bundleName;
const char *moduleName;
bool isEncrypt;
int securityLevel;
} OH_Rdb_Config; |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int OH_Rdb_DeleteStore(const char *path); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-distributeddatamgr.md | int OH_Rdb_DeleteStore(const OH_Rdb_Config *config); |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-formfwk.md | import formObserver from '@ohos.app.form.formObserver';
import formInfo from '@ohos.app.form.formInfo';
import Base from '@ohos.base';
try {
formObserver.getRunningFormInfos((error: Base.BusinessError, data: formInfo.RunningFormInfo[]) => {
if (error) {
console.error(`error, code: ${error.code}, message: $... |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-formfwk.md | function on(type: 'formAdd', observerCallback: Callback<formInfo.RunningFormInfo>, bundleName?: string): void;
function off(type: 'formAdd', observerCallback?: Callback<formInfo.RunningFormInfo>, bundleName?: string): void;
function on(type: 'formRemove', observerCallback: Callback<formInfo.RunningFormInfo>, bundleNam... |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-formfwk.md | function on(type: 'formAdd', observerCallback: Callback<formInfo.RunningFormInfo>): void;
function on(type: 'formAdd', hostBundleName: string, observerCallback: Callback<formInfo.RunningFormInfo>): void;
function off(type: 'formAdd', hostBundleName?: string, observerCallback?: Callback<formInfo.RunningFormInfo>): void;... |
release-notes\changelogs\OpenHarmony_4.0.9.5\changelogs-formfwk.md | import formObserver from '@ohos.app.form.formObserver';
let bundleName = 'ohos.samples.FormApplication';
let callback = function(data) {
console.log('a new form added, data: ${JSON.stringify(data)');
}
formHost.on('formAdd', callback);
formHost.on('formAdd', bundleName, callback); |
release-notes\changelogs\OpenHarmony_4.1.1.1\changelogs-bundlemanager.md | import bundleManager from '@ohos.bundle.bundleManager';
import { BusinessError } from '@ohos.base';
import hilog from '@ohos.hilog';
let bundleName = 'com.example.myapplication';
let appFlags = bundleManager.ApplicationFlag.GET_APPLICATION_INFO_WITH_METADATA;
let userId = 100;
try {
bundleManager.getApplicationInf... |
release-notes\changelogs\OpenHarmony_4.1.1.5\changelogs-access_token.md | let context: common.UIAbilityContext = GlobalThis.getInstance().getContext('context');
atManager.requestPermissionsFromUser(context, ['ohos.permission.APPROXIMATELY_LOCATION', 'ohos.permission.LOCATION', 'ohos.permission.LOCATION_IN_BACKGROUND']).then((data) => {
console.info('data:' + JSON.stringify(data))... |
release-notes\changelogs\OpenHarmony_4.1.2.2\changelogs-access_token.md | import privacyManager from '@ohos.privacyManager';
try {
privacyManager.getPermissionUsedRecord({
flag:1
}, (err, data) => {
try {
let record = data.bundleRecords[0].permissionRecords[0];
let access = record.accessRecords;
let reject = record.rejectRecords;
... |
release-notes\changelogs\OpenHarmony_4.1.2.2\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct QRCodeExample {
private value: string = 'hello world'
build() {
Column() {
QRCode(this.value)
}.width('100%').height('100%')
}
} |
release-notes\changelogs\OpenHarmony_4.1.2.2\changelogs-arkui.md | @Entry
@Component
struct RefreshExample {
@State isRefreshing: boolean = false
@State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']
build() {
Column() {
Refresh({ refreshing: $$this.isRefreshing}) {
List() {
ForEach(this.arr, (item: string) => {
ListIt... |
release-notes\changelogs\OpenHarmony_4.1.2.2\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct RefreshExample {
@State isRefreshing: boolean = false
@State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']
@Builder
customRefreshComponent()
{
Stack()
{
Row()
{
LoadingProgress().height(32)
Text("Refreshing...").fontS... |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | load(uri: string): Promise<number>
load(fd: number, offset: number, length: number): Promise<number>
play(soundID: number, params: PlayParameters, callback: AsyncCallback<number>): void
play(soundID: number, callback: AsyncCallback<number>): void
play(soundID: number, params?: PlayParameters): Promise<number>
stop(stre... |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | @throws { BusinessError } 5400102 - Operation not allowed. |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | load(uri: string): Promise<number>
load(fd: number, offset: number, length: number, callback: AsyncCallback<number>): void
load(fd: number, offset: number, length: number): Promise<number>
unload(soundID: number): Promise<void> |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | @throws { BusinessError } 5400103 - I/O error. |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | load(uri: string): Promise<number>
load(fd: number, offset: number, length: number): Promise<number>
play(soundID: number, params?: PlayParameters): Promise<number>
stop(streamID: number): Promise<void>
setLoop(streamID: number, loop: number): Promise<void>
setPriority(streamID: number, priority: number): Promise<void>... |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | @throws { BusinessError } 5400105 - Service died. |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | on(type: 'loadComplete', callback: Callback<number>): void |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | @param {'loadComplete'} type Type of the play finish event to listen for.
@param {Callback<number>} callback Callback used to listen for load result event
@syscap SystemCapability.Multimedia.Media.SoundPool
@since 10 |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | on(type: 'playFinished', callback: Callback<void>): void |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | @param {'loadComplete'} type Type of the play finish event to listen for.
@param {Callback<number>} callback Callback used to listen for load result event
@syscap SystemCapability.Multimedia.Media.SoundPool
@since 10 |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | play(soundID: number, params: PlayParameters, callback: AsyncCallback<number>): void;
play(soundID: number, callback: AsyncCallback<number>): void;
play(soundID: number, params?: PlayParameters): Promise<number>;
stop(streamID: number, callback: AsyncCallback<void>): void;
stop(streamID: number): Promise<void>;
setLoop... |
release-notes\changelogs\OpenHarmony_4.1.2.3\changelogs-multimedia.md | @throws { BusinessError } 401 - The parameter check failed. Return by callback. |
release-notes\changelogs\OpenHarmony_4.1.5.1\changelogs-arkui.md | import { PromptAction, UIInspector } from '@ohos.arkui.UIContext';
import promptAction from '@ohos.promptAction';
import { BusinessError } from '@ohos.base';
let promptActionF: PromptAction = uiContext.getPromptAction();
try {
promptActionF.showActionMenu({
title: 'Title Info',
buttons: [
{
... |
release-notes\changelogs\OpenHarmony_4.1.5.1\changelogs-arkui.md | import { PromptAction, UIInspector } from '@ohos.arkui.UIContext';
import promptAction from '@ohos.promptAction';
import { BusinessError } from '@ohos.base';
let promptActionF: PromptAction = uiContext.getPromptAction();
try {
promptActionF.showActionMenu({
title: 'Title Info',
buttons: [
{
... |
release-notes\changelogs\OpenHarmony_4.1.5.2\changelogs-arkui.md | @Entry
@Component
struct Index {
@State message: string = 'Custom menu';
@Builder
MenuBuilder() {
Menu() {
MenuItem({ content: "item00" })
MenuItem({ content: "item11" })
}
}
@Builder
ContextMenuBuilder() {
Menu() {
MenuItem({ content: "item22" })
MenuItem({ content: "i... |
release-notes\changelogs\OpenHarmony_4.1.5.2\changelogs-arkui.md | .bindMenu(this.MenuBuilder())
.bindContextMenu(this.ContextMenuBuilder(), ResponseType.LongPress) |
release-notes\changelogs\OpenHarmony_4.1.5.2\changelogs-arkui.md | .bindMenu(this.MenuBuilder(), { backgroundColor: Color.White, backgroundBlurStyle: BlurStyle.NONE })
.bindContextMenu(this.ContextMenuBuilder(), ResponseType.LongPress, { backgroundColor: Color.White, backgroundBlurStyle: BlurStyle.NONE }) |
release-notes\changelogs\OpenHarmony_4.1.5.3\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct PopupExample {
@State handlePopup: boolean = false
build() {
Column() {
// PopupOptions for setting the popup
Button('PopupOptions')
.onClick(() => {
this.handlePopup = !this.handlePopup;
})
... |
release-notes\changelogs\OpenHarmony_4.1.5.3\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct PopupExample {
@State handlePopup: boolean = false;
build() {
Column() {
// PopupOptions for setting the popup
Button ('Button Name')
.onClick(() => {
this.handlePopup = !this.handlePopup;
})
... |
release-notes\changelogs\OpenHarmony_4.1.5.3\changelogs-arkui.md | // xxx.ets
@Entry
@Component
struct PopupExample {
@State customPopup: boolean = false
// Define the popup content in the popup builder.
@Builder
popupBuilder() {
Row({ space: 2 }) {
Button("button1")
Button("button2")
}
}
build() {
C... |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-arkui.md | @Entry
@Component
struct AlertDialogExample {
build() {
Column({ space: 5 }) {
Button('one button dialog')
.onClick(() => {
AlertDialog.show({
message:"alertDialog",
})
}).backgroundColor(0x317aff)
}.width('100%').margin({ top: 5 })
}
} |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-arkui.md | AlertDialog.show({
message:"alertDialog",
}) |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-arkui.md | AlertDialog.show({
message:"alertDialog",
backgroundColor:Color.White,
backgroundBlurStyle:BlurStyle.NONE
}) |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-arkui.md | .parallelGesture(GestureGroup(GestureMode.Parallel,
TapGesture({count: 1})
.onAction((event?: GestureEvent)=> {
if (event) {
console.info("Tapgesture")
}
}),
PanGesture({fingers: 1})
.onActionStart((event?: GestureEvent)=>{
console.info("Pan start")
})
... |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-arkui.md | .parallelGesture(GestureGroup(GestureMode.Parallel,
PanGesture({fingers: 1})
.onActionStart((event?: GestureEvent)=>{
console.info("Pan start")
})
.onActionUpdate((event?: GestureEvent)=>{
console.info("Pan update")
})
.onActionEnd((event?: GestureEvent)=>{
cons... |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-arkui.md | .gesture(
TapGesture({count: 1})
.onAction((event?: GestureEvent)=> {
if (event) {
console.log("Tapgesture")
}
})
)
.onTouch((event?: TouchEvent)=> {
if (event) {
if (event.type === TouchType.Down) {
this.downX = event.touches[0].windowX
this.downY... |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-arkui.md | @Entry
@Component
struct Index {
@State message: string = '';
private hasPanActive = false;
build() {
Column() {
Row({ space: 20 }) {
Text(this.message).width(100).height(40).backgroundColor(Color.Pink)
}.margin(20)
}
.width('100%')
.height(200)
.borderWidth(2)
.paralle... |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-graphic.md | import image from "@ohos.multimedia.image";
import effectKit from "@ohos.effectKit";
const color = new ArrayBuffer(96);
let opts : image.InitializationOptions = {
editable: true,
pixelFormat: 3,
size: {
height: 4,
width: 6
}
};
image.createPixelMap(color, opts).then((pixelMap) => {
let pixel = effect... |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-graphic.md | let pixel = effectKit.createEffect(pixelMap).grayscale().getPixelMap(); |
release-notes\changelogs\OpenHarmony_4.1.5.5\changelogs-graphic.md | effectKit.createEffect(pixelMap).grayscale().getEffectPixelMap().then(data => {
let pixel = data;
}).catch(ex => console.log("getEffectPixelMap error: " + ex.toString())); |
release-notes\changelogs\OpenHarmony_4.1.6.1\changelogs-arkui.md | @Entry
@Component
struct NavigationExample {
build() {
NavDestination() {
...
}.margin({...})
}
} |
release-notes\changelogs\OpenHarmony_4.1.6.1\changelogs-arkui.md | @Entry
@Component
struct NavigationExample {
build() {
NavDestination() {
...
}.padding({...})
}
} |
release-notes\changelogs\OpenHarmony_4.1.6.3\changelogs-blendMode.md | // In the .ets file that uses the new API, you can call BlendApplyType.OFFSCREEN twice to trigger two offscreen operations.
@Entry
@Component
struct Index {
build() {
Column() {
// The second offscreen operation is used to draw the subnode content.
Text("test")
.fontSize(144)
... |
release-notes\changelogs\OpenHarmony_4.1.6.5\changelogs-ability.md | import AutoStartupManager from '@ohos.app.ability.autoStartupManager';
import { BusinessError } from '@ohos.base';
try {
AutoStartupManager.setApplicationAutoStartup({
bundleName: 'com.example.autostartupapp',
abilityName: 'EntryAbility'
}).then((data: void) => {
console.info('====> setApplicationAutoS... |
release-notes\changelogs\OpenHarmony_4.1.6.5\changelogs-ability.md | import AutoStartupManager from '@ohos.app.ability.autoStartupManager';
import common from '@ohos.app.ability.common';
try {
AutoStartupManager.on('systemAutoStartup', {
onAutoStartupOn(data: common.AutoStartupInfo) {
console.info('===> autostartupmanager onAutoStartupOn data: ' + JSON.stringify(data));
... |
release-notes\changelogs\OpenHarmony_5.0.0.12\changelogs-arkui.md | @Entry
@Component
struct Index {
@State message: string = 'Hello World';
@Builder buildTest() {
Row() {
Text('Hello, world')
.fontSize(30)
}
}
build() {
Row() {
Child()
}
}
}
@Component
struct Child {
@Builder buildFuction() {
Column() {
Text('initBuilderPara... |
release-notes\changelogs\OpenHarmony_5.0.0.12\changelogs-arkui.md | @Entry
@Component
struct Index {
@State message: string = 'Hello World';
@Builder buildTest() {
Row() {
Text('Hello, world')
.fontSize(30)
}
}
build() {
Row() {
Child({ regular_value: this.message, state_value: this.message, provide_value: this.message, initMessage: this.messag... |
release-notes\changelogs\OpenHarmony_5.0.0.12\changelogs-arkui.md | @Entry
@Component
struct AccessRestrictions {
@Builder buildTest() {
Text("Parent builder")
}
build() {
Column() {
ComponentsChild({state_value: "Hello", prop_value: "Hello", provide_value: "Hello", builder_value: this.buildTest, regular_value: "Hello"})
}
.width('100%')
}
}
@Component
st... |
release-notes\changelogs\OpenHarmony_5.0.0.12\changelogs-arkui.md | @Entry
@Component
struct AccessRestrictions {
build() {
Column() {
ComponentChild()
}
.width('100%')
}
}
@Component
struct ComponentChild {
@LocalStorageProp("sessionLocalProp") public local_prop_value: string = "Hello";
@LocalStorageLink("sessionLocalLink") public local_link_value: string = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.