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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/ContactTypes.ets | arkts | 排序配置接口 | export interface SortConfig {
field: ContactSortField;
order: 'asc' | 'desc';
} | AST#export_declaration#Left export AST#interface_declaration#Left interface SortConfig AST#object_type#Left { AST#type_member#Left field : AST#type_annotation#Left AST#primary_type#Left ContactSortField AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#ERROR#Left order : 'asc' | 'desc' ; AST#... | export interface SortConfig {
field: ContactSortField;
order: 'asc' | 'desc';
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/ContactTypes.ets#L25-L28 | 7f846f365caaafb0d3610e1a9c6ebd4f90d2e760 | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/arkui/runtime-api/@koalaui.runtime.tree.ReadonlyTreeNode.d.ets | arkts | @file
@kit ArkUI
@arkts 1.2 | export interface ReadonlyTreeNode {
readonly parent: ReadonlyTreeNode | undefined
toHierarchy(): string
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ReadonlyTreeNode AST#object_type#Left { AST#type_member#Left readonly AST#ERROR#Left parent AST#ERROR#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ReadonlyTreeNode AST#primary_type#Right | AST#primary_type#Left und... | export interface ReadonlyTreeNode {
readonly parent: ReadonlyTreeNode | undefined
toHierarchy(): string
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/arkui/runtime-api/@koalaui.runtime.tree.ReadonlyTreeNode.d.ets#L21-L24 | 328c6cf13952af663cdbbbf3a6756b40eec738e5 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/utils/LunarUtils.ets | arkts | getLunarMonthDays | 获取农历某月的天数
@param year 农历年份
@param month 农历月份
@param isLeapMonth 是否闰月
@returns 天数 | static getLunarMonthDays(year: number, month: number, isLeapMonth: boolean = false): number {
if (year < 1900 || year > 2050) {
return 30; // 默认值
}
if (isLeapMonth) {
const yearInfo = LunarUtils.getLunarYearInfo(year);
if (yearInfo.leapMonth === month) {
return 30; // 闰月通常30天
... | AST#method_declaration#Left static getLunarMonthDays AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#prima... | static getLunarMonthDays(year: number, month: number, isLeapMonth: boolean = false): number {
if (year < 1900 || year > 2050) {
return 30;
}
if (isLeapMonth) {
const yearInfo = LunarUtils.getLunarYearInfo(year);
if (yearInfo.leapMonth === month) {
return 30;
}
re... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/utils/LunarUtils.ets#L455-L473 | 7dfe3c199ed0befe7d8dc41f8544b33402672ae5 | github |
kumaleap/ArkSwipeDeck.git | 5afa77b9b2a2a531595d31f895c54a3371e4249a | library/src/main/ets/types/SwipeCardTypes.ets | arkts | 卡片栈即将为空回调函数类型
@param remainingCount - 剩余卡片数量 | export type OnStackNearEmptyCallback = (remainingCount: number) => void; | AST#export_declaration#Left export AST#type_declaration#Left type OnStackNearEmptyCallback = AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left remainingCount : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#... | export type OnStackNearEmptyCallback = (remainingCount: number) => void; | https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/src/main/ets/types/SwipeCardTypes.ets#L63-L63 | 0e0b8740e3510d4eff4c01212bad71226beb9c82 | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/viewmodel/CategoryViewModel.ets | arkts | getActiveIndex | 获取侧边栏当前激活索引
@returns {number} 当前激活索引 | getActiveIndex(): number {
return this.selectedCategoryIndex < 0 ? 0 : this.selectedCategoryIndex;
} | AST#method_declaration#Left getActiveIndex 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_expressio... | getActiveIndex(): number {
return this.selectedCategoryIndex < 0 ? 0 : this.selectedCategoryIndex;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/viewmodel/CategoryViewModel.ets#L117-L119 | dd964617245841fb91e0c72af24913cb26ab4b61 | github |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_history_index.ets | arkts | clear | Clears index by setting it a new empty Map. | static clear() {
bunch_of_history_index.index_map = new collections.Map<string, collections.Array<number>>();
} | AST#method_declaration#Left static clear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left bunch_of_history_index AST#expression#Right . index_map AST#membe... | static clear() {
bunch_of_history_index.index_map = new collections.Map<string, collections.Array<number>>();
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_history_index.ets#L24-L26 | 4b34704a880e1c2aa4d6ad420247802840629751 | gitee |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/model/system/IAlertDialogOptions.ets | arkts | 【系统】确认alert弹窗配置 | export interface IAlertDialogOptions extends IBaseConfirmOrAlertDialogOptions {
/**
* Sets the ConfirmDialog title.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Sets the ConfirmDialog title.
* @type { ResourceStr }.
* @syscap SystemCapability.Ark... | AST#export_declaration#Left export AST#interface_declaration#Left interface IAlertDialogOptions AST#extends_clause#Left extends IBaseConfirmOrAlertDialogOptions AST#extends_clause#Right AST#object_type#Left { /**
* Sets the ConfirmDialog title.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Fu... | export interface IAlertDialogOptions extends IBaseConfirmOrAlertDialogOptions {
primaryTitle?: ResourceStr;
secondaryTitle?: ResourceStr;
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/model/system/IAlertDialogOptions.ets#L6-L38 | bd259dbb1956ee58505c30d30d2d4eaa337d58b8 | github | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | ScreenFlickerSolution/entry/src/main/ets/pages/TabsRight.ets | arkts | [Start tabs_right_build] | build() {
Stack({ alignContent: Alignment.TopStart }) {
Tabs({ barPosition: BarPosition.Start }) {
TabContent() {
Column()
.width('100%')
.height('100%')
.backgroundColor(Color.Green)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, Sa... | 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.TopStart }) {
Tabs({ barPosition: BarPosition.Start }) {
TabContent() {
Column()
.width('100%')
.height('100%')
.backgroundColor(Color.Green)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, Sa... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ScreenFlickerSolution/entry/src/main/ets/pages/TabsRight.ets#L47-L126 | 916576a1f1c6d96b5f6c8a8e5c7a439f9e1e5db5 | gitee | |
Delsin-Yu/JustPDF.git | d53f566e02820dac46e1752151750144acbed50a | entry/src/main/ets/components/PageInfo.ets | arkts | ensureCached | Ensures the page is cached at the specified render scale.
If already cached or caching is in progress, this is a no-op.
@param sandboxPath Path to the PDF file
@param renderScale The render scale to cache at
@param priority Task priority (LOW for background, HIGH for immediate)
@returns Promise that resolves when cachi... | public ensureCached(
renderScale: number,
priority: taskpool.Priority
): Promise<PageCache> | undefined {
// Skip if already cached or has pending task
if (this.caches.has(renderScale) || this.pendingTasks.has(renderScale)) {
return undefined;
}
const task = new taskpool.Task(cachePage,... | AST#method_declaration#Left public ensureCached AST#parameter_list#Left ( AST#parameter#Left renderScale : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priority : AST#type_annotation#Left AST#primary_type#Left AST#qualifi... | public ensureCached(
renderScale: number,
priority: taskpool.Priority
): Promise<PageCache> | undefined {
if (this.caches.has(renderScale) || this.pendingTasks.has(renderScale)) {
return undefined;
}
const task = new taskpool.Task(cachePage, this.pagePath, this.localPageIndex, renderSc... | https://github.com/Delsin-Yu/JustPDF.git/blob/d53f566e02820dac46e1752151750144acbed50a/entry/src/main/ets/components/PageInfo.ets#L161-L187 | 52065a8aa49c4881d83bf4f38c976ca1cb6ae958 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/entryability/EntryAbility.ets | arkts | onWindowStageDestroy | 窗口Stage销毁时的回调 | onWindowStageDestroy(): void {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, '%{public}s', 'Ability onWindowStageDestroy');
this.windowStage = undefined;
} | AST#method_declaration#Left onWindowStageDestroy 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#exp... | onWindowStageDestroy(): void {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, '%{public}s', 'Ability onWindowStageDestroy');
this.windowStage = undefined;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/entryability/EntryAbility.ets#L66-L69 | 6fe4f90533a8fbe328e9d6e8c3f8161e7a8fc4e1 | github |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/SM4.ets | arkts | decryptGCM | 解密(GCM模式),异步
@param data 加密或者解密的数据。data不能为null。
@param symKey 指定加密或解密的密钥。
@param gcmParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。。
@returns | static async decryptGCM(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
gcmParams: cryptoFramework.GcmParamsSpec): Promise<cryptoFramework.DataBlob> {
let decoder = cryptoFramework.createCipher('SM4_128|GCM|PKCS7');
await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, gcmParam... | AST#method_declaration#Left static async decryptGCM AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left sym... | static async decryptGCM(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
gcmParams: cryptoFramework.GcmParamsSpec): Promise<cryptoFramework.DataBlob> {
let decoder = cryptoFramework.createCipher('SM4_128|GCM|PKCS7');
await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, gcmParam... | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/SM4.ets#L70-L78 | 7d6c2b9e3373bb47cc8cc2bbce2e354c81181725 | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/renderer/AxisRenderer.ets | arkts | getPaintGrid | Returns the Paint object that is used for drawing the grid-lines of the
axis.
@return | public getPaintGrid(): Paint {
return this.mGridPaint;
} | AST#method_declaration#Left public getPaintGrid AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Paint 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_expre... | public getPaintGrid(): Paint {
return this.mGridPaint;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/AxisRenderer.ets#L90-L92 | 5e01eed0bb46a02406ff01ddb1d02fcb71fefc6f | gitee |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/DialogBuilder.ets | arkts | GuideBuilder | Guide功能引导弹窗view | @Builder
export function GuideBuilder(options: IGuideDialogOptions) {
GuideDialogView({ options: options });
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function GuideBuilder AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left IGuideDialogOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#paramet... | @Builder
export function GuideBuilder(options: IGuideDialogOptions) {
GuideDialogView({ options: options });
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/DialogBuilder.ets#L301-L304 | c907fce1ae3307469c7561dc57d6b2e90ccabcd5 | github |
lentozi/DailyPlan.git | 96ce0bec8f545511c51b577c4aa8327c2c5bb0c8 | entry/src/main/ets/tabcontent/HomeContent.ets | arkts | addMenu | 封装新增按钮的菜单栏组件 | @Builder addMenu() {
Menu() {
MenuItem({ content: '新建代办', labelInfo: 'Ctrl+T'})
}
.height('20vp')
.borderRadius(0)
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right addMenu 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 Menu ( ) AST#container_content_body#Left { AST#arkts_ui_element#Le... | @Builder addMenu() {
Menu() {
MenuItem({ content: '新建代办', labelInfo: 'Ctrl+T'})
}
.height('20vp')
.borderRadius(0)
} | https://github.com/lentozi/DailyPlan.git/blob/96ce0bec8f545511c51b577c4aa8327c2c5bb0c8/entry/src/main/ets/tabcontent/HomeContent.ets#L142-L148 | 754814d07e11a43a11846b2415a8a478d38a846b | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/NetWork_Kit/NetWorkKit_NetManager/NetConnection_Manage_case/entry/src/main/ets/pages/Index.ets | arkts | [End construct_singleton_object] | export function resourceToString(resource: Resource): string {
return getContext().resourceManager.getStringSync(resource);
} | AST#export_declaration#Left export AST#function_declaration#Left function resourceToString AST#parameter_list#Left ( AST#parameter#Left resource : 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... | export function resourceToString(resource: Resource): string {
return getContext().resourceManager.getStringSync(resource);
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_NetManager/NetConnection_Manage_case/entry/src/main/ets/pages/Index.ets#L136-L138 | 730c76ea10f27b8cc74ac11b696c78470163a564 | gitee | |
didi/dimina.git | 7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2 | harmony/dimina/src/main/ets/Bridges/PhotoView/PhotoPicker.ets | arkts | selectPhotos | 调用系统相册选择图片(无权限)
@param context 上下文(预留)
@param toDir 存放位置,会把照片copy过去
@param maxSelectNumber 最多能选择多少张
@param isEditSupported 是否支持编辑,默认ture
@returns 返回AssetModel | public static async selectPhotos(context: common.UIAbilityContext, localDir: string,
maxSelectNumber: number = 9, isEditSupported: boolean = true): Promise<Array<AssetModel> | null> {
let PhotoSelectOptions = new photoAccessHelper.PhotoSelectOptions();
PhotoSelectOptions.MIMEType = photoAccessHelper.PhotoVi... | AST#method_declaration#Left public static async selectPhotos 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#paramet... | public static async selectPhotos(context: common.UIAbilityContext, localDir: string,
maxSelectNumber: number = 9, isEditSupported: boolean = true): Promise<Array<AssetModel> | null> {
let PhotoSelectOptions = new photoAccessHelper.PhotoSelectOptions();
PhotoSelectOptions.MIMEType = photoAccessHelper.PhotoVi... | https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/Bridges/PhotoView/PhotoPicker.ets#L17-L34 | d9d755395f1f2f0cec0c03b8f00ce233516891da | github |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/entry/src/main/ets/pages/practice/TrainTimePage.ets | arkts | getMonth | 得到Years,Month,所有统计图所需数据 | getMonth(month:number)
{
if(month<9)
{
return '0'+month;
}
return month+'';
} | AST#method_declaration#Left getMonth AST#parameter_list#Left ( AST#parameter#Left month : 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#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#exp... | getMonth(month:number)
{
if(month<9)
{
return '0'+month;
}
return month+'';
} | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/practice/TrainTimePage.ets#L70-L77 | 58b5c02003fc44060f92afe865df92be693b2c3c | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets | arkts | getAllCarts | 获取购物车中所有商品
@returns {Promise<Cart[]>} 购物车列表 | async getAllCarts(): Promise<Cart[]> {
const list: CartEntity[] = this.orm.query(CartEntity).find();
return list.map((entity) => this.toModel(entity));
} | AST#method_declaration#Left async getAllCarts 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 Cart [ ] AST#array_type#Right AST#primary_type#Ri... | async getAllCarts(): Promise<Cart[]> {
const list: CartEntity[] = this.orm.query(CartEntity).find();
return list.map((entity) => this.toModel(entity));
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets#L128-L131 | 8c9c64a7058cd5468bc96fa5bf224ee38234840f | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/PreferencesUtil.ets | arkts | putSync | 将数据缓存
@param key
@param value | static putSync(key: string, value: preferences.ValueType,
preferenceName: string = PreferencesUtil.defaultPreferenceName) {
const preferences = PreferencesUtil.getPreferencesSync(preferenceName); //获取实例
preferences.putSync(key, value);
preferences.flush(); //此处一定要flush,要不然不能永久序列化到本地
} | AST#method_declaration#Left static putSync AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left pre... | static putSync(key: string, value: preferences.ValueType,
preferenceName: string = PreferencesUtil.defaultPreferenceName) {
const preferences = PreferencesUtil.getPreferencesSync(preferenceName);
preferences.putSync(key, value);
preferences.flush();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PreferencesUtil.ets#L79-L84 | df3aee0790dccfa5a5deab64188e92b3593640b7 | gitee |
openharmony-tpc-incubate/photo-deal-demo | 01382ce30b1785f8fc8bc14f6b94f0a670a5b50b | library/src/main/ets/controller/EditController.ets | arkts | addCropRecord | 添加裁剪记录
@param crop 裁剪数据 | addCropRecord(crop: CropData): void {
this.addRecord({ data: crop, type: ImageEditFunctionType.CROP });
} | AST#method_declaration#Left addCropRecord AST#parameter_list#Left ( AST#parameter#Left crop : AST#type_annotation#Left AST#primary_type#Left CropData 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#Rig... | addCropRecord(crop: CropData): void {
this.addRecord({ data: crop, type: ImageEditFunctionType.CROP });
} | https://github.com/openharmony-tpc-incubate/photo-deal-demo/blob/01382ce30b1785f8fc8bc14f6b94f0a670a5b50b/library/src/main/ets/controller/EditController.ets#L70-L72 | 8e1cae173164b2e3b4eac43bf1cc737688182941 | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/MoneyTrack-master/commons/commonlib/src/main/ets/utils/router/Router.ets | arkts | pop | 弹出栈顶元素 | public static pop(result?: Object, animated?: boolean) {
try {
RouterModule._stack.pop(result, animated);
} catch (err) {
Logger.error(TAG, 'navigation stack pop failed::' + JSON.stringify(err));
}
} | AST#method_declaration#Left public static pop AST#parameter_list#Left ( AST#parameter#Left result ? : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left animated ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#pr... | public static pop(result?: Object, animated?: boolean) {
try {
RouterModule._stack.pop(result, animated);
} catch (err) {
Logger.error(TAG, 'navigation stack pop failed::' + JSON.stringify(err));
}
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/MoneyTrack-master/commons/commonlib/src/main/ets/utils/router/Router.ets#L40-L46 | 7c6ed36bafae863fa2b83ae421ec2aa4c7486f66 | github |
yycy134679/FoodieHarmony.git | e6971f0a8f7574ae278d02eb5c057e57e667dab5 | entry/src/main/ets/view/home/HomeTabContent.ets | arkts | handleCategoryClick | 分类点击处理
@param category 分类名称,空字符串表示取消筛选 | private async handleCategoryClick(category: string) {
try {
hilog.info(DOMAIN, TAG, 'Category clicked: %{public}s', category || '(取消筛选)');
// 更新选中的分类
this.selectedCategory = category;
// 重置页码并加载筛选后的数据
await this.loadMerchantList(1, false);
// 滚动到顶部
this.scroller.scrollEd... | AST#method_declaration#Left private async handleCategoryClick AST#parameter_list#Left ( AST#parameter#Left category : 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_statement#Left { AST#statement#Left AST#tr... | private async handleCategoryClick(category: string) {
try {
hilog.info(DOMAIN, TAG, 'Category clicked: %{public}s', category || '(取消筛选)');
this.selectedCategory = category;
await this.loadMerchantList(1, false);
this.scroller.scrollEdge(Edge.Top);
if (ca... | https://github.com/yycy134679/FoodieHarmony.git/blob/e6971f0a8f7574ae278d02eb5c057e57e667dab5/entry/src/main/ets/view/home/HomeTabContent.ets#L203-L235 | b241ff354381015767b0e80954fcc3e272894c35 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/widgets/pages/WidgetCard2x4.ets | arkts | formatUpdateTime | 格式化更新时间 | private formatUpdateTime(): string {
const updateTime = this.widgetData.updateTime || '';
if (!updateTime) return '';
const timeParts = updateTime.split(':');
if (timeParts.length >= 2) {
return `${timeParts[0]}:${timeParts[1]}`;
}
return updateTime;
} | AST#method_declaration#Left private formatUpdateTime AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Lef... | private formatUpdateTime(): string {
const updateTime = this.widgetData.updateTime || '';
if (!updateTime) return '';
const timeParts = updateTime.split(':');
if (timeParts.length >= 2) {
return `${timeParts[0]}:${timeParts[1]}`;
}
return updateTime;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/widgets/pages/WidgetCard2x4.ets#L274-L284 | e8f50101efa32fd8297a14bfd50f84dc3c9a1a5a | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Ability/StageAbilityDemo/entry/src/main/ets/common/constants/HomeConstants.ets | arkts | The constant of MenusComponent. | export class Menus {
/**
* The vertical padding of container.
*/
static readonly CONTAINER_PADDING_VERTICAL: number = 12;
/**
* The vertical padding of item.
*/
static readonly ITEM_PADDING_VERTICAL: number = 16;
/**
* The weight of layout.
*/
static readonly LAYOUT_WEIGHT: string = '25%... | AST#export_declaration#Left export AST#class_declaration#Left class Menus AST#class_body#Left { /**
* The vertical padding of container.
*/ AST#property_declaration#Left static readonly CONTAINER_PADDING_VERTICAL : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Ri... | export class Menus {
static readonly CONTAINER_PADDING_VERTICAL: number = 12;
static readonly ITEM_PADDING_VERTICAL: number = 16;
static readonly LAYOUT_WEIGHT: string = '25%';
}; | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Ability/StageAbilityDemo/entry/src/main/ets/common/constants/HomeConstants.ets#L221-L236 | c6589ce5a4aff292f4fc3350763dbf5ccb6711c0 | gitee | |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/PreferencesUtils.ets | arkts | getBoolean | 获取boolean类型的缓存值
@param key
@param defValue
@param preferenceName
@returns | static async getBoolean(key: string, defValue: boolean = false) {
return (await PreferencesUtils.get(key, defValue)) as boolean
} | AST#method_declaration#Left static async getBoolean AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left defValue : AST#type_annotation#Left AST#primary_type#Left boolean AST#pri... | static async getBoolean(key: string, defValue: boolean = false) {
return (await PreferencesUtils.get(key, defValue)) as boolean
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/PreferencesUtils.ets#L115-L117 | 27ef7ff916c0ee51ddf6ea10122b79a709a5c1a8 | gitee |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_onAreaChange/entry/src/main/ets/MainAbility/view/position/TabsView.ets | arkts | TabsView | 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 TabsView {
@State fontColor: string = '#182431';
@State selectedFontColor: string = '#007DFF';
@State currentIndex: number = 0;
private controller: TabsController = new TabsController();
@Link _position: Position;
private componentKey: string;
@Builder TabBuilder(index: number, n... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TabsView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right fontColor : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotat... | @Component
export struct TabsView {
@State fontColor: string = '#182431';
@State selectedFontColor: string = '#007DFF';
@State currentIndex: number = 0;
private controller: TabsController = new TabsController();
@Link _position: Position;
private componentKey: string;
@Builder TabBuilder(index: number, n... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_onAreaChange/entry/src/main/ets/MainAbility/view/position/TabsView.ets#L16-L84 | d0fd708a1edd8465cde3b4dbdefadc6b496e9990 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/plan/plancurve/Plan.ets | arkts | getTempBookId | / 获取临时用的BookId | getTempBookId(): number | null {
return this.planId !== null ? this.planId + PlanManager.planBookIdPref : null;
} | AST#method_declaration#Left getTempBookId AST#parameter_list#Left ( ) AST#parameter_list#Right : 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#Right AST#block_statement#Left { ... | getTempBookId(): number | null {
return this.planId !== null ? this.planId + PlanManager.planBookIdPref : null;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Plan.ets#L513-L515 | 8f566169eb7d2b21a314775b278c5e946e3d75a4 | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | NavigationRouter/RouterModule/src/main/ets/sourcecode/RouterModule.ets | arkts | popToName | 直接跳转到指定路由 | public static popToName(routerName: string, builderName: string): void {
RouterModule.getRouter(routerName).popToName(builderName);
} | AST#method_declaration#Left public static popToName AST#parameter_list#Left ( AST#parameter#Left routerName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left builderName : AST#type_annotation#Left AST#primary_type#Left strin... | public static popToName(routerName: string, builderName: string): void {
RouterModule.getRouter(routerName).popToName(builderName);
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NavigationRouter/RouterModule/src/main/ets/sourcecode/RouterModule.ets#L72-L74 | e30ce6e3a19fefd7a72f31e0115d1061998a18ae | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/model/BufferModel.ets | arkts | connectToAp | 发起连接 | private async connectToAp(): Promise<boolean> {
try {
if (this.mSocketImpl == null) {
return false;
}
let ipInfo: wifiManager.IpInfo = wifiManager.getIpInfo();
let ipAddress: number = ipInfo.ipAddress;
let gateway: number = ipInfo.gateway;
if (ipAddress === 0 || gateway ... | AST#method_declaration#Left private async connectToAp 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 boolean AST#primary_type#Right AST#type_annotation#Right > AS... | private async connectToAp(): Promise<boolean> {
try {
if (this.mSocketImpl == null) {
return false;
}
let ipInfo: wifiManager.IpInfo = wifiManager.getIpInfo();
let ipAddress: number = ipInfo.ipAddress;
let gateway: number = ipInfo.gateway;
if (ipAddress === 0 || gateway ... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/model/BufferModel.ets#L217-L246 | a500b6f30153118097cae9c68d2cc459f573a724 | gitee |
didi/dimina.git | 7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2 | harmony/dimina/src/main/ets/DApp/DMPAppLifecycle.ets | arkts | onHide | 框架接口 / 小程序 App / App https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onHide | static onHide() {
DMPAppLifecycle.onAppHide()
} | AST#method_declaration#Left static onHide 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 DMPAppLifecycle AST#expression#Right . onAppHide A... | static onHide() {
DMPAppLifecycle.onAppHide()
} | https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/DApp/DMPAppLifecycle.ets#L45-L47 | da01bf8e1c5459ad08ab80004f8f946af49dc668 | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/datastore/src/main/ets/datasource/token/TokenStoreDataSourceImpl.ets | arkts | setToken | 保存 Token
@param {string} token Token
@returns {Promise<void>} Promise<void> | async setToken(token: string): Promise<void> {
await this.prefs.set(TokenStoreDataSourceImpl.KEY_TOKEN, token);
} | AST#method_declaration#Left async setToken AST#parameter_list#Left ( AST#parameter#Left token : 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#Left Pro... | async setToken(token: string): Promise<void> {
await this.prefs.set(TokenStoreDataSourceImpl.KEY_TOKEN, token);
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/datastore/src/main/ets/datasource/token/TokenStoreDataSourceImpl.ets#L38-L40 | ab2bce680a7b2d4cbd11e6ac73e4d4b8bcf2e16c | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | spinkit/src/main/ets/components/SpinM.ets | arkts | SpinM | TODO SpinKit动画组件
author: 桃花镇童长老
since: 2024/05/01 | @ComponentV2
export struct SpinM {
@Require @Param spinSize: number = 36;
@Require @Param spinColor: ResourceColor;
@Local round1: number = this.spinSize * 0.14
@Local opacity1: number = 0.3;
@Local opacity2: number = 0.3;
@Local opacity3: number = 0.3;
@Local opacity4: number = 0.3;
@Local opacity5: nu... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct SpinM AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Require AST#decorator#Right AST#decorator#Left @ Param AST#decorator#Right spinSize : AST#type_annotation#Left AST#primary_type#Left... | @ComponentV2
export struct SpinM {
@Require @Param spinSize: number = 36;
@Require @Param spinColor: ResourceColor;
@Local round1: number = this.spinSize * 0.14
@Local opacity1: number = 0.3;
@Local opacity2: number = 0.3;
@Local opacity3: number = 0.3;
@Local opacity4: number = 0.3;
@Local opacity5: nu... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/spinkit/src/main/ets/components/SpinM.ets#L21-L354 | e9720dd29358ffd67fa558941ec38bc85bee0320 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/dragtoswitchpictures/src/main/ets/components/view/DragToSwitchPicturesView.ets | arkts | 用来记录每次图标拖动时右侧Image的实时width宽度 | build() {
Row() {
/**
* 创建三个Stack组件,用来展示装修前后对比图,第一个和第三个Stack分别存放装修前的图片和装修后的图片,zIndex设置为1。
* 第二个Stack存放按钮的图片,zIndex设置为2,这样按钮的图片就会覆盖在两张装修图片之上。
*/
Stack() {
Row() {
Image($r("app.media.dragtoswitchpictures_before_decoration"))
.width($r('app.integer.dragto... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { /**
* 创建三个Stack组件,用来展示装修前后对比图,第一个和第三个Stack分别存放装修前的图片和装修后的图片,zIndex设置为1。
* 第二个Stack存放按钮的图片,zIndex设置为2,这样按钮的图片就会覆盖在两张装修图片之上。
... | build() {
Row() {
Stack() {
Row() {
Image($r("app.media.dragtoswitchpictures_before_decoration"))
.width($r('app.integer.dragtoswitchpictures_decoration_width'))
.height($r('app.integer.dragtoswitchpictures_decoration_height'))
.draggable(false)
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/dragtoswitchpictures/src/main/ets/components/view/DragToSwitchPicturesView.ets#L26-L154 | b118186565e241047412a32babe8a8e9efb737fd | gitee | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Description.ets | arkts | setTextAlign | Sets the text alignment of the description text. Default RIGHT.
@param align | public setTextAlign(align: TextAlign) {
this.mTextAlign = align;
} | AST#method_declaration#Left public setTextAlign AST#parameter_list#Left ( AST#parameter#Left align : AST#type_annotation#Left AST#primary_type#Left TextAlign AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST... | public setTextAlign(align: TextAlign) {
this.mTextAlign = align;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Description.ets#L89-L91 | 0e6cbccc85cc6f1bc4255cbbfd24e02c8a48af24 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/database/src/main/ets/datasource/searchhistory/SearchHistoryLocalDataSource.ets | arkts | @file 搜索历史本地数据源接口
@author Joker.X | export interface SearchHistoryLocalDataSource {
/**
* 添加搜索历史记录
* @param {SearchHistory} searchHistory 搜索历史记录
* @returns {Promise<void>} Promise<void>
*/
addSearchHistory(searchHistory: SearchHistory): Promise<void>;
/**
* 根据关键词删除搜索历史记录
* @param {string} keyword 搜索关键词
* @returns {Promise<void... | AST#export_declaration#Left export AST#interface_declaration#Left interface SearchHistoryLocalDataSource AST#object_type#Left { /**
* 添加搜索历史记录
* @param {SearchHistory} searchHistory 搜索历史记录
* @returns {Promise<void>} Promise<void>
*/ AST#type_member#Left addSearchHistory AST#parameter_list#Left ( AST#paramet... | export interface SearchHistoryLocalDataSource {
addSearchHistory(searchHistory: SearchHistory): Promise<void>;
removeSearchHistory(keyword: string): Promise<void>;
clearAllSearchHistory(): Promise<void>;
getAllSearchHistory(): Promise<SearchHistory[]>;
getSearchHistoryCount(): Promise<numbe... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/searchhistory/SearchHistoryLocalDataSource.ets#L7-L53 | 7e08a7a868a17ae47a916b14a7b0174b2b628871 | github | |
WinWang/HarmoneyOpenEye.git | 57f0542795336009aa0d46fd9fa5b07facc2ae87 | entry/src/main/ets/constants/ViewStateConstant.ets | arkts | 页面状态 | export class ViewStateConstant {
//加载中
static readonly VIEW_STATE_LOADING: string = "view_state_loading"
//成功
static readonly VIEW_STATE_SUCCESS: string = "view_state_success"
//错误
static readonly VIEW_STATE_ERROR: string = "view_state_error"
//网络异常
static readonly VIEW_STATE_NETWORK_ERROR: string = "vi... | AST#export_declaration#Left export AST#class_declaration#Left class ViewStateConstant AST#class_body#Left { //加载中 AST#property_declaration#Left static readonly VIEW_STATE_LOADING : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "view_state_lo... | export class ViewStateConstant {
static readonly VIEW_STATE_LOADING: string = "view_state_loading"
static readonly VIEW_STATE_SUCCESS: string = "view_state_success"
static readonly VIEW_STATE_ERROR: string = "view_state_error"
static readonly VIEW_STATE_NETWORK_ERROR: string = "view_state_network_er... | https://github.com/WinWang/HarmoneyOpenEye.git/blob/57f0542795336009aa0d46fd9fa5b07facc2ae87/entry/src/main/ets/constants/ViewStateConstant.ets#L4-L15 | ca1eeebdc39ee40d4c616d3a8b34fb581f849011 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/social/CommunityPage.ets | arkts | buildHeader | 构建头部 | @Builder
buildHeader() {
Row() {
Button() {
Image($r('app.media.ic_back'))
.width('24vp')
.height('24vp')
.fillColor($r('app.color.text_primary'))
}
.type(ButtonType.Normal)
.backgroundColor(Color.Transparent)
.onClick(() => {
router.back... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildHeader 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 Row ( ) AST#container_content_body#Left { AST#arkts_ui_element... | @Builder
buildHeader() {
Row() {
Button() {
Image($r('app.media.ic_back'))
.width('24vp')
.height('24vp')
.fillColor($r('app.color.text_primary'))
}
.type(ButtonType.Normal)
.backgroundColor(Color.Transparent)
.onClick(() => {
router.back... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/social/CommunityPage.ets#L78-L124 | d154ebe565cebe2d74ed29b4d8513e7035e61d38 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/UniversalKeystoreKit/KeyUsage/KeyExchange/entry/src/main/ets/pages/X25519.ets | arkts | publicExportKeyFunc | 调用exportKeyItem导出公钥操作 | async function publicExportKeyFunc(keyAlias: string, huksOptions: huks.HuksOptions) {
console.info(`enter promise export`);
let throwObject: ThrowObject = { isThrow: false };
try {
await exportKeyItem(keyAlias, huksOptions, throwObject)
.then((data) => {
console.info(`promise: exportKeyItem succ... | AST#function_declaration#Left async function publicExportKeyFunc AST#parameter_list#Left ( AST#parameter#Left keyAlias : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left huksOptions : AST#type_annotation#Left AST#primary_type... | async function publicExportKeyFunc(keyAlias: string, huksOptions: huks.HuksOptions) {
console.info(`enter promise export`);
let throwObject: ThrowObject = { isThrow: false };
try {
await exportKeyItem(keyAlias, huksOptions, throwObject)
.then((data) => {
console.info(`promise: exportKeyItem succ... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/UniversalKeystoreKit/KeyUsage/KeyExchange/entry/src/main/ets/pages/X25519.ets#L303-L324 | abec0ccc619bc5404c26fd8e0c9ac2720c9df3cc | gitee |
JinnyWang-Space/guanlanwenjuan.git | 601c4aa6c427e643d7bf42bc21945f658738e38c | common/src/main/ets/utils/FileUtil.ets | arkts | *
功能:创建目录
参数 1:创建目录的上层目录路径
参数 2:创建目录的名称 | export function mkdir(path: string, dirName: string) {
let dirPath = `${path}/${dirName}`;
fs.mkdir(dirPath).then(() => {
Logger.info('[FileUtils.mkdir]', `mkdir succeed, dirPath: ${dirPath}.`);
}).catch((err: BusinessError) => {
Logger.error('[FileUtils.mkdir]', `mkdir failed with error message: ${err.me... | AST#export_declaration#Left export AST#function_declaration#Left function mkdir AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dirName : AST#type_annotation#Left AST#prima... | export function mkdir(path: string, dirName: string) {
let dirPath = `${path}/${dirName}`;
fs.mkdir(dirPath).then(() => {
Logger.info('[FileUtils.mkdir]', `mkdir succeed, dirPath: ${dirPath}.`);
}).catch((err: BusinessError) => {
Logger.error('[FileUtils.mkdir]', `mkdir failed with error message: ${err.me... | https://github.com/JinnyWang-Space/guanlanwenjuan.git/blob/601c4aa6c427e643d7bf42bc21945f658738e38c/common/src/main/ets/utils/FileUtil.ets#L125-L132 | 70504f51b07f4008810f386771c48d8f7e3a35d2 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/managers/AIModelManager.ets | arkts | AI请求选项 | export interface AIRequestOptions {
model?: string;
temperature?: number;
maxTokens?: number;
stream?: boolean;
systemPrompt?: string;
timeout?: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface AIRequestOptions AST#object_type#Left { AST#type_member#Left model ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left temperature ? : AST#type_... | export interface AIRequestOptions {
model?: string;
temperature?: number;
maxTokens?: number;
stream?: boolean;
systemPrompt?: string;
timeout?: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/managers/AIModelManager.ets#L24-L31 | c4e2f0260cd6cbfe72790d5b4f24a495c63e73a4 | github | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_bookmarks.ets | arkts | del_content | Deletes a bookmark or folder in this directory, according to the index given.
@param index The index of the delete target in this directory.
@returns true if success.
@returns false if failed, due to an index out of bounds, perhaps. | del_content(index: number) {
if (index >= this.contents.length) {
// Index out of bounds
return false;
}
this.contents.splice(index, 1);
return true;
} | AST#method_declaration#Left del_content 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#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#... | del_content(index: number) {
if (index >= this.contents.length) {
return false;
}
this.contents.splice(index, 1);
return true;
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_bookmarks.ets#L825-L832 | 70959468657d81fa6340c8b7ad6f30369a5a8ab9 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/settings/LLMConfigPage.ets | arkts | getProviderModels | 获取提供商模型列表 | private getProviderModels(): string[] {
const providerInfo = this.getCurrentProviderInfo();
return providerInfo ? providerInfo.models : [];
} | AST#method_declaration#Left private getProviderModels AST#parameter_list#Left ( ) AST#parameter_list#Right : 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#block_statement#Left { AST#statement#Left AST#variable_decl... | private getProviderModels(): string[] {
const providerInfo = this.getCurrentProviderInfo();
return providerInfo ? providerInfo.models : [];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LLMConfigPage.ets#L80-L83 | c20e7f9670b83c2a6ecab0fca8a93d491eb80708 | github |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_loadingProgress/ace_ets_module_loadingProgress_api12/entry/src/main/ets/constants/Constants.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 Constants {
static readonly EVENT_ID_CHANGE_DATA = 101
} | AST#export_declaration#Left export AST#class_declaration#Left class Constants AST#class_body#Left { AST#property_declaration#Left static readonly EVENT_ID_CHANGE_DATA = AST#expression#Left 101 AST#expression#Right AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#... | export class Constants {
static readonly EVENT_ID_CHANGE_DATA = 101
} | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_loadingProgress/ace_ets_module_loadingProgress_api12/entry/src/main/ets/constants/Constants.ets#L16-L18 | f8acfd7b76d13ba11130a4441505d5388b17bcfb | gitee | |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/pages/DetailPage.ets | arkts | aboutToAppear | 生命周期函数,在页面即将显示时触发 | aboutToAppear() {
// 获取路由参数,判断是否为编辑已有闹钟
let params = router.getParams() as Record<string, Object | undefined>;
if (params !== undefined) {
let alarmItem: AlarmItem = params.alarmItem as AlarmItem;
if (alarmItem !== undefined) {
this.isNew = false;
this.alarmItem = alarmItem;
... | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 获取路由参数,判断是否为编辑已有闹钟 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left params = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Le... | aboutToAppear() {
let params = router.getParams() as Record<string, Object | undefined>;
if (params !== undefined) {
let alarmItem: AlarmItem = params.alarmItem as AlarmItem;
if (alarmItem !== undefined) {
this.isNew = false;
this.alarmItem = alarmItem;
this.viewModel.se... | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/pages/DetailPage.ets#L36-L52 | d4747c2578a19f5fff646e0e9095028a88684a37 | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | ArkUI/Component_Nesting_Optimization/entry/src/main/ets/segment/segment3.ets | arkts | example2 | [End Counter_example3] [Start Case3] | @Component
export struct example2 {
build() {
Column() {
// Custom Components
FlowListStruct(
// Custom Component Passing Parameters
// ...
)
}
.width('100%')
.height('100%')
}
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct example2 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 { ... | @Component
export struct example2 {
build() {
Column() {
FlowListStruct(
)
}
.width('100%')
.height('100%')
}
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkUI/Component_Nesting_Optimization/entry/src/main/ets/segment/segment3.ets#L28-L41 | 3288988303f490909e961bc4a22bc8862fd503ba | gitee |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/model/Episode.ets | arkts | Episode实体类 | export enum DownloadStatus {
NOT_DOWNLOADED = 0,
DOWNLOADING = 1,
DOWNLOADED = 2,
FAILED = 3
} | AST#export_declaration#Left export AST#enum_declaration#Left enum DownloadStatus AST#enum_body#Left { AST#enum_member#Left NOT_DOWNLOADED = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left DOWNLOADING = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right , AST#enum_me... | export enum DownloadStatus {
NOT_DOWNLOADED = 0,
DOWNLOADING = 1,
DOWNLOADED = 2,
FAILED = 3
} | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/model/Episode.ets#L4-L9 | 16b5bad231be6efd7e9a9fb56165c92df91bcb84 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/notification/NotificationService.ets | arkts | scheduleReminderAlarm | 设置定时提醒 | public async scheduleReminderAlarm(hour: number, minute: number): Promise<void> {
try {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[NotificationService] Scheduling daily reminder at ${hour}:${minute}`);
// 检查提醒权限
const hasPermission = await this.timedReminderService.checkReminderP... | AST#method_declaration#Left public async scheduleReminderAlarm AST#parameter_list#Left ( AST#parameter#Left hour : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left minute : AST#type_annotation#Left AST#primary_type#Left numbe... | public async scheduleReminderAlarm(hour: number, minute: number): Promise<void> {
try {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[NotificationService] Scheduling daily reminder at ${hour}:${minute}`);
const hasPermission = await this.timedReminderService.checkReminderPermission... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationService.ets#L201-L240 | dfb1a4d463c8257cae025ee318b79cadc399628a | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | GlobalCustomComponentReuse/ComponentPrebuild/customreusablepool/src/main/ets/utils/BuilderNodePool.ets | arkts | recycleNode | [StartExclude builder_node_pool] Recycle sub components into the reuse pool | public recycleNode(type: string, node: NodeItem) {
let nodeArray: Array<NodeItem> = this.nodePool.get(type);
if (!nodeArray) {
nodeArray = new Array<NodeItem>();
this.nodePool.set(type, nodeArray);
}
nodeArray.push(node);
} | AST#method_declaration#Left public recycleNode AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left node : AST#type_annotation#Left AST#primary_type#Left NodeItem AST#primary_ty... | public recycleNode(type: string, node: NodeItem) {
let nodeArray: Array<NodeItem> = this.nodePool.get(type);
if (!nodeArray) {
nodeArray = new Array<NodeItem>();
this.nodePool.set(type, nodeArray);
}
nodeArray.push(node);
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/GlobalCustomComponentReuse/ComponentPrebuild/customreusablepool/src/main/ets/utils/BuilderNodePool.ets#L123-L130 | 2fba4733080ece702c08b1b8d04a2306077894bb | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/notification/NotificationService.ets | arkts | testNotification | 测试通知功能 | public async testNotification(): Promise<void> {
try {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, '[NotificationService] Testing notification...');
promptAction.showToast({
message: '🎂 测试通知:这是一个生日提醒测试!',
duration: 3000
});
if (this.settings.vibrationEnabled)... | AST#method_declaration#Left public async testNotification 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 > A... | public async testNotification(): Promise<void> {
try {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, '[NotificationService] Testing notification...');
promptAction.showToast({
message: '🎂 测试通知:这是一个生日提醒测试!',
duration: 3000
});
if (this.settings.vibrationEnabled)... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationService.ets#L385-L407 | 8cea3adfca583379e4eca83fc3836ff1df7a335f | github |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement03_api12/entry/src/main/ets/MainAbility/common/Log.ets | arkts | showDebug | print debug level log
@param {string} tag - Page or class tag
@param {string} log - Log needs to be printed | static showDebug(tag, log) {
console.debug(`${TAG} tag: ${tag} --> ${log}`);
} | AST#method_declaration#Left static showDebug AST#parameter_list#Left ( AST#parameter#Left tag AST#parameter#Right , AST#parameter#Left log AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#me... | static showDebug(tag, log) {
console.debug(`${TAG} tag: ${tag} --> ${log}`);
} | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement03_api12/entry/src/main/ets/MainAbility/common/Log.ets#L40-L42 | d54f01c62965ebc5f98108edf6edd310ccba6016 | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/modules/live/LiveManager.ets | arkts | enterRoom | 进入直播间 | async enterRoom(roomId: string): Promise<LiveRoom | null> {
try {
Logger.info('LiveManager', `Entering room: ${roomId}`);
// Mock 直播间数据(实际需要从API获取)
const room: LiveRoom = {
id: roomId,
title: '直播间标题',
streamUrl: 'https://example.com/live/stream.m3u8',
viewerC... | AST#method_declaration#Left async enterRoom AST#parameter_list#Left ( AST#parameter#Left roomId : 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#Left P... | async enterRoom(roomId: string): Promise<LiveRoom | null> {
try {
Logger.info('LiveManager', `Entering room: ${roomId}`);
const room: LiveRoom = {
id: roomId,
title: '直播间标题',
streamUrl: 'https://example.com/live/stream.m3u8',
viewerCount: 1000,
statu... | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/modules/live/LiveManager.ets#L60-L85 | 78439746ad4d93beff314a5b11c0c0f5ee446316 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/model/BufferModel.ets | arkts | connect | 使用 TimerUtil 全程序共用一个setInterval | private connect(): void {
Logger.log(TAG, ` >>>>>>>>>>>>>>>>>>>>>> start connect `);
this.socketConnTask();
this.observer = TimerUtil.getInstance().registerObserver((count: number) => {
this.timerCallback(count);
});
} | AST#method_declaration#Left private connect 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#expressi... | private connect(): void {
Logger.log(TAG, ` >>>>>>>>>>>>>>>>>>>>>> start connect `);
this.socketConnTask();
this.observer = TimerUtil.getInstance().registerObserver((count: number) => {
this.timerCallback(count);
});
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/model/BufferModel.ets#L124-L130 | 3d8c3d66d214f86ab32035d4bd393458a28ed0ad | gitee |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/model/ChatLog.ets | arkts | ChatLog Data Model
Represents a chat message record for history
Database row representation for ChatLog | export interface ChatLogRow {
id: number;
date: string; // YYYY-MM-DD format
content: string; // Message content
is_user: number; // 1 = user message, 0 = AI message
emotion: string; // Detected emotion for user messages
timestamp: number; // When this message was sent
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ChatLogRow 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 date : AST#type_annotation#Left AST#... | export interface ChatLogRow {
id: number;
date: string;
content: string;
is_user: number;
emotion: string;
timestamp: number;
} | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/ChatLog.ets#L9-L16 | 8709b77ae62704f755557fd3801a8d9b240df968 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/styledtext/src/main/ets/model/TextModel.ets | arkts | 内容 | constructor(id: number | string, profile: string | Resource, userName: string, subTitle: string, spans: MyCustomSpan[], media?: Resource) {
this.id = id;
this.profile = profile;
this.userName = userName;
this.subTitle = subTitle;
this.spans = spans;
if (media) {
this.media = media;
}
... | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , AST#p... | constructor(id: number | string, profile: string | Resource, userName: string, subTitle: string, spans: MyCustomSpan[], media?: Resource) {
this.id = id;
this.profile = profile;
this.userName = userName;
this.subTitle = subTitle;
this.spans = spans;
if (media) {
this.media = media;
}
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/styledtext/src/main/ets/model/TextModel.ets#L27-L36 | f7adcf9740ca178cc957a00b5a4b866403dd5064 | gitee | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_tabs.ets | arkts | get_home_url | Gets the home url.
@returns The home_url. | get_home_url() {
return bunch_of_tabs.home_url;
} | AST#method_declaration#Left get_home_url AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left bunch_of_tabs AST#expression#Right . home_url AST#member_expression#Right AST#ex... | get_home_url() {
return bunch_of_tabs.home_url;
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_tabs.ets#L251-L253 | 7819f4e65c553b1c215fefda4a84633cb52b6be4 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Sounds/Cloud/Download/CMetaInfo_CFile/CFileDownloader.ets | arkts | getMetaInfoFromResult | 从 COS 接口返回结果中解析 CMetaInfo
@param fileName 文件名(经过安全处理的名字)
@param result COS SDK 返回的结果对象(需包含 headers)
@returns CMetaInfo 实例 | private getMetaInfoFromResult(fileName: string, result: CosXmlResult): CMetaInfo {
// 这里尽量稳健地去读 header 值
let lastModified : string | null = null;
let contentLength : number | null = null;
if (result && result.headers) {
const headers = result.headers as Record<string, string>;
lastModified... | AST#method_declaration#Left private getMetaInfoFromResult AST#parameter_list#Left ( AST#parameter#Left fileName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left result : AST#type_annotation#Left AST#primary_type#Left CosXml... | private getMetaInfoFromResult(fileName: string, result: CosXmlResult): CMetaInfo {
let lastModified : string | null = null;
let contentLength : number | null = null;
if (result && result.headers) {
const headers = result.headers as Record<string, string>;
lastModified = headers["last-mod... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/Download/CMetaInfo_CFile/CFileDownloader.ets#L190-L203 | ef7c8ab85366a0c22b30195eaf38011aeec9ee48 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets | arkts | getLimit | Returns the limit that is set for this line.
@return | public getLimit(): number {
return this.mLimit;
} | AST#method_declaration#Left public getLimit 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_expressi... | public getLimit(): number {
return this.mLimit;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets#L59-L61 | 2ffc80b682d5d45df10bf1bd69759d0a8750eb04 | gitee |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | validator/acts_validator/entry/src/main/ets/pages/Wifi/WifiScan.ets | arkts | getLinkedInfo | 获取有关Wi-Fi连接的信息,存入linkedInfo | async getLinkedInfo() {
try {
let wifiLinkedInfo = await wifi.getLinkedInfo()
if (wifiLinkedInfo === null || wifiLinkedInfo.bssid === '') {
this.isLinked = false
this.linkedInfo = null
return
}
Logger.info(TAG, `getLinkedInfo:isLinked ${this.isLinked}`)
this.isL... | AST#method_declaration#Left async getLinkedInfo 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 wifiLinkedInfo = AST#expression#Left ... | async getLinkedInfo() {
try {
let wifiLinkedInfo = await wifi.getLinkedInfo()
if (wifiLinkedInfo === null || wifiLinkedInfo.bssid === '') {
this.isLinked = false
this.linkedInfo = null
return
}
Logger.info(TAG, `getLinkedInfo:isLinked ${this.isLinked}`)
this.isL... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/validator/acts_validator/entry/src/main/ets/pages/Wifi/WifiScan.ets#L82-L96 | bdde30d7d6b76b30f0ab4b9061a921fcad393c5f | gitee |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/viewmodel/StatsManager.ets | arkts | checkAchievements | 检查成就解锁 | private async checkAchievements(): Promise<void> {
const today = DateUtils.getTodayKey();
const todayStats = this.stats.dailyStats[today];
if (!todayStats) return;
// 检查首个任务完成成就
if (todayStats.tasksCompleted >= 1 && !this.stats.achievements.unlocked.includes('first_task')) {
this.unlockAchie... | AST#method_declaration#Left private async checkAchievements 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 >... | private async checkAchievements(): Promise<void> {
const today = DateUtils.getTodayKey();
const todayStats = this.stats.dailyStats[today];
if (!todayStats) return;
if (todayStats.tasksCompleted >= 1 && !this.stats.achievements.unlocked.includes('first_task')) {
this.unlockAchievement('first... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/StatsManager.ets#L254-L279 | a5cf0ef5dd6c01e9975bf205bc151c5f6d49ff4e | github |
zl3624/harmonyos_network_samples | b8664f8bf6ef5c5a60830fe616c6807e83c21f96 | code/tcp/SmtpClient/entry/src/main/ets/pages/Index.ets | arkts | sendCmd2ServerWithCRLF | 发送命令到服务端,自动在命令后加上回车换行 | async sendCmd2ServerWithCRLF(cmd: string): Promise<boolean> {
cmd = cmd + "\r\n"
let result = false
await tcpSocket.send({ data: cmd })
.then(() => {
this.msgHistory += "C:" + cmd;
result = true
})
.catch((e) => {
this.msgHistory += 'C:send fail ' + e.message + "\r\... | AST#method_declaration#Left async sendCmd2ServerWithCRLF AST#parameter_list#Left ( AST#parameter#Left cmd : 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_t... | async sendCmd2ServerWithCRLF(cmd: string): Promise<boolean> {
cmd = cmd + "\r\n"
let result = false
await tcpSocket.send({ data: cmd })
.then(() => {
this.msgHistory += "C:" + cmd;
result = true
})
.catch((e) => {
this.msgHistory += 'C:send fail ' + e.message + "\r\... | https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/tcp/SmtpClient/entry/src/main/ets/pages/Index.ets#L338-L352 | 507463aef258025af5442d0db9a837edaa925b01 | gitee |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | examples/Select/entry/src/main/ets/pages/components/radio/radioResponse.ets | arkts | RadioResponseBuilder | Copyright (c) 2025 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... | @Builder
export function RadioResponseBuilder(name: string, param: Object) {
RadioResponseExample()
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function RadioResponseBuilder 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
export function RadioResponseBuilder(name: string, param: Object) {
RadioResponseExample()
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/radio/radioResponse.ets#L16-L19 | 08c3408fd8f91cdbdacea9981137ea6936ea33d0 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/model/Part_Unit.ets | arkts | get | 计算属性:获取活跃单词(未删除的单词) | get aliveWords(): WordUser[] {
return this.words.filter(word => !word.deleted);
} | AST#method_declaration#Left get AST#ERROR#Left aliveWords AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left WordUser [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#... | get aliveWords(): WordUser[] {
return this.words.filter(word => !word.deleted);
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/Part_Unit.ets#L12-L14 | c71e9a778f7b058374d0bd28e53a216a23bb88e4 | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Row.ets | arkts | 渲染布局
@returns {void} 无返回值
@example
RowEndBottom() { Text("Hi"); } | build(): void {
RowBase({
options: this.options,
justifyContent: FlexAlign.End,
alignItems: VerticalAlign.Bottom,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.marginValue,
... | AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left RowBase ( AST#component_parameters#Left { AST#component_parameter#Left options : AST#expression#Left AST#member_expression#L... | build(): void {
RowBase({
options: this.options,
justifyContent: FlexAlign.End,
alignItems: VerticalAlign.Bottom,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.marginValue,
... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Row.ets#L1084-L1099 | 6fc8e4936c141e58c26651b6b91ee34b3f326fe7 | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/TextComponent/entry/src/main/ets/pages/textInput/CursorAvoidance.ets | arkts | CursorAvoidance | [Start cursor_avoid] | @Entry
@Component
export struct CursorAvoidance {
@State caretPosition: number = 600;
areaController: TextAreaController = new TextAreaController();
text = 'Most of us compare ourselves with anyone we think is happier — a relative, someone we know a lot,' +
' or someone we hardly know. As a result, what we do... | AST#decorated_export_declaration#Left AST#decorator#Left @ Entry AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct CursorAvoidance AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right caretPosition : AST#type_annotation#Left AST#primar... | @Entry
@Component
export struct CursorAvoidance {
@State caretPosition: number = 600;
areaController: TextAreaController = new TextAreaController();
text = 'Most of us compare ourselves with anyone we think is happier — a relative, someone we know a lot,' +
' or someone we hardly know. As a result, what we do... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/TextComponent/entry/src/main/ets/pages/textInput/CursorAvoidance.ets#L19-L68 | 7f8dd3cd1b71c946ba7733fe0c97d066d74cc205 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/decompressfile/src/main/ets/model/FileListDataSource.ets | arkts | getData | 获取索引对应的数据
@param index 数组索引
@returns | public getData(index: number): FileItem {
return this.fileList[index];
} | AST#method_declaration#Left public getData 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 FileItem AST#primary_type... | public getData(index: number): FileItem {
return this.fileList[index];
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/decompressfile/src/main/ets/model/FileListDataSource.ets#L33-L35 | 915a47f62e5e7d8e16ec45415c7fe82c45ab872c | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/FileUtil.ets | arkts | utimes | 修改文件最近访问时间属性。
path 文件的应用沙箱路径。
mtime 待更新的时间戳。自1970年1月1日起至目标时间的毫秒数。仅支持修改文件最近访问时间属性。
@returns | static utimes(path: string, mtime: number): void {
fs.utimes(path, mtime);
} | AST#method_declaration#Left static utimes AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left mtime : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Rig... | static utimes(path: string, mtime: number): void {
fs.utimes(path, mtime);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FileUtil.ets#L867-L869 | 4f237245965224d98101763bcfddd42d1c0df013 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/social/SearchPage.ets | arkts | buildSearchingView | 构建搜索中视图 | @Builder
buildSearchingView() {
Column({ space: 16 }) {
LoadingProgress()
.width(40)
.height(40)
.color($r('app.color.primary'))
Text('搜索中...')
.fontSize(14)
.fontColor($r('app.color.text_secondary'))
}
.layoutWeight(1)
.width('100%')
.justifyCo... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSearchingView 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#component_... | @Builder
buildSearchingView() {
Column({ space: 16 }) {
LoadingProgress()
.width(40)
.height(40)
.color($r('app.color.primary'))
Text('搜索中...')
.fontSize(14)
.fontColor($r('app.color.text_secondary'))
}
.layoutWeight(1)
.width('100%')
.justifyCo... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/social/SearchPage.ets#L359-L375 | 439fe2554d04031ac449ceaf2cff2f3e4324157e | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/webDavService/WebdavService.ets | arkts | exitApp | 弹窗关闭 | exitApp() {
this.serviceDialogStatus = false
} | AST#method_declaration#Left exitApp AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . serviceDialogStatus AST#member_expression#... | exitApp() {
this.serviceDialogStatus = false
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/webDavService/WebdavService.ets#L152-L154 | f9c21b54eef837aec27006edb73111e9a0d77889 | github |
IceYuanyyy/OxHornCampus.git | bb5686f77fa36db89687502e35898cda218d601f | entry/src/main/ets/controller/MapController.ets | arkts | Used for map control. | export class MapController {
private leftTop: Array<number> = [];
private previousScale: number = 0;
private pinchCount: number = 0;
private panX: number = 0;
private panY: number = 0;
/**
* Initialize the map.
*
* @param mapContext This object of MapComponent.
*/
initLeftTop(screenMapWidth: ... | AST#export_declaration#Left export AST#class_declaration#Left class MapController AST#class_body#Left { AST#property_declaration#Left private leftTop : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left number AST#primary_t... | export class MapController {
private leftTop: Array<number> = [];
private previousScale: number = 0;
private pinchCount: number = 0;
private panX: number = 0;
private panY: number = 0;
initLeftTop(screenMapWidth: number, mapWidth: number): void {
this.leftTop = [(screenMapWidth - mapWidth), 0];
}
... | https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/controller/MapController.ets#L27-L156 | 739e32081339d63c9618c9bba27bb175bb7de796 | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/common/src/main/ets/view/SettingsPage.ets | arkts | SettingsPage | @file 设置页面视图
@author Joker.X | @ComponentV2
export struct SettingsPage {
/**
* 设置页面 ViewModel
*/
@Local
private vm: SettingsViewModel = new SettingsViewModel();
/**
* 构建设置页面
* @returns {void} 无返回值
*/
build() {
AppNavDestination({
title: "设置",
viewModel: this.vm
}) {
this.SettingsContent();
}
... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct SettingsPage AST#component_body#Left { /**
* 设置页面 ViewModel
*/ AST#property_declaration#Left AST#decorator#Left @ Local AST#decorator#Right private vm : AST#type_annotation#Left AST#primary_type#Left SettingsV... | @ComponentV2
export struct SettingsPage {
@Local
private vm: SettingsViewModel = new SettingsViewModel();
build() {
AppNavDestination({
title: "设置",
viewModel: this.vm
}) {
this.SettingsContent();
}
}
@Builder
private SettingsContent() {
Text("设置页面内容视图")
}
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/view/SettingsPage.ets#L8-L37 | 58665e38a1a04431ebbf9cde7934fb274cb4ca46 | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Row.ets | arkts | RowEndBottom | 横向末尾 + 垂直底部 | @ComponentV2
export struct RowEndBottom {
/**
* Row 构造参数
*/
@Param
options: RowOptions | RowOptionsV2 = {};
/**
* 宽度
*/
@Param
widthValue: Length | undefined = undefined;
/**
* 高度
*/
@Param
heightValue: Length | undefined = undefined;
/**
* 尺寸(对应官方 size 属性)
*/
@Param
size... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct RowEndBottom AST#component_body#Left { /**
* Row 构造参数
*/ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right options : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Lef... | @ComponentV2
export struct RowEndBottom {
@Param
options: RowOptions | RowOptionsV2 = {};
@Param
widthValue: Length | undefined = undefined;
@Param
heightValue: Length | undefined = undefined;
@Param
sizeValue: SizeOptions | undefined = undefined;
@Param
paddingValue: Padding | Length... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Row.ets#L1025-L1100 | 39379a1a1016d0eab324ff911749fcb3ff7e692c | github |
fengmingdev/protobuf-arkts-generator.git | 75888d404fd6ce52a046cba2a94807ecf1350147 | runtime/arkpb/MessageRegistry.ets | arkts | get | 获取消息构造器
@param typeName 消息类型名称
@returns 消息构造器,如果未注册则返回 undefined
使用示例:
```typescript
const ctor = MessageRegistry.get('test.Person')
if (ctor !== undefined) {
const msg = ctor.create({ name: 'Alice' })
}
``` | static get(typeName: string): MessageConstructor<Message> | undefined {
return MessageRegistry.types.get(typeName)
} | AST#method_declaration#Left static get AST#parameter_list#Left ( AST#parameter#Left typeName : 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#union_type#Left AST#primary_type#Left AST#ge... | static get(typeName: string): MessageConstructor<Message> | undefined {
return MessageRegistry.types.get(typeName)
} | https://github.com/fengmingdev/protobuf-arkts-generator.git/blob/75888d404fd6ce52a046cba2a94807ecf1350147/runtime/arkpb/MessageRegistry.ets#L119-L121 | 7b1c3c4cdf56baf8da16c4db5fc1538debc2bcd3 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/services/data/ContactService.ets | arkts | deleteContact | 删除联系人
@param contactId 联系人ID
@returns 是否成功 | async deleteContact(contactId: string): Promise<boolean> {
try {
// 获取联系人数据用于日志记录
const existingContact = await this.getContactById(contactId);
if (!existingContact) {
throw new Error('联系人不存在');
}
await this.databaseService.executeTransaction(async () => {
// 删除相关的祝福历史... | AST#method_declaration#Left async deleteContact AST#parameter_list#Left ( AST#parameter#Left contactId : 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... | async deleteContact(contactId: string): Promise<boolean> {
try {
const existingContact = await this.getContactById(contactId);
if (!existingContact) {
throw new Error('联系人不存在');
}
await this.databaseService.executeTransaction(async () => {
await this.database... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/data/ContactService.ets#L150-L193 | 49f45b5233e980171cd066f46b4979a69f4f8ed1 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index.ets | arkts | getThemeColorNameByColor | 根据颜色值获取主题名称 | private getThemeColorNameByColor(color: string): string {
const themeMap: Record<string, string> = {
'#4ECDC4': '清新蓝绿',
'#FF6B9D': '温馨粉红',
'#9B59B6': '紫罗兰',
'#27AE60': '森林绿',
'#F39C12': '阳光橙',
'#34495E': '深空灰',
'#3498DB': '天空蓝',
'#1ABC9C': '薄荷绿',
'#FFB6C1': '樱花粉... | AST#method_declaration#Left private getThemeColorNameByColor AST#parameter_list#Left ( AST#parameter#Left color : 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 ... | private getThemeColorNameByColor(color: string): string {
const themeMap: Record<string, string> = {
'#4ECDC4': '清新蓝绿',
'#FF6B9D': '温馨粉红',
'#9B59B6': '紫罗兰',
'#27AE60': '森林绿',
'#F39C12': '阳光橙',
'#34495E': '深空灰',
'#3498DB': '天空蓝',
'#1ABC9C': '薄荷绿',
'#FFB6C1': '樱花粉... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L6105-L6124 | 6661421b34fefcbf4a5b4b3c48e2d6f7b4957193 | github |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/MultiDeviceAppDev/MultiNavBar/entry/src/main/ets/common/BreakpointSystem.ets | arkts | Copyright (c) 2022-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,... | export class BreakpointType<T> {
sm: T;
md: T;
lg: T;
constructor(sm: T, md: T, lg: T) {
this.sm = sm;
this.md = md;
this.lg = lg;
}
GetValue(currentBreakpoint: string): T | undefined {
if (currentBreakpoint === 'sm') {
return this.sm;
}
if (currentBreakpoint === 'md') {
... | AST#export_declaration#Left export AST#class_declaration#Left class BreakpointType AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#class_body#Left { AST#property_declaration#Left sm : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AS... | export class BreakpointType<T> {
sm: T;
md: T;
lg: T;
constructor(sm: T, md: T, lg: T) {
this.sm = sm;
this.md = md;
this.lg = lg;
}
GetValue(currentBreakpoint: string): T | undefined {
if (currentBreakpoint === 'sm') {
return this.sm;
}
if (currentBreakpoint === 'md') {
... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/MultiDeviceAppDev/MultiNavBar/entry/src/main/ets/common/BreakpointSystem.ets#L16-L39 | 47c98f8c267bf9e8f8c21690e2440c430c12ac83 | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/navigation/src/main/ets/order/OrderNavigator.ets | arkts | toLogistics | 跳转到订单物流
@param {number} orderId - 订单 ID
@returns {void} 无返回值 | static toLogistics(orderId: number): void {
const params: OrderIdParam = { orderId };
navigateTo(OrderRoutes.Logistics, params);
} | AST#method_declaration#Left static toLogistics AST#parameter_list#Left ( AST#parameter#Left orderId : 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_ty... | static toLogistics(orderId: number): void {
const params: OrderIdParam = { orderId };
navigateTo(OrderRoutes.Logistics, params);
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/order/OrderNavigator.ets#L86-L89 | d9c5079c71d0f42cbf6d5af92af79b10e62c2edd | github |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/processes/init_process.ets | arkts | ensure_zones_folder | Checks and ensures there is a /zones directory in sandbox. | function ensure_zones_folder(context: common.UIAbilityContext) {
let filesDir = context.filesDir;
try {
if (!fileIo.accessSync(filesDir + '/zones')) {
fileIo.mkdirSync(filesDir + '/zones', true);
} else {
// Zones exist
refresh_AppStorage_zones();
console.log('[init][ensure_zones_fol... | AST#function_declaration#Left function ensure_zones_folder 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... | function ensure_zones_folder(context: common.UIAbilityContext) {
let filesDir = context.filesDir;
try {
if (!fileIo.accessSync(filesDir + '/zones')) {
fileIo.mkdirSync(filesDir + '/zones', true);
} else {
refresh_AppStorage_zones();
console.log('[init][ensure_zones_folder] Found zon... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/processes/init_process.ets#L100-L113 | 8722706aa5bb60faab871ac7b7adf2179f6aa6fd | gitee |
iichen-bycode/ArkTsWanandroid.git | ad128756a6c703d9a72cf7f6da128c27fc63bd00 | entry/src/main/ets/http/api.ets | arkts | 搜索
@param date
@returns | export function search(page:number,key:string) {
return axiosClient.post<HomeArticleModel>({
url: `article/query/${page}/json?k=${encodeURI(key)}`,
showLoading:page === 0,
})
} | AST#export_declaration#Left export AST#function_declaration#Left function search AST#parameter_list#Left ( AST#parameter#Left page : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left key : AST#type_annotation#Left AST#primary_... | export function search(page:number,key:string) {
return axiosClient.post<HomeArticleModel>({
url: `article/query/${page}/json?k=${encodeURI(key)}`,
showLoading:page === 0,
})
} | https://github.com/iichen-bycode/ArkTsWanandroid.git/blob/ad128756a6c703d9a72cf7f6da128c27fc63bd00/entry/src/main/ets/http/api.ets#L123-L128 | 94003af921676a62ef653ceb14559b440cb56ede | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/cs/src/main/ets/navigation/CsGraph.ets | arkts | register | 注册客服模块导航路由 | register(): void {
RouteBuild.register(CsRoutes.Chat, wrapBuilder(ChatNav));
} | AST#method_declaration#Left register 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#Left... | register(): void {
RouteBuild.register(CsRoutes.Chat, wrapBuilder(ChatNav));
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/cs/src/main/ets/navigation/CsGraph.ets#L13-L15 | c7b5bbc1d73843b04f56f318eddbb10ec1e2a6cf | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/AIAssistantService.ets | arkts | AI意图识别结果接口 | export interface IntentResult {
intent: string;
confidence: number;
entities: Record<string, string | number | boolean>;
sentiment: SentimentAnalysis;
suggestedActions: SuggestedAction[];
} | AST#export_declaration#Left export AST#interface_declaration#Left interface IntentResult AST#object_type#Left { AST#type_member#Left intent : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left confidence : AST#type_annotati... | export interface IntentResult {
intent: string;
confidence: number;
entities: Record<string, string | number | boolean>;
sentiment: SentimentAnalysis;
suggestedActions: SuggestedAction[];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/AIAssistantService.ets#L172-L178 | 8bebeb12f06fe7c1b357a4a88b14333af6b049f2 | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | entry/src/main/ets/adapter/WindowAdapter.ets | arkts | initBreakpointObserver | 初始化断点监听
@param {window.Window} windowClass - 当前窗口
@returns {void} 无返回值 | private initBreakpointObserver(windowClass: window.Window): void {
const initialWidth = windowClass.getWindowProperties().windowRect.width;
if (initialWidth !== undefined) {
this.updateBreakpoint(initialWidth);
}
this.windowSizeChangeHandler = (windowSize) => {
if (windowSize.width !== undef... | AST#method_declaration#Left private initBreakpointObserver AST#parameter_list#Left ( AST#parameter#Left windowClass : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#... | private initBreakpointObserver(windowClass: window.Window): void {
const initialWidth = windowClass.getWindowProperties().windowRect.width;
if (initialWidth !== undefined) {
this.updateBreakpoint(initialWidth);
}
this.windowSizeChangeHandler = (windowSize) => {
if (windowSize.width !== undef... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/entry/src/main/ets/adapter/WindowAdapter.ets#L156-L167 | 73d0eca826cc6b428f662eb7146ca18fbc50bd38 | github |
ni202383/Chenguang-Calendar.git | c04543db2c394d662bc1336d098335134ff1e9a5 | src/main/ets/component/TaskTimeRangeItem.ets | arkts | showEditDialog | 显示编辑对话框 | private showEditDialog(): void {
// 这里可以添加编辑对话框的实现
console.log(`编辑任务: ${this.taskItem.taskName}`);
} | AST#method_declaration#Left private showEditDialog 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_exp... | private showEditDialog(): void {
console.log(`编辑任务: ${this.taskItem.taskName}`);
} | https://github.com/ni202383/Chenguang-Calendar.git/blob/c04543db2c394d662bc1336d098335134ff1e9a5/src/main/ets/component/TaskTimeRangeItem.ets#L92-L95 | 0cc899ab12608203e128034eb4bc3ef635f6d7f9 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/statusbaranimation/src/main/ets/view/ArticlesList.ets | arkts | scrollToTop | 底部导航栏高度 | scrollToTop() {
if (this.isTop) {
// 点击回顶部按钮列表回滚到顶部
this.listScroller.scrollTo({
xOffset: Constants.MAIN_SCROLLER_OFFSET_X,
yOffset: Constants.MAIN_SCROLLER_OFFSET_Y,
animation: {
duration: Constants.ANIMATION_DURATION1,
curve: Curve.FastOutLinearIn
}
... | AST#method_declaration#Left scrollToTop AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isTop AST#member_expression#Right AST#expres... | scrollToTop() {
if (this.isTop) {
this.listScroller.scrollTo({
xOffset: Constants.MAIN_SCROLLER_OFFSET_X,
yOffset: Constants.MAIN_SCROLLER_OFFSET_Y,
animation: {
duration: Constants.ANIMATION_DURATION1,
curve: Curve.FastOutLinearIn
}
});
t... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/statusbaranimation/src/main/ets/view/ArticlesList.ets#L30-L43 | d512982ce99a0b0c6b736942c395a02350ed5e1f | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/demo/src/main/ets/viewmodel/NetworkDemoViewModel.ets | arkts | requestRepository | 请求商品详情数据
@returns {Promise<NetworkResponse<Goods>>} 网络请求 Promise | protected requestRepository(): Promise<NetworkResponse<Goods>> {
return this.repository.getGoodsInfo("1");
} | AST#method_declaration#Left protected requestRepository 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#generic_type#Left NetworkResponse AST#type_arguments#Le... | protected requestRepository(): Promise<NetworkResponse<Goods>> {
return this.repository.getGoodsInfo("1");
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/viewmodel/NetworkDemoViewModel.ets#L20-L22 | ecf40932de5c789c4f8ff666e0977a25cd3af08a | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/StyleConstants.ets | arkts | Constants for common style. | export class StyleConstants {
/**
* Component width percentage: 100%.
*/
static readonly FULL_WIDTH: string = '100%';
/**
* Component height percentage: 100%.
*/
static readonly FULL_HEIGHT: string = '100%';
/**
* Translate value of the collection text.
*/
static readonly TRANSLATE_X: nu... | AST#export_declaration#Left export AST#class_declaration#Left class StyleConstants AST#class_body#Left { /**
* Component width percentage: 100%.
*/ AST#property_declaration#Left static readonly FULL_WIDTH : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AS... | export class StyleConstants {
static readonly FULL_WIDTH: string = '100%';
static readonly FULL_HEIGHT: string = '100%';
static readonly TRANSLATE_X: number = 10;
static readonly TRANSLATE_Y: string = '-100%';
static readonly TRANSLATE_PLAYER_Y: string = '-48vp';
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/StyleConstants.ets#L19-L44 | c58aac3d19438622ff0c6c63304be9d938317a52 | gitee | |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | advanced_ui_component/subheaderv2/source/subheaderv2.ets | arkts | isResourceType | 是否Resource类型
@param resource 资源
@returns true:Resource类型;false:非Resource类型 | public static isResourceType(resource: SubHeaderV2IconType | undefined): boolean {
if (!resource) {
return false;
}
if (typeof resource === 'string' || typeof resource === 'undefined') {
return false;
}
return true;
} | AST#method_declaration#Left public static isResourceType AST#parameter_list#Left ( AST#parameter#Left resource : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left SubHeaderV2IconType AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation... | public static isResourceType(resource: SubHeaderV2IconType | undefined): boolean {
if (!resource) {
return false;
}
if (typeof resource === 'string' || typeof resource === 'undefined') {
return false;
}
return true;
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/advanced_ui_component/subheaderv2/source/subheaderv2.ets#L1252-L1260 | ff826a139140236267df62acb4cba74d06e47174 | gitee |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/model/IToastIconOptions.ets | arkts | Toast提示框参数配置接口
@extends IBaseDialogOptions | export interface IToastIconOptions extends IBaseDialogOptions {
/**
* 样式
*/
style?: IToastIconStyle
/**
* 提示内容(可选)
* @description 支持字符串或Resource
*/
message?: ResourceStr;
/**
* 显示持续时间(可选,单位:毫秒)
* @default 2000ms
* @range 1500-10000ms
*/
duration?: number;
/**
* 布局方向(可选)
... | AST#export_declaration#Left export AST#interface_declaration#Left interface IToastIconOptions AST#extends_clause#Left extends IBaseDialogOptions AST#extends_clause#Right AST#object_type#Left { /**
* 样式
*/ AST#type_member#Left style ? : AST#type_annotation#Left AST#primary_type#Left IToastIconStyle AST#primary_typ... | export interface IToastIconOptions extends IBaseDialogOptions {
style?: IToastIconStyle
message?: ResourceStr;
duration?: number;
orientation?: Orientation;
icon?: ResourceStr | PixelMap;
iconSize?: SizeOptions;
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/model/IToastIconOptions.ets#L50-L88 | cb954a924e55d42c7cb08c948d09b4415faa98c3 | github | |
OHPG/FinVideo.git | 2b288396af5b2a20a24575faa317b46214965391 | entry/src/main/ets/pages/common/ListViewModel.ets | arkts | @Author peerless2012
@Email peerless2012@126.com
@DateTime 2024/11/27 21:36
@Version V1.0
@Description | export abstract class ListViewModel extends AppViewModel implements RefreshRepository {
hasMore(): boolean {
return false
}
protected readonly dataSource = new RefreshDataSource();
getDataSource(): RefreshDataSource {
return this.dataSource
}
abstract loadData(type: LoadType): Promise<void>
} | AST#export_declaration#Left export AST#class_declaration#Left abstract class ListViewModel extends AST#type_annotation#Left AST#primary_type#Left AppViewModel AST#primary_type#Right AST#type_annotation#Right AST#implements_clause#Left implements RefreshRepository AST#implements_clause#Right AST#class_body#Left { AST#me... | export abstract class ListViewModel extends AppViewModel implements RefreshRepository {
hasMore(): boolean {
return false
}
protected readonly dataSource = new RefreshDataSource();
getDataSource(): RefreshDataSource {
return this.dataSource
}
abstract loadData(type: LoadType): Promise<void>
} | https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/pages/common/ListViewModel.ets#L12-L26 | 50178b8dc94db5c1b0dc608dd42f4e066071ae42 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/animation/TextAnimator.ets | arkts | eraseText | 逐字擦除文本
@param setText 绑定的状态更新函数
@param text 要擦除的文本
@param completion 完成后回调 | private static eraseText(
setText: (text: string) => void,
text: string,
completion?: () => void
) {
if (!text) return;
const totalLength = text.length;
const durationPerChar = 100; // 每个字符擦除动画时长 ms
let index = totalLength;
const eraseStep = () => {
if (index < 0) {
co... | AST#method_declaration#Left private static eraseText AST#parameter_list#Left ( AST#parameter#Left setText : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#param... | private static eraseText(
setText: (text: string) => void,
text: string,
completion?: () => void
) {
if (!text) return;
const totalLength = text.length;
const durationPerChar = 100;
let index = totalLength;
const eraseStep = () => {
if (index < 0) {
completion?.();
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/animation/TextAnimator.ets#L49-L74 | f666801c3ad0d6fd19a2b73a56c4114e4aa0c62e | github |
openharmony/applications_settings | aac607310ec30e30d1d54db2e04d055655f72730 | product/phone/src/main/ets/pages/wifi.ets | arkts | 状态描述 | build() {
Row() {
Column() {
Text(this.settingTitle)
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor(this.titleFontColor === "activated" ?
$r('sys.color.ohos_id_color_text_primary_activated') : $r('sys.color.ohos_id_color_text_primary'))
.fontWeigh... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_... | build() {
Row() {
Column() {
Text(this.settingTitle)
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor(this.titleFontColor === "activated" ?
$r('sys.color.ohos_id_color_text_primary_activated') : $r('sys.color.ohos_id_color_text_primary'))
.fontWeigh... | https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/product/phone/src/main/ets/pages/wifi.ets#L844-L885 | f63694d15fb977a526d94d0ea34de7d1966946f8 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/i18n/I18nManager.ets | arkts | t | 获取翻译文本 | t(key: string, params?: FormatParams, fallbackLanguage?: SupportedLanguage): string {
try {
// 尝试从当前语言获取翻译
let translation = this.getTranslationByKey(key, this.currentLanguage);
// 如果没有找到,尝试回退语言
if (!translation && fallbackLanguage) {
translation = this.getTranslationByKey(key... | AST#method_declaration#Left t AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left params ? : AST#type_annotation#Left AST#primary_type#Left FormatParams AST#primary_type#Right A... | t(key: string, params?: FormatParams, fallbackLanguage?: SupportedLanguage): string {
try {
let translation = this.getTranslationByKey(key, this.currentLanguage);
if (!translation && fallbackLanguage) {
translation = this.getTranslationByKey(key, fallbackLanguage);
}
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/i18n/I18nManager.ets#L298-L327 | 35cf967a13ae629ea5bc0735a24e6321bd7bcb0d | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets | arkts | createPlan | MARK: - Create Plan /创建plan用(会删除旧的学习记录) /只在内存中创建,不会保存到db /如果之前有旧的planId,会继续使用旧的planId, 同时会删除相应的learn记录 /如果没有旧的planId,则为nil /countPerDay : 每日学习个数(新字的) ,是整个plan全局的默认值 | public static async createPlan(
planId: number | null,
planName: string,
wordIds: number[],
bookId: number | null = null,
countPerDay: number,
distances: DistanceFromBase[]
): Promise<Plan> {
// 删除之前 plan 的旧的 Learn
if (planId != null) {
await PlanDbAccess.shared.deleteLearn(plan... | AST#method_declaration#Left public static async createPlan AST#parameter_list#Left ( AST#parameter#Left planId : 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#Right AST#paramet... | public static async createPlan(
planId: number | null,
planName: string,
wordIds: number[],
bookId: number | null = null,
countPerDay: number,
distances: DistanceFromBase[]
): Promise<Plan> {
if (planId != null) {
await PlanDbAccess.shared.deleteLearn(planId);
}
c... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets#L254-L289 | c48d66a10fcb69304ef1c69e32a4b086426e69fb | github |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/CryptoUtil.ets | arkts | signSegment | 对数据进行分段签名,异步
@param data 待签名数据
@param priKey 私钥
@param algName 指定签名算法(RSA1024|PKCS1|SHA256、RSA2048|PKCS1|SHA256、ECC256|SHA256、SM2_256|SM3、、等)。
@param len 自定义的数据拆分长度。
@returns | static async signSegment(data: Uint8Array, priKey: cryptoFramework.PriKey, algName: string, len: number): Promise<cryptoFramework.DataBlob> {
let signer = cryptoFramework.createSign(algName);
await signer.init(priKey);
for (let i = 0; i < data.length; i += len) {
let updateData = data.subarray(i, i + ... | AST#method_declaration#Left static async signSegment AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priKey : AST#type_annotation#Left AST#primary_type#Left AST#qualifi... | static async signSegment(data: Uint8Array, priKey: cryptoFramework.PriKey, algName: string, len: number): Promise<cryptoFramework.DataBlob> {
let signer = cryptoFramework.createSign(algName);
await signer.init(priKey);
for (let i = 0; i < data.length; i += len) {
let updateData = data.subarray(i, i + ... | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/CryptoUtil.ets#L353-L364 | 3c6ee55b4f15427729db940d5e4f676a97fa3e33 | github |
XiangRui_FuZi/harmony-oscourse | da885f9a777a1eace7a07e1cd81137746687974b | class1/entry/src/main/ets/view/EditorComponent.ets | arkts | topicBuilder | Build #Topics. | @Builder
topicBuilder(topicInfo: string) {
if (topicInfo.length !== 0) {
Text(CommonConstants.TOPIC_SYMBOL + topicInfo)
.fontColor($r('app.color.font_color3'))
}
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right topicBuilder AST#parameter_list#Left ( AST#parameter#Left topicInfo : 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#builder_function_bo... | @Builder
topicBuilder(topicInfo: string) {
if (topicInfo.length !== 0) {
Text(CommonConstants.TOPIC_SYMBOL + topicInfo)
.fontColor($r('app.color.font_color3'))
}
} | https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/view/EditorComponent.ets#L141-L147 | 9bfa65b75cda371a96779143a2224eeb2a9ce842 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/DialogHelper.ets | arkts | isApiSupported | 检查API版本是否安全
@param apiVersion API方法支持的最低版本 | static isApiSupported(apiVersion: number): boolean {
return Helper.isApiSupported(apiVersion);
} | AST#method_declaration#Left static isApiSupported AST#parameter_list#Left ( AST#parameter#Left apiVersion : 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 boolean AST#p... | static isApiSupported(apiVersion: number): boolean {
return Helper.isApiSupported(apiVersion);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogHelper.ets#L129-L131 | 84fad738d2861ab03f31fba16c1541516269578b | gitee |
azhuge233/ASFShortcut-HN.git | d1669c920c56317611b5b0375aa5315c1b91211b | entry/src/main/ets/pages/Index.ets | arkts | SetupPopup | 检测到数据库未设置 ASF 相关条目时显示 提示前往设置页面 | @Builder
SetupPopup() {
Stack() {
Column()
.width(StyleConstants.FULL_PERCENT)
.height(StyleConstants.FULL_PERCENT)
.backgroundColor($r("app.color.transparent"))
.blur(StyleConstants.BLUE_LEVEL)
.onClick(() => {})
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right SetupPopup 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 Stack ( ) AST#container_content_body#Left { AST#arkts_ui_elemen... | @Builder
SetupPopup() {
Stack() {
Column()
.width(StyleConstants.FULL_PERCENT)
.height(StyleConstants.FULL_PERCENT)
.backgroundColor($r("app.color.transparent"))
.blur(StyleConstants.BLUE_LEVEL)
.onClick(() => {})
... | https://github.com/azhuge233/ASFShortcut-HN.git/blob/d1669c920c56317611b5b0375aa5315c1b91211b/entry/src/main/ets/pages/Index.ets#L314-L350 | 433267cedf0699cdf4ea289ba84a890bb738e82a | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Data/Rdb/entry/src/main/ets/viewmodel/ConstantsInterface.ets | arkts | Copyright (c) 2022 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, softw... | export interface AccountTable {
tableName: string;
sqlCreate: string;
columns: string[];
} | AST#export_declaration#Left export AST#interface_declaration#Left interface AccountTable AST#object_type#Left { AST#type_member#Left tableName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left sqlCreate : AST#type_annota... | export interface AccountTable {
tableName: string;
sqlCreate: string;
columns: string[];
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Data/Rdb/entry/src/main/ets/viewmodel/ConstantsInterface.ets#L17-L21 | b3df6ddd1e2f49cd8f4efdba08f3750771193023 | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/SecondaryLinkExample.ets | arkts | contentListNoMoreBuilder | 内容底部'没有更多'视图 | @Builder
contentListNoMoreBuilder() {
ListItem() {
Text($r('app.string.secondarylinkage_nomore'))
.fontSize(20)
.backgroundColor('#ffb8b8b8')
}
.width('100%')
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right contentListNoMoreBuilder 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 ListItem ( ) AST#container_content_body#Left { AS... | @Builder
contentListNoMoreBuilder() {
ListItem() {
Text($r('app.string.secondarylinkage_nomore'))
.fontSize(20)
.backgroundColor('#ffb8b8b8')
}
.width('100%')
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/SecondaryLinkExample.ets#L190-L198 | daa2405f20d29f94d75db3580a19da60d6ca1cf3 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | spinkit/src/main/ets/components/SpinE.ets | arkts | SpinE | TODO SpinKit动画组件
author: 桃花镇童长老
since: 2024/05/01 | @ComponentV2
export struct SpinE {
@Require @Param spinSize: number;
@Require @Param spinColor: ResourceColor;
@Local scale1: number = 1;
@Local opacity1: number = 1;
build() {
Canvas()
.width(this.spinSize)
.height(this.spinSize)
.borderRadius(this.spinSize)
.backgroundColor(this... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct SpinE AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Require AST#decorator#Right AST#decorator#Left @ Param AST#decorator#Right spinSize : AST#type_annotation#Left AST#primary_type#Left... | @ComponentV2
export struct SpinE {
@Require @Param spinSize: number;
@Require @Param spinColor: ResourceColor;
@Local scale1: number = 1;
@Local opacity1: number = 1;
build() {
Canvas()
.width(this.spinSize)
.height(this.spinSize)
.borderRadius(this.spinSize)
.backgroundColor(this... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/spinkit/src/main/ets/components/SpinE.ets#L22-L59 | 66fa270b7769ca9ea92669d01a3f7f5e10335a8b | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Solutions/Shopping/OrangeShopping/feature/detailPageHsp/src/main/ets/components/Choice.ets | arkts | Choice | Copyright (c) 2022-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,... | @Component
export struct Choice {
build() {
Row() {
Text($r('app.string.selected'))
.fontSize(14)
.fontColor($r('app.color.blank'))
Flex({ justifyContent: FlexAlign.Start, wrap: FlexWrap.Wrap }) {
Text($r('app.string.select_configuration'))
.fontSize(14)
.pa... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct Choice 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 Row ( ) AST#container_content_body#Left { AST#a... | @Component
export struct Choice {
build() {
Row() {
Text($r('app.string.selected'))
.fontSize(14)
.fontColor($r('app.color.blank'))
Flex({ justifyContent: FlexAlign.Start, wrap: FlexWrap.Wrap }) {
Text($r('app.string.select_configuration'))
.fontSize(14)
.pa... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/Shopping/OrangeShopping/feature/detailPageHsp/src/main/ets/components/Choice.ets#L16-L43 | 8dfcb122cc4167913fc3f8f09176a3a053690a48 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.