nwo stringclasses 304
values | sha stringclasses 304
values | path stringlengths 9 214 | language stringclasses 1
value | identifier stringlengths 0 49 | docstring stringlengths 1 34.2k | function stringlengths 8 59.4k | ast_function stringlengths 71 497k | obf_function stringlengths 8 39.4k | url stringlengths 102 324 | function_sha stringlengths 40 40 | source stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
AntoSmith/PicWorld.git | b53ec0b59192b537de563f75bcc3c7664939397e | entry/src/main/ets/components/ImageCard.ets | arkts | saveNetworkImage | 保存网络图片的逻辑 | async saveNetworkImage(context: common.UIAbilityContext, imageUrl: string) {
promptAction.showToast({ message: 'Start downloading and saving...' });
// 为确保资源释放,预先声明变量
let imageSource: image.ImageSource | undefined = undefined;
let pixelMap: image.PixelMap | undefined = undefined;
let imagePacker: im... | AST#method_declaration#Left async saveNetworkImage AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left im... | async saveNetworkImage(context: common.UIAbilityContext, imageUrl: string) {
promptAction.showToast({ message: 'Start downloading and saving...' });
let imageSource: image.ImageSource | undefined = undefined;
let pixelMap: image.PixelMap | undefined = undefined;
let imagePacker: image.ImagePacker |... | https://github.com/AntoSmith/PicWorld.git/blob/b53ec0b59192b537de563f75bcc3c7664939397e/entry/src/main/ets/components/ImageCard.ets#L93-L151 | 263209d4ce13669283aef608883b569afefc77b9 | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | ArkUI/Component_Nesting_Optimization/entry/src/main/ets/segment/segment3.ets | arkts | example | [Start Counter_example3] | @Component
export struct example {
build() {
Column() {
Row() {
// Custom Components
FlowListStruct(
// Custom Component Passing Parameters
// ...
)
}
.width('100%')
}
.width('100%')
.height('100%')
}
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct example AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { A... | @Component
export struct example {
build() {
Column() {
Row() {
FlowListStruct(
)
}
.width('100%')
}
.width('100%')
.height('100%')
}
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkUI/Component_Nesting_Optimization/entry/src/main/ets/segment/segment3.ets#L8-L24 | fdf6043f61ccba8bdf8d5587a92d9f47719ea2f6 | gitee |
jjjjjjava/ffmpeg_tools.git | 6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161 | src/main/ets/ffmpeg/FFmpegManager.ets | arkts | executeWithPriority | 执行FFmpeg任务(带优先级) | public executeWithPriority(
commands: string[],
duration: number,
priority: TaskPriority,
callback: TaskCallback
): string {
const taskId = util.generateRandomUUID(true);
const task = new Task(taskId, commands, duration, TaskConfig.defaultConfig(), callback);
task.setPriority(priority);
... | AST#method_declaration#Left public executeWithPriority AST#parameter_list#Left ( AST#parameter#Left commands : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left duration : AST#type_... | public executeWithPriority(
commands: string[],
duration: number,
priority: TaskPriority,
callback: TaskCallback
): string {
const taskId = util.generateRandomUUID(true);
const task = new Task(taskId, commands, duration, TaskConfig.defaultConfig(), callback);
task.setPriority(priority);
... | https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFmpegManager.ets#L93-L109 | 6b081fdb01aa65264b221a3be51634fcadc8d320 | github |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/hashing/SHA256.ets | arkts | hash | 计算SHA256哈希值 | public static hash(input: string): string {
const encoder: TextEncoder = new TextEncoder();
const inputBytes: Uint8Array = encoder.encode(input);
const inputSize: number = inputBytes.length;
// 计算填充后的消息大小
let paddedMessageSize: number = 0;
if (inputSize % 64 < 56) {
paddedMessageSize = in... | AST#method_declaration#Left public static hash AST#parameter_list#Left ( AST#parameter#Left input : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_ty... | public static hash(input: string): string {
const encoder: TextEncoder = new TextEncoder();
const inputBytes: Uint8Array = encoder.encode(input);
const inputSize: number = inputBytes.length;
let paddedMessageSize: number = 0;
if (inputSize % 64 < 56) {
paddedMessageSize = inputSize + 64 ... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/hashing/SHA256.ets#L41-L151 | 90e4c915b17e64764e42cc6fee05724e5a70c65d | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_rcp/src/main/ets/rcp/efRcpConfig.ets | arkts | 证书工具类 | export class securityUtil {
/**
* 读取证书内容
* @param certPath 证书地址需要为沙箱环境地址
* @returns 证书字符串
*/
static readClientCerts(certPath: string): string {
//读取文件内容
let file = fileIo.openSync(certPath, fileIo.OpenMode.READ_ONLY);
//读取文件大小
let info = fileIo.statSync(file.fd);
... | AST#export_declaration#Left export AST#class_declaration#Left class securityUtil AST#class_body#Left { /**
* 读取证书内容
* @param certPath 证书地址需要为沙箱环境地址
* @returns 证书字符串
*/ AST#method_declaration#Left static readClientCerts AST#parameter_list#Left ( AST#parameter#Left certPath : AST#type_annotation#Left ... | export class securityUtil {
static readClientCerts(certPath: string): string {
let file = fileIo.openSync(certPath, fileIo.OpenMode.READ_ONLY);
let info = fileIo.statSync(file.fd);
let buffer = new ArrayBuffer(info.size);
let readLen = fileIo.readSync(file.fd... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/efRcpConfig.ets#L163-L185 | c2de4307b01fa2114e9dd6bad39b93c0f2f14d98 | gitee | |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/accuracy/path_sensitive/exception_throw/exception_throw_001_T.ets | arkts | Introduction 异常抛出-try块 | export function exception_throw_001_T(taint_src : string) {
try {
taint.Sink(taint_src)
throw new Error()
} catch (e) {
}
} | AST#export_declaration#Left export AST#function_declaration#Left function exception_throw_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_stateme... | export function exception_throw_001_T(taint_src : string) {
try {
taint.Sink(taint_src)
throw new Error()
} catch (e) {
}
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/path_sensitive/exception_throw/exception_throw_001_T.ets#L6-L12 | a6b1b65f4b66c07007fe55207eab0e2092c05b8c | github | |
huaweicloud/huaweicloud-iot-device-sdk-arkts.git | 72954bea19e7e7f93567487b036c0664457bdaf3 | huaweicloud_iot_device_library/src/main/ets/client/listener/RawMessageListener.ets | arkts | 原始消息接收监听器 | export interface RawMessageListener {
/**
* 收到消息通知
*
* @param message 原始消息
*/
onMessageReceived: (message: RawMessage) => void;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface RawMessageListener AST#object_type#Left { /**
* 收到消息通知
*
* @param message 原始消息
*/ AST#type_member#Left onMessageReceived : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left message : AST#ty... | export interface RawMessageListener {
onMessageReceived: (message: RawMessage) => void;
} | https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts.git/blob/72954bea19e7e7f93567487b036c0664457bdaf3/huaweicloud_iot_device_library/src/main/ets/client/listener/RawMessageListener.ets#L20-L27 | da7777d57c2f4ce8e3a16e147d02f32d9139900f | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/WindowUtil.ets | arkts | destroyWindow | 销毁窗口
@param name 窗口名字,即Configuration中的name。
@returns | static async destroyWindow(name: string): Promise<boolean> {
const subWindow = WindowUtil.findWindow(name);
if (subWindow) {
await subWindow.destroyWindow();
return true;
}
return false;
} | AST#method_declaration#Left static async destroyWindow AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_ty... | static async destroyWindow(name: string): Promise<boolean> {
const subWindow = WindowUtil.findWindow(name);
if (subWindow) {
await subWindow.destroyWindow();
return true;
}
return false;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/WindowUtil.ets#L489-L496 | 155e35a686cd92713dbdbbc73e5f4972f224a44b | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/GuildRoleUpdate.ets | arkts | handle | 应用了约束45:添加函数返回类型标注 | handle(packet: Object): void {
const client = this.packetManager.client;
const data = packet.d;
client.actions.GuildRoleUpdate.handle(data);
} | AST#method_declaration#Left handle AST#parameter_list#Left ( AST#parameter#Left packet : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#... | handle(packet: Object): void {
const client = this.packetManager.client;
const data = packet.d;
client.actions.GuildRoleUpdate.handle(data);
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/GuildRoleUpdate.ets#L6-L10 | 9968d5e24cf6360b0ab161d8373c1c61eb41a9c0 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/wordrecognition/src/main/ets/pages/WordRecognition.ets | arkts | 聊天信息 | export class MessageBase {
msgBody: string | Resource
constructor(msg: string | Resource) {
this.msgBody = msg;
}
toString(): string {
return this.msgBody + ' ';
}
} | AST#export_declaration#Left export AST#class_declaration#Left class MessageBase AST#class_body#Left { AST#property_declaration#Left msgBody : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#... | export class MessageBase {
msgBody: string | Resource
constructor(msg: string | Resource) {
this.msgBody = msg;
}
toString(): string {
return this.msgBody + ' ';
}
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/wordrecognition/src/main/ets/pages/WordRecognition.ets#L249-L259 | 4bef4f6717c30457385556666ad6bbdd9f1c2b83 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/ActionParameter.ets | arkts | initBottomSheetDefault | 初始化BottomSheetOptions参数
@param options | static initBottomSheetDefault(options: BottomSheetOptions, fullWidth: boolean) {
options.alignment = DialogAlignment.Bottom; //弹窗的对齐方式。
options.offset = { dx: 0, dy: 0 }; //弹窗相对alignment所在位置的偏移量。
options.cancelValue = options.cancelValue ?? ActionParameter.config.primaryButton;
options.actionCancel = op... | AST#method_declaration#Left static initBottomSheetDefault AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left BottomSheetOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fullWidth : AST#type_annotation#Left AST#primary_ty... | static initBottomSheetDefault(options: BottomSheetOptions, fullWidth: boolean) {
options.alignment = DialogAlignment.Bottom;
options.offset = { dx: 0, dy: 0 };
options.cancelValue = options.cancelValue ?? ActionParameter.config.primaryButton;
options.actionCancel = options.actionCancel ?? ActionParame... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/ActionParameter.ets#L135-L173 | 5b959041aa49564fc0242c5fdb0ed6ea4eda03a5 | gitee |
texiwustion/chinese-herbal-shopping--arkts.git | 3f71338f3c6d88bc74342e0322867f3a0c2c17d1 | entry/src/main/ets/database/UserTable.ets | arkts | generateBucket | 工具函数,将用户数据的数据结构,转化为存储键值对 | generateBucket(user: IUserModel) {
let obj: relationalStore.ValuesBucket = {};
obj.username = user.username;
obj.password = user.password;
return obj;
} | AST#method_declaration#Left generateBucket AST#parameter_list#Left ( AST#parameter#Left user : AST#type_annotation#Left AST#primary_type#Left IUserModel AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#... | generateBucket(user: IUserModel) {
let obj: relationalStore.ValuesBucket = {};
obj.username = user.username;
obj.password = user.password;
return obj;
} | https://github.com/texiwustion/chinese-herbal-shopping--arkts.git/blob/3f71338f3c6d88bc74342e0322867f3a0c2c17d1/entry/src/main/ets/database/UserTable.ets#L100-L105 | 0c1358687ea45a0ed552ad1a025a6673643e153f | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/DialogBuilder.ets | arkts | BottomSheetDialogBuilder | BottomSheetDialog
@param options | @Builder
export function BottomSheetDialogBuilder(options: BottomSheetOptions) {
BottomSheetDialogView({ options: options });
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function BottomSheetDialogBuilder AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left BottomSheetOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) ... | @Builder
export function BottomSheetDialogBuilder(options: BottomSheetOptions) {
BottomSheetDialogView({ options: options });
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogBuilder.ets#L157-L160 | 3bc648f70a01d32b8357c918a3d60b9e37399ae8 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/navigation/src/main/ets/RouteBuild.ets | arkts | @file 路由构建器
@author Joker.X | export class RouteBuild {
private static builderMap: Map<string, WrappedBuilder<[]>> = new Map();
/**
* 注册路由
* @param name 路由名称
* @param builder 路由构建器
*/
static register(name: string, builder: WrappedBuilder<[]>) {
RouteBuild.builderMap.set(name, builder);
}
/**
* 获取路由构建器
* @param name... | AST#export_declaration#Left export AST#class_declaration#Left class RouteBuild AST#class_body#Left { AST#property_declaration#Left private static builderMap : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Map AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#prim... | export class RouteBuild {
private static builderMap: Map<string, WrappedBuilder<[]>> = new Map();
static register(name: string, builder: WrappedBuilder<[]>) {
RouteBuild.builderMap.set(name, builder);
}
static getBuilder(name: string): WrappedBuilder<[]> | undefined {
return RouteBuild.builderMa... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/navigation/src/main/ets/RouteBuild.ets#L5-L25 | 19d6e58dc62645070305c9ed06d0a0578448cc1b | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_rcp/src/main/ets/rcp/EfRcp.ets | arkts | enableLogInterceptor | 是否启用日志拦截器-默认启用 true
@returns | enableLogInterceptor(enable: boolean = true): EfRcp {
if (enable) {
efRcpConfig.logger.enable = true;
return this.addLogInterceptor();
}
return this;
} | AST#method_declaration#Left enableLogInterceptor AST#parameter_list#Left ( AST#parameter#Left enable : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#parameter#... | enableLogInterceptor(enable: boolean = true): EfRcp {
if (enable) {
efRcpConfig.logger.enable = true;
return this.addLogInterceptor();
}
return this;
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/EfRcp.ets#L137-L143 | a936864d48f0a57ef44fe2c29fe4b11ab0360526 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/pages/Index.ets | arkts | buildNavBar | 构建导航栏 | @Builder buildNavBar(){
NavBarView({
title: this.navTitle(),
navBarBgColor: $r('app.color.colorPrimary'),
navBarTitleColor: $r('app.color.color_white'),
// 左侧按钮数组(只有一个图标按钮)
leftButtons: [
{
icon: $r('app.media.ic_menu'), //set
onClick: () => {
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildNavBar AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left NavBarView ( AST#component_parameters#Left { AST#component_par... | @Builder buildNavBar(){
NavBarView({
title: this.navTitle(),
navBarBgColor: $r('app.color.colorPrimary'),
navBarTitleColor: $r('app.color.color_white'),
leftButtons: [
{
icon: $r('app.media.ic_menu'),
onClick: () => {
SetViewConfig.open()
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/pages/Index.ets#L139-L172 | bffa81791fc87e97e10e149aa6bf96949f612c9a | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | NetworkManagement/entry/src/main/ets/pages/WiFiQuery.ets | arkts | getSignalLevel | [End get_scan_info_list] [Start get_signal_level] | getSignalLevel() {
try {
let rssi = 0;
let band = 0;
let level = wifiManager.getSignalLevel(rssi, band);
hilog.info(0x0000, 'Sample', 'level: %{public}s', JSON.stringify(level));
// [StartExclude get_signal_level]
this.textArea = 'level:' + JSON.stringify(level);
// [EndExc... | AST#method_declaration#Left getSignalLevel AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left rssi = AST#expression#Left 0 AST#expressio... | getSignalLevel() {
try {
let rssi = 0;
let band = 0;
let level = wifiManager.getSignalLevel(rssi, band);
hilog.info(0x0000, 'Sample', 'level: %{public}s', JSON.stringify(level));
this.textArea = 'level:' + JSON.stringify(level);
} catch (error) {
hilog.error(0x0... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NetworkManagement/entry/src/main/ets/pages/WiFiQuery.ets#L72-L84 | 69ba1c1ee839dbdbf413544bbbc7235bf41847df | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/data/DataImportExportService.ets | arkts | exportToExcel | 导出为Excel格式 | async exportToExcel(contacts: Contact[], onProgress?: ExportProgressCallback): Promise<ExportResult> {
try {
hilog.info(0x0000, 'DataImportExportService', 'Starting Excel export...');
if (onProgress) {
onProgress({
totalRecords: contacts.length,
processedRecords: 0,
... | AST#method_declaration#Left async exportToExcel AST#parameter_list#Left ( AST#parameter#Left contacts : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Contact [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left onProgress ? : AST#type_an... | async exportToExcel(contacts: Contact[], onProgress?: ExportProgressCallback): Promise<ExportResult> {
try {
hilog.info(0x0000, 'DataImportExportService', 'Starting Excel export...');
if (onProgress) {
onProgress({
totalRecords: contacts.length,
processedRecords: 0,
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/data/DataImportExportService.ets#L417-L458 | 926416ee03e97bfbbf1a8cb6a43b0aa09904e15b | github |
openharmony/update_update_app | 0157b7917e2f48e914b5585991e8b2f4bc25108a | common/src/main/ets/component/CheckingDots.ets | arkts | CheckingDots | ...等待轮播
@since 2022-07-07 | @Component
export struct CheckingDots {
@Prop @Watch('onDotTextPlayChange')
private dotTextPlay: boolean;
private newVersionDotText: string= '.';
private checkingTid: number = null;
@State private dotNumber: number = 0;
aboutToDisappear() {
this.clearCheckingTid();
}
aboutToAppear() {
this.onD... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CheckingDots AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right AST#decorator#Left @ Watch ( AST#expression#Left 'onDotTextPlayChange' AST#expression#Right ) AST#deco... | @Component
export struct CheckingDots {
@Prop @Watch('onDotTextPlayChange')
private dotTextPlay: boolean;
private newVersionDotText: string= '.';
private checkingTid: number = null;
@State private dotNumber: number = 0;
aboutToDisappear() {
this.clearCheckingTid();
}
aboutToAppear() {
this.onD... | https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/common/src/main/ets/component/CheckingDots.ets#L21-L98 | 32cbcab39d4f2a0e81b2c8f55977320bc2395fbf | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/AxisBase.ets | arkts | getGridColor | Returns the color of the grid lines for this axis (the horizontal lines
coming from each label).
@return | public getGridColor(): number {
return this.mGridColor;
} | AST#method_declaration#Left public getGridColor AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expr... | public getGridColor(): number {
return this.mGridColor;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L276-L278 | b37a5b7d978f6f8d978a72b16c8ec1a6ac7b62da | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/analytics/AnalyticsPage.ets | arkts | formatDuration | 格式化持续时间 | private formatDuration(milliseconds: number): string {
const seconds = Math.floor(milliseconds / 1000);
const minutes = Math.floor(seconds / 60);
const hours = Math.floor(minutes / 60);
if (hours > 0) {
return `${hours}小时${minutes % 60}分钟`;
} else if (minutes > 0) {
return `${minutes}分钟... | AST#method_declaration#Left private formatDuration AST#parameter_list#Left ( AST#parameter#Left milliseconds : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST... | private formatDuration(milliseconds: number): string {
const seconds = Math.floor(milliseconds / 1000);
const minutes = Math.floor(seconds / 60);
const hours = Math.floor(minutes / 60);
if (hours > 0) {
return `${hours}小时${minutes % 60}分钟`;
} else if (minutes > 0) {
return `${minutes}分钟... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/analytics/AnalyticsPage.ets#L655-L667 | 2b3f22f6765d9ed8396d929ac07d7d648962ac7d | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | ComponentReuse/positive/src/main/ets/common/CustomRoutes.ets | arkts | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class CustomRoutes {
static readonly ROUTES: Route[] = [
{
title: '未使用组件复用',
child: [
{ text: '场景1', title: '列表项结构类型相同', to: 'NoReuseScene1Positive' },
{ text: '场景2', title: '列表项结构类型相同-结构一', to: 'NoReuseScene2_StructureOnePositive' },
{ text: '场景2', title: '列表项结构类型相同-结构二... | AST#export_declaration#Left export AST#class_declaration#Left class CustomRoutes AST#class_body#Left { AST#property_declaration#Left static readonly ROUTES : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Route [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expressio... | export class CustomRoutes {
static readonly ROUTES: Route[] = [
{
title: '未使用组件复用',
child: [
{ text: '场景1', title: '列表项结构类型相同', to: 'NoReuseScene1Positive' },
{ text: '场景2', title: '列表项结构类型相同-结构一', to: 'NoReuseScene2_StructureOnePositive' },
{ text: '场景2', title: '列表项结构类型相同-结构二... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ComponentReuse/positive/src/main/ets/common/CustomRoutes.ets#L16-L36 | 37b8bdd80ff51525b84f590e0503fab6f67d1a8d | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index.ets | arkts | buildContactCard | 联系人卡片 | @Builder
buildContactCard(contact: Contact) {
Row({ space: 16 }) {
// 头像
Column() {
Text(contact.name.charAt(0))
.fontSize(18)
.fontWeight(FontWeight.Bold)
.fontColor(this.COLORS.whitePrimary)
}
.width(48)
.height(48)
.borderRadius(24)
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildContactCard AST#parameter_list#Left ( AST#parameter#Left contact : AST#type_annotation#Left AST#primary_type#Left Contact AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function... | @Builder
buildContactCard(contact: Contact) {
Row({ space: 16 }) {
Column() {
Text(contact.name.charAt(0))
.fontSize(18)
.fontWeight(FontWeight.Bold)
.fontColor(this.COLORS.whitePrimary)
}
.width(48)
.height(48)
.borderRadius(24)
.ba... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L2037-L2159 | 8d6b4403d7ec25a70fd82e22e93ff09f87bad809 | github |
wenfujing/honms-super-market.git | 0858abecd8be5db7b8dcf88dcd77b7c66d37517a | common/src/main/ets/utils/Utils.ets | arkts | Get id.
@returns id | export function getID() {
const date = Date.now()
const arr = `${date}`.split('')
arr.sort(() => (Math.random() - StyleConstants.HALF_ONE) > 0 ? 1 : StyleConstants.MINUS_ONE)
return arr.join('')
} | AST#export_declaration#Left export AST#function_declaration#Left function getID AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left date = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#... | export function getID() {
const date = Date.now()
const arr = `${date}`.split('')
arr.sort(() => (Math.random() - StyleConstants.HALF_ONE) > 0 ? 1 : StyleConstants.MINUS_ONE)
return arr.join('')
} | https://github.com/wenfujing/honms-super-market.git/blob/0858abecd8be5db7b8dcf88dcd77b7c66d37517a/common/src/main/ets/utils/Utils.ets#L60-L66 | 6d639067456b0e010ea8e8dda776b306d59d81c3 | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/ArkTS1.2/TabsSample/entry/src/main/ets/pages/tabContentOverFlow/TabContentOverFlow.ets | arkts | dragAnimation | 获取设备宽度 | private dragAnimation() {
this.getUIContext()?.animateTo({
duration: 300,
}, () => {
hilog.info(0x0000, 'testTag', 'animateTo动画触发');
this.isTouch = true;
});
} | AST#method_declaration#Left private dragAnimation AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Le... | private dragAnimation() {
this.getUIContext()?.animateTo({
duration: 300,
}, () => {
hilog.info(0x0000, 'testTag', 'animateTo动画触发');
this.isTouch = true;
});
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/TabsSample/entry/src/main/ets/pages/tabContentOverFlow/TabContentOverFlow.ets#L50-L57 | e2e9889f64af8fa60ff83397ff5870ec8bcbab8f | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/ModuleLoadingSideEffects/entry/src/main/ets/pages/ModifyGlobalObject/module.ets | arkts | [Start export_change_global_data_100] | export let data1 = 'data from module'; | AST#export_declaration#Left export AST#variable_declaration#Left let AST#variable_declarator#Left data1 = AST#expression#Left 'data from module' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export let data1 = 'data from module'; | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/ModuleLoadingSideEffects/entry/src/main/ets/pages/ModifyGlobalObject/module.ets#L17-L17 | 8536f4c9fda9379231f05c01a6bf2f48eff17f09 | gitee | |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/common/util/DimensionUtils.ets | arkts | getPx | 获取屏幕水平适配 px 值。
@param value 资源值
@return 适配后的 px 值 | static getPx(value: Resource): number {
let beforeVp = context.resourceManager.getNumber(value.id);
return DimensionUtil.adaptDimension(beforeVp);
} | AST#method_declaration#Left static getPx AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#R... | static getPx(value: Resource): number {
let beforeVp = context.resourceManager.getNumber(value.id);
return DimensionUtil.adaptDimension(beforeVp);
} | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/common/util/DimensionUtils.ets#L41-L44 | 86310853ed5ba3c243c4490cd64ba67949058f7e | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/timeto/TimeToManager.ets | arkts | TimeToType 枚举 | export enum TimeToType {
updateServerConfigs = "updateServerConfigs",
autoRefreshSubsciptionInfo = "autoRefreshSubsciptionInfo",
} | AST#export_declaration#Left export AST#enum_declaration#Left enum TimeToType AST#enum_body#Left { AST#enum_member#Left updateServerConfigs = AST#expression#Left "updateServerConfigs" AST#expression#Right AST#enum_member#Right , AST#enum_member#Left autoRefreshSubsciptionInfo = AST#expression#Left "autoRefreshSubsciptio... | export enum TimeToType {
updateServerConfigs = "updateServerConfigs",
autoRefreshSubsciptionInfo = "autoRefreshSubsciptionInfo",
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/timeto/TimeToManager.ets#L9-L12 | b94d165669029a2338339123901bc382ab0e2f85 | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | eftool/src/main/ets/ui/prompt/CustomDialog.ets | arkts | @Author csx
@DateTime 2024/6/11 12:37:06
@TODO CustomDialog 高级组件自定义弹框工具类
参考链接 https://developer.huawei.com/consumer/cn/forum/topic/0201150581656599021 | export class CustomDialog {
//完善弹框 参考https://gitee.com/harmonyos_samples/custom-dialog-gathers
//https://gitee.com/harmonyos_samples/component-collection
// https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-arkui-componentcontent-V5 API12
} | AST#export_declaration#Left export AST#class_declaration#Left class CustomDialog AST#class_body#Left { //完善弹框 参考https://gitee.com/harmonyos_samples/custom-dialog-gathers //https://gitee.com/harmonyos_samples/component-collection // https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-arkui-comp... | export class CustomDialog {
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/eftool/src/main/ets/ui/prompt/CustomDialog.ets#L24-L31 | 07a6ab367a18e5ab12d49832440e19a8ab70a9f2 | gitee | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Security/StringCipherArkTS/entry/src/main/ets/viewmodel/User.ets | arkts | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class User {
id: number | null;
username: string;
password: string;
authTag: string;
constructor(id: number | null, username: string, password: string, authTag: string) {
this.id = id;
this.username = username;
this.password = password;
this.authTag = authTag;
}
toString() {
r... | AST#export_declaration#Left export AST#class_declaration#Left class User AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#... | export class User {
id: number | null;
username: string;
password: string;
authTag: string;
constructor(id: number | null, username: string, password: string, authTag: string) {
this.id = id;
this.username = username;
this.password = password;
this.authTag = authTag;
}
toString() {
r... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Security/StringCipherArkTS/entry/src/main/ets/viewmodel/User.ets#L16-L32 | 48c678e040653a94c4b8f4e67e39718c9fbcac1c | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/secondfloorloadanimation/Index.ets | arkts | SecondFloorLoadAnimationComponent | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export { SecondFloorLoadAnimationComponent } from './src/main/ets/view/SecondFloorLoadAnimation'; | AST#export_declaration#Left export { SecondFloorLoadAnimationComponent } from './src/main/ets/view/SecondFloorLoadAnimation' ; AST#export_declaration#Right | export { SecondFloorLoadAnimationComponent } from './src/main/ets/view/SecondFloorLoadAnimation'; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/secondfloorloadanimation/Index.ets#L16-L16 | 99db6fa6abf54a80fd185317025496ebfcab2aad | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/ui/src/main/ets/component/modal/DictSelectModal.ets | arkts | getItemKey | 获取字典项 Key
@param {DictItem} item - 字典项
@param {number} index - 下标
@returns {string} Key | private getItemKey(item: DictItem, index: number): string {
const itemId: number | null | undefined = item.id;
if (itemId === null || itemId === undefined) {
return `${index}`;
}
return `${itemId}`;
} | AST#method_declaration#Left private getItemKey AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left DictItem AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_t... | private getItemKey(item: DictItem, index: number): string {
const itemId: number | null | undefined = item.id;
if (itemId === null || itemId === undefined) {
return `${index}`;
}
return `${itemId}`;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/ui/src/main/ets/component/modal/DictSelectModal.ets#L187-L193 | 712ea97df859ea290176093989591ff705d947b0 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/decodeheifimage/src/main/ets/model/WaterFlowData.ets | arkts | HEIF图片资源链接 | export const heifUrls: string[] = [
"https://gitee.com/harmonyos-cases/cases/raw/master/CommonAppDevelopment/feature/decodeheifimage/src/main/resources/base/media/image1.heic",
"https://gitee.com/harmonyos-cases/cases/raw/master/CommonAppDevelopment/feature/decodeheifimage/src/main/resources/base/media/image2.heic"... | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left heifUrls : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression... | export const heifUrls: string[] = [
"https://gitee.com/harmonyos-cases/cases/raw/master/CommonAppDevelopment/feature/decodeheifimage/src/main/resources/base/media/image1.heic",
"https://gitee.com/harmonyos-cases/cases/raw/master/CommonAppDevelopment/feature/decodeheifimage/src/main/resources/base/media/image2.heic"... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/decodeheifimage/src/main/ets/model/WaterFlowData.ets#L36-L43 | 7987f7fa0c3ff961b144909051f99333a5b308eb | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/ui/src/main/ets/component/address/AddressCard.ets | arkts | buildAddressHeader | 构建地址头部信息
@param {Address} address - 地址数据
@returns {void} 无返回值 | @Builder
private buildAddressHeader(address: Address): void {
RowSpaceBetweenCenter({
widthValue: P100,
paddingValue: $r("app.float.space_padding_medium")
}) {
Column() {
Text(this.buildRegionText(address))
.fontSize($r("app.float.headline_large"))
.fontColor($r("... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private buildAddressHeader AST#parameter_list#Left ( AST#parameter#Left address : AST#type_annotation#Left AST#primary_type#Left Address AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type... | @Builder
private buildAddressHeader(address: Address): void {
RowSpaceBetweenCenter({
widthValue: P100,
paddingValue: $r("app.float.space_padding_medium")
}) {
Column() {
Text(this.buildRegionText(address))
.fontSize($r("app.float.headline_large"))
.fontColor($r("... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/ui/src/main/ets/component/address/AddressCard.ets#L83-L116 | 5fe756ca24af9a7231b2708169c3768bcfcc01f8 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/backgroundblur/src/main/ets/pages/CustomTabsComponent.ets | arkts | TabContent组件 | build() {
Stack({ alignContent: Alignment.Bottom }) {
Tabs({ index: this.selectedIndex, barPosition: BarPosition.End, controller: this.controller }) {
ForEach(this.tabsInfoList, (item: TabInfo) => {
TabContent() {
item.tabContent.builder(item.title)
}
.expandS... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Stack ( AST#component_parameters#Left { AST#component_parameter#Left alignContent : AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right .... | build() {
Stack({ alignContent: Alignment.Bottom }) {
Tabs({ index: this.selectedIndex, barPosition: BarPosition.End, controller: this.controller }) {
ForEach(this.tabsInfoList, (item: TabInfo) => {
TabContent() {
item.tabContent.builder(item.title)
}
.expandS... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/backgroundblur/src/main/ets/pages/CustomTabsComponent.ets#L37-L96 | aa772490d7ad590ad6ef71c513be863ffde404bf | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/FileUtil.ets | arkts | readText | 基于文本方式读取文件(即直接读取文件的文本内容),使用Promise异步回调。
@param filePath 文件的应用沙箱路径。
@param options 支持如下选项:
offset,number类型,表示期望读取文件的位置。可选,默认从当前位置开始读取。
length,number类型,表示期望读取数据的长度。可选,默认文件长度。
encoding,string类型,当数据是 string 类型时有效,表示数据的编码方式,默认 'utf-8',仅支持 'utf-8'。
@returns | static readText(filePath: string, options?: ReadTextOptions): Promise<string> {
return fs.readText(filePath, options);
} | AST#method_declaration#Left static readText AST#parameter_list#Left ( AST#parameter#Left filePath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left ReadTextOptions A... | static readText(filePath: string, options?: ReadTextOptions): Promise<string> {
return fs.readText(filePath, options);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FileUtil.ets#L451-L453 | a9ebb6c12ef06f593cb573ba021252a5bd6e23cb | gitee |
JinnyWang-Space/guanlanwenjuan.git | 601c4aa6c427e643d7bf42bc21945f658738e38c | setting/src/main/ets/views/DotSheetBind.ets | arkts | DotSheetBind | 设置半模态页面 | @ComponentV2
export struct DotSheetBind {
// 获取应用上下文
@Local context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext;
// 在 PersistenceV2 中创建一个 type 为 AppViewModel 的键值对
@Local appBasicData: AppViewModel =
PersistenceV2.globalConnect({ type: AppViewModel, defaultCreat... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct DotSheetBind AST#component_body#Left { // 获取应用上下文 AST#property_declaration#Left AST#decorator#Left @ Local AST#decorator#Right context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common ... | @ComponentV2
export struct DotSheetBind {
@Local context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext;
@Local appBasicData: AppViewModel =
PersistenceV2.globalConnect({ type: AppViewModel, defaultCreator: () => new AppViewModel() })!;
@Local appAppearance... | https://github.com/JinnyWang-Space/guanlanwenjuan.git/blob/601c4aa6c427e643d7bf42bc21945f658738e38c/setting/src/main/ets/views/DotSheetBind.ets#L28-L294 | e4cbed07e0b784ad60ccdfbe9c1b970b5835353c | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/PieDataSet.ets | arkts | isUseValueColorForLineEnabled | @Override | public isUseValueColorForLineEnabled(): boolean {
return this.mUseValueColorForLine;
} | AST#method_declaration#Left public isUseValueColorForLineEnabled AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Le... | public isUseValueColorForLineEnabled(): boolean {
return this.mUseValueColorForLine;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/PieDataSet.ets#L193-L195 | 0adf22f2683387d1542d896446991cce14bfdb35 | gitee |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/Notification/CustomNotificationBadge/notification/src/main/ets/notification/NotificationContentUtil.ets | arkts | initNotificationConversationContent | init conversation notification content
@param basicContent
@return return the created NotificationContent | initNotificationConversationContent(basicContent: notification.NotificationBasicContent) {
let result: NotificationContentUtilResultType = {
contentType: notification.ContentType.NOTIFICATION_CONTENT_CONVERSATION, // 通知内容类型
normal: basicContent // 基本类型通知内容
};
return result;
} | AST#method_declaration#Left initNotificationConversationContent AST#parameter_list#Left ( AST#parameter#Left basicContent : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left notification . NotificationBasicContent AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#paramet... | initNotificationConversationContent(basicContent: notification.NotificationBasicContent) {
let result: NotificationContentUtilResultType = {
contentType: notification.ContentType.NOTIFICATION_CONTENT_CONVERSATION,
normal: basicContent
};
return result;
} | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Notification/CustomNotificationBadge/notification/src/main/ets/notification/NotificationContentUtil.ets#L117-L123 | de13ff472ca1bdc01b5fc0243ee5b3bc6ed0edfc | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_axios/src/main/ets/axios/EfAxiosError.ets | arkts | @Author csx
@DateTime 2024/8/12 22:45
@TODO EfAxiosError efAxios统一自定义异常
@Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_axios | export class EfAxiosError implements BusinessError {
/**
* 编码
*/
code: number;
/**
* 数据
*/
data?: void | undefined;
/**
* 名称
*/
name: string;
/**
* 消息
*/
message: string;
/**
* 堆栈信息
*/
stack?: string | undefined;
constructor(code: number, name: string, message: strin... | AST#export_declaration#Left export AST#class_declaration#Left class EfAxiosError AST#implements_clause#Left implements BusinessError AST#implements_clause#Right AST#class_body#Left { /**
* 编码
*/ AST#property_declaration#Left code : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#t... | export class EfAxiosError implements BusinessError {
code: number;
data?: void | undefined;
name: string;
message: string;
stack?: string | undefined;
constructor(code: number, name: string, message: string, stack?: string) {
this.code = code;
this.name = name;
this.message = mes... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_axios/src/main/ets/axios/EfAxiosError.ets#L27-L73 | 9fe0cf89f1a46c83d9cc9a6bf570c2825a0ecc3c | gitee | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.DialogV2.d.ets | arkts | AlertDialogV2 | Declare CustomDialog AlertDialogV2.
@struct { AlertDialogV2 }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 18 | @ComponentV2
export declare struct AlertDialogV2 {
/**
* Sets the AlertDialogV2 title.
*
* @type { ?ResourceStr }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 18
*/
@Param
primaryTitle?: ResourceStr;
/**
* Sets the AlertDialogV2 secondary titl... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct AlertDialogV2 AST#component_body#Left { /**
* Sets the AlertDialogV2 title.
*
* @type { ?ResourceStr }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatfo... | @ComponentV2
export declare struct AlertDialogV2 {
@Param
primaryTitle?: ResourceStr;
@Param
secondaryTitle?: ResourceStr;
@Require
@Param
content: ResourceStr;
@Param
primaryButton?: AdvancedDialogV2Button;
@Param
secondaryButton?: AdvancedDialogV2Button;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.DialogV2.d.ets#L558-L616 | e4fbee6b9c3eb6ea7d8993c7f59f16bce2872f9b | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/basedict/utils/BaseWordUtility.ets | arkts | BaseWordUtility | export class BaseWordUtility {
// 字符常量
private static readonly STR_POINT_HALF = "."; // 半角 点
private static readonly STR_OMIT_HALF = "..."; // 半角 三个点
private static readonly STR_OMIT_FULL = "……"; // 全角省略号
private static readonly STR_COMMA_HALF = ";"; // ①半角分号(;)
private static... | AST#export_declaration#Left export AST#class_declaration#Left class BaseWordUtility AST#class_body#Left { // 字符常量 AST#property_declaration#Left private static readonly STR_POINT_HALF = AST#expression#Left "." AST#expression#Right ; AST#property_declaration#Right // 半角 点 AST#property_declaration#Left private static read... | export class BaseWordUtility {
private static readonly STR_POINT_HALF = ".";
private static readonly STR_OMIT_HALF = "...";
private static readonly STR_OMIT_FULL = "……";
private static readonly STR_COMMA_HALF = ";";
private static readonly STR_COMMA_FULL = ";";
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/basedict/utils/BaseWordUtility.ets#L16-L260 | 4e17e8e9effab75c59e28b148328caf7173ae72e | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customdrawtabbar/Index.ets | arkts | CustomDrawTabbarComponent | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export { CustomDrawTabbarComponent } from './src/main/ets/view/Index'; | AST#export_declaration#Left export { CustomDrawTabbarComponent } from './src/main/ets/view/Index' ; AST#export_declaration#Right | export { CustomDrawTabbarComponent } from './src/main/ets/view/Index'; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customdrawtabbar/Index.ets#L16-L16 | acec46579f88f9c1392b5db546ca0537258b6005 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/util/src/main/ets/notification/NotificationUtil.ets | arkts | export | 通知生命周期管理 | export namespace Manager {
/**
* 取消已发布的通知
* 根据通知ID和标签取消已发布的通知,若标签为空,则取消与指定通知ID匹配的已发布通知。
* @param {number} id 通知ID
* @param {string} label 通知标签,默认为空
* @returns {Promise<void>} void
*/
export async | AST#export_declaration#Left export AST#ERROR#Left namespace Manager AST#ERROR#Right { /**
* 取消已发布的通知
* 根据通知ID和标签取消已发布的通知,若标签为空,则取消与指定通知ID匹配的已发布通知。
* @param {number} id 通知ID
* @param {string} label 通知标签,默认为空
* @returns {Promise<void>} void
*/ export as ync AST#export_declaration#Right | export namespace Manager {
export async | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/util/src/main/ets/notification/NotificationUtil.ets#L299-L307 | 566b6af7379477a2af43666230dd7eff7c04c187 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/viewmodel/CategoryViewModel.ets | arkts | clearSideBarUnlockTimer | 清理侧边栏联动解锁计时器
@returns {void} 无返回值 | private clearSideBarUnlockTimer(): void {
if (this.sideBarUnlockTimer >= 0) {
clearTimeout(this.sideBarUnlockTimer);
this.sideBarUnlockTimer = -1;
}
} | AST#method_declaration#Left private clearSideBarUnlockTimer AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#L... | private clearSideBarUnlockTimer(): void {
if (this.sideBarUnlockTimer >= 0) {
clearTimeout(this.sideBarUnlockTimer);
this.sideBarUnlockTimer = -1;
}
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/viewmodel/CategoryViewModel.ets#L169-L174 | 98e4de97a111a86f5c2549fba3d39ac1da9daaa8 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/shortcut/ShortcutManager.ets | arkts | removeExpiredShortcuts | 移除过期的快捷方式 | async removeExpiredShortcuts(): Promise<void> {
try {
const currentShortcuts = await shortcutManager.getShortcuts();
const shortcutsToRemove: string[] = [];
for (const shortcut of currentShortcuts) {
// 检查生日祝福类快捷方式是否过期
if (shortcut.id.startsWith('greeting_')) {
const con... | AST#method_declaration#Left async removeExpiredShortcuts AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AS... | async removeExpiredShortcuts(): Promise<void> {
try {
const currentShortcuts = await shortcutManager.getShortcuts();
const shortcutsToRemove: string[] = [];
for (const shortcut of currentShortcuts) {
if (shortcut.id.startsWith('greeting_')) {
const contactId = shortcut.... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/shortcut/ShortcutManager.ets#L252-L284 | e30343a3f00fd17e2376021696bb67e9c1145ecb | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/BaseDataSet.ets | arkts | getIndexInEntries | ###### ###### DATA RELATED METHODS ###### ###### | public getIndexInEntries(xIndex: number): number {
for (let i = 0; i < this.getEntryCount(); i++) {
if (xIndex == this.getEntryForIndex(i).getX()) {
return i;
}
}
return -1;
} | AST#method_declaration#Left public getIndexInEntries AST#parameter_list#Left ( AST#parameter#Left xIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#pri... | public getIndexInEntries(xIndex: number): number {
for (let i = 0; i < this.getEntryCount(); i++) {
if (xIndex == this.getEntryForIndex(i).getX()) {
return i;
}
}
return -1;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/BaseDataSet.ets#L395-L402 | c7df9f2054282509a5071fd85553d9b155dfbd7a | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/settings/SettingsService.ets | arkts | updatePrivacySettings | 更新隐私设置
@param privacySettings 隐私设置
@returns 更新后的隐私设置 | async updatePrivacySettings(privacySettings: Partial<PrivacySettings>): Promise<PrivacySettings> {
const updatedSettings = await this.updateSettings({ privacy: privacySettings });
return updatedSettings.privacy;
} | AST#method_declaration#Left async updatePrivacySettings AST#parameter_list#Left ( AST#parameter#Left privacySettings : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Partial AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left PrivacySettings AST#primary_type#Right AST#type_ann... | async updatePrivacySettings(privacySettings: Partial<PrivacySettings>): Promise<PrivacySettings> {
const updatedSettings = await this.updateSettings({ privacy: privacySettings });
return updatedSettings.privacy;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/settings/SettingsService.ets#L239-L242 | 16d4f29251f7600e28b6a9c223260c427e884421 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Speech/Recorder/SpeechRecordDbAccessor.ets | arkts | refreshDbs | 用于恢复数据时检查是否有新表 | refreshDbs(): void {
this.createDbIfNeeds();
} | AST#method_declaration#Left refreshDbs AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Le... | refreshDbs(): void {
this.createDbIfNeeds();
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Speech/Recorder/SpeechRecordDbAccessor.ets#L85-L87 | 8bfbe04eb6d4e3ee90191c4f4d02ccb6384638d2 | github |
sea5241/PictureSelector | 09bac407ebd61100d1ccbf6e6d3b6349cb0013d7 | selector/src/main/ets/model/MediaDataParams.ets | arkts | 媒体文件参数
@Author sea
@Date 2024/7/8 | export class MediaDataParams {
mediaDataList: object
mediaDataListCount:number
constructor | AST#export_declaration#Left export AST#ERROR#Left class MediaDataParams { mediaDataList AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left object AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right AST#ERROR#Left mediaData List Count AST#ERROR#Right : number AST#ERROR#Right AST#variable_declar... | export class MediaDataParams {
mediaDataList: object
mediaDataListCount:number
constructor | https://github.com/sea5241/PictureSelector/blob/09bac407ebd61100d1ccbf6e6d3b6349cb0013d7/selector/src/main/ets/model/MediaDataParams.ets#L6-L9 | df2c14d06847a05c56020c6e37fd790b9a1eb9cd | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/contacts/ContactEditPage.ets | arkts | loadContact | 加载联系人数据 | private async loadContact() {
try {
this.isLoading = true;
// 等待数据库初始化
if (!this.databaseService.isDbInitialized()) {
let waitCount = 0;
while (!this.databaseService.isDbInitialized() && waitCount < 50) {
await new Promise<void>((resolve: () => void) => setTimeout(resolve... | AST#method_declaration#Left private async loadContact AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_ex... | private async loadContact() {
try {
this.isLoading = true;
if (!this.databaseService.isDbInitialized()) {
let waitCount = 0;
while (!this.databaseService.isDbInitialized() && waitCount < 50) {
await new Promise<void>((resolve: () => void) => setTimeout(resolve, 100));
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/contacts/ContactEditPage.ets#L104-L128 | bb944a65160c00cec38bd181d5f0775f6a004fb8 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/timeto/TimeToManager.ets | arkts | clearAllSavedTime | 清空所有已保存的时间和结果 | public static clearAllSavedTime(): void {
try {
const prefs = TimeToManager._getPrefs();
const allKeys = Object.keys(prefs.getAllSync());
for (const key of allKeys) {
prefs.putSync(key, '');
}
prefs.flushSync();
DebugLog.d('cleared all savedTime');
} catch (err) {
... | AST#method_declaration#Left public static clearAllSavedTime AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#... | public static clearAllSavedTime(): void {
try {
const prefs = TimeToManager._getPrefs();
const allKeys = Object.keys(prefs.getAllSync());
for (const key of allKeys) {
prefs.putSync(key, '');
}
prefs.flushSync();
DebugLog.d('cleared all savedTime');
} catch (err) {
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/timeto/TimeToManager.ets#L144-L156 | 7695e24922d32cb598aad20be3376308eaa65306 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/verticalhorizontallinkage/src/main/ets/view/VerticalAndHorizontalList.ets | arkts | rightFixedTitle | 底部右侧纵向滚动的标题
@param index 索引值 | @Builder
rightFixedTitle(index: number) {
Text(index === 0 ? $r('app.string.vertical_horizontal_linkage_bottom_right_title_initial_content') :
$r('app.string.vertical_horizontal_linkage_bottom_right_title_content'))
.fontWeight(FontWeight.Bold)
.height($r('app.string.vertical_horizontal_linkage_fi... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right rightFixedTitle AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_bod... | @Builder
rightFixedTitle(index: number) {
Text(index === 0 ? $r('app.string.vertical_horizontal_linkage_bottom_right_title_initial_content') :
$r('app.string.vertical_horizontal_linkage_bottom_right_title_content'))
.fontWeight(FontWeight.Bold)
.height($r('app.string.vertical_horizontal_linkage_fi... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/verticalhorizontallinkage/src/main/ets/view/VerticalAndHorizontalList.ets#L318-L333 | 9daff47e0f66abcc234d9b7a17e76a5e9704621f | gitee |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/animation/NavAnimationMgr.ets | arkts | 路由转场动画管理 | export class NavAnimationStore {
private static delegate = new NavAnimationStore();
private interactive: boolean = false;
private proxy: NavigationTransitionProxy | undefined = undefined;
private operation: NavigationOperation = NavigationOperation.PUSH
// 根据 页面对象唯一标识 设置/获取 modifier 和 pageId
private navCont... | AST#export_declaration#Left export AST#class_declaration#Left class NavAnimationStore AST#class_body#Left { AST#property_declaration#Left private static delegate = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left NavAnimationStore AST#expression#Right AST#... | export class NavAnimationStore {
private static delegate = new NavAnimationStore();
private interactive: boolean = false;
private proxy: NavigationTransitionProxy | undefined = undefined;
private operation: NavigationOperation = NavigationOperation.PUSH
private navContextMap: Map<string, NavAnimatePageInfo... | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/animation/NavAnimationMgr.ets#L246-L650 | 59d1da473867ac9d9389516b71bf614fcffe1c82 | gitee | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/model/src/main/ets/entity/Auth.ets | arkts | isRefreshTokenExpired | 检查刷新令牌是否过期
@returns {boolean} 是否过期 | isRefreshTokenExpired(): boolean {
const currentTime: number = Date.now();
const expirationTime: number = this.createdAt + this.refreshExpire * 1000;
return currentTime >= expirationTime;
} | AST#method_declaration#Left isRefreshTokenExpired AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left ... | isRefreshTokenExpired(): boolean {
const currentTime: number = Date.now();
const expirationTime: number = this.createdAt + this.refreshExpire * 1000;
return currentTime >= expirationTime;
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/model/src/main/ets/entity/Auth.ets#L66-L70 | cfdafd94ba2837a76730ccb32b42c86fd998e1f0 | github |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/view/AvatarComponent.ets | arkts | startSwayAnimation | 摇摆动画 - 微妙的旋转(更慢更自然) | private startSwayAnimation() {
clearInterval(this.swayTimer);
let swayPhase = 0;
this.swayTimer = setInterval(() => {
swayPhase += 0.01; // 更慢的速度
// 更微妙的旋转 ±0.3度
this.swayRotate = Math.sin(swayPhase) * 0.3;
}, 120);
} | AST#method_declaration#Left private startSwayAnimation AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_custom_component_statement#Left clearInterval ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . swayTimer AST#member_expressi... | private startSwayAnimation() {
clearInterval(this.swayTimer);
let swayPhase = 0;
this.swayTimer = setInterval(() => {
swayPhase += 0.01;
this.swayRotate = Math.sin(swayPhase) * 0.3;
}, 120);
} | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/view/AvatarComponent.ets#L258-L266 | b1f18432e082dc6fd752144ad105e25473398005 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/ShareUtils.ets | arkts | shareImage | 分享图片
@param imagePath - 图片路径
@param summary - 描述(可选) | static shareImage(imagePath: string, summary?: string): void {
const uri = fileUri.getUriFromPath(imagePath);
const data = new systemShare.SharedData({
utd: utd.UniformDataType.IMAGE,
uri: uri
});
if (summary) {
data.addRecord({
utd: utd.UniformDataType.PLAIN_TEXT,
con... | AST#method_declaration#Left static shareImage AST#parameter_list#Left ( AST#parameter#Left imagePath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left summary ? : AST#type_annotation#Left AST#primary_type#Left string AST#pri... | static shareImage(imagePath: string, summary?: string): void {
const uri = fileUri.getUriFromPath(imagePath);
const data = new systemShare.SharedData({
utd: utd.UniformDataType.IMAGE,
uri: uri
});
if (summary) {
data.addRecord({
utd: utd.UniformDataType.PLAIN_TEXT,
con... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/ShareUtils.ets#L200-L215 | 6c50ac66e56b1593f305461c2b3016d9a5bdd48a | github |
JackJiang2011/harmonychat.git | bca3f3e1ce54d763720510f99acf595a49e37879 | entry/src/main/ets/pages/components/msg_view/MsgTimeView.ets | arkts | MsgTimeView | 聊天消息时间显示组件。
@author Jack Jiang(http://www.52im.net/thread-2792-1-1.html) | @Component
export struct MsgTimeView {
message?: Message;
build() {
// 需要显示消息时间的才显示,否则不需要显示
if (this.message?.showTopTime) {
Text(ToolKits.getTimeStringAutoShort2(this.message.date, true, true))
.fontSize(12)
.fontColor('#979ca6')
.margin({bottom: 13})
}
}
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct MsgTimeView AST#component_body#Left { AST#property_declaration#Left message ? : AST#type_annotation#Left AST#primary_type#Left Message AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right ... | @Component
export struct MsgTimeView {
message?: Message;
build() {
if (this.message?.showTopTime) {
Text(ToolKits.getTimeStringAutoShort2(this.message.date, true, true))
.fontSize(12)
.fontColor('#979ca6')
.margin({bottom: 13})
}
}
} | https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/pages/components/msg_view/MsgTimeView.ets#L19-L32 | 6ce9fbbc85463c92efd76e9a5e569caeff723fd4 | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | WebDevelopOptimizationRender/entry/src/main/ets/pages/common.ets | arkts | makeNode | 必须要重写的方法,用于构建节点数、返回节点挂载在对应NodeContainer中 在对应NodeContainer创建的时候调用、或者通过rebuild方法调用刷新 | makeNode(uiContext: UIContext): FrameNode | null {
console.info(' uicontext is undifined : ' + (uiContext === undefined));
if (this.rootnode != null) {
const parent = this.rootnode.getFrameNode()?.getParent();
if (parent) {
console.info(JSON.stringify(parent.getInspectorInfo()));
par... | AST#method_declaration#Left makeNode AST#parameter_list#Left ( AST#parameter#Left uiContext : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Fram... | makeNode(uiContext: UIContext): FrameNode | null {
console.info(' uicontext is undifined : ' + (uiContext === undefined));
if (this.rootnode != null) {
const parent = this.rootnode.getFrameNode()?.getParent();
if (parent) {
console.info(JSON.stringify(parent.getInspectorInfo()));
par... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/WebDevelopOptimizationRender/entry/src/main/ets/pages/common.ets#L42-L58 | 164fd2c33010b760f2c93bb364fd3e3a60cccbe3 | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | entry/src/main/ets/pages/example/lottie/LottieView.ets | arkts | addEventListener | 添加侦听事件, 事件完成后会触发指定回调函数
@param name 事件名称, 有效范围见AnimationEventName声明
@param AnimationEventCallback 用户自定义回调函数
@since 8
@design | addEventListener<T extends AnimationEventName>(name: T,
callback: AnimationEventCallback<AnimationEventsIndexed<T>>) {
this.animationItem?.addEventListener(name, callback)
} | AST#method_declaration#Left addEventListener AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left AnimationEventName AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left n... | addEventListener<T extends AnimationEventName>(name: T,
callback: AnimationEventCallback<AnimationEventsIndexed<T>>) {
this.animationItem?.addEventListener(name, callback)
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/entry/src/main/ets/pages/example/lottie/LottieView.ets#L312-L315 | f4874da60e29562356ef27e6479f09781e613602 | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/utils/ScreenUtils.ets | arkts | px2dp | 像素转DP | static px2dp(px: number): number {
return px / (ScreenUtils.getDensity() / 160);
} | AST#method_declaration#Left static px2dp AST#parameter_list#Left ( AST#parameter#Left px : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right ... | static px2dp(px: number): number {
return px / (ScreenUtils.getDensity() / 160);
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/ScreenUtils.ets#L45-L47 | 7d10cd78c5bd10be19cac409f1281f6f1464c960 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/feedback/src/main/ets/navigation/FeedbackGraph.ets | arkts | @file 反馈模块导航图
@author Joker.X | export class FeedbackGraph implements RouteGraph {
/**
* 注册反馈模块导航路由
*/
register(): void {
RouteBuild.register(FeedbackRoutes.List, wrapBuilder(FeedbackListNav));
RouteBuild.register(FeedbackRoutes.Submit, wrapBuilder(FeedbackSubmitNav));
}
} | AST#export_declaration#Left export AST#class_declaration#Left class FeedbackGraph AST#implements_clause#Left implements RouteGraph AST#implements_clause#Right AST#class_body#Left { /**
* 注册反馈模块导航路由
*/ AST#method_declaration#Left register AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#L... | export class FeedbackGraph implements RouteGraph {
register(): void {
RouteBuild.register(FeedbackRoutes.List, wrapBuilder(FeedbackListNav));
RouteBuild.register(FeedbackRoutes.Submit, wrapBuilder(FeedbackSubmitNav));
}
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/feedback/src/main/ets/navigation/FeedbackGraph.ets#L10-L18 | 34d4fb6b8081f4aafb6a7e6ae54110933d26dcbb | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets | arkts | notifyDataChange | 通知控制器数据变化 | notifyDataChange(index: number): void {
this.listeners.forEach(listener => {
listener.onDataChange(index);
})
} | AST#method_declaration#Left notifyDataChange AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#R... | notifyDataChange(index: number): void {
this.listeners.forEach(listener => {
listener.onDataChange(index);
})
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets#L47-L51 | 7dab0316bb00a4570486856f37300fae3b92a345 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/app/views/LinkText.ets | arkts | getLinkParts | ---------- 私有方法:文本分割逻辑 ----------
将原始文本分割为链接/普通片段
@returns 分割后的文本片段数组 | private getLinkParts(): TextSegment[] {
// 无链接文本时返回完整普通文本
if (this.linkTexts.length === 0) {
return [{ text: this.content, isLink: false }];
}
const segments: TextSegment[] = [];
let remainingText = this.content;
while (remainingText !== '') {
let foundLink = false;
// 按顺序检查... | AST#method_declaration#Left private getLinkParts AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TextSegment [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // 无链接文本时返回完整普通文本 AST#statement#Left... | private getLinkParts(): TextSegment[] {
if (this.linkTexts.length === 0) {
return [{ text: this.content, isLink: false }];
}
const segments: TextSegment[] = [];
let remainingText = this.content;
while (remainingText !== '') {
let foundLink = false;
for (const linkTex... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/LinkText.ets#L59-L100 | 7d2d301c82684a019a17725ac162ef54e4c2fa4d | github |
ashcha0/line-inspection-terminal-frontend_arkts.git | c82616097e8a3b257b7b01e75b6b83ce428b518c | entry/src/main/ets/services/FlawService.ets | arkts | 故障缺陷接口定义 | export interface AgvFlaw {
id: number;
taskId: number;
round: number;
flawType: string;
flawName: string;
flawDesc: string;
flawDistance: number;
flawImage: string;
flawImageUrl: string;
flawRtsp: string;
shown: boolean;
confirmed: boolean;
uploaded: boolean;
createTime: Date;
remark?: str... | AST#export_declaration#Left export AST#interface_declaration#Left interface AgvFlaw AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left taskId : AST#type_annotation#Left AST#p... | export interface AgvFlaw {
id: number;
taskId: number;
round: number;
flawType: string;
flawName: string;
flawDesc: string;
flawDistance: number;
flawImage: string;
flawImageUrl: string;
flawRtsp: string;
shown: boolean;
confirmed: boolean;
uploaded: boolean;
createTime: Date;
remark?: str... | https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/FlawService.ets#L5-L27 | b96d8d0f494c7103bd7d8f8ab83aa873a8f523d3 | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/util/CryptoSyncUtil.ets | arkts | convertPubKeyFromStr | 将非对称加密字符串pubKey转换为symKey对象
@param publicKey字符串key
@param symAlgName 秘钥规格
@param keyName 密钥长度
@param keyCoding 公钥的编码方式(utf8/hex/base64)
@returns | static convertPubKeyFromStr(publicKey: string, symAlgName: string, keyName: number,
keyCoding: buffer.BufferEncoding) {
let symKeyBlob: crypto.DataBlob = { data: StrAndUintUtil.strKey2Uint8Array(publicKey, keyName, keyCoding) };
let aesGenerator = crypto.createAsyKeyGenerator(symAlgName);
let symKey = a... | AST#method_declaration#Left static convertPubKeyFromStr AST#parameter_list#Left ( AST#parameter#Left publicKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symAlgName : AST#type_annotation#Left AST#primary_type#Left str... | static convertPubKeyFromStr(publicKey: string, symAlgName: string, keyName: number,
keyCoding: buffer.BufferEncoding) {
let symKeyBlob: crypto.DataBlob = { data: StrAndUintUtil.strKey2Uint8Array(publicKey, keyName, keyCoding) };
let aesGenerator = crypto.createAsyKeyGenerator(symAlgName);
let symKey = a... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/CryptoSyncUtil.ets#L36-L42 | 06a312b227d87395289fd1e59b497d1bce175e30 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_web/src/main/ets/arkweb/ArkWebHelper.ets | arkts | getContext | 获取上下文,common.UIAbilityContext
@returns | static getContext(): common.UIAbilityContext {
if (!ArkWebHelper.context) {
ArkWebHelper.context = getContext() as common.UIAbilityContext; //兜底
Tools.logError("请在UIAbility的onCreate方法中调用ArkWebHelper的init方法初始化!");
}
return ArkWebHelper.context;
} | AST#method_declaration#Left static getContext AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_... | static getContext(): common.UIAbilityContext {
if (!ArkWebHelper.context) {
ArkWebHelper.context = getContext() as common.UIAbilityContext;
Tools.logError("请在UIAbility的onCreate方法中调用ArkWebHelper的init方法初始化!");
}
return ArkWebHelper.context;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/arkweb/ArkWebHelper.ets#L41-L47 | bfdf19d6c38f6ada7e3cb4d736541aa8944b9213 | gitee |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/entry/src/main/ets/pages/practice/PracticePage.ets | arkts | practiceTodayType | ***********************************今日训练时长卡片*******************************************888 | @Builder
practiceTodayType(isTime:boolean){
Column() {
Row() {
Text((isTime===true)?'今日训练时长':'燃烧卡路里')
.fontSize(20)
.fontWeight(400)
.fontColor('#333333') // 标题颜色为黑色
.margin({ left: 10 })
Image('/image/practice/RightArrow.png')
.fillColor('#3... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right practiceTodayType AST#parameter_list#Left ( AST#parameter#Left isTime : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function... | @Builder
practiceTodayType(isTime:boolean){
Column() {
Row() {
Text((isTime===true)?'今日训练时长':'燃烧卡路里')
.fontSize(20)
.fontWeight(400)
.fontColor('#333333')
.margin({ left: 10 })
Image('/image/practice/RightArrow.png')
.fillColor('#333333')
... | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/practice/PracticePage.ets#L56-L102 | 7084696c7ce2ddb3320d28b1bd814f9084ba1cbd | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/demo/src/main/ets/view/LocalStoragePage.ets | arkts | normalizeFieldValue | 规范化输入框值为字符串
@param {IBestFieldValueType} value - 输入框值
@returns {string} 处理后的字符串 | private normalizeFieldValue(value: IBestFieldValueType): string {
if (typeof value === "string" || typeof value === "number") {
return `${value}`;
}
return "";
} | AST#method_declaration#Left private normalizeFieldValue AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left IBestFieldValueType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left... | private normalizeFieldValue(value: IBestFieldValueType): string {
if (typeof value === "string" || typeof value === "number") {
return `${value}`;
}
return "";
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/LocalStoragePage.ets#L118-L123 | c1af50d5e85f7141332e69fafb5da0fabfa0b1ab | github |
tomorrowKreswell/Ledger.git | 1f2783ae70b8540d677af8a27f29db1b4089ea69 | ledger/entry/src/main/ets/common/database/Rdb.ets | arkts | getRdbStore | 获取关系型数据库存储对象
@param callback - 获取成功后的回调函数 | getRdbStore(callback: Function = () => {
}): void {
// 如果回调函数未提供,记录警告信息
if (!callback || typeof callback === 'undefined' || callback === undefined) {
Logger.info(CommonConstants.RDB_TAG, 'getRdbStore() has no callback!');
return;
}
// 如果 rdbStore 已存在,直接调用回调函数并返回
if (this.rdbStore !== ... | AST#method_declaration#Left getRdbStore AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left Function AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#expression#Le... | getRdbStore(callback: Function = () => {
}): void {
if (!callback || typeof callback === 'undefined' || callback === undefined) {
Logger.info(CommonConstants.RDB_TAG, 'getRdbStore() has no callback!');
return;
}
if (this.rdbStore !== null) {
Logger.info(CommonConstants.RDB_TAG... | https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/common/database/Rdb.ets#L33-L67 | 611370eec3ba2c30286f58ee794904995af95fd7 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/contacts/ContactEditPage.ets | arkts | buildLunarBirthdayInput | 构建农历生日录入 | @Builder
buildLunarBirthdayInput() {
Column({ space: 16 }) {
// 农历月份和日期
Row({ space: 16 }) {
Column({ space: 8 }) {
Text('农历月份')
.fontSize(16)
.fontColor('#333333')
Select(this.getLunarMonthOptions() as SelectOptionItem[])
.sel... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildLunarBirthdayInput AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#compo... | @Builder
buildLunarBirthdayInput() {
Column({ space: 16 }) {
Row({ space: 16 }) {
Column({ space: 8 }) {
Text('农历月份')
.fontSize(16)
.fontColor('#333333')
Select(this.getLunarMonthOptions() as SelectOptionItem[])
.selected(this... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/contacts/ContactEditPage.ets#L664-L783 | a3cb6ef9db45d779568b718b9f9c52aa912a0a69 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/components/MonthDataSource.ets | arkts | addData | 改变单个数据。
@param {number} index - 索引值。
@param {CustomDataType} data - 修改后的值。 | public addData(index: number, data: Month): void {
this.dataArray.splice(index, 0, data);
this.notifyDataAdd(index);
} | AST#method_declaration#Left public addData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Month AST#primary_type#Rig... | public addData(index: number, data: Month): void {
this.dataArray.splice(index, 0, data);
this.notifyDataAdd(index);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/components/MonthDataSource.ets#L118-L121 | 8764cf66c95e1fb9f0fa64435fa2ad76627c3edd | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/analogclock/src/main/ets/pages/AnalogClockComponent.ets | arkts | paintDial | 绘制表盘 | private paintDial() {
this.renderContext.beginPath();
if (this.clockPixelMap) {
this.renderContext.drawImage(
this.clockPixelMap,
-this.clockRadius,
-this.clockRadius,
this.canvasSize,
this.canvasSize);
} else {
logger.error('clockPixelMap is null!');
... | AST#method_declaration#Left private paintDial AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left... | private paintDial() {
this.renderContext.beginPath();
if (this.clockPixelMap) {
this.renderContext.drawImage(
this.clockPixelMap,
-this.clockRadius,
-this.clockRadius,
this.canvasSize,
this.canvasSize);
} else {
logger.error('clockPixelMap is null!');
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/analogclock/src/main/ets/pages/AnalogClockComponent.ets#L191-L203 | 7e5fd5f009dbfcd6173060007895cf7c0a608d20 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Notification/CustomNotification/notification/src/main/ets/notification/NotificationUtil.ets | arkts | publishNotification | @param notificationRequest
@param id, Support specifying notification id when publishing notifications | async publishNotification(notificationRequest: notification.NotificationRequest, id?: number) {
if (id && id > 0) {
notificationRequest.id = id;
}
try {
let notificationSlot: notification.NotificationSlot = {
type: notification.SlotType.CONTENT_INFORMATION,
level: notification.Sl... | AST#method_declaration#Left async publishNotification AST#parameter_list#Left ( AST#parameter#Left notificationRequest : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left notification . NotificationRequest AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right... | async publishNotification(notificationRequest: notification.NotificationRequest, id?: number) {
if (id && id > 0) {
notificationRequest.id = id;
}
try {
let notificationSlot: notification.NotificationSlot = {
type: notification.SlotType.CONTENT_INFORMATION,
level: notification.Sl... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Notification/CustomNotification/notification/src/main/ets/notification/NotificationUtil.ets#L53-L80 | 41d1f702f778d9cdc2bbf33b2b263a3441c540dc | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/DialogHelper.ets | arkts | showCustomContentDialog | 显示自定义内容区弹出框,同时支持定义操作区按钮样式。 | static showCustomContentDialog(options: CustomContentOptions): string {
ActionParameter.initBaseDefault(options);
ActionParameter.initDialogDefault(options);
ActionParameter.initAlertTitle(options);
ActionParameter.initButtons(options, false);
const dialogId = ActionBaseCore.getInstance().openCustom... | AST#method_declaration#Left static showCustomContentDialog AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left CustomContentOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_typ... | static showCustomContentDialog(options: CustomContentOptions): string {
ActionParameter.initBaseDefault(options);
ActionParameter.initDialogDefault(options);
ActionParameter.initAlertTitle(options);
ActionParameter.initButtons(options, false);
const dialogId = ActionBaseCore.getInstance().openCustom... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogHelper.ets#L221-L228 | dd8655e1eace62c426854e58dcf01592b45c8b8f | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/danmakuplayer/src/main/ets/model/DanmakuData.ets | arkts | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export const sourceData = '['
+
'{"DanmakuType":1,"alphaDuration":0,"beginAlpha":0,"beginX":0,"beginY":0,"duration":0,"endAlpha":0,"endX":0,"endY":0,"index":1,"isQuadraticEaseOut":false,"rotationY":0,"rotationZ":0,"text":"一起抖呗","textColor":-16777216,"textShadowColor":-1,"textSize":25,"time":6505,"timeOffset":0,"transla... | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left sourceData = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left... | export const sourceData = '['
+
'{"DanmakuType":1,"alphaDuration":0,"beginAlpha":0,"beginX":0,"beginY":0,"duration":0,"endAlpha":0,"endX":0,"endY":0,"index":1,"isQuadraticEaseOut":false,"rotationY":0,"rotationZ":0,"text":"一起抖呗","textColor":-16777216,"textShadowColor":-1,"textSize":25,"time":6505,"timeOffset":0,"transla... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/danmakuplayer/src/main/ets/model/DanmakuData.ets#L15-L64 | dad96aeb6fc1b016e122c7fa0610833ae1892215 | gitee | |
YShelter/Accouting_ArkTS.git | 8c663c85f2c11738d4eabf269c23dc1ec84eb013 | entry/src/main/ets/common/database/Rdb/RdbUtils.ets | arkts | query | 查询数据 | query(rdbPredicates: dataRdb.RdbPredicates, columns?: Array<string>): Promise<dataRdb.ResultSet> {
return this.getDb().then(dbHelper => {
return dbHelper.query(rdbPredicates, columns);
})
} | AST#method_declaration#Left query AST#parameter_list#Left ( AST#parameter#Left rdbPredicates : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left dataRdb . RdbPredicates AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left columns ? : AST... | query(rdbPredicates: dataRdb.RdbPredicates, columns?: Array<string>): Promise<dataRdb.ResultSet> {
return this.getDb().then(dbHelper => {
return dbHelper.query(rdbPredicates, columns);
})
} | https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Rdb/RdbUtils.ets#L99-L103 | b81e558e15cf8fa0c9689e2036ec3a7cc743ea59 | github |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_picker/ace_ets_module_picker_api12/entry/src/main/ets/MainAbility/pages/Slider/XcomponentSlider/XcomponentSlider20.ets | arkts | buildSlider20 | Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | @Builder function buildSlider20(config: SliderConfiguration) {
Row() {
Column({space: 30}) {
Button('增加').onClick(() => {
config.value = config.value + config.step
config.triggerChange(config.value, SliderChangeMode.Click)
})
.width(100)
.height(25)
.fontSize(10... | AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function buildSlider20 AST#parameter_list#Left ( AST#parameter#Left config : AST#type_annotation#Left AST#primary_type#Left SliderConfiguration AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_li... | @Builder function buildSlider20(config: SliderConfiguration) {
Row() {
Column({space: 30}) {
Button('增加').onClick(() => {
config.value = config.value + config.step
config.triggerChange(config.value, SliderChangeMode.Click)
})
.width(100)
.height(25)
.fontSize(10... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_picker/ace_ets_module_picker_api12/entry/src/main/ets/MainAbility/pages/Slider/XcomponentSlider/XcomponentSlider20.ets#L16-L67 | 51d4089cc76a675b866b96874fe7a58319a8c89f | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/app/constants/AppDefault.ets | arkts | 应用默认配置常量类 | export class AppDefault {
// 卡片形状配置
// static readonly isCardCircle : boolean = false;
// 书籍默认索引
// static readonly InitialBookIndex : number = 2;
// 发音配置
// static readonly isAutoPron : boolean = false;
// static readonly cardSoundPlaying... | AST#export_declaration#Left export AST#class_declaration#Left class AppDefault AST#class_body#Left { // 卡片形状配置 // static readonly isCardCircle : boolean = false; // 书籍默认索引 // static readonly InitialBookIndex : number = 2; // 发音配置 // static readonly isAutoPron : boolean... | export class AppDefault {
卡片状态
static readonly isCardFlipped : boolean = false;
卡片样式
static readonly cardTypeFront : CardType = CardType.one; expZwPyEn;
static readonly cardTypeBack : CardType = CardType.memo;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/constants/AppDefault.ets#L4-L21 | 79bcc6af9b483d8ef46bbd7f946bcdc686cf2911 | github | |
iotjin/JhHarmonyDemo.git | 819e6c3b1db9984c042a181967784550e171b2e8 | JhCommon/src/main/ets/JhCommon/components/JhProgressHUD.ets | arkts | initConfig | / 初始化Loading(在 windowStage.loadContent 后执行初始化) | public static initConfig(windowStage: window.WindowStage) {
const context = windowStage.getMainWindowSync().getUIContext()
JhProgressHUD.initXTPromptHUDConfig(context)
} | AST#method_declaration#Left public static initConfig AST#parameter_list#Left ( AST#parameter#Left windowStage : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . WindowStage AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#R... | public static initConfig(windowStage: window.WindowStage) {
const context = windowStage.getMainWindowSync().getUIContext()
JhProgressHUD.initXTPromptHUDConfig(context)
} | https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/components/JhProgressHUD.ets#L28-L31 | cd60e0e572ac34d6ce2dc0abda087caa502f1f27 | github |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/DeviceManagement/DeviceManagementCollection/feature/menuitems/src/main/ets/components/MainItem.ets | arkts | MainItem | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Component
export struct MainItem {
private title?: string | Resource;
@LocalStorageProp('isSplitMode') isSplitMode: boolean = false;
@State isTouched: boolean = false;
build() {
Row() {
Text(this.title)
.fontSize(20)
.lineHeight(22)
.fontWeight(FontWeight.Medium)
.fon... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct MainItem AST#component_body#Left { AST#property_declaration#Left private title ? : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#... | @Component
export struct MainItem {
private title?: string | Resource;
@LocalStorageProp('isSplitMode') isSplitMode: boolean = false;
@State isTouched: boolean = false;
build() {
Row() {
Text(this.title)
.fontSize(20)
.lineHeight(22)
.fontWeight(FontWeight.Medium)
.fon... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/DeviceManagement/DeviceManagementCollection/feature/menuitems/src/main/ets/components/MainItem.ets#L16-L52 | 7afc65f8b92fdb3eb90df5669e10a025c70b4c3b | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/database/GreetingHistoryDAO.ets | arkts | getAllGreetingHistory | 获取所有祝福记录
@returns 祝福历史数组 | async getAllGreetingHistory(): Promise<GreetingHistoryEntity[]> {
const rdbStore = this.dbManager.getRdbStore();
if (!rdbStore) {
throw new Error('Database not initialized');
}
try {
const predicates = new relationalStore.RdbPredicates('greeting_history');
predicates.orderByDesc('sent... | AST#method_declaration#Left async getAllGreetingHistory AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left GreetingHistoryEntity [ ] AST#array_typ... | async getAllGreetingHistory(): Promise<GreetingHistoryEntity[]> {
const rdbStore = this.dbManager.getRdbStore();
if (!rdbStore) {
throw new Error('Database not initialized');
}
try {
const predicates = new relationalStore.RdbPredicates('greeting_history');
predicates.orderByDesc('sent... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/database/GreetingHistoryDAO.ets#L123-L144 | 3dee905fdf2ba39555a0226ea939b3b87c33ad90 | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/navigation/src/main/ets/RouteBuild.ets | arkts | register | 注册路由
@param name 路由名称
@param builder 路由构建器 | static register(name: string, builder: WrappedBuilder<[]>) {
RouteBuild.builderMap.set(name, builder);
} | AST#method_declaration#Left static register AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left builder : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left W... | static register(name: string, builder: WrappedBuilder<[]>) {
RouteBuild.builderMap.set(name, builder);
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/navigation/src/main/ets/RouteBuild.ets#L13-L15 | dded3fbf5ae0d22c7e3db539d40efe728d098731 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/bluetoothSample/entry/src/main/ets/bluetoothService/BluetoothScan.ets | arkts | onScanResult | 1 订阅扫描结果 | public onScanResult() {
ble.on('BLEDeviceFind', (data: Array<ble.ScanResult>) => {
if (data.length > 0) {
console.info(TAG, 'BLE scan result = ' + data[0].deviceId);
this.parseScanResult(data[0].data);
// [StartExclude open_close_scan]
this.toastReport.showResult(data[0].device... | AST#method_declaration#Left public onScanResult AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left ble AST#expression#Right . on AST#member_exp... | public onScanResult() {
ble.on('BLEDeviceFind', (data: Array<ble.ScanResult>) => {
if (data.length > 0) {
console.info(TAG, 'BLE scan result = ' + data[0].deviceId);
this.parseScanResult(data[0].data);
this.toastReport.showResult(data[0].deviceId);
if (!this.scanDataLi... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/bluetoothSample/entry/src/main/ets/bluetoothService/BluetoothScan.ets#L75-L89 | 3ca67aae6531ab339b7a84a70b1228f377391c43 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets | arkts | registerDataChangeListener | Register data change listener | registerDataChangeListener(): void {
} | AST#method_declaration#Left registerDataChangeListener AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right | registerDataChangeListener(): void {
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets#L52-L53 | bf8094b4289345fab5f9ffb49877f5fbcc850730 | gitee |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/pages/MainPage.ets | arkts | buildEpisodesTab | 单集页签 | @Builder
buildEpisodesTab() {
Column() {
// 搜索框
Row() {
Search({ placeholder: '搜索单集标题或描述', value: this.episodeSearchKeyword })
.width('100%')
.height(40)
.backgroundColor($r('app.color.background_card'))
.onChange((value: string) => {
this.on... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildEpisodesTab AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 搜索框 AST#a... | @Builder
buildEpisodesTab() {
Column() {
Row() {
Search({ placeholder: '搜索单集标题或描述', value: this.episodeSearchKeyword })
.width('100%')
.height(40)
.backgroundColor($r('app.color.background_card'))
.onChange((value: string) => {
this.onEpisod... | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/MainPage.ets#L564-L652 | 9a645e35562b15b0321347bcd5f046c39cb87d06 | github |
wustcat404/time-bar | d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8 | entry/src/main/ets/common/contants/CommonConstants.ets | arkts | Time constants | export enum TimeMsUnit {
ONE_MINUTE = 60 * 1000, // 1 minute in ms
TEN_MINUTE = 10 * 60 * 1000, // 10 minutes in ms
ONE_HOUR = 60 * 60 * 1000, // 1 hour in ms
} | AST#export_declaration#Left export AST#enum_declaration#Left enum TimeMsUnit AST#enum_body#Left { AST#enum_member#Left ONE_MINUTE = AST#expression#Left AST#binary_expression#Left AST#expression#Left 60 AST#expression#Right * AST#expression#Left 1000 AST#expression#Right AST#binary_expression#Right AST#expression#Right ... | export enum TimeMsUnit {
ONE_MINUTE = 60 * 1000,
TEN_MINUTE = 10 * 60 * 1000,
ONE_HOUR = 60 * 60 * 1000,
} | https://github.com/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/entry/src/main/ets/common/contants/CommonConstants.ets#L23-L27 | f2a91cea9b0acb6686cbfb78b8a360a2a593be63 | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/CustomAnimationTab/customanimationtab/src/main/ets/view/CustomAnimationTabView.ets | arkts | testBuilder | 功能说明: 本示例介绍使用List、Text等组件,以及animateTo等接口实现自定义Tab效果
推荐场景: 需要自定义动效的tab场景
核心组件:
1. CustomAnimationTab: 自定义动效tab构建组件
2. AnimationAttribute: 动效属性,可通过继承扩展动效属性
3. TabInfo: 设置TabBar的标题、TabContent以及TabBar样式的类
4. CustomAnimationTabController: 自定义动效Tab控制器,用于控制自定义动效Tab组件进行页签切换
5. IndicatorBarAttribute: 设置背景条属性
6. TabBarAttribute... | @Builder
function testBuilder() {
Column() {
}
.height('100%')
.width('100%')
.backgroundColor(Color.Gray)
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function testBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Lef... | @Builder
function testBuilder() {
Column() {
}
.height('100%')
.width('100%')
.backgroundColor(Color.Gray)
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CustomAnimationTab/customanimationtab/src/main/ets/view/CustomAnimationTabView.ets#L88-L95 | 474ec68b3115926321ab151ec59fdc614887d809 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/network/src/main/ets/datasource/address/AddressNetworkDataSource.ets | arkts | @file 用户地址相关网络数据源接口
@author Joker.X | export interface AddressNetworkDataSource {
/**
* 修改地址
* @param params 地址信息
* @returns 修改结果响应
*/
updateAddress(params: Address): Promise<NetworkResponse<void>>;
/**
* 分页查询地址
* @param params 分页请求参数
* @returns 地址分页数据响应
*/
getAddressPage(params: PageRequest): Promise<NetworkResponse<Networ... | AST#export_declaration#Left export AST#interface_declaration#Left interface AddressNetworkDataSource AST#object_type#Left { /**
* 修改地址
* @param params 地址信息
* @returns 修改结果响应
*/ AST#type_member#Left updateAddress AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#... | export interface AddressNetworkDataSource {
updateAddress(params: Address): Promise<NetworkResponse<void>>;
getAddressPage(params: PageRequest): Promise<NetworkResponse<NetworkPageData<Address>>>;
getAddressList(): Promise<NetworkResponse<Address[]>>;
deleteAddress(params: Ids): Promise<NetworkRe... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/network/src/main/ets/datasource/address/AddressNetworkDataSource.ets#L7-L54 | 2e9a516b9e3e2a4b4b07f93fe1bd14815c9e4539 | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_web/src/main/ets/utils/Tools.ets | arkts | openDeepLink | APP安装更新
@param deeplink 格式具体见开发者文档,store://enterprise/manifest?url=https://ios.bagcloud.cn/app/harmony/szzhzx/manifest.json5 | static openDeepLink(deeplink: string): Promise<void> {
const headStr = 'store://enterprise/manifest?url=';
if (!StrUtils.startsWith(deeplink, headStr)) {
deeplink = headStr + deeplink;
}
return ArkWebHelper.getContext().openLink(deeplink);
} | AST#method_declaration#Left static openDeepLink AST#parameter_list#Left ( AST#parameter#Left deeplink : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#... | static openDeepLink(deeplink: string): Promise<void> {
const headStr = 'store://enterprise/manifest?url=';
if (!StrUtils.startsWith(deeplink, headStr)) {
deeplink = headStr + deeplink;
}
return ArkWebHelper.getContext().openLink(deeplink);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/Tools.ets#L377-L383 | 7944f48a3c2780434bda09ac1b9e9146b71b1f2f | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/cuberotateanimation/src/main/ets/views/CubeRotateAnimationSamplePage.ets | arkts | popularModule | 热门UI | @Builder
popularModule() {
Column() {
Column() {
Row() {
Text($r('app.string.cube_animation_popular'))
.fontSize($r('app.integer.cube_animation_text_medium'))
.fontWeight(FontWeight.Bold)
Text($r('app.string.cube_animation_more'))
.fontSize($r(... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right popularModule AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#ui_component#Right AST#ERROR#Left { AST#arkts... | @Builder
popularModule() {
Column() {
Column() {
Row() {
Text($r('app.string.cube_animation_popular'))
.fontSize($r('app.integer.cube_animation_text_medium'))
.fontWeight(FontWeight.Bold)
Text($r('app.string.cube_animation_more'))
.fontSize($r(... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cuberotateanimation/src/main/ets/views/CubeRotateAnimationSamplePage.ets#L231-L278 | ca81ba700d110465c9d6426e3135437f1fd082bd | gitee |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.arkui.advanced.ComposeTitleBar.d.ets | arkts | ComposeTitleBar | Declaration of the composable title bar.
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 10
Declaration of the composable title bar.
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 11 | @Component
export declare struct ComposeTitleBar {
/**
* Avatar resource and event callback of this title bar.
* @type { ?ComposeTitleBarMenuItem }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Avatar resource and event callback of this title bar.
* @type {... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct ComposeTitleBar AST#component_body#Left { /**
* Avatar resource and event callback of this title bar.
* @type { ?ComposeTitleBarMenuItem }.
* @syscap SystemCapabil... | @Component
export declare struct ComposeTitleBar {
item?: ComposeTitleBarMenuItem;
title: ResourceStr;
subtitle?: ResourceStr;
menuItems?: Array<ComposeTitleBarMenuItem>;
} | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.ComposeTitleBar.d.ets#L93-L151 | 34c941d4b09a287945a98c2896898acbdc3e3143 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/containernestedslide/src/main/ets/view/Scroller.ets | arkts | customBuilder2 | 定义Web的builder方法 | @Builder customBuilder2() {} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customBuilder2 AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right | @Builder customBuilder2() {} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/containernestedslide/src/main/ets/view/Scroller.ets#L44-L44 | 71aafc4408351cab4ab5b9a6758ac4daa51c583f | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.Popup.d.ets | arkts | Defines the popup icon options
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@since 11
Defines the popup icon options
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export interface PopupIconOptions {
/**
* Set the icon image.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* Set the icon image.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atom... | AST#export_declaration#Left export AST#interface_declaration#Left interface PopupIconOptions AST#object_type#Left { /**
* Set the icon image.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/ /**
* Set the icon image.
* @type { ResourceStr }.
... | export interface PopupIconOptions {
image: ResourceStr;
width?: Dimension;
height?: Dimension;
fillColor?: ResourceColor;
borderRadius?: Length | BorderRadiuses;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.Popup.d.ets#L202-L287 | 68bd14547e8ddf42e918646c9b455aec1499a446 | gitee | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/AxisBase.ets | arkts | isDrawGridLinesEnabled | Returns true if drawing grid lines is enabled for this axis.
@return | public isDrawGridLinesEnabled(): boolean {
return this.mDrawGridLines;
} | AST#method_declaration#Left public isDrawGridLinesEnabled AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#... | public isDrawGridLinesEnabled(): boolean {
return this.mDrawGridLines;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L203-L205 | 1ade250d376533973e2d4cf1ecbbe76441b7b655 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/model/src/main/ets/entity/Footprint.ets | arkts | @file 用户足迹模型
@author Joker.X | export class Footprint {
/**
* 商品ID
*/
goodsId: number = 0;
/**
* 商品名称
*/
goodsName: string = "";
/**
* 商品副标题
*/
goodsSubTitle?: string | null = null;
/**
* 商品主图
*/
goodsMainPic: string = "";
/**
* 商品价格
*/
goodsPrice: number = 0;
/**
* 已售数量
*/
goodsSold: numbe... | AST#export_declaration#Left export AST#class_declaration#Left class Footprint AST#class_body#Left { /**
* 商品ID
*/ AST#property_declaration#Left goodsId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#proper... | export class Footprint {
goodsId: number = 0;
goodsName: string = "";
goodsSubTitle?: string | null = null;
goodsMainPic: string = "";
goodsPrice: number = 0;
goodsSold: number = 0;
viewTime: number = Date.now();
constructor(init?: Partial<Footprint>) {
if (!init) {
retur... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/Footprint.ets#L5-L47 | 77cff07e4118da25b501a7754beb0efb01219f6f | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/ModelConfigService.ets | arkts | getProviders | 获取支持的模型厂商列表 | public getProviders(): ProviderInfo[] {
const providers: ProviderInfo[] = [
{ provider: ModelProvider.ZHIPU, name: '🤖 智谱AI (GLM)' },
{ provider: ModelProvider.DEEPSEEK, name: '🧠 DeepSeek' },
{ provider: ModelProvider.KIMI, name: '🌙 Kimi (月之暗面)' },
{ provider: ModelProvider.CUSTOM, name: '... | AST#method_declaration#Left public getProviders AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ProviderInfo [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_decl... | public getProviders(): ProviderInfo[] {
const providers: ProviderInfo[] = [
{ provider: ModelProvider.ZHIPU, name: '🤖 智谱AI (GLM)' },
{ provider: ModelProvider.DEEPSEEK, name: '🧠 DeepSeek' },
{ provider: ModelProvider.KIMI, name: '🌙 Kimi (月之暗面)' },
{ provider: ModelProvider.CUSTOM, name: '... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/ModelConfigService.ets#L298-L306 | 64132091d1859f267c08cf5fa589b09b668e2814 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | setPosition | sets the position of the y-labels
@param pos | public setPosition(pos: YAxisLabelPosition): void {
this.mPosition = pos;
} | AST#method_declaration#Left public setPosition AST#parameter_list#Left ( AST#parameter#Left pos : AST#type_annotation#Left AST#primary_type#Left YAxisLabelPosition AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#pr... | public setPosition(pos: YAxisLabelPosition): void {
this.mPosition = pos;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L183-L185 | 4a4ab3b96105f5381f1169e60682f71e58704d1a | gitee |
ni202383/Chenguang-Calendar.git | c04543db2c394d662bc1336d098335134ff1e9a5 | src/main/ets/model/TaskTimeRange.ets | arkts | toggleCompletion | 切换完成状态 | toggleCompletion(): void {
this.isCompleted = !this.isCompleted;
} | AST#method_declaration#Left toggleCompletion AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#m... | toggleCompletion(): void {
this.isCompleted = !this.isCompleted;
} | https://github.com/ni202383/Chenguang-Calendar.git/blob/c04543db2c394d662bc1336d098335134ff1e9a5/src/main/ets/model/TaskTimeRange.ets#L30-L32 | 85992abb47d4db25a57d8c9a1c265b3c4e98684d | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/applicationexception/src/main/ets/utils/FunctionDescription.ets | arkts | FunctionDescription | 模块功能描述组件
@param title 标题
@param context 内容 | @Component
export struct FunctionDescription {
private title: ResourceStr = '';
private content: ResourceStr = '';
build() {
Column() {
Row() {
Text(this.title)
.fontSize($r('app.string.application_exception_text_size_headline'))
.fontWeight(FontWeight.Medium)
.tex... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct FunctionDescription AST#component_body#Left { AST#property_declaration#Left private title : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right = AST#expression#... | @Component
export struct FunctionDescription {
private title: ResourceStr = '';
private content: ResourceStr = '';
build() {
Column() {
Row() {
Text(this.title)
.fontSize($r('app.string.application_exception_text_size_headline'))
.fontWeight(FontWeight.Medium)
.tex... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/applicationexception/src/main/ets/utils/FunctionDescription.ets#L21-L47 | 2b731cf4aff0d5bf2a805936a2a51e0811ce4068 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.